summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-10-04 20:46:41 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-10-04 20:46:41 +0000
commit23bd6cc156dd6091bb43063f6853a23b56511418 (patch)
tree50c067d91e3d7f055586bb270b18408d220fac26 /clang/test
parentfdfb0a0d5e0fa9df2e1c8a299a9402767c56a8e1 (diff)
downloadbcm5719-llvm-23bd6cc156dd6091bb43063f6853a23b56511418.tar.gz
bcm5719-llvm-23bd6cc156dd6091bb43063f6853a23b56511418.zip
Add test/Driver.
- 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. llvm-svn: 57070
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Coverage/html-diagnostics.c15
-rw-r--r--clang/test/Coverage/verbose.c1
-rw-r--r--clang/test/Driver/env-include-paths.c27
3 files changed, 43 insertions, 0 deletions
diff --git a/clang/test/Coverage/html-diagnostics.c b/clang/test/Coverage/html-diagnostics.c
new file mode 100644
index 00000000000..75d4e067fc6
--- /dev/null
+++ b/clang/test/Coverage/html-diagnostics.c
@@ -0,0 +1,15 @@
+// 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;
+}
+
+
diff --git a/clang/test/Coverage/verbose.c b/clang/test/Coverage/verbose.c
new file mode 100644
index 00000000000..6157bad395f
--- /dev/null
+++ b/clang/test/Coverage/verbose.c
@@ -0,0 +1 @@
+// RUN: clang -fsyntax-only -v %s
diff --git a/clang/test/Driver/env-include-paths.c b/clang/test/Driver/env-include-paths.c
new file mode 100644
index 00000000000..de4ba5b1b7e
--- /dev/null
+++ b/clang/test/Driver/env-include-paths.c
@@ -0,0 +1,27 @@
+// 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
OpenPOWER on IntegriCloud