libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / bool-13.c
blobde8c99a77278e3f386dea0f68b021c0f2b10dd49
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fdump-tree-optimized -fdump-tree-original -fdump-tree-forwprop1 -fdump-tree-forwprop2" } */
3 #define bool _Bool
4 int maxbool(bool ab, bool bb)
6 int a = ab;
7 int b = bb;
8 int c;
9 c = a > b ? a : b;
10 return c;
12 int minbool(bool ab, bool bb)
14 int a = ab;
15 int b = bb;
16 int c;
17 c = a < b ? a : b;
18 return c;
20 /* In Original, we should still have the min/max form as that is what is written. */
21 /* { dg-final { scan-tree-dump-times "MAX_EXPR" 1 "original" } } */
22 /* { dg-final { scan-tree-dump-times "MIN_EXPR" 1 "original" } } */
23 /* { dg-final { scan-tree-dump-times "if " 0 "original" } } */
25 /* Forwprop1 will convert it into &\| as we can detect that the arguments are one_zero. */
26 /* { dg-final { scan-tree-dump-times "MAX_EXPR" 0 "forwprop1" } } */
27 /* { dg-final { scan-tree-dump-times "MIN_EXPR" 0 "forwprop1" } } */
28 /* { dg-final { scan-tree-dump-times "if " 0 "forwprop1" } } */
30 /* By optimize there should be no min/max nor if */
31 /* { dg-final { scan-tree-dump-times "MAX_EXPR" 0 "optimized" } } */
32 /* { dg-final { scan-tree-dump-times "MIN_EXPR" 0 "optimized" } } */
33 /* { dg-final { scan-tree-dump-times "if " 0 "optimized" } } */