]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/weak/weak-16.c
Get rid of dg-skip-if etc. default args
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / weak / weak-16.c
1 /* From PR37280. */
2 /* { dg-do compile } */
3 /* { dg-require-weak "" } */
4 /* { dg-options "-fno-common -Os" } */
5 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?kallsyms_token_index" } } */
6 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?kallsyms_token_table" } } */
7 /* { dg-skip-if "" { x86_64-*-mingw* } } */
8 /* NVPTX's weak is applied to the definition, not declaration. */
9 /* { dg-skip-if "" { nvptx-*-* } } */
10
11 extern int kallsyms_token_index[] __attribute__((weak));
12 extern int kallsyms_token_table[] __attribute__((weak));
13 void kallsyms_expand_symbol(int *result)
14 {
15 int len = *result;
16 int *tptr;
17 while(len) {
18 tptr = &kallsyms_token_table[ kallsyms_token_index[*result] ];
19 len--;
20 while (*tptr) tptr++;
21 *tptr = 1;
22 }
23 *result = 0;
24 }