1 /* { dg-do compile { target { ! keeps_null_pointer_checks } } } */
2 /* { dg-options "-O2 -fdump-tree-original -fdump-tree-vrp1 -fdelete-null-pointer-checks -fdisable-tree-evrp" } */
3 
4 extern int* f(int) __attribute__((returns_nonnull));
5 extern void eliminate ();
g()6 void g () {
7   if (f (2) == 0)
8     eliminate ();
9 }
h()10 void h () {
11   int *p = f (2);
12   if (p == 0)
13     eliminate ();
14 }
15 
16 /* { dg-final { scan-tree-dump-times "== 0" 1 "original" } } */
17 /* { dg-final { scan-tree-dump-times "Folding predicate\[^\\n\]*to 0" 1 "vrp1" } } */
18