gcc/testsuite/gcc.c-torture/execute/991019-1.c
raw| 1 | void abort (void); |
| 2 | void exit (int); |
| 3 | |
| 4 | typedef struct { |
| 5 | double epsilon; |
| 6 | } material_type; |
| 7 | |
| 8 | material_type foo(double x) |
| 9 | { |
| 10 | material_type m; |
| 11 | |
| 12 | m.epsilon = 1.0 + x; |
| 13 | return m; |
| 14 | } |
| 15 | |
| 16 | int |
| 17 | main(void) |
| 18 | { |
| 19 | int i; |
| 20 | material_type x; |
| 21 | |
| 22 | /* We must iterate enough times to overflow the FP stack on the |
| 23 | x86. */ |
| 24 | for (i = 0; i < 10; i++) |
| 25 | { |
| 26 | x = foo (1.0); |
| 27 | if (x.epsilon != 1.0 + 1.0) |
| 28 | abort (); |
| 29 | } |
| 30 | |
| 31 | exit (0); |
| 32 | } |