================
@@ -13,8 +13,9 @@ void voidret() { return; }
 
 int intfunc() { return 42; }
 // CHECK: cir.func @intfunc() -> !cir.int<s, 32> {
-// CHECK:   %0 = cir.const #cir.int<42> : !cir.int<s, 32>
-// CHECK:   cir.return %0 : !cir.int<s, 32>
+// CHECK:   %0 = cir.alloca !cir.int<s, 32>, !cir.ptr<!cir.int<s, 32>>, 
["__retval"] {alignment = 4 : i64}
+// CHECK:   %1 = cir.const #cir.int<42> : !cir.int<s, 32>
----------------
andykaylor wrote:

The constant here should be stored to the return alloca slot and reloaded 
before being used in the return statement. That will require setting 
`returnStatement` here and using it in `emitReturnStmt`. Hopefully, that will 
cause updates to the test cases below.

https://github.com/llvm/llvm-project/pull/129933
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to