preamble.c revision 9a570b45480ce068ff243801b72ea605fe7c9fd3
1// Preamble detection test: see below for comments and test commands.
2//
3#include <blah>
4#ifndef FOO
5#else
6#ifdef BAR
7#elif WIBBLE
8#endif
9#pragma unknown
10#endif
11#ifdef WIBBLE
12#include "honk"
13#else
14int 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
23// RUN: echo END. >> %t
24// RUN: FileCheck < %t %s
25// XFAIL: win32
26
27// CHECK: // Preamble detection test: see below for comments and test commands.
28// CHECK-NEXT: //
29// CHECK-NEXT: #include <blah>
30// CHECK-NEXT: #ifndef FOO
31// CHECK-NEXT: #else
32// CHECK-NEXT: #ifdef BAR
33// CHECK-NEXT: #elif WIBBLE
34// CHECK-NEXT: #endif
35// CHECK-NEXT: #pragma unknown
36// CHECK-NEXT: #endif
37// CHECK-NEXT: END.
38