gcc:
[official-gcc.git] / gcc / testsuite / gcc.dg / fold-and-rshift-1.c
blob11c13d582eb6fc7c46b0b3aacc9a7a4be1ad8521
1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-original" } */
4 int f(int x)
6 return (x >> 2) & 128;
9 int g(int x)
11 return !!(x & 512) << 7;
14 int h(int x)
16 return ((x >> 9) & 1) << 7;
19 int i(int x)
21 return (x & 512) >> 9 << 7;
24 int j(int x)
26 return ((x >> 9) & 1) ? 128 : 0;
29 int k(int x)
31 return (x & 512) ? 128 : 0;
34 /* { dg-final { scan-tree-dump-not " \\? " "original" } } */
35 /* { dg-final { scan-assembler-not "sall" { target i?86-*-* x86_64-*-* } } }" */