2 /* { dg-do compile } */
3 /* { dg-options "-Wtautological-compare" } */
13 if (a
> a
); /* { dg-warning "self-comparison always evaluates to false" } */
14 if (a
< a
); /* { dg-warning "self-comparison always evaluates to false" } */
15 if (a
>= a
); /* { dg-warning "self-comparison always evaluates to true" } */
16 if (a
<= a
); /* { dg-warning "self-comparison always evaluates to true" } */
17 if (a
== a
); /* { dg-warning "self-comparison always evaluates to true" } */
18 if (a
!= a
); /* { dg-warning "self-comparison always evaluates to false" } */
19 if (A
== A
); /* { dg-warning "self-comparison always evaluates to true" } */
20 if ((unsigned) a
!= (unsigned) a
);
21 if ((a
+ 1) <= (a
+ 1)); /* { dg-warning "self-comparison always evaluates to true" } */
22 if (1 ? a
== a
: 0); /* { dg-warning "self-comparison always evaluates to true" } */
23 if (fn1
== fn1
); /* { dg-warning "self-comparison always evaluates to true" } */
24 if (*p
== *p
); /* { dg-warning "self-comparison always evaluates to true" } */
34 if (sizeof (int) >= 4);
35 if (sizeof (char) != 1);
36 if (sizeof (long) != sizeof (long long));
37 if (0 < sizeof (short));
42 if ((unsigned) a
!= (unsigned long) a
);
56 if (a
[i
] == a
[i
]); /* { dg-warning "self-comparison always evaluates to true" } */
57 if (b
[5][5] == b
[5][5]);
58 if (b
[X
][Y
] >= b
[Y
][X
]);
59 if (b
[X
][X
] == b
[Y
][Y
]);
60 if (b
[i
][j
] != b
[i
][j
]); /* { dg-warning "self-comparison always evaluates to false" } */
61 if (b
[i
][Y
] < b
[i
][X
]);
62 if (b
[X
][j
] < b
[X
][j
]);
63 if ((a
[i
] + 4) == (4 + a
[i
])); /* { dg-warning "self-comparison always evaluates to true" } */
69 return x
> x
? 1 : 0; /* { dg-warning "self-comparison always evaluates to false" } */