URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
693 |
jeremybenn |
// { dg-do compile }
|
2 |
|
|
// { dg-options "-Wparentheses" }
|
3 |
|
|
|
4 |
|
|
// C++ version of gcc.dg/Wparentheses-2.c.
|
5 |
|
|
|
6 |
|
|
int foo (int);
|
7 |
|
|
|
8 |
|
|
int
|
9 |
|
|
bar (int a, int b, int c)
|
10 |
|
|
{
|
11 |
|
|
foo (a <= b <= c); // { dg-warning "comparison" "correct warning" }
|
12 |
|
|
foo ((a <= b) <= c);
|
13 |
|
|
foo (a <= (b <= c));
|
14 |
|
|
foo (1 <= 2 <= c); // { dg-warning "comparison" "correct warning" }
|
15 |
|
|
foo ((1 <= 2) <= c);
|
16 |
|
|
foo (1 <= (2 <= c));
|
17 |
|
|
foo (1 <= 2 <= 3); // { dg-warning "comparison" "correct warning" }
|
18 |
|
|
foo ((1 <= 2) <= 3);
|
19 |
|
|
foo (1 <= (2 <= 3));
|
20 |
|
|
foo (a > b > c); // { dg-warning "comparison" "correct warning" }
|
21 |
|
|
foo ((a > b) > c);
|
22 |
|
|
foo (a > (b > c));
|
23 |
|
|
foo (1 > 2 > c); // { dg-warning "comparison" "correct warning" }
|
24 |
|
|
foo ((1 > 2) > c);
|
25 |
|
|
foo (1 > (2 > c));
|
26 |
|
|
foo (1 > 2 > 3); // { dg-warning "comparison" "correct warning" }
|
27 |
|
|
foo ((1 > 2) > 3);
|
28 |
|
|
foo (1 > (2 > 3));
|
29 |
|
|
foo (a < b <= c); // { dg-warning "comparison" "correct warning" }
|
30 |
|
|
foo ((a < b) <= c);
|
31 |
|
|
foo (a < (b <= c));
|
32 |
|
|
foo (1 < 2 <= c); // { dg-warning "comparison" "correct warning" }
|
33 |
|
|
foo ((1 < 2) <= c);
|
34 |
|
|
foo (1 < (2 <= c));
|
35 |
|
|
foo (1 < 2 <= 3); // { dg-warning "comparison" "correct warning" }
|
36 |
|
|
foo ((1 < 2) <= 3);
|
37 |
|
|
foo (1 < (2 <= 3));
|
38 |
|
|
foo (a <= b > c); // { dg-warning "comparison" "correct warning" }
|
39 |
|
|
foo ((a <= b) > c);
|
40 |
|
|
foo (a <= (b > c));
|
41 |
|
|
foo (1 <= 2 > c); // { dg-warning "comparison" "correct warning" }
|
42 |
|
|
foo ((1 <= 2) > c);
|
43 |
|
|
foo (1 <= (2 > c));
|
44 |
|
|
foo (1 <= 2 > 3); // { dg-warning "comparison" "correct warning" }
|
45 |
|
|
foo ((1 <= 2) > 3);
|
46 |
|
|
foo (1 <= (2 > 3));
|
47 |
|
|
foo (a <= b == c); // { dg-warning "comparison" "correct warning" }
|
48 |
|
|
foo ((a <= b) == c);
|
49 |
|
|
foo (a <= (b == c));
|
50 |
|
|
foo (1 <= 2 == c); // { dg-warning "comparison" "correct warning" }
|
51 |
|
|
foo ((1 <= 2) == c);
|
52 |
|
|
foo (1 <= (2 == c));
|
53 |
|
|
foo (1 <= 2 == 3); // { dg-warning "comparison" "correct warning" }
|
54 |
|
|
foo ((1 <= 2) == 3);
|
55 |
|
|
foo (1 <= (2 == 3));
|
56 |
|
|
foo (a != b != c); // { dg-warning "comparison" "correct warning" }
|
57 |
|
|
foo ((a != b) != c);
|
58 |
|
|
foo (a != (b != c));
|
59 |
|
|
foo (1 != 2 != c); // { dg-warning "comparison" "correct warning" }
|
60 |
|
|
foo ((1 != 2) != c);
|
61 |
|
|
foo (1 != (2 != c));
|
62 |
|
|
foo (1 != 2 != 3); // { dg-warning "comparison" "correct warning" }
|
63 |
|
|
foo ((1 != 2) != 3);
|
64 |
|
|
foo (1 != (2 != 3));
|
65 |
|
|
}
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.