gcc/testsuite/gcc.dg/torture/pr90020.c
raw| 1 | /* { dg-do run { target { weak_undefined } } } */ |
| 2 | /* { dg-add-options weak_undefined } */ |
| 3 | |
| 4 | void __attribute__((noinline,noclone)) |
| 5 | check (int i) |
| 6 | { |
| 7 | if (i == 0) |
| 8 | __builtin_exit (0); |
| 9 | } |
| 10 | |
| 11 | int i; |
| 12 | extern int x __attribute__((weak)); |
| 13 | |
| 14 | int main(int argc, char **argv) |
| 15 | { |
| 16 | if (argc) |
| 17 | { |
| 18 | check (i); |
| 19 | return x; |
| 20 | } |
| 21 | else |
| 22 | { |
| 23 | check (i); |
| 24 | return x-1; |
| 25 | } |
| 26 | return 0; |
| 27 | } |