Douglas Gregor | e721f95 | 2009-04-28 18:58:38 +0000 | [diff] [blame] | 1 | // Test with pch. |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 2 | // RUN: clang-cc -emit-pch -DFOO -o %t %S/variables.h |
| 3 | // RUN: clang-cc -DBAR=int -include-pch %t -fsyntax-only -pedantic %s |
| 4 | // RUN: clang-cc -DFOO -DBAR=int -include-pch %t -Werror %s |
Douglas Gregor | 92b059e | 2009-04-28 20:33:11 +0000 | [diff] [blame] | 5 | // RUN: not clang-cc -DFOO -DBAR=int -DX=5 -include-pch %t -Werror %s |
Douglas Gregor | e721f95 | 2009-04-28 18:58:38 +0000 | [diff] [blame] | 6 | |
| 7 | BAR bar = 17; |
| 8 | |
| 9 | #ifndef FOO |
| 10 | # error FOO was not defined |
| 11 | #endif |
| 12 | |
| 13 | #if FOO != 1 |
| 14 | # error FOO has the wrong definition |
| 15 | #endif |
| 16 | |
| 17 | #ifndef BAR |
| 18 | # error BAR was not defined |
| 19 | #endif |