Files
carbon-lang/toolchain/check/testdata/tuple/no_prelude/empty.carbon
T
Jon Ross-Perkins 0d106fbf90 Rename check/testdata/tuples to remove the plural (#4200)
This is just odd since other dirs aren't plural (struct, not structs),
and we do have parse/testdata/tuple
2024-08-07 21:05:11 +00:00

49 lines
2.2 KiB
Plaintext

// 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/tuple/no_prelude/empty.carbon
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/no_prelude/empty.carbon
var x: () = ();
var y: () = x;
// CHECK:STDOUT: --- empty.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %tuple: %.1 = tuple_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .x = %x
// CHECK:STDOUT: .y = %y
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc11_9.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc11_9.2: type = converted %.loc11_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %x.var: ref %.1 = var x
// CHECK:STDOUT: %x: ref %.1 = bind_name x, %x.var
// CHECK:STDOUT: %.loc12_9.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc12_9.2: type = converted %.loc12_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %y.var: ref %.1 = var y
// CHECK:STDOUT: %y: ref %.1 = bind_name y, %y.var
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc11_14.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc11_14.2: init %.1 = tuple_init () to file.%x.var [template = constants.%tuple]
// CHECK:STDOUT: %.loc11_15: init %.1 = converted %.loc11_14.1, %.loc11_14.2 [template = constants.%tuple]
// CHECK:STDOUT: assign file.%x.var, %.loc11_15
// CHECK:STDOUT: %x.ref: ref %.1 = name_ref x, file.%x
// CHECK:STDOUT: %.loc12_13: init %.1 = tuple_init () to file.%y.var [template = constants.%tuple]
// CHECK:STDOUT: %.loc12_14: init %.1 = converted %x.ref, %.loc12_13 [template = constants.%tuple]
// CHECK:STDOUT: assign file.%y.var, %.loc12_14
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT: