gcc/testsuite/gcc.dg/tree-ssa/ssa-hoist-1.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2 -fdump-tree-pre" } */ |
| 3 | |
| 4 | unsigned short f(unsigned short a) |
| 5 | { |
| 6 | if (a & 0x8000) |
| 7 | a <<= 1, a = a ^ 0x1021; |
| 8 | else |
| 9 | a <<= 1; |
| 10 | |
| 11 | return a; |
| 12 | } |
| 13 | |
| 14 | /* We should hoist and CSE the shift. */ |
| 15 | |
| 16 | /* { dg-final { scan-tree-dump-times " << 1;" 1 "pre" } } */ |