decl.carbon 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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: %int_32: Core.IntLiteral = int_value 32 [template]
  15. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  16. // CHECK:STDOUT: }
  17. // CHECK:STDOUT:
  18. // CHECK:STDOUT: imports {
  19. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  20. // CHECK:STDOUT: .Int = %Core.Int
  21. // CHECK:STDOUT: import Core//prelude
  22. // CHECK:STDOUT: import Core//prelude/...
  23. // CHECK:STDOUT: }
  24. // CHECK:STDOUT: }
  25. // CHECK:STDOUT:
  26. // CHECK:STDOUT: file {
  27. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  28. // CHECK:STDOUT: .Core = imports.%Core
  29. // CHECK:STDOUT: .a = %a
  30. // CHECK:STDOUT: }
  31. // CHECK:STDOUT: %Core.import = import Core
  32. // CHECK:STDOUT: name_binding_decl {
  33. // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a
  34. // CHECK:STDOUT: %.loc10_1: %i32 = var_pattern %a.patt
  35. // CHECK:STDOUT: }
  36. // CHECK:STDOUT: %a.var: ref %i32 = var a
  37. // CHECK:STDOUT: %.loc10_8: type = splice_block %i32 [template = constants.%i32] {
  38. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  39. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  40. // CHECK:STDOUT: }
  41. // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var
  42. // CHECK:STDOUT: }
  43. // CHECK:STDOUT: