OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [pr15784-1.c] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-fstrict-overflow -fdump-tree-gimple" } */
3
/* Test for folding abs(x) where appropriate.  */
4
#define abs(x) x > 0 ? x : -x
5
extern double fabs (double);
6
 
7
int a (int x) {
8
        return (abs(x)) >= 0;
9
}
10
 
11
int b (int x) {
12
        return (abs(x)) == 0;
13
}
14
 
15
int c (int x) {
16
        return (abs(x)) != 0;
17
}
18
 
19
int d (int x) {
20
        return 0 != (abs(x));
21
}
22
 
23
int e (int x) {
24
        return 0 == (abs(x));
25
}
26
 
27
int f (int x) {
28
        return 0 <= (abs(x));
29
}
30
 
31
int g (int x) {
32
        return 0 > (abs(x));
33
}
34
 
35
int h (float x) {
36
        return 0.0 > fabs(x);
37
}
38
 
39
int i (float x) {
40
        return fabs(x) == -0.0;
41
}
42
/* { dg-final { scan-tree-dump-times "ABS_EXPR" 0 "gimple" } } */
43
/* { dg-final { cleanup-tree-dump "gimple" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.