Skip to content

Commit

Permalink
[libc][NFC] Adjust the libc init / fini array test
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jhuber6 committed Sep 29, 2023
1 parent 23b88e8 commit ce38cbb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libc/test/integration/startup/gpu/init_fini_array_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit ce38cbb

Please sign in to comment.