File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1+ // compile-flags: --crate-type=lib -O -Cdebuginfo=2 -Cno-prepopulate-passes
2+ // min-llvm-version: 15.0 # this test uses opaque pointer notation
3+ #![ feature( stmt_expr_attributes) ]
4+
5+ pub struct S ( [ usize ; 8 ] ) ;
6+
7+ #[ no_mangle]
8+ pub fn outer_function ( x : S , y : S ) -> usize {
9+ ( #[ inline( always) ] || {
10+ let _z = x;
11+ y. 0 [ 0 ]
12+ } ) ( )
13+ }
14+
15+ // Check that we do not attempt to load from the spilled arg before it is assigned to
16+ // when generating debuginfo.
17+ // CHECK-LABEL: @outer_function
18+ // CHECK: [[spill:%.*]] = alloca %"[closure@{{.*.rs}}:9:23: 9:25]"
19+ // CHECK: [[ptr_tmp:%.*]] = getelementptr inbounds %"[closure@{{.*.rs}}:9:23: 9:25]", ptr [[spill]]
20+ // CHECK: [[load:%.*]] = load ptr, ptr [[ptr_tmp]]
21+ // CHECK: call void @llvm.lifetime.start{{.*}}({{.*}}, ptr [[spill]])
22+ // CHECK: call void @llvm.memcpy{{.*}}(ptr {{align .*}} [[spill]], ptr {{align .*}} %x
You can’t perform that action at this time.
0 commit comments