summaryrefslogtreecommitdiffstats
path: root/clang/test/Driver/cl-pch-showincludes.cpp
blob: a78e60e9ba4a68dd2bc6c8c6c959f1248b69073a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Note: %s and %S must be preceded by --, otherwise it may be interpreted as a
// command-line option, e.g. on Mac where %s is commonly under /Users.

// Tests interaction of /Yc / /Yu with /showIncludes
// REQUIRES: x86-registered-target

#include "header3.h"

// When building the pch, header1.h (included by header2.h), header2.h (the pch
// input itself) and header3.h (included directly, above) should be printed.
// RUN: %clang_cl -Werror /showIncludes /I%S/Inputs /Ycheader2.h /FIheader2.h /Fp%t.pch /c -- %s 2>&1 \
// RUN:   | FileCheck -check-prefix=CHECK-YC %s
// CHECK-YC: Note: including file: {{.+header2.h}}
// CHECK-YC: Note: including file: {{.+header1.h}}
// CHECK-YC: Note: including file: {{.+header3.h}}

// When using the pch, only the direct include is printed.
// RUN: %clang_cl -Werror /showIncludes /I%S/Inputs /Yuheader2.h /FIheader2.h /Fp%t.pch /c -- %s 2>&1 \
// RUN:   | FileCheck -check-prefix=CHECK-YU %s
// CHECK-YU-NOT: Note: including file: {{.*pch}}
// CHECK-YU-NOT: Note: including file: {{.*header1.h}}
// CHECK-YU-NOT: Note: including file: {{.*header2.h}}
// CHECK-YU: Note: including file: {{.+header3.h}}
OpenPOWER on IntegriCloud