[clang] [Arm64EC][clang] Implement varargs support in clang. (PR #152411)

Jacek Caban via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 15 06:25:55 PDT 2025


================
@@ -0,0 +1,59 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --check-globals --include-generated-funcs --global-value-regex "f"
+// RUN: %clang_cc1 -opaque-pointers -triple arm64ec-windows-msvc -emit-llvm -o - %s | FileCheck %s
+
+typedef struct { float x[2]; } A;
+typedef struct { float x[4]; } B;
+void f(A a, ...) {
+  __builtin_va_list b;
+  __builtin_va_start(b, a);
+  float x = __builtin_va_arg(b, A).x[0];
+  float y = __builtin_va_arg(b, B).x[0];
+}
+void g(A a, B b) { f(a, b); }
----------------
cjacek wrote:

It would be nice to have a test with a size that isn’t a power of two.
Looks good to me overall.

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


More information about the cfe-commits mailing list