| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O1 -fdump-tree-dom2" } */ |
| 3 |
|
| 4 |
extern void abort (void); |
| 5 |
extern int blah[]; |
| 6 |
|
| 7 |
void |
| 8 |
foo(int index) |
| 9 |
{ |
| 10 |
if (blah [(unsigned int)index] != 0) |
| 11 |
abort (); |
| 12 |
if (blah [(unsigned int)index] != 0) |
| 13 |
abort (); |
| 14 |
} |
| 15 |
|
| 16 |
/* There should be precisely one load of blah. If there is |
| 17 |
more than one, then the dominator optimizations failed. */ |
| 18 |
/* { dg-final { scan-tree-dump-times "blah" 1 "dom2"} } */ |
| 19 |
|
| 20 |
/* There should be exactly one IF conditional. */ |
| 21 |
/* { dg-final { scan-tree-dump-times "if " 1 "dom2"} } */ |
| 22 |
|