Artem Dergachev | e2a8e43 | 2019-04-23 02:50:38 +0000 | [diff] [blame^] | 1 | // RUN: %clang_analyze_cc1 -w -analyzer-checker=core,debug.ExprInspection \ |
| 2 | // RUN: -analyzer-output=text -verify %s |
| 3 | |
| 4 | int OSAtomicCompareAndSwapPtrBarrier(*, *, **); |
| 5 | int OSAtomicCompareAndSwapPtrBarrier() { |
| 6 | // There is some body in the actual header, |
| 7 | // but we should trust our BodyFarm instead. |
| 8 | } |
| 9 | |
| 10 | int *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 | } |