We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d593cf commit ab19c5fCopy full SHA for ab19c5f
tests/codegen/transparent-aggregates.rs
@@ -0,0 +1,29 @@
1
+//@ compile-flags: -O -C no-prepopulate-passes
2
+
3
+#![crate_type = "lib"]
4
5
+#[repr(transparent)]
6
+struct Transparent32(u32);
7
8
+// CHECK: i32 @make_transparent(i32 noundef %x)
9
+#[no_mangle]
10
+pub fn make_transparent(x: u32) -> Transparent32 {
11
+ // CHECK: %a = alloca i32
12
+ // CHECK: store i32 %x, ptr %a
13
+ // CHECK: %[[TEMP:.+]] = load i32, ptr %a
14
+ // CHECK: ret i32 %[[TEMP]]
15
+ let a = Transparent32(x);
16
+ a
17
+}
18
19
+// CHECK-LABEL: { i32, i32 } @make_2_tuple(i32 noundef %x)
20
21
+pub fn make_2_tuple(x: u32) -> (u32, u32) {
22
+ // CHECK: %pair = alloca { i32, i32 }
23
+ // CHECK: store i32
24
25
+ // CHECK: load i32
26
27
+ let pair = (x, x);
28
+ pair
29
0 commit comments