[analyzer] Convert many existing tests to use clang_analyzer_eval.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156920 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Analysis/string-fail.c b/test/Analysis/string-fail.c
index 3bff6d4..ac5c6d0 100644
--- a/test/Analysis/string-fail.c
+++ b/test/Analysis/string-fail.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.unix.CString,experimental.deadcode.UnreachableCode -analyzer-store=region -Wno-null-dereference -verify %s
-// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -analyzer-checker=core,experimental.unix.CString,experimental.deadcode.UnreachableCode -analyzer-store=region -Wno-null-dereference -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.cstring,debug.ExprInspection -analyzer-store=region -verify %s
+// RUN: %clang_cc1 -analyze -DUSE_BUILTINS -analyzer-checker=core,unix.cstring,debug.ExprInspection -analyzer-store=region -verify %s
 // XFAIL: *
 
 // This file is for tests that may eventually go into string.c, or may be
@@ -32,6 +32,7 @@
 #define NULL 0
 typedef typeof(sizeof(int)) size_t;
 
+void clang_analyzer_eval(int);
 
 //===----------------------------------------------------------------------===
 // strnlen()
@@ -43,8 +44,7 @@
 void strnlen_liveness(const char *x) {
   if (strnlen(x, 10) < 5)
     return;
-  if (strnlen(x, 10) < 5)
-    (void)*(char*)0; // no-warning
+  clang_analyzer_eval(strnlen(x, 10) < 5); // expected-warning{{FALSE}}
 }
 
 void strnlen_subregion() {
@@ -57,43 +57,43 @@
   size_t a = strnlen(z.a, 10);
   z.b[0] = 5;
   size_t b = strnlen(z.a, 10);
-  if (a == 0 && b != 0)
-    (void)*(char*)0; // expected-warning{{never executed}}
+  if (a == 0)
+    clang_analyzer_eval(b == 0); // expected-warning{{TRUE}}
 
   use_two_stringsn(&z);
 
   size_t c = strnlen(z.a, 10);
-  if (a == 0 && c != 0)
-    (void)*(char*)0; // expected-warning{{null}}
+  if (a == 0)
+    clang_analyzer_eval(c == 0); // expected-warning{{UNKNOWN}}
 }
 
 extern void use_stringn(char *);
 void strnlen_argument(char *x) {
   size_t a = strnlen(x, 10);
   size_t b = strnlen(x, 10);
-  if (a == 0 && b != 0)
-    (void)*(char*)0; // expected-warning{{never executed}}
+  if (a == 0)
+    clang_analyzer_eval(b == 0); // expected-warning{{TRUE}}
 
   use_stringn(x);
 
   size_t c = strnlen(x, 10);
-  if (a == 0 && c != 0)
-    (void)*(char*)0; // expected-warning{{null}}  
+  if (a == 0)
+    clang_analyzer_eval(c == 0); // expected-warning{{UNKNOWN}}
 }
 
 extern char global_strn[];
 void strnlen_global() {
   size_t a = strnlen(global_strn, 10);
   size_t b = strnlen(global_strn, 10);
-  if (a == 0 && b != 0)
-    (void)*(char*)0; // expected-warning{{never executed}}
+  if (a == 0)
+    clang_analyzer_eval(b == 0); // expected-warning{{TRUE}}
 
   // Call a function with unknown effects, which should invalidate globals.
   use_stringn(0);
 
   size_t c = strnlen(global_strn, 10);
-  if (a == 0 && c != 0)
-    (void)*(char*)0; // expected-warning{{null}}  
+  if (a == 0)
+    clang_analyzer_eval(c == 0); // expected-warning{{UNKNOWN}}
 }
 
 void strnlen_indirect(char *x) {
@@ -101,13 +101,13 @@
   char *p = x;
   char **p2 = &p;
   size_t b = strnlen(x, 10);
-  if (a == 0 && b != 0)
-    (void)*(char*)0; // expected-warning{{never executed}}
+  if (a == 0)
+    clang_analyzer_eval(b == 0); // expected-warning{{TRUE}}
 
   extern void use_stringn_ptr(char*const*);
   use_stringn_ptr(p2);
 
   size_t c = strnlen(x, 10);
-  if (a == 0 && c != 0)
-    (void)*(char*)0; // expected-warning{{null}}
+  if (a == 0)
+    clang_analyzer_eval(c == 0); // expected-warning{{UNKNOWN}}
 }