Douglas Gregor | f033f1d | 2010-07-20 20:18:03 +0000 | [diff] [blame] | 1 | // Preamble detection test: see below for comments and test commands. |
Daniel Dunbar | 0286de6 | 2010-07-21 19:40:01 +0000 | [diff] [blame] | 2 | // |
Douglas Gregor | f033f1d | 2010-07-20 20:18:03 +0000 | [diff] [blame] | 3 | #include <blah> |
| 4 | #ifndef FOO |
| 5 | #else |
| 6 | #ifdef BAR |
| 7 | #elif WIBBLE |
| 8 | #endif |
| 9 | #pragma unknown |
| 10 | #endif |
Douglas Gregor | f033f1d | 2010-07-20 20:18:03 +0000 | [diff] [blame] | 11 | #ifdef WIBBLE |
| 12 | #include "honk" |
| 13 | #else |
| 14 | int foo(); |
| 15 | #endif |
| 16 | |
| 17 | // This test checks for detection of the preamble of a file, which |
| 18 | // includes all of the starting comments and #includes. Note that any |
| 19 | // changes to the preamble part of this file must be mirrored in |
| 20 | // Inputs/preamble.txt, since we diff against it. |
| 21 | |
| 22 | // RUN: %clang_cc1 -print-preamble %s > %t |
Daniel Dunbar | 9a570b4 | 2010-07-22 02:22:24 +0000 | [diff] [blame] | 23 | // RUN: echo END. >> %t |
Daniel Dunbar | 0286de6 | 2010-07-21 19:40:01 +0000 | [diff] [blame] | 24 | // RUN: FileCheck < %t %s |
| 25 | |
| 26 | // CHECK: // Preamble detection test: see below for comments and test commands. |
| 27 | // CHECK-NEXT: // |
| 28 | // CHECK-NEXT: #include <blah> |
| 29 | // CHECK-NEXT: #ifndef FOO |
| 30 | // CHECK-NEXT: #else |
| 31 | // CHECK-NEXT: #ifdef BAR |
| 32 | // CHECK-NEXT: #elif WIBBLE |
| 33 | // CHECK-NEXT: #endif |
| 34 | // CHECK-NEXT: #pragma unknown |
| 35 | // CHECK-NEXT: #endif |
Daniel Dunbar | 9a570b4 | 2010-07-22 02:22:24 +0000 | [diff] [blame] | 36 | // CHECK-NEXT: END. |