decl.carbon 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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: %.1: Core.IntLiteral = int_value 32 [template]
  15. // CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
  16. // CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
  17. // CHECK:STDOUT: %i32: type = int_type signed, %.1 [template]
  18. // CHECK:STDOUT: }
  19. // CHECK:STDOUT:
  20. // CHECK:STDOUT: imports {
  21. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  22. // CHECK:STDOUT: .Int = %import_ref
  23. // CHECK:STDOUT: import Core//prelude
  24. // CHECK:STDOUT: import Core//prelude/...
  25. // CHECK:STDOUT: }
  26. // CHECK:STDOUT: }
  27. // CHECK:STDOUT:
  28. // CHECK:STDOUT: file {
  29. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  30. // CHECK:STDOUT: .Core = imports.%Core
  31. // CHECK:STDOUT: .a = %a
  32. // CHECK:STDOUT: }
  33. // CHECK:STDOUT: %Core.import = import Core
  34. // CHECK:STDOUT: %.loc10_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1]
  35. // CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc10_8.1) [template = constants.%i32]
  36. // CHECK:STDOUT: %.loc10_8.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32]
  37. // CHECK:STDOUT: %.loc10_8.3: type = converted %int.make_type_signed, %.loc10_8.2 [template = constants.%i32]
  38. // CHECK:STDOUT: %a.var: ref %i32 = var a
  39. // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var
  40. // CHECK:STDOUT: }
  41. // CHECK:STDOUT: