diff options
Diffstat (limited to 'test/Analysis/inlining/false-positive-suppression.c')
-rw-r--r-- | test/Analysis/inlining/false-positive-suppression.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/Analysis/inlining/false-positive-suppression.c b/test/Analysis/inlining/false-positive-suppression.c index a836d9c62433..c5c6bb875ea2 100644 --- a/test/Analysis/inlining/false-positive-suppression.c +++ b/test/Analysis/inlining/false-positive-suppression.c @@ -143,6 +143,27 @@ void testTrackNullVariable() { #endif } +void inlinedIsDifferent(int inlined) { + int i; + + // We were erroneously picking up the inner stack frame's initialization, + // even though the error occurs in the outer stack frame! + int *p = inlined ? &i : getNull(); + + if (!inlined) + inlinedIsDifferent(1); + + *p = 1; +#ifndef SUPPRESSED + // expected-warning@-2 {{Dereference of null pointer}} +#endif +} + +void testInlinedIsDifferent() { + // <rdar://problem/13787723> + inlinedIsDifferent(0); +} + // --------------------------------------- // FALSE NEGATIVES (over-suppression) |