[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / Analysis / OSAtomic_mac.c
blob4e07105a035cc6b7a35a5709acd93c26300f7e9b
1 // RUN: %clang_analyze_cc1 -w -analyzer-checker=core,debug.ExprInspection \
2 // RUN: -analyzer-output=text -verify %s
4 int OSAtomicCompareAndSwapPtrBarrier(void *, void *, void **);
5 int OSAtomicCompareAndSwapPtrBarrier(void *, void *, void **) {
6 // There is some body in the actual header,
7 // but we should trust our BodyFarm instead.
10 int *invalidSLocOnRedecl(void) {
11 // Was crashing when trying to throw a report about returning an uninitialized
12 // value to the caller. FIXME: We should probably still throw that report,
13 // something like "The "compare" part of CompareAndSwap depends on an
14 // undefined value".
15 int *b;
16 OSAtomicCompareAndSwapPtrBarrier(0, 0, &b); // no-crash
17 return b;
20 void testThatItActuallyWorks(void) {
21 void *x = 0;
22 int res = OSAtomicCompareAndSwapPtrBarrier(0, &x, &x);
23 clang_analyzer_eval(res); // expected-warning{{TRUE}}
24 // expected-note@-1{{TRUE}}
25 clang_analyzer_eval(x == &x); // expected-warning{{TRUE}}
26 // expected-note@-1{{TRUE}}