gcc/testsuite/gcc.dg/tree-ssa/20031106-3.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O1 -fdump-tree-optimized" } */ |
| 3 | |
| 4 | extern void link_error (void); |
| 5 | |
| 6 | /* Check for cprop on array elements. */ |
| 7 | |
| 8 | void foo (int testarray[]) |
| 9 | { |
| 10 | testarray[0] = 0; |
| 11 | testarray[1] = 1; |
| 12 | testarray[0]++; |
| 13 | testarray[1]++; |
| 14 | if (testarray[0] != 1) |
| 15 | link_error (); |
| 16 | if (testarray[1] != 2) |
| 17 | link_error (); |
| 18 | } |
| 19 | |
| 20 | /* There should be no link_error calls. */ |
| 21 | /* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */ |