libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / fold-eqandshift-4.c
blobfbba438556e0a7585166af50f26bb8361a4bb49a
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 int sr30eq00(signed char x) { return ((x >> 4) & 0x30) == 0; }
5 int sr30ne00(signed char x) { return ((x >> 4) & 0x30) != 0; }
6 int sr30eq20(signed char z) { return ((z >> 4) & 0x30) == 0x20; }
7 int sr30ne20(signed char z) { return ((z >> 4) & 0x30) != 0x20; }
8 int sr30eq30(signed char x) { return ((x >> 4) & 0x30) == 0x30; }
9 int sr30ne30(signed char x) { return ((x >> 4) & 0x30) != 0x30; }
10 int sr33eq33(signed char x) { return ((x >> 4) & 0x33) == 0x33; }
11 int sr33ne33(signed char x) { return ((x >> 4) & 0x33) != 0x33; }
13 int ur30eq00(unsigned char z) { return ((z >> 4) & 0x30) == 0; }
14 int ur30ne00(unsigned char z) { return ((z >> 4) & 0x30) != 0; }
15 int ur30eq30(unsigned char z) { return ((z >> 4) & 0x30) == 0x30; }
16 int ur30ne30(unsigned char z) { return ((z >> 4) & 0x30) != 0x30; }
17 int ur33eq03(unsigned char x) { return ((x >> 4) & 0x33) == 0x03; }
18 int ur33ne03(unsigned char x) { return ((x >> 4) & 0x33) != 0x03; }
19 int ur33eq30(unsigned char z) { return ((z >> 4) & 0x33) == 0x30; }
20 int ur33ne30(unsigned char z) { return ((z >> 4) & 0x33) != 0x30; }
21 int ur33eq33(unsigned char z) { return ((z >> 4) & 0x33) == 0x33; }
22 int ur33ne33(unsigned char z) { return ((z >> 4) & 0x33) != 0x33; }
24 int sl30eq00(char x) { return ((char)(x << 4) & 0x30) == 0; }
25 int sl30ne00(char x) { return ((char)(x << 4) & 0x30) != 0; }
26 int sl30eq20(char x) { return ((char)(x << 4) & 0x30) == 0x20; }
27 int sl30ne20(char x) { return ((char)(x << 4) & 0x30) != 0x20; }
28 int sl30eq30(char x) { return ((char)(x << 4) & 0x30) == 0x30; }
29 int sl30ne30(char x) { return ((char)(x << 4) & 0x30) != 0x30; }
30 int sl33eq00(char x) { return ((char)(x << 4) & 0x33) == 0; }
31 int sl33ne00(char x) { return ((char)(x << 4) & 0x33) != 0; }
32 int sl33eq03(char z) { return ((char)(z << 4) & 0x33) == 0x03; }
33 int sl33ne03(char z) { return ((char)(z << 4) & 0x33) != 0x03; }
34 int sl33eq30(char x) { return ((char)(x << 4) & 0x33) == 0x30; }
35 int sl33ne30(char x) { return ((char)(x << 4) & 0x33) != 0x30; }
36 int sl33eq33(char z) { return ((char)(z << 4) & 0x33) == 0x33; }
37 int sl33ne33(char z) { return ((char)(z << 4) & 0x33) != 0x33; }
39 /* { dg-final { scan-tree-dump-not " >> " "optimized" } } */
40 /* { dg-final { scan-tree-dump-not " << " "optimized" } } */
41 /* { dg-final { scan-tree-dump-not "z_\[0-9\]\\(D\\)" "optimized" } } */
42 /* { dg-final { scan-tree-dump-times "return \[01\]" 14 "optimized" } } */
43 /* { dg-final { scan-tree-dump-times "char z\\)" 14 "optimized" } } */
44 /* { dg-final { scan-tree-dump-times "x_\[0-9\]\\(D\\)" 18 "optimized" } } */
45 /* { dg-final { scan-tree-dump-times "char x\\)" 18 "optimized" } } */