decl.carbon 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  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/global/decl.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/global/decl.carbon
  10. var a: i32;
  11. // CHECK:STDOUT: --- decl.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: }
  18. // CHECK:STDOUT:
  19. // CHECK:STDOUT: file {
  20. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  21. // CHECK:STDOUT: .Core = %Core
  22. // CHECK:STDOUT: .a = %a
  23. // CHECK:STDOUT: }
  24. // CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
  25. // CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
  26. // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
  27. // CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_32 [template = i32]
  28. // CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_32, %.loc10_8.1 [template = i32]
  29. // CHECK:STDOUT: %a.var: ref i32 = var a
  30. // CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var
  31. // CHECK:STDOUT: }
  32. // CHECK:STDOUT:
  33. // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
  34. // CHECK:STDOUT: