gcc/testsuite/gcc.c-torture/execute/nest-stdar-1.c
raw| 1 | #include <stdarg.h> |
| 2 | |
| 3 | void abort (void); |
| 4 | void exit (int); |
| 5 | |
| 6 | int |
| 7 | main (void) |
| 8 | { |
| 9 | double f (int x, ...) |
| 10 | { |
| 11 | va_list args; |
| 12 | double a; |
| 13 | |
| 14 | va_start (args, x); |
| 15 | a = va_arg (args, double); |
| 16 | va_end (args); |
| 17 | return a; |
| 18 | } |
| 19 | |
| 20 | if (f (1, (double)1) != 1.0) |
| 21 | abort (); |
| 22 | exit (0); |
| 23 | } |