summaryrefslogtreecommitdiff
path: root/test/PCH
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2018-08-17 13:43:39 +0000
committerErich Keane <erich.keane@intel.com>2018-08-17 13:43:39 +0000
commitcc56a9650522460610126a9162dc4c54e7d9315e (patch)
tree7725fd35164e60aa2e490db0edcdae175d60953c /test/PCH
parentfe170f961ef352eee1aeec5decee8111a7fc9f4e (diff)
downloadclang-cc56a9650522460610126a9162dc4c54e7d9315e.tar.gz
Fix for bug 38508 - Don't do PCH processing when only generating preprocessor output
This clang-cl driver change removes the PCH options when we are only generating preprocessed output. This is similar to the behavior of Y-. Patch by: mikerice Differential Revision: https://reviews.llvm.org/D50640 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340025 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/PCH')
-rw-r--r--test/PCH/Inputs/pch-through-use3c.cpp2
-rw-r--r--test/PCH/Inputs/pch-through3c.h1
-rw-r--r--test/PCH/pch-through3c.cpp8
3 files changed, 11 insertions, 0 deletions
diff --git a/test/PCH/Inputs/pch-through-use3c.cpp b/test/PCH/Inputs/pch-through-use3c.cpp
new file mode 100644
index 0000000000..6102c514fb
--- /dev/null
+++ b/test/PCH/Inputs/pch-through-use3c.cpp
@@ -0,0 +1,2 @@
+int a = A;
+// expected-no-diagnostics
diff --git a/test/PCH/Inputs/pch-through3c.h b/test/PCH/Inputs/pch-through3c.h
new file mode 100644
index 0000000000..ab2a05dbbf
--- /dev/null
+++ b/test/PCH/Inputs/pch-through3c.h
@@ -0,0 +1 @@
+#define A 1
diff --git a/test/PCH/pch-through3c.cpp b/test/PCH/pch-through3c.cpp
new file mode 100644
index 0000000000..97b98c4059
--- /dev/null
+++ b/test/PCH/pch-through3c.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -I %S -emit-pch \
+// RUN: -include Inputs/pch-through3c.h \
+// RUN: -pch-through-header=Inputs/pch-through3c.h -o %t.3c %s
+
+// RUN: %clang_cc1 -verify -I %S -include-pch %t.3c \
+// RUN: -include Inputs/pch-through3c.h \
+// RUN: -pch-through-header=Inputs/pch-through3c.h \
+// RUN: %S/Inputs/pch-through-use3c.cpp 2>&1