blob: f5fb627fec16c1c043d4fca115cfaf96a77dcb92 [file] [log] [blame]
Reid Kleckner1df0fea2015-02-26 00:17:25 +00001// RUN: %clang_cc1 -E -frewrite-includes -I %S/Inputs %s | FileCheck %s --check-prefix=GNU
2// RUN: %clang_cc1 -E -frewrite-includes -fuse-line-directives -I %S/Inputs %s | FileCheck %s --check-prefix=LINE
3#include "test.h"
4int f() { return x; }
5
Richard Smithc7cacdc2017-04-29 00:54:03 +00006#include "empty.h"
7
Reid Kleckner1df0fea2015-02-26 00:17:25 +00008// GNU: {{^}}# 1 "{{.*}}rewrite-includes-line-markers.c"
9// GNU: {{^}}#include "test.h"
10// GNU: {{^}}# 1 "{{.*}}test.h"
11// GNU: {{^}}#include "test2.h"
12// GNU: {{^}}# 1 "{{.*}}test2.h"
13// GNU: {{^}}int x;
14// GNU: {{^}}# 4 "{{.*}}rewrite-includes-line-markers.c" 2
15// GNU: {{^}}int f() { return x; }
Richard Smithc7cacdc2017-04-29 00:54:03 +000016// GNU: {{^}}
17// GNU: {{^}}# 1 "{{.*}}empty.h" 1
18// GNU: {{^}}# 7 "{{.*}}rewrite-includes-line-markers.c" 2
Reid Kleckner1df0fea2015-02-26 00:17:25 +000019
20// LINE: {{^}}#line 1 "{{.*}}rewrite-includes-line-markers.c"
21// LINE: {{^}}#include "test.h"
22// LINE: {{^}}#line 1 "{{.*}}test.h"
23// LINE: {{^}}#include "test2.h"
24// LINE: {{^}}#line 1 "{{.*}}test2.h"
25// LINE: {{^}}int x;
26// LINE: {{^}}#line 4 "{{.*}}rewrite-includes-line-markers.c"
27// LINE: {{^}}int f() { return x; }
Richard Smithc7cacdc2017-04-29 00:54:03 +000028// LINE: {{^}}
29// LINE: {{^}}#line 1 "{{.*}}empty.h"
30// LINE: {{^}}#line 7 "{{.*}}rewrite-includes-line-markers.c"