diff options
Diffstat (limited to 'clang/test/Lexer/preamble2.c')
-rw-r--r-- | clang/test/Lexer/preamble2.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/Lexer/preamble2.c b/clang/test/Lexer/preamble2.c new file mode 100644 index 00000000000..499a9a22a5b --- /dev/null +++ b/clang/test/Lexer/preamble2.c @@ -0,0 +1,19 @@ +// Preamble detection test: header with an include guard. +#ifndef HEADER_H +#define HEADER_H +#include "foo" +int bar; +#endif + +// This test checks for detection of the preamble of a file, which +// includes all of the starting comments and #includes. + +// RUN: %clang_cc1 -print-preamble %s > %t +// RUN: echo END. >> %t +// RUN: FileCheck < %t %s + +// CHECK: // Preamble detection test: header with an include guard. +// CHECK-NEXT: #ifndef HEADER_H +// CHECK-NEXT: #define HEADER_H +// CHECK-NEXT: #include "foo" +// CHECK-NEXT: END. |