Files
carbon-lang/toolchain/lowering/testdata/function/call/empty_tuple.carbon
T
Farzana Ahmed SiddiqueandFarzana Ahmed Siddique 545688e9d4 Lowering for tuple (#3016)
Lowering for tuple with a workaround for typetype. I don't think this
will generate tuple objects with correct values for the typetype issue.

---------

Co-authored-by: Farzana Ahmed Siddique <fasiddique@google.com>
2023-07-25 16:00:17 +00:00

34 lines
1.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
// CHECK:STDOUT: ; ModuleID = 'empty_tuple.carbon'
// CHECK:STDOUT: source_filename = "empty_tuple.carbon"
// CHECK:STDOUT:
// CHECK:STDOUT: %TupleLiteralType = type {}
// CHECK:STDOUT: %EmptyTupleType = type {}
// CHECK:STDOUT:
// CHECK:STDOUT: define %TupleLiteralType @Echo(%TupleLiteralType %a) {
// CHECK:STDOUT: ret %TupleLiteralType %a
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: define %EmptyTupleType @Main() {
// CHECK:STDOUT: %TupleLiteralValue = alloca %TupleLiteralType, align 8
// CHECK:STDOUT: %var = alloca %TupleLiteralType, align 8
// CHECK:STDOUT: %TupleLiteralValue1 = alloca %TupleLiteralType, align 8
// CHECK:STDOUT: %1 = load %TupleLiteralType, ptr %TupleLiteralValue1, align 1
// CHECK:STDOUT: %Echo = call %TupleLiteralType @Echo(%TupleLiteralType %1)
// CHECK:STDOUT: store %TupleLiteralType %Echo, ptr %var, align 1
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
fn Echo(a: ()) -> () {
return a;
}
fn Main() {
var b: () = Echo(());
}