Handle Temporary values when const-evaling AcquireValue (#6992)

This will be used for const-evaling functions. Splitting into a separate
commit since it touches a lot of test files, and a couple fail_todo
tests are no longer failing.
This commit is contained in:
Nicholas Bishop
2026-03-31 15:50:54 +00:00
committed by GitHub
parent bf6a14ac39
commit 396756c151
48 changed files with 304 additions and 241 deletions
@@ -76,6 +76,7 @@ fn InitLet() {
// CHECK:STDOUT: source_filename = "let_param.carbon"
// CHECK:STDOUT:
// CHECK:STDOUT: @C.val = internal constant {} zeroinitializer
// CHECK:STDOUT: @C.val.loc12_6.6 = internal constant {} zeroinitializer
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CF.Main(ptr %_) #0 !dbg !4 {
@@ -90,7 +91,7 @@ fn InitLet() {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc12_6.2.temp = alloca {}, align 8, !dbg !14
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_6.2.temp), !dbg !14
// CHECK:STDOUT: call void @_CF.Main(ptr @C.val), !dbg !15
// CHECK:STDOUT: call void @_CF.Main(ptr @C.val.loc12_6.6), !dbg !15
// CHECK:STDOUT: call void @_CG.Main(), !dbg !16
// CHECK:STDOUT: ret void, !dbg !17
// CHECK:STDOUT: }
@@ -33,6 +33,7 @@ fn Call() {
// CHECK:STDOUT:
// CHECK:STDOUT: @int_1.5d2 = internal constant i32 1
// CHECK:STDOUT: @X.val = internal constant {} zeroinitializer
// CHECK:STDOUT: @X.val.loc27_18.6 = internal constant {} zeroinitializer
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_COneVar_i32.Main(ptr %_) #0 !dbg !4 {
@@ -83,7 +84,7 @@ fn Call() {
// CHECK:STDOUT: call void @_CTwoVars.Main(ptr @int_1.5d2, ptr @X.val), !dbg !47
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_15.1.temp), !dbg !42
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc27_18.2.temp), !dbg !43
// CHECK:STDOUT: call void @_CVarThenLet.Main(ptr @int_1.5d2, ptr @X.val), !dbg !48
// CHECK:STDOUT: call void @_CVarThenLet.Main(ptr @int_1.5d2, ptr @X.val.loc27_18.6), !dbg !48
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc21_23.1.temp), !dbg !44
// CHECK:STDOUT: call void @_CLetThenVar.Main(i32 1, ptr @X.val), !dbg !49
// CHECK:STDOUT: ret void, !dbg !50