aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/inlining/false-positive-suppression.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2013-06-10 20:45:12 +0000
committerDimitry Andric <dim@FreeBSD.org>2013-06-10 20:45:12 +0000
commit6a0372513edbc473b538d2f724efac50405d6fef (patch)
tree8f7776b7310bebaf415ac5b69e46e9f928c37144 /test/Analysis/inlining/false-positive-suppression.c
parent809500fc2c13c8173a16b052304d983864e4a1e1 (diff)
Vendor import of clang tags/RELEASE_33/final r183502 (effectively, 3.3vendor/clang/clang-release_33-r183502
Notes
Notes: svn path=/vendor/clang/dist/; revision=251609 svn path=/vendor/clang/clang-release_33-r183502/; revision=251610; tag=vendor/clang/clang-release_33-r183502
Diffstat (limited to 'test/Analysis/inlining/false-positive-suppression.c')
-rw-r--r--test/Analysis/inlining/false-positive-suppression.c21
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)