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>
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|never be NULL" "correct warning" }
30 if (&&lab) // { dg-warning "always evaluate as|never be NULL" "correct warning" }
40 if (&a == 0) // { dg-warning "never be NULL" "correct warning" }
44 if (&&lab == 0) // { dg-warning "never be NULL" "correct warning" }
54 if (0 == &a) // { dg-warning "never be NULL" "correct warning" }
58 if (0 == &&lab) // { dg-warning "never be NULL" "correct warning" }