1 /* PR tree-optimization/111150 */
2 /* { dg-do compile } */
3 /* { dg-options "-O1 -fgimple -fdump-tree-forwprop1-raw" } */
5 /* Checks if pattern (X ? e : f) == (Y ? e : f) gets optimized. */
7 _Bool
f1_(int a
, int b
, int c
, int d
, int e
, int f
) {
15 /* Before the patch cond_expr was generated for these 2 statements. */
22 /* Checks if pattern (X ? e : f) != (Y ? e : f) gets optimized. */
24 _Bool
f2_(int a
, int b
, int c
, int d
, int e
, int f
) {
38 /* Checks if pattern (X ? e : f) == (Y ? f : e) gets optimized. */
40 _Bool
f3_(int a
, int b
, int c
, int d
, int e
, int f
) {
54 /* Checks if pattern (X ? e : f) != (Y ? f : e) gets optimized. */
56 _Bool
f4_(int a
, int b
, int c
, int d
, int e
, int f
) {
70 /* Should generate one bit_xor_expr for each testcase. */
71 /* { dg-final { scan-tree-dump-not "cond_expr, " "forwprop1" } } */
72 /* 2 IOR, one each for f1 and f2.
73 2 AND, one each for f3 and f4. */
74 /* { dg-final { scan-tree-dump-times "bit_ior_expr, " 2 "forwprop1" } } */
75 /* { dg-final { scan-tree-dump-times "bit_and_expr, " 2 "forwprop1" } } */
76 /* { dg-final { scan-tree-dump-times "bit_xor_expr, " 4 "forwprop1" } } */
77 /* 8 eq comparisons from each of `a == b`/`c == d`.
78 2 more to check that `e == f`
79 2 ne comparisons to check that `e != f`. */
80 /* { dg-final { scan-tree-dump-times "<ne_expr, " 2 "forwprop1" } } */
81 /* { dg-final { scan-tree-dump-times "<eq_expr, " 10 "forwprop1" } } */