We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8f529ab commit 259a7a7Copy full SHA for 259a7a7
src/test/codegen/issue-98156-const-arg-temp-lifetime.rs
@@ -0,0 +1,27 @@
1
+// This test checks that temporaries for indirectly-passed arguments get lifetime markers.
2
+
3
+// compile-flags: -O -C no-prepopulate-passes -Zmir-opt-level=0
4
5
+#![crate_type = "lib"]
6
7
+extern "Rust" {
8
+ fn f(x: [u8; 1024]);
9
+}
10
11
+const A: [u8; 1024] = [0; 1024];
12
13
+// CHECK-LABEL: @const_arg_indirect
14
+#[no_mangle]
15
+pub unsafe fn const_arg_indirect() {
16
+ // Ensure that the live ranges for the two argument temporaries don't overlap.
17
18
+ // CHECK: call void @llvm.lifetime.start
19
+ // CHECK: call void @f
20
+ // CHECK: call void @llvm.lifetime.end
21
22
23
24
25
+ f(A);
26
27
0 commit comments