blob: a69d98078e1717b5318df54e589c61caaa8ccc09 [file] [log] [blame]
Artem Dergacheve2a8e432019-04-23 02:50:38 +00001// RUN: %clang_analyze_cc1 -w -analyzer-checker=core,debug.ExprInspection \
2// RUN: -analyzer-output=text -verify %s
3
4int OSAtomicCompareAndSwapPtrBarrier(*, *, **);
5int OSAtomicCompareAndSwapPtrBarrier() {
6 // There is some body in the actual header,
7 // but we should trust our BodyFarm instead.
8}
9
10int *invalidSLocOnRedecl() {
11 int *b; // expected-note{{'b' declared without an initial value}}
12
13 OSAtomicCompareAndSwapPtrBarrier(0, 0, &b); // no-crash
14 // FIXME: We don't really need these notes.
15 // expected-note@-2{{Calling 'OSAtomicCompareAndSwapPtrBarrier'}}
16 // expected-note@-3{{Returning from 'OSAtomicCompareAndSwapPtrBarrier'}}
17
18 return b; // expected-warning{{Undefined or garbage value returned to caller}}
19 // expected-note@-1{{Undefined or garbage value returned to caller}}
20}