]> granicus.if.org Git - clang/commitdiff
Test more array logic in outofbound.c
authorTed Kremenek <kremenek@apple.com>
Thu, 22 Jan 2009 20:36:33 +0000 (20:36 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 22 Jan 2009 20:36:33 +0000 (20:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62782 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/outofbound.c

index b0c2db438629a8129bcfa9b6375ef17ff8dd1a71..e496425eb91afeb78d9515a3ee164d7bbb0a88bf 100644 (file)
@@ -2,5 +2,6 @@
 
 char f1() {
   char* s = "abcd";
-  return s[6]; // expected-warning{{Load or store into an out-of-bound memory position.}}
+  char c = s[4]; // no-warning
+  return s[5] + c; // expected-warning{{Load or store into an out-of-bound memory position.}}
 }