gcc/testsuite/gcc.dg/tree-ssa/pr107323.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-options "-O2 -fno-tree-vectorize" } */ |
| 3 | |
| 4 | int A[4]; |
| 5 | int B[4]; |
| 6 | |
| 7 | static const char *__attribute__((noipa)) foo() |
| 8 | { |
| 9 | return "1"; |
| 10 | } |
| 11 | |
| 12 | int main() |
| 13 | { |
| 14 | const char *s = foo(); |
| 15 | |
| 16 | A[0] = 1000; |
| 17 | for(int i = 1; i < 4; ++i) { |
| 18 | B[i] = 0; |
| 19 | A[i] = 0; |
| 20 | if(s[0]) |
| 21 | B[i] = 1; |
| 22 | A[i] = A[i - 1]; |
| 23 | } |
| 24 | |
| 25 | if (A[3] != 1000) |
| 26 | __builtin_abort (); |
| 27 | return 0; |
| 28 | } |