[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / Analysis / zero-operands.c
blob3311c524f81460da67b1b478d633aff7c585b88e
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core \
2 // RUN: -analyzer-checker=debug.ExprInspection \
3 // RUN: -verify %s
5 void clang_analyzer_dump(int);
7 void test_0_multiplier1(int x, int y) {
8 int a = x < 0; // Eagerly bifurcate.
9 clang_analyzer_dump(a);
10 // expected-warning@-1{{0 S32b}}
11 // expected-warning@-2{{1 S32b}}
13 int b = a * y;
14 clang_analyzer_dump(b);
15 // expected-warning@-1{{0 S32b}}
16 // expected-warning-re@-2{{reg_${{[[:digit:]]+}}<int y>}}
19 void test_0_multiplier2(int x, int y) {
20 int a = x < 0; // Eagerly bifurcate.
21 clang_analyzer_dump(a);
22 // expected-warning@-1{{0 S32b}}
23 // expected-warning@-2{{1 S32b}}
25 int b = y * a;
26 clang_analyzer_dump(b);
27 // expected-warning@-1{{0 S32b}}
28 // expected-warning-re@-2{{reg_${{[[:digit:]]+}}<int y>}}
31 void test_0_modulo(int x, int y) {
32 int a = x < 0; // Eagerly bifurcate.
33 clang_analyzer_dump(a);
34 // expected-warning@-1{{0 S32b}}
35 // expected-warning@-2{{1 S32b}}
37 int b = a % y;
38 clang_analyzer_dump(b);
39 // expected-warning@-1{{0 S32b}}
40 // expected-warning-re@-2{{1 % (reg_${{[[:digit:]]+}}<int y>)}}
43 void test_0_divisible(int x, int y) {
44 int a = x < 0; // Eagerly bifurcate.
45 clang_analyzer_dump(a);
46 // expected-warning@-1{{0 S32b}}
47 // expected-warning@-2{{1 S32b}}
49 int b = a / y;
50 clang_analyzer_dump(b);
51 // expected-warning@-1{{0 S32b}}
52 // expected-warning-re@-2{{1 / (reg_${{[[:digit:]]+}}<int y>)}}