[cfe-commits] r57070 - in /cfe/trunk/test: Coverage/ Coverage/html-diagnostics.c Coverage/verbose.c Driver/ Driver/env-include-paths.c
Daniel Dunbar
daniel at zuster.org
Sat Oct 4 13:46:41 PDT 2008
Author: ddunbar
Date: Sat Oct 4 15:46:41 2008
New Revision: 57070
URL: http://llvm.org/viewvc/llvm-project?rev=57070&view=rev
Log:
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.
Added:
cfe/trunk/test/Coverage/
cfe/trunk/test/Coverage/html-diagnostics.c
cfe/trunk/test/Coverage/verbose.c
cfe/trunk/test/Driver/
cfe/trunk/test/Driver/env-include-paths.c
Added: cfe/trunk/test/Coverage/html-diagnostics.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Coverage/html-diagnostics.c?rev=57070&view=auto
==============================================================================
--- cfe/trunk/test/Coverage/html-diagnostics.c (added)
+++ cfe/trunk/test/Coverage/html-diagnostics.c Sat Oct 4 15:46:41 2008
@@ -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;
+}
+
+
Added: cfe/trunk/test/Coverage/verbose.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Coverage/verbose.c?rev=57070&view=auto
==============================================================================
--- cfe/trunk/test/Coverage/verbose.c (added)
+++ cfe/trunk/test/Coverage/verbose.c Sat Oct 4 15:46:41 2008
@@ -0,0 +1 @@
+// RUN: clang -fsyntax-only -v %s
Added: cfe/trunk/test/Driver/env-include-paths.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/env-include-paths.c?rev=57070&view=auto
==============================================================================
--- cfe/trunk/test/Driver/env-include-paths.c (added)
+++ cfe/trunk/test/Driver/env-include-paths.c Sat Oct 4 15:46:41 2008
@@ -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
More information about the cfe-commits
mailing list