pr79732.c: Require alias support.
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr53922.c
blobfac054d9ce3f03f65c2ee1c07da0e10da3840642
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-skip-if "No undefined weak" { nvptx-*-* } { "*" } { "" } } */
7 /* { dg-options "-Wl,-undefined,dynamic_lookup" { target *-*-darwin* } } */
8 /* { dg-additional-options "-Wl,-flat_namespace" { target *-*-darwin[89]* } } */
10 int x(int a)
12 return a;
14 int y(int a) __attribute__ ((weak));
15 int g = 0;
16 int main()
18 int (*scan_func)(int);
19 if (g)
20 scan_func = x;
21 else
22 scan_func = y;
24 if (scan_func)
25 g = scan_func(10);
27 return 0;