diff options
author | Nico Weber <nicolasweber@gmx.de> | 2016-03-12 19:55:59 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2016-03-12 19:55:59 +0000 |
commit | 1f8bad519804ace0326e53934c48a06dea3a5265 (patch) | |
tree | 7ff73fb57d62448215d38d7058ffc321fbb3fdfb | |
parent | 5658b589365e35afa65eab08ee3eac6061a3f46b (diff) | |
download | bcm5719-llvm-1f8bad519804ace0326e53934c48a06dea3a5265.tar.gz bcm5719-llvm-1f8bad519804ace0326e53934c48a06dea3a5265.zip |
clang-cl: Add a test for the interaction of /Yc and /showIncludes.
We almost get this right, but not completely (see FIXME). It looks like /FI
headers generally aren't included in /showIncludes yet, but they should be.
But it seems good to have test coverage for the bits that already work.
llvm-svn: 263344
-rw-r--r-- | clang/test/Driver/Inputs/header1.h | 0 | ||||
-rw-r--r-- | clang/test/Driver/Inputs/header2.h | 1 | ||||
-rw-r--r-- | clang/test/Driver/Inputs/header3.h | 0 | ||||
-rw-r--r-- | clang/test/Driver/cl-pch-showincludes.cpp | 22 |
4 files changed, 23 insertions, 0 deletions
diff --git a/clang/test/Driver/Inputs/header1.h b/clang/test/Driver/Inputs/header1.h new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/clang/test/Driver/Inputs/header1.h diff --git a/clang/test/Driver/Inputs/header2.h b/clang/test/Driver/Inputs/header2.h new file mode 100644 index 00000000000..243468d879c --- /dev/null +++ b/clang/test/Driver/Inputs/header2.h @@ -0,0 +1 @@ +#include "header1.h" diff --git a/clang/test/Driver/Inputs/header3.h b/clang/test/Driver/Inputs/header3.h new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/clang/test/Driver/Inputs/header3.h diff --git a/clang/test/Driver/cl-pch-showincludes.cpp b/clang/test/Driver/cl-pch-showincludes.cpp new file mode 100644 index 00000000000..1fe25c08ece --- /dev/null +++ b/clang/test/Driver/cl-pch-showincludes.cpp @@ -0,0 +1,22 @@ +// 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 + +#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 +// FIXME: clang-cl doesn't print "header2.h" yet, next line shouldn't say -NOT +// CHECK-YC-NOT: 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: {{.*header1.h}} +// CHECK-YU-NOT: Note: including file: {{.*header2.h}} +// CHECK-YU: Note: including file: {{.*header3.h}} |