Skip to content

Commit ce38cbb

Browse files
committed
[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.
1 parent 23b88e8 commit ce38cbb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ A global(GLOBAL_INDEX, INITVAL_INITIALIZER);
3737
int initval = 0;
3838
int before = 0;
3939

40-
__attribute__((constructor(101))) void run_before() {
40+
__attribute__((constructor(101))) void run_before(int, char **, char **) {
4141
before = BEFORE_INITIALIZER;
4242
}
4343

44-
__attribute__((constructor(65535))) void run_after() {
44+
__attribute__((constructor(65535))) void run_after(int, char **, char **) {
4545
ASSERT_EQ(before, BEFORE_INITIALIZER);
4646
}
4747

4848
__attribute__((constructor)) void set_initval() {
4949
initval = INITVAL_INITIALIZER;
5050
}
51-
__attribute__((destructor(1))) void reset_initval() {
51+
__attribute__((destructor(101))) void reset_initval() {
5252
ASSERT_TRUE(global_destroyed);
5353
initval = 0;
5454
}

0 commit comments

Comments
 (0)