[cfe-commits] r70532 - /cfe/trunk/test/Analysis/xfail_rdar_6440393.m

Ted Kremenek kremenek at apple.com
Thu Apr 30 21:13:52 PDT 2009


Author: kremenek
Date: Thu Apr 30 23:13:51 2009
New Revision: 70532

URL: http://llvm.org/viewvc/llvm-project?rev=70532&view=rev
Log:
Add failing static analyzer case (this crashes).

Added:
    cfe/trunk/test/Analysis/xfail_rdar_6440393.m

Added: cfe/trunk/test/Analysis/xfail_rdar_6440393.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/xfail_rdar_6440393.m?rev=70532&view=auto

==============================================================================
--- cfe/trunk/test/Analysis/xfail_rdar_6440393.m (added)
+++ cfe/trunk/test/Analysis/xfail_rdar_6440393.m Thu Apr 30 23:13:51 2009
@@ -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.
+ at 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);
+}





More information about the cfe-commits mailing list