From 5ade19c4211db61c7e85c417677ea1384891a5c5 Mon Sep 17 00:00:00 2001 From: Christian Jullien Date: Sun, 22 Mar 2020 08:40:35 +0100 Subject: [PATCH] Add a test function which verifies we can pass a struct ptr to va_arg for all supported architectures. The bug has been identify by trying to compile FFTW-3.3.8. --- tests/tcctest.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/tcctest.c b/tests/tcctest.c index 059d0f7b..0f445f14 100644 --- a/tests/tcctest.c +++ b/tests/tcctest.c @@ -2679,6 +2679,18 @@ void manyarg_test(void) 42.0, 43.0, ld); } +void* +va_arg_with_struct_ptr(va_list ap) { + /* + * This was a BUG identified with FFTW-3.3.8 on arm64. + * The test case only checks it compiles on all supported + * architectures. This function is not currently called. + */ + struct X { int _x; }; + struct X *x = va_arg(ap, struct X *); + return x; +} + void vprintf1(const char *fmt, ...) { va_list ap, aq;