| 12345678910111213141516171819202122232425262728293031 |
- // 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/lower/testdata/tuple/value_forwarding.carbon
- // TIP: To dump output, run:
- // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/tuple/value_forwarding.carbon
- fn G(ab: ((i32, i32, i32), (i32, i32, i32)));
- fn F(a: (i32, i32, i32), b: (i32, i32, i32)) {
- G((a, b));
- }
- // CHECK:STDOUT: ; ModuleID = 'value_forwarding.carbon'
- // CHECK:STDOUT: source_filename = "value_forwarding.carbon"
- // CHECK:STDOUT:
- // CHECK:STDOUT: declare void @G(ptr)
- // CHECK:STDOUT:
- // CHECK:STDOUT: define void @F(ptr %a, ptr %b) {
- // CHECK:STDOUT: entry:
- // CHECK:STDOUT: %tuple = alloca { ptr, ptr }, align 8
- // CHECK:STDOUT: %tuple1 = getelementptr inbounds { ptr, ptr }, ptr %tuple, i32 0, i32 0
- // CHECK:STDOUT: store ptr %a, ptr %tuple1, align 8
- // CHECK:STDOUT: %tuple2 = getelementptr inbounds { ptr, ptr }, ptr %tuple, i32 0, i32 1
- // CHECK:STDOUT: store ptr %b, ptr %tuple2, align 8
- // CHECK:STDOUT: call void @G(ptr %tuple)
- // CHECK:STDOUT: ret void
- // CHECK:STDOUT: }
|