gcc/testsuite/gcc.dg/torture/pr64365.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-require-effective-target int32plus } */ |
| 3 | |
| 4 | extern void abort (void); |
| 5 | extern int memcmp (const void * , const void *, __SIZE_TYPE__); |
| 6 | |
| 7 | void __attribute__((noinline,noclone)) |
| 8 | foo(int *in) |
| 9 | { |
| 10 | int i; |
| 11 | for (i = 62; i >= 10; i--) |
| 12 | { |
| 13 | in[i - 8] -= in[i]; |
| 14 | in[i - 5] += in[i] * 2; |
| 15 | in[i - 4] += in[i]; |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | int main() |
| 20 | { |
| 21 | int x[64]; |
| 22 | int y[64] = { 0, 1, -2380134, -1065336, -1026376, 3264240, 3113534, 2328130, 3632054, 3839634, 2380136, 1065339, 1026380, 1496037, 1397286, 789976, 386408, 450984, 597112, 497464, 262008, 149184, 194768, 231519, 173984, 87753, 60712, 82042, 87502, 60014, 30050, 25550, 33570, 32386, 20464, 10675, 10868, 13329, 11794, 6892, 3988, 4564, 5148, 4228, 2284, 1568, 1848, 1943, 1472, 741, 628, 702, 714, 474, 230, 234, 238, 242, 120, 59, 60, 61, 62, 63 }; |
| 23 | int i; |
| 24 | |
| 25 | for (i = 0; i < 64; ++i) |
| 26 | { |
| 27 | x[i] = i; |
| 28 | __asm__ volatile (""); |
| 29 | } |
| 30 | |
| 31 | foo (x); |
| 32 | |
| 33 | if (memcmp (x, y, sizeof (x)) != 0) |
| 34 | abort (); |
| 35 | |
| 36 | return 0; |
| 37 | } |