1 /* Make sure we don't assume that a weak symbol is always non-NULL.
2 This is just like Walways-true-1.C, except that it uses a weak
4 Origin: Ian Lance Taylor <iant@google.com>. */
6 /* { dg-do compile } */
7 /* { dg-options "-Waddress" } */
8 /* { dg-require-weak "" } */
10 extern int foo (int) __attribute__ ((weak
));
12 int i
__attribute__ ((weak
));
26 if (&a
) /* { dg-warning "always evaluate as" "correct warning" } */
30 if (&&lab
) /* { dg-warning "always evaluate as" "correct warning" } */
40 if (&a
== 0) /* { dg-warning "the comparison will always evaluate as 'false'" "correct warning" } */
44 if (&&lab
== 0) /* { dg-warning "the comparison will always evaluate as 'false'" "correct warning" } */
54 if (0 == &a
) /* { dg-warning "the comparison will always evaluate as 'false'" "correct warning" } */
58 if (0 == &&lab
) /* { dg-warning "the comparison will always evaluate as 'false'" "correct warning" } */