| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
- // Exceptions. See /LICENSE for license information.
- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- //
- // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon
- // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
- // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
- //
- // AUTOUPDATE
- // TIP: To test this file alone, run:
- // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/global_decl.carbon
- // TIP: To dump output, run:
- // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/global_decl.carbon
- var x: {.v: ()};
- // CHECK:STDOUT: --- global_decl.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
- // CHECK:STDOUT: %struct_type.v: type = struct_type {.v: %empty_tuple.type} [concrete]
- // CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.v [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .x = %x
- // CHECK:STDOUT: }
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %x.patt: %pattern_type = binding_pattern x [concrete]
- // CHECK:STDOUT: %x.var_patt: %pattern_type = var_pattern %x.patt [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %x.var: ref %struct_type.v = var %x.var_patt [concrete]
- // CHECK:STDOUT: %.loc15_15: type = splice_block %struct_type.v [concrete = constants.%struct_type.v] {
- // CHECK:STDOUT: %.loc15_14.1: %empty_tuple.type = tuple_literal ()
- // CHECK:STDOUT: %.loc15_14.2: type = converted %.loc15_14.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
- // CHECK:STDOUT: %struct_type.v: type = struct_type {.v: %empty_tuple.type} [concrete = constants.%struct_type.v]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %x: ref %struct_type.v = bind_name x, %x.var [concrete = %x.var]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
|