1 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdelete-null-pointer-checks -Wnull-dereference" } */
4 /* { dg-skip-if "" keeps_null_pointer_checks } */
25 s
->bar
= 1; /* { dg-warning "null" } */
28 void test2 (struct t
*s
)
30 if (s
== NULL
&& s
->bar
> 2) /* { dg-warning "null" } */
36 void test3 (struct t
*s
)
38 if (s
!= NULL
|| s
->bar
> 2) /* { dg-warning "null" } */
41 s
->bar
= 3; /* { dg-warning "null" } */
44 int test4 (struct t
*s
)
46 if (s
!= NULL
&& s
->bar
> 2) /* { dg-bogus "null" } */
51 int test5 (struct t
*s
)
53 if (s
== NULL
|| s
->bar
> 2) /* { dg-bogus "null" } */
58 int test6 (struct t2
*s
)
60 if (s
->s
== 0 && s
->s
->bar
== 0) /* { dg-warning "null" } */
65 int test7 (struct t
*s
)
68 return s
->bar
; /* { dg-warning "null" } */
73 return ((struct t
*)0)->bar
; /* { dg-warning "null" } */
76 void test9 (struct t
**s
)
79 *s
= 0; /* { dg-warning "null" } */