1 /* Test -Waddress for testing an address against NULL.
2 Origin: Ian Lance Taylor <iant@google.com>. */
4 /* { dg-do compile } */
5 /* { dg-options "-Waddress -fshow-column" } */
15 if (foo
) /* { dg-warning "7:always evaluate as" "correct warning" } */
19 if (&i
) /* { dg-warning "7:always evaluate as" "correct warning" } */
23 if (&a
) /* { dg-warning "7:always evaluate as" "correct warning" } */
27 if (&&lab
) /* { dg-warning "7:always evaluate as" "correct warning" } */
29 if (foo
== 0) /* { dg-warning "11:the comparison will always evaluate as 'false'" "correct warning" } */
33 if (&i
== 0) /* { dg-warning "10:the comparison will always evaluate as 'false'" "correct warning" } */
37 if (&a
== 0) /* { dg-warning "10:the comparison will always evaluate as 'false'" "correct warning" } */
41 if (&&lab
== 0) /* { dg-warning "13:the comparison will always evaluate as 'false'" "correct warning" } */
43 if (0 == foo
) /* { dg-warning "9:the comparison will always evaluate as 'false'" "correct warning" } */
47 if (0 == &i
) /* { dg-warning "9:the comparison will always evaluate as 'false'" "correct warning" } */
51 if (0 == &a
) /* { dg-warning "9:the comparison will always evaluate as 'false'" "correct warning" } */
55 if (0 == &&lab
) /* { dg-warning "9:the comparison will always evaluate as 'false'" "correct warning" } */