Debian Codegraph @

gcc/testsuite/g++.dg/warn/weak1.C

raw
1 // { dg-do run }
2 // { dg-require-weak "" }
3 // The PA HP-UX dynamic loader doesn't support unsatisfied weak symbols.
4 // { dg-skip-if "No unsat" { hppa*-*-hpux* } }
5 // { dg-skip-if "No weak unsat" { *-*-aix* } }
6 // The darwin loader does, but they do need to exist at link time.
7 // { dg-skip-if "No link unsat" { *-*-darwin* } }
8 // For kernel modules and static RTPs, the loader treats undefined weak
9 // symbols in the same way as undefined strong symbols. The test
10 // therefore fails to load, so skip it.
11 // { dg-skip-if "" { "*-*-vxworks*" && nonpic } "*" { "-non-static" } }
12
13 extern void foo (void) __attribute__ ((weak));
14
15 int
16 main ()
17 {
18 if (&foo)
19 foo ();
20
21 return 0;
22 }