================
@@ -1,22 +1,42 @@
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fcoroutines -fclangir
-emit-cir %s -o %t.cir
// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fcoroutines -fclangir
-fclangir -emit-llvm -disable-llvm-passes %s -o %t-cir.ll
+// RUN: FileCheck --input-file=%t-cir.ll %s -check-prefix=LLVM
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fcoroutines -emit-llvm
-disable-llvm-passes %s -o %t.ll
+// RUN: FileCheck --input-file=%t.ll %s -check-prefix=OGCG
void *myAlloc(long long);
// CIR: cir.func {{.*}} @_Z1fi
+// LLVM: void @_Z1fi
+// OGCG: void @_Z1fi
void f(int n) {
int promise;
// CIR: %[[ADDR:.*]] = cir.alloca "n"
// CIR: %[[PROMISE:.*]] = cir.alloca "promise"
+ // LLVM: %[[ADDR:.*]] = alloca i32
+ // LLVM: %[[PROMISE:.*]] = alloca i32
+
+ // OGCG: %n.addr = alloca i32, align 4
+ // OGCG: %promise = alloca i32, align 4
+
__builtin_coro_id(32, &promise, 0, 0);
// CIR: %[[CORO_ID_ALIGN:.*]] = cir.const #cir.int<32>
// CIR: %[[CAS_PROM:.*]] = cir.cast bitcast %[[PROMISE]]
// CIR: %[[COROID:.*]] = cir.coro.intrinsic.id(%[[CORO_ID_ALIGN]],
%[[CAS_PROM]], {{.*}}, {{.*}})
+ // LLVM: %[[COROID:.*]] = call token @llvm.coro.id(i32 32, ptr %[[PROMISE]],
ptr null, ptr null)
+
+ // OGCG: %[[COROID:.*]] = call token @llvm.coro.id(i32 32, ptr %promise, ptr
null, ptr null)
----------------
erichkeane wrote:
Don't do %promise here, that isn't a stable name.
https://github.com/llvm/llvm-project/pull/215709
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits