2 /* { dg-options "-fdump-tree-original" } */
4 /* Check that MIN-MAX and MAX-MIN combinations are folded. */
6 extern void abort (void);
8 #define MIN(a,b) ((a) < (b) ? (a) : (b))
9 #define MAX(a,b) ((a) > (b) ? (a) : (b))
13 return MIN (MAX (a
, b
), b
); /* == b */
18 return MAX (MIN (a
, b
), b
); /* == b */
23 return MIN (MAX (b
, a
), b
); /* == b */
28 return MAX (MIN (b
, a
), b
); /* == b */
34 return MIN (a
, MAX (a
, b
)); /* == a */
39 return MAX (a
, MIN (a
, b
)); /* == a */
44 return MIN (a
, MAX (b
, a
)); /* == a */
49 return MAX (a
, MIN (b
, a
)); /* == a */
81 /* { dg-final { scan-tree-dump-times "MIN_EXPR" 0 "original"} } */
82 /* { dg-final { scan-tree-dump-times "MAX_EXPR" 0 "original"} } */
83 /* { dg-final { cleanup-tree-dump "original" } } */