Merge from mainline
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr21582.c
blob0f5dc9ec1d492633f79a8333fc18e635339edb80
1 /* { dg-do link } */
2 /* { dg-options "-O2 -fdump-tree-vrp1" } */
4 static inline void do_thing(char *s, int *p, char *q)
6 /* This should be folded away. */
7 if (s == 0 || q == 0)
8 link_error ();
10 /* This should not be folded as 'p' is not marked nonnull. */
11 if (p)
12 *p = 3;
15 void __attribute__((nonnull (1, 3))) do_other_thing(char *s, int *p, char *q)
17 do_thing(s, p, q);
20 int i;
22 main()
24 do_other_thing ("xxx", &i, "yyy");
27 /* { dg-final { scan-tree-dump-times "Folding predicate p_.*" 0 "vrp1" } } */
28 /* { dg-final { cleanup-tree-dump "vrp1" } } */