Skip to content

Commit 2b8b1d2

Browse files
committed
tests: fix warnings to fix target_clones test (-Werror)
1 parent a761251 commit 2b8b1d2

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/target_clones.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
/* This will only be available for GCC with glibc for the foreseeable future */
22

3+
#include <stdlib.h> /* EXIT_*, exit */
4+
35
__attribute__((target_clones("default,avx2"))) int f(int x)
46
{
57
return x + 3;
68
}
79

8-
int main(int argc, char **argv)
10+
int main(void)
911
{
10-
int y = f(39);
11-
return 0;
12-
}
12+
const int y = f(39);
13+
if (y != 42) {
14+
exit(EXIT_FAILURE);
15+
}
16+
17+
return EXIT_SUCCESS;
18+
}

0 commit comments

Comments
 (0)