Debian Codegraph @

gcc/testsuite/gcc.dg/weak/weak-12.c

raw
1 /* Test for #pragma weak with declaration not at file scope. */
2 /* { dg-do compile } */
3 /* { dg-require-weak "" } */
4 /* { dg-options "" } */
5 /* NVPTX's weak is applied to the definition, not declaration. */
6 /* { dg-skip-if "" { nvptx-*-* } } */
7 /* { dg-skip-if PR119369 { amdgcn-*-* } } */
8
9 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?foo" } } */
10
11 #pragma weak foo
12
13 int
14 main (void)
15 {
16 extern int foo (void);
17 if (&foo)
18 return foo ();
19 return 0;
20 }