testsuite: Skip analyzer tests on AIX.
[official-gcc.git] / gcc / testsuite / c-c++-common / Wtautological-compare-ranges.c
blob2634d276641313dd3007524261a768606bb1ce9f
1 /* { dg-do compile } */
2 /* { dg-options "-Wtautological-compare -fdiagnostics-show-caret" } */
4 #define FOO foo
6 void
7 fn1 (int foo)
9 if (foo == foo); /* { dg-warning "self-comparison always evaluates to true" } */
10 /* { dg-begin-multiline-output "" }
11 if (foo == foo);
13 { dg-end-multiline-output "" { target c } } */
14 /* { dg-begin-multiline-output "" }
15 if (foo == foo);
16 ~~~ ^~ ~~~
17 { dg-end-multiline-output "" { target c++ } } */
20 void
21 fn2 (int foo)
23 if (FOO == FOO); /* { dg-warning "self-comparison always evaluates to true" } */
24 /* { dg-begin-multiline-output "" }
25 if (FOO == FOO);
27 { dg-end-multiline-output "" } */
30 void
31 fn3 (int foo)
33 if ((foo & 16) == 10); /* { dg-warning "bitwise comparison always evaluates to false" } */
34 /* { dg-begin-multiline-output "" }
35 if ((foo & 16) == 10);
37 { dg-end-multiline-output "" { target c } } */
38 /* { dg-begin-multiline-output "" }
39 if ((foo & 16) == 10);
40 ~~~~~~~~~~ ^~ ~~
41 { dg-end-multiline-output "" { target c++ } } */