run_i32.carbon 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/run_i32.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/run_i32.carbon
  10. fn Run() -> i32 { return 0; }
  11. // CHECK:STDOUT: --- run_i32.carbon
  12. // CHECK:STDOUT:
  13. // CHECK:STDOUT: constants {
  14. // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
  15. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  16. // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
  17. // CHECK:STDOUT: %Run.type: type = fn_type @Run [template]
  18. // CHECK:STDOUT: %Run: %Run.type = struct_value () [template]
  19. // CHECK:STDOUT: %.2: i32 = int_literal 0 [template]
  20. // CHECK:STDOUT: }
  21. // CHECK:STDOUT:
  22. // CHECK:STDOUT: file {
  23. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  24. // CHECK:STDOUT: .Core = %Core
  25. // CHECK:STDOUT: .Run = %Run.decl
  26. // CHECK:STDOUT: }
  27. // CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
  28. // CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
  29. // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {
  30. // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
  31. // CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32 [template = i32]
  32. // CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_32, %.loc11_13.1 [template = i32]
  33. // CHECK:STDOUT: @Run.%return: ref i32 = var <return slot>
  34. // CHECK:STDOUT: }
  35. // CHECK:STDOUT: }
  36. // CHECK:STDOUT:
  37. // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
  38. // CHECK:STDOUT:
  39. // CHECK:STDOUT: fn @Run() -> i32 {
  40. // CHECK:STDOUT: !entry:
  41. // CHECK:STDOUT: %.loc11: i32 = int_literal 0 [template = constants.%.2]
  42. // CHECK:STDOUT: return %.loc11
  43. // CHECK:STDOUT: }
  44. // CHECK:STDOUT: