2013-10-21 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr53922.c
blobd385587e391c22cc8eab540ee0247eb9131b193e
1 /* { dg-do run } */
2 /* { dg-require-weak "" } */
3 /* { dg-skip-if "No undefined" { *-*-mingw* } { "*" } { "" } } */
4 /* { dg-skip-if "No undefined weak" { *-*-aix* } { "*" } { "" } } */
5 /* { dg-skip-if "No undefined weak" { hppa*-*-hpux* && { ! lp64 } } { "*" } { "" } } */
6 /* { dg-options "-Wl,-undefined,dynamic_lookup" { target *-*-darwin* } } */
8 int x(int a)
10 return a;
12 int y(int a) __attribute__ ((weak));
13 int g = 0;
14 int main()
16 int (*scan_func)(int);
17 if (g)
18 scan_func = x;
19 else
20 scan_func = y;
22 if (scan_func)
23 g = scan_func(10);
25 return 0;