From b3b83ac1e80e4a3f3e4241b2ae0ceabef369a5bf Mon Sep 17 00:00:00 2001 From: Nick Sarnie Date: Wed, 26 Nov 2025 00:16:15 +0900 Subject: [PATCH] [offload][lit] Fix compilation of two offload tests (#169399) These are C tests, not C++, so no function parameters means unspecified number of parameters, not `void`. These compile fine on the current tested offload targets because an error is only [thrown](https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaDecl.cpp#L10695) if the calling convention doesn't support variadic arguments, which they happen to. When compiling this test for other targets that do not support variadic arguments, we get an error, which does not seem intentional. Just add `void` to the parameter list. --------- Signed-off-by: Nick Sarnie --- offload/test/offloading/shared_lib_fp_mapping.c | 4 ++-- offload/test/offloading/static_linking.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/offload/test/offloading/shared_lib_fp_mapping.c b/offload/test/offloading/shared_lib_fp_mapping.c index c6203443eee1..e0af9b70a75c 100644 --- a/offload/test/offloading/shared_lib_fp_mapping.c +++ b/offload/test/offloading/shared_lib_fp_mapping.c @@ -7,8 +7,8 @@ #include -extern int func(); // Provided in liba.so, returns 42 -typedef int (*fp_t)(); +extern int func(void); // Provided in liba.so, returns 42 +typedef int (*fp_t)(void); int main() { int x = 0; diff --git a/offload/test/offloading/static_linking.c b/offload/test/offloading/static_linking.c index 7be95a10ffcd..273109e10c09 100644 --- a/offload/test/offloading/static_linking.c +++ b/offload/test/offloading/static_linking.c @@ -14,7 +14,7 @@ int foo() { } #else #include -int foo(); +int foo(void); int main() { int x = foo();