gcc/ChangeLog:
[official-gcc.git] / gcc / testsuite / g++.dg / warn / weak1.C
blob7af7e4c8450a488ccd2acab7bdd253aebd59f557
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" } }
13 extern void foo (void) __attribute__ ((weak));
15 int
16 main ()
18   if (&foo)
19     foo ();
21   return 0;