gcc/testsuite/gcc.dg/pr123431.c
raw| 1 | /* PR tree-optimization/123431 */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "-O2" } */ |
| 4 | |
| 5 | extern void foo (int); |
| 6 | |
| 7 | extern inline __attribute__((always_inline)) void |
| 8 | bar (int x, ...) |
| 9 | { |
| 10 | if (__builtin_constant_p (__builtin_va_arg_pack ())) |
| 11 | foo (x); |
| 12 | } |
| 13 | |
| 14 | void |
| 15 | baz (int x) |
| 16 | { |
| 17 | bar (1, 2); |
| 18 | bar (3, x); |
| 19 | } |