| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- // 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
- //
- // AUTOUPDATE
- // TIP: To test this file alone, run:
- // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/no_prelude/lookup.carbon
- // TIP: To dump output, run:
- // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/lookup.carbon
- fn Main() {
- var x: () = ();
- x;
- }
- // CHECK:STDOUT: --- lookup.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Main.type: type = fn_type @Main [template]
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
- // CHECK:STDOUT: %Main: %Main.type = struct_value () [template]
- // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .Main = %Main.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Main() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var x
- // CHECK:STDOUT: %x: ref %empty_tuple.type = bind_name x, %x.var
- // CHECK:STDOUT: %.loc12_16.1: %empty_tuple.type = tuple_literal ()
- // CHECK:STDOUT: %.loc12_16.2: init %empty_tuple.type = tuple_init () to %x.var [template = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc12_17: init %empty_tuple.type = converted %.loc12_16.1, %.loc12_16.2 [template = constants.%empty_tuple]
- // CHECK:STDOUT: assign %x.var, %.loc12_17
- // CHECK:STDOUT: %x.ref: ref %empty_tuple.type = name_ref x, %x
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
|