- env-include-paths.c is XFAIL as it exposed a bug.
Add test/Coverage.
- For tests which achieve code coverage but don't validate anything.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57070
91177308-0d34-0410-b5e6-
96231b3b80d8
--- /dev/null
+// RUN: rm -rf %t &&
+// RUN: clang --html-diags=%t -checker-simple %s
+
+void f0(int x) {
+ int *p = &x;
+
+ if (x > 10) {
+ if (x == 22)
+ p = 0;
+ }
+
+ *p = 10;
+}
+
+
--- /dev/null
+// RUN: clang -fsyntax-only -v %s
--- /dev/null
+// RUN: clang -fsyntax-only -verify -DAS_SOURCE %s &&
+// RUN: env CPATH="" clang -fsyntax-only -verify -DAS_SOURCE %s &&
+// RUN: env CPATH="xyz:xyz" clang -fsyntax-only -verify -DAS_SOURCE %s &&
+// RUN: env CPATH="xyz::xyz" clang -fsyntax-only -verify -DSHOULD_FIND -DAS_SOURCE %s &&
+// RUN: env CPATH="../Driver" clang -fsyntax-only -verify -DSHOULD_FIND -DAS_SOURCE %s
+// XFAIL
+
+#ifdef AS_SOURCE
+#undef AS_SOURCE
+
+#define AS_INCLUDE
+
+#ifdef SHOULD_FIND
+#include <env-include-paths.c>
+#else
+/* expected-error {{file not found}} */ #include <env-include-paths.c>
+#endif
+
+#undef AS_INCLUDE
+
+#endif
+
+#ifdef AS_INCLUDE
+
+/* expected-warning {{Hello}} */ #warning "Hello"
+
+#endif