Avoid expicit builtion list in tree-ssa-dce
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / pattern-test-1.c
blob1306f6de575befddc24facdf04439f60ee53fda9
1 /* { dg-additional-options "-fanalyzer-checker=pattern-test" } */
3 #include <stdlib.h>
5 extern void foo(void *);
6 extern void bar(void *);
8 void test1(void *ptr)
10 if (ptr) { /* { dg-warning "pattern match on 'ptr != 0'" "ptr != 0" } */
11 /* { dg-warning "pattern match on 'ptr == 0'" "ptr == 0" { target *-*-* } .-1 } */
12 foo(ptr);
13 } else {
14 bar(ptr);
18 void test_2 (void *p, void *q)
20 if (p == NULL || q == NULL) /* { dg-line cond_2 } */
21 return;
22 foo(p);
24 /* { dg-warning "pattern match on 'p == 0'" "p == 0" { target *-*-* } cond_2 } */
25 /* { dg-warning "pattern match on 'q == 0'" "q == 0" { target *-*-* } cond_2 } */
26 /* { dg-warning "pattern match on 'p != 0'" "p != 0" { target *-*-* } cond_2 } */
27 /* { dg-warning "pattern match on 'q != 0'" "q != 0" { target *-*-* } cond_2 } */