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