xref: /llvm-project/clang/test/Lexer/preamble2.c (revision b34c79ff277b20ec00f66c50bf550f2d76ea2108)
1 // Preamble detection test: header with an include guard.
2 #ifndef HEADER_H
3 #define HEADER_H
4 #include "foo"
5 int bar;
6 #endif
7 
8 // This test checks for detection of the preamble of a file, which
9 // includes all of the starting comments and #includes.
10 
11 // RUN: %clang_cc1 -print-preamble %s > %t
12 // RUN: echo END. >> %t
13 // RUN: FileCheck < %t %s
14 
15 // CHECK: // Preamble detection test: header with an include guard.
16 // CHECK-NEXT: #ifndef HEADER_H
17 // CHECK-NEXT: #define HEADER_H
18 // CHECK-NEXT: #include "foo"
19 // CHECK-NEXT: END.
20