global_decl.carbon 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637
  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/var/no_prelude/global_decl.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/global_decl.carbon
  10. var x: {.v: ()};
  11. // CHECK:STDOUT: --- global_decl.carbon
  12. // CHECK:STDOUT:
  13. // CHECK:STDOUT: constants {
  14. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  15. // CHECK:STDOUT: %struct_type.v: type = struct_type {.v: %empty_tuple.type} [concrete]
  16. // CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.v [concrete]
  17. // CHECK:STDOUT: }
  18. // CHECK:STDOUT:
  19. // CHECK:STDOUT: file {
  20. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  21. // CHECK:STDOUT: .x = %x
  22. // CHECK:STDOUT: }
  23. // CHECK:STDOUT: name_binding_decl {
  24. // CHECK:STDOUT: %x.patt: %pattern_type = binding_pattern x [concrete]
  25. // CHECK:STDOUT: %x.var_patt: %pattern_type = var_pattern %x.patt [concrete]
  26. // CHECK:STDOUT: }
  27. // CHECK:STDOUT: %x.var: ref %struct_type.v = var %x.var_patt [concrete]
  28. // CHECK:STDOUT: %.loc11_15: type = splice_block %struct_type.v [concrete = constants.%struct_type.v] {
  29. // CHECK:STDOUT: %.loc11_14.1: %empty_tuple.type = tuple_literal ()
  30. // CHECK:STDOUT: %.loc11_14.2: type = converted %.loc11_14.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  31. // CHECK:STDOUT: %struct_type.v: type = struct_type {.v: %empty_tuple.type} [concrete = constants.%struct_type.v]
  32. // CHECK:STDOUT: }
  33. // CHECK:STDOUT: %x: ref %struct_type.v = bind_name x, %x.var
  34. // CHECK:STDOUT: }
  35. // CHECK:STDOUT: