[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / Analysis / PR49490.cpp
blob3254355013a60ad54f0bc54ba9c1e8e53ba333b1
1 // RUN: %clang_analyze_cc1 -w -analyzer-checker=core -verify %s
3 // expected-no-diagnostics
5 struct toggle {
6 bool value;
7 };
9 toggle global_toggle;
10 toggle get_global_toggle() { return global_toggle; }
12 int oob_access();
14 bool compare(toggle one, bool other) {
15 if (one.value != other)
16 return true;
18 if (one.value)
19 oob_access();
20 return true;
23 bool coin();
25 void bar() {
26 bool left = coin();
27 bool right = coin();
28 for (;;)
29 compare(get_global_toggle(), left) && compare(get_global_toggle(), right);