1 // RUN: %clang_analyze_cc1 \
2 // RUN: -analyzer-checker=core -analyzer-config \
3 // RUN: silence-checkers=core.DivideZero \
4 // RUN: -verify %s
5
test_disable_core_div_by_zero()6 void test_disable_core_div_by_zero() {
7 (void)(1 / 0);
8 // expected-warning@-1 {{division by zero is undefined}}
9 // no-warning: 'Division by zero'
10 }
11
test_disable_null_deref(int * p)12 void test_disable_null_deref(int *p) {
13 if (p)
14 return;
15
16 int x = p[0];
17 // expected-warning@-1 {{Array access (from variable 'p') results in a null pointer dereference}}
18 }
19