gcc/testsuite/gcc.dg/torture/pr30665-1.c
raw| 1 | /* PR target/30665: bug in cris.md peephole2 condition. |
| 2 | Testcase for trunk. */ |
| 3 | /* { dg-do run } */ |
| 4 | |
| 5 | extern void abort (void); |
| 6 | extern void exit (int); |
| 7 | |
| 8 | int __attribute__ ((__noinline__)) f (unsigned *p, int *x) |
| 9 | { |
| 10 | int y = *p++ & 0xfff; |
| 11 | *x++ = y; |
| 12 | *x = *p; |
| 13 | return y; |
| 14 | } |
| 15 | |
| 16 | int main (void) |
| 17 | { |
| 18 | unsigned u[2] = { 0x3aad, 0x5ad1 }; |
| 19 | int x[2] = {17689, 23456}; |
| 20 | |
| 21 | if (f (u, x) != 0xaad || x[0] != 0xaad || x[1] != 0x5ad1) |
| 22 | abort (); |
| 23 | exit (0); |
| 24 | } |