Daniel Dunbar | 9263fd5 | 2008-10-04 20:46:41 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify -DAS_SOURCE %s && |
| 2 | // RUN: env CPATH="" clang -fsyntax-only -verify -DAS_SOURCE %s && |
| 3 | // RUN: env CPATH="xyz:xyz" clang -fsyntax-only -verify -DAS_SOURCE %s && |
Daniel Dunbar | ef96cf0 | 2008-10-04 21:05:04 +0000 | [diff] [blame] | 4 | // RUN: cd $(dirname %s) && |
Daniel Dunbar | 9263fd5 | 2008-10-04 20:46:41 +0000 | [diff] [blame] | 5 | // RUN: env CPATH="xyz::xyz" clang -fsyntax-only -verify -DSHOULD_FIND -DAS_SOURCE %s && |
| 6 | // RUN: env CPATH="../Driver" clang -fsyntax-only -verify -DSHOULD_FIND -DAS_SOURCE %s |
Daniel Dunbar | 9263fd5 | 2008-10-04 20:46:41 +0000 | [diff] [blame] | 7 | |
| 8 | #ifdef AS_SOURCE |
| 9 | #undef AS_SOURCE |
| 10 | |
| 11 | #define AS_INCLUDE |
| 12 | |
| 13 | #ifdef SHOULD_FIND |
| 14 | #include <env-include-paths.c> |
| 15 | #else |
| 16 | /* expected-error {{file not found}} */ #include <env-include-paths.c> |
| 17 | #endif |
| 18 | |
| 19 | #undef AS_INCLUDE |
| 20 | |
| 21 | #endif |
| 22 | |
| 23 | #ifdef AS_INCLUDE |
| 24 | |
| 25 | /* expected-warning {{Hello}} */ #warning "Hello" |
| 26 | |
| 27 | #endif |