gcc/testsuite/gcc.target/avr/pr60991.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-options "-O1" } */ |
| 3 | |
| 4 | /* This testcase (simplified from the original bug report) exposes |
| 5 | PR60991. The code generated for writing the __int24 value corrupts |
| 6 | the frame pointer if the offset is <= 63 + MAX_LD_OFFSET */ |
| 7 | |
| 8 | #include <stdlib.h> |
| 9 | |
| 10 | int main(void) |
| 11 | { |
| 12 | volatile char junk[62]; |
| 13 | junk[0] = 5; |
| 14 | volatile __int24 staticConfig = 0; |
| 15 | |
| 16 | if (junk[0] != 5) |
| 17 | abort(); |
| 18 | |
| 19 | exit(0); |
| 20 | return 0; |
| 21 | } |