summaryrefslogtreecommitdiff
path: root/test/Lexer/preamble2.c
blob: 499a9a22a5b35dba83d0ca422d9137e7944672be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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.