[libc-commits] [libc] ce38cbb - [libc][NFC] Adjust the `libc` init / fini array test

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Fri Sep 29 11:22:11 PDT 2023


Author: Joseph Huber
Date: 2023-09-29T13:22:02-05:00
New Revision: ce38cbb13bb1110df43456cfe541da0fc004c99f

URL: https://github.com/llvm/llvm-project/commit/ce38cbb13bb1110df43456cfe541da0fc004c99f
DIFF: https://github.com/llvm/llvm-project/commit/ce38cbb13bb1110df43456cfe541da0fc004c99f.diff

LOG: [libc][NFC] Adjust the `libc` init / fini array test

Summary:
The NVPTX backend is picky about the definitions of functions. Because
we call these functions with these arguments it can cause some problems
when it goes through the backend. This was observed in a different test
for `printf` that hasn't been landed yet. Also adjust the priority.

Added: 
    

Modified: 
    libc/test/integration/startup/gpu/init_fini_array_test.cpp

Removed: 
    


################################################################################
diff  --git a/libc/test/integration/startup/gpu/init_fini_array_test.cpp b/libc/test/integration/startup/gpu/init_fini_array_test.cpp
index 1e61711f0fc4ddc..ead05f0240585a4 100644
--- a/libc/test/integration/startup/gpu/init_fini_array_test.cpp
+++ b/libc/test/integration/startup/gpu/init_fini_array_test.cpp
@@ -37,18 +37,18 @@ A global(GLOBAL_INDEX, INITVAL_INITIALIZER);
 int initval = 0;
 int before = 0;
 
-__attribute__((constructor(101))) void run_before() {
+__attribute__((constructor(101))) void run_before(int, char **, char **) {
   before = BEFORE_INITIALIZER;
 }
 
-__attribute__((constructor(65535))) void run_after() {
+__attribute__((constructor(65535))) void run_after(int, char **, char **) {
   ASSERT_EQ(before, BEFORE_INITIALIZER);
 }
 
 __attribute__((constructor)) void set_initval() {
   initval = INITVAL_INITIALIZER;
 }
-__attribute__((destructor(1))) void reset_initval() {
+__attribute__((destructor(101))) void reset_initval() {
   ASSERT_TRUE(global_destroyed);
   initval = 0;
 }


        


More information about the libc-commits mailing list