This commit was manufactured by cvs2svn to create branch
[official-gcc.git] / gcc / testsuite / gcc.dg / pr15784-1.c
blob0b057b5af64543af6f9f17e8de8cdffaaa2b5b00
1 /* { dg-do compile } */
2 /* { dg-options "-fdump-tree-generic" } */
3 /* Test for folding abs(x) where appropriate. */
4 #define abs(x) x > 0 ? x : -x
5 extern double fabs (double);
7 int a (int x) {
8 return (abs(x)) >= 0;
11 int b (int x) {
12 return (abs(x)) == 0;
15 int c (int x) {
16 return (abs(x)) != 0;
19 int d (int x) {
20 return 0 != (abs(x));
23 int e (int x) {
24 return 0 == (abs(x));
27 int f (int x) {
28 return 0 <= (abs(x));
31 int g (int x) {
32 return 0 > (abs(x));
35 int h (float x) {
36 return 0.0 > fabs(x);
39 int i (float x) {
40 return fabs(x) == -0.0;
42 /* { dg-final { scan-tree-dump-times "ABS_EXPR" 0 "generic" } } */