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)]
5 pub struct S([usize; 8]);
8 pub fn outer_function(x: S, y: S) -> usize {
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-NOT: [[ptr_tmp:%.*]] = getelementptr inbounds %"[closure@{{.*.rs}}:9:23: 9:25]", ptr [[spill]]
20 // CHECK-NOT: [[load:%.*]] = load ptr, ptr
21 // CHECK: call void @llvm.lifetime.start{{.*}}({{.*}}, ptr [[spill]])
22 // CHECK: call void @llvm.memcpy{{.*}}(ptr {{align .*}} [[spill]], ptr {{align .*}} %x