From: Daniel Dunbar Date: Sat, 4 Oct 2008 20:46:41 +0000 (+0000) Subject: Add test/Driver. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae3c16cc544d21b49936d9da51fd1f8ca8bc064e;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57070 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Coverage/html-diagnostics.c b/test/Coverage/html-diagnostics.c new file mode 100644 index 0000000000..75d4e067fc --- /dev/null +++ b/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/test/Coverage/verbose.c b/test/Coverage/verbose.c new file mode 100644 index 0000000000..6157bad395 --- /dev/null +++ b/test/Coverage/verbose.c @@ -0,0 +1 @@ +// RUN: clang -fsyntax-only -v %s diff --git a/test/Driver/env-include-paths.c b/test/Driver/env-include-paths.c new file mode 100644 index 0000000000..de4ba5b1b7 --- /dev/null +++ b/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 +#else +/* expected-error {{file not found}} */ #include +#endif + +#undef AS_INCLUDE + +#endif + +#ifdef AS_INCLUDE + +/* expected-warning {{Hello}} */ #warning "Hello" + +#endif