annotate gcc/testsuite/gcc.dg/weak/weak-16.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* From PR37280. */
kono
parents:
diff changeset
2 /* { dg-do compile } */
kono
parents:
diff changeset
3 /* { dg-require-weak "" } */
kono
parents:
diff changeset
4 /* { dg-options "-fno-common -Os" } */
kono
parents:
diff changeset
5 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?kallsyms_token_index" } } */
kono
parents:
diff changeset
6 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?kallsyms_token_table" } } */
kono
parents:
diff changeset
7 /* { dg-skip-if "" { x86_64-*-mingw* } } */
kono
parents:
diff changeset
8 /* NVPTX's weak is applied to the definition, not declaration. */
kono
parents:
diff changeset
9 /* { dg-skip-if "" { nvptx-*-* } } */
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 extern int kallsyms_token_index[] __attribute__((weak));
kono
parents:
diff changeset
12 extern int kallsyms_token_table[] __attribute__((weak));
kono
parents:
diff changeset
13 void kallsyms_expand_symbol(int *result)
kono
parents:
diff changeset
14 {
kono
parents:
diff changeset
15 int len = *result;
kono
parents:
diff changeset
16 int *tptr;
kono
parents:
diff changeset
17 while(len) {
kono
parents:
diff changeset
18 tptr = &kallsyms_token_table[ kallsyms_token_index[*result] ];
kono
parents:
diff changeset
19 len--;
kono
parents:
diff changeset
20 while (*tptr) tptr++;
kono
parents:
diff changeset
21 *tptr = 1;
kono
parents:
diff changeset
22 }
kono
parents:
diff changeset
23 *result = 0;
kono
parents:
diff changeset
24 }