]> granicus.if.org Git - clang/commitdiff
Add test case.
authorZhongxing Xu <xuzhongxing@gmail.com>
Tue, 19 Jan 2010 12:11:55 +0000 (12:11 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Tue, 19 Jan 2010 12:11:55 +0000 (12:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93874 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/misc-ps.m

index 9543a98fe3230cea5e15483d689fec307833e5e7..ae42dca3b45eaf76a836edce3e8d9b3e7f12a544 100644 (file)
@@ -811,3 +811,29 @@ int pr6033(int x) {
   return x % y; // expected-warning{{The right operand of '%' is a garbage value}}
 }
 
+struct trie {
+  struct trie* next;
+};
+
+struct kwset {
+  struct trie *trie;
+  unsigned char delta[10];
+  struct trie* next[10];
+  int d;
+};
+
+typedef struct trie trie_t;
+typedef struct kwset kwset_t;
+
+void f(kwset_t *kws, char const *p, char const *q) {
+  struct trie const *trie;
+  struct trie * const *next = kws->next;
+  register unsigned char c;
+  register char const *end = p;
+  register char const *lim = q;
+  register int d = 1;
+  register unsigned char const *delta = kws->delta;
+
+  d = delta[c = (end+=d)[-1]]; // no-warning
+  trie = next[c];
+}