gcc/testsuite/gcc.c-torture/execute/20060905-1.c
raw| 1 | /* PR rtl-optimization/28386 */ |
| 2 | /* Origin: Volker Reichelt <[email protected]> */ |
| 3 | |
| 4 | extern void abort(void); |
| 5 | |
| 6 | volatile char s[256][3]; |
| 7 | |
| 8 | char g; |
| 9 | |
| 10 | static void dummy(char a) |
| 11 | { |
| 12 | g = a; |
| 13 | } |
| 14 | |
| 15 | static int foo(void) |
| 16 | { |
| 17 | int i, j=0; |
| 18 | |
| 19 | for (i = 0; i < 256; i++) |
| 20 | if (i >= 128 && i < 256) |
| 21 | { |
| 22 | dummy (s[i - 128][0]); |
| 23 | ++j; |
| 24 | } |
| 25 | |
| 26 | return j; |
| 27 | } |
| 28 | |
| 29 | int main(void) |
| 30 | { |
| 31 | if (foo () != 128) |
| 32 | abort (); |
| 33 | |
| 34 | return 0; |
| 35 | } |