1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-vrp1 -fdisable-tree-evrp -fdump-tree-mergephi2" } */
3 
4 int bar (void);
5 
foo1(int x,int y)6 int foo1 (int x, int y)
7 {
8   if (y < 10) return bar ();
9   if (x > 9) return bar ();
10 
11   return x < y ? x : y;
12 }
13 
foo2(int x,int y)14 int foo2 (int x, int y)
15 {
16   if (y < 10) return bar ();
17   if (x > 9) return bar ();
18 
19   return x > y ? x : y;
20 }
21 
22 /* We expect to optimiz min/max in VRP*/
23 
24 /* { dg-final { scan-tree-dump-times "MIN_EXPR" 1 "mergephi2" } } */
25 /* { dg-final { scan-tree-dump-times "MAX_EXPR" 1 "mergephi2" } } */
26 /* { dg-final { scan-tree-dump-not "MIN_EXPR" "vrp1" } } */
27 /* { dg-final { scan-tree-dump-not "MAX_EXPR" "vrp1" } } */
28