summaryrefslogtreecommitdiff
path: root/test/Driver/cl-pch-errorhandling.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Driver/cl-pch-errorhandling.cpp')
-rw-r--r--test/Driver/cl-pch-errorhandling.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Driver/cl-pch-errorhandling.cpp b/test/Driver/cl-pch-errorhandling.cpp
new file mode 100644
index 0000000000000..879c8cf8e7dad
--- /dev/null
+++ b/test/Driver/cl-pch-errorhandling.cpp
@@ -0,0 +1,15 @@
+// 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.
+
+// /Yc but pch generation fails => main file not compiled
+// This is a separate file since executing this failure path requires
+// code generation, which makes this test require an x86 backend.
+// REQUIRES: x86-registered-target
+
+// RUN: not %clang_cl -Werror /Yc%S/Inputs/pchfile.h /FI%S/Inputs/pchfile.h /Fp%t.pch /c -DERR_HEADER -- %s 2>&1 \
+// RUN: | FileCheck %s
+
+// CHECK: nope1
+// CHECK-NOT: nope2
+
+#error nope2