[clang] [CIR] Add support for __builtin_alloca (PR #157116)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 5 11:17:52 PDT 2025


================
@@ -258,3 +258,13 @@ void trap2() {
 // LLVM:       {{.+}}:
 // LLVM-NEXT:    call void @_Z2f1v()
 // LLVM:       }
+
+void *test_alloca(unsigned long n) {
+  return __builtin_alloca(n);
+}
+
+// CIR-LABEL: @_Z11test_allocam(
+// CIR:         %{{.+}} = cir.alloca !u8i, !cir.ptr<!u8i>, %{{.+}} : !u64i, ["bi_alloca"]
+
+// LLVM-LABEL: @_Z11test_allocam(
----------------
andykaylor wrote:

Can you add the OGCG checks? This test seems to have started drifting away from doing that for some reason.

https://github.com/llvm/llvm-project/pull/157116


More information about the cfe-commits mailing list