decl.carbon 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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: imports {
  20. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  21. // CHECK:STDOUT: .Int32 = %import_ref
  22. // CHECK:STDOUT: import Core//prelude
  23. // CHECK:STDOUT: import Core//prelude/operators
  24. // CHECK:STDOUT: import Core//prelude/types
  25. // CHECK:STDOUT: import Core//prelude/operators/arithmetic
  26. // CHECK:STDOUT: import Core//prelude/operators/as
  27. // CHECK:STDOUT: import Core//prelude/operators/bitwise
  28. // CHECK:STDOUT: import Core//prelude/operators/comparison
  29. // CHECK:STDOUT: import Core//prelude/types/bool
  30. // CHECK:STDOUT: }
  31. // CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
  32. // CHECK:STDOUT: }
  33. // CHECK:STDOUT:
  34. // CHECK:STDOUT: file {
  35. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  36. // CHECK:STDOUT: .Core = imports.%Core
  37. // CHECK:STDOUT: .a = %a
  38. // CHECK:STDOUT: }
  39. // CHECK:STDOUT: %Core.import = import Core
  40. // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
  41. // CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_32 [template = i32]
  42. // CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_32, %.loc10_8.1 [template = i32]
  43. // CHECK:STDOUT: %a.var: ref i32 = var a
  44. // CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var
  45. // CHECK:STDOUT: }
  46. // CHECK:STDOUT:
  47. // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
  48. // CHECK:STDOUT: