--- /dev/null
+struct X { int i[10]; int j; struct X* next; };
+
+void f(int parm)
+{{
+#if 0
+ parm++;
+ int x = 0;
+ int y = 1;
+ x = x + y;
+ for (int z = 0;; ++z) {
+ z;
+ }
+ int* a = 0;
+ a = &a[*a];
+ int* b = 0;
+ b = b[*b] = 0;
+ for (struct X* px = 0;; px = px->next) {}
+ struct X* x2 = 0;
+ x2->next = 0;
+ int c;
+ c = *&c = 0;
+ int d = 23;
+ int e = 42;
+ asm("" : "+r" (e) : "r" (d));
+ struct X* x3 = 0;
+ x3->i[2] = 0;
+ int i[10];
+ i[0] = 1;
+ int j[10];
+ j[j[j[0]]] = 23;
+#endif
+ struct X* x4 = 0;
+ x4->j++;
+}}
--- /dev/null
+struct X { int i[10]; int j; struct X* next; } gX;
+
+int main(void)
+{
+ struct X* x4 = &gX;
+ x4->j++;
+ return 0;
+}
--- /dev/null
+struct X { int i[10]; int j; struct X* next; } gX;
+
+int main(void)
+{
+ struct X* x3 = &gX;
+ x3->i[2] = 0;
+ return 0;
+}
--- /dev/null
+int A;
+
+int main(void)
+{
+ int *a = &A;
+ a[*a] = 0;
+
+ return 0;
+}
--- /dev/null
+struct X { int i[10]; int j; struct X* next; } gX;
+
+int main(void)
+{
+ struct X* x2 = &gX;
+ x2->next = 0;
+ return 0;
+}
--- /dev/null
+int main(void)
+{
+ int d = 23;
+ int e = 42;
+ asm("" : "+r" (e) : "r" (d));
+ return 0;
+}
--- /dev/null
+This directory contains testcases that should produces a certain warning
+(but no syntax errors)
--- /dev/null
+/* -w -Wunused-variable */
+extern int rand(void);
+
+int main(void)
+{
+ int x = 23;
+ x = rand();
+ return 0;
+}
--- /dev/null
+struct X { int i[10]; int j; struct X* next; };
+
+void f(int parm)
+{{
+#if 0
+ parm++;
+ int x = 0;
+ int y = 1;
+ x = x + y;
+ for (int z = 0;; ++z) {
+ z;
+ }
+ int* a = 0;
+ a = &a[*a];
+ int* b = 0;
+ b = b[*b] = 0;
+ for (struct X* px = 0;; px = px->next) {}
+ struct X* x2 = 0;
+ x2->next = 0;
+ int c;
+ c = *&c = 0;
+ int d = 23;
+ int e = 42;
+ asm("" : "+r" (e) : "r" (d));
+ struct X* x3 = 0;
+ x3->i[2] = 0;
+ int i[10];
+ i[0] = 1;
+ int j[10];
+ j[j[j[0]]] = 23;
+#endif
+ struct X* x4 = 0;
+ x4->j++;
+}}
--- /dev/null
+int main(void)
+{
+ int i[10];
+ i[0] = 1;
+ return 0;
+}
--- /dev/null
+int main(void)
+{
+ int j[10];
+ j[j[j[0]]] = 23;
+ return 0;
+}
--- /dev/null
+struct X { int i[10]; int j; struct X* next; } gX;
+
+int main(void)
+{
+ int x = 0;
+ int y = 1;
+ x = x + y;
+ return 0;
+}
--- /dev/null
+extern int rand(void);
+
+int main(void)
+{
+ for(int z = 0; rand() % 2 != 0; ++z)
+ z;
+ return 0;
+}
--- /dev/null
+int A;
+
+int main(void)
+{
+ int *a = &A;
+ a = &a[*a];
+
+ return 0;
+}
--- /dev/null
+struct X { int i[10]; int j; struct X* next; } gX;
+
+extern int rand(void);
+
+int main(void)
+{
+ for (struct X* px = &gX; rand() % 2 == 0; px = px->next)
+ {}
+
+ return 0;
+}
--- /dev/null
+int main(void)
+{
+ int c;
+ c = *&c = 0;
+ return 0;
+}