aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-05-01 04:13:51 +0000
committerTed Kremenek <kremenek@apple.com>2009-05-01 04:13:51 +0000
commit1bc440b9224247fd30541b747fd213e586e8da9e (patch)
tree4797626642ebf5e022e7b227c233d817985a992c
parent41826bb59d2ef5e8c8a4a0cd2b06a7a011b67b4d (diff)
Add failing static analyzer case (this crashes).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70532 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Analysis/xfail_rdar_6440393.m26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/Analysis/xfail_rdar_6440393.m b/test/Analysis/xfail_rdar_6440393.m
new file mode 100644
index 0000000000..9a30c01eee
--- /dev/null
+++ b/test/Analysis/xfail_rdar_6440393.m
@@ -0,0 +1,26 @@
+// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic &&
+// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region
+// XFAIL
+
+// *** These tests will be migrated to other test files once these failures
+// are resolved.
+
+// <rdar://problem/6440393> - A bunch of misc. failures involving evaluating
+// these expressions and building CFGs. These tests are here to prevent
+// regressions.
+@class NSString, NSDictionary;
+typedef long NSInteger;
+typedef unsigned long NSUInteger;
+typedef unsigned char Boolean;
+typedef const struct __CFDictionary * CFDictionaryRef;
+
+extern Boolean CFDictionaryGetValueIfPresent(CFDictionaryRef theDict, const void *key, const void **value);
+static void shazam(NSUInteger i, unsigned char **out);
+
+void rdar_6440393_1(NSDictionary *dict) {
+ NSInteger x = 0;
+ unsigned char buf[10], *bufptr = buf;
+ if (!CFDictionaryGetValueIfPresent(0, dict, (void *)&x))
+ return;
+ shazam(x, &bufptr);
+}