summaryrefslogtreecommitdiff
path: root/test/PCH
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-02-07 08:33:28 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-02-07 08:33:28 +0000
commit229253a4431d77d43c067e8d086bb8fd800f65bf (patch)
treec24f3993521d9397379a966eabfac830170fa5d2 /test/PCH
parent61a09b7d35b270bd78c7869fa524f5071fffdd1c (diff)
downloadclang-229253a4431d77d43c067e8d086bb8fd800f65bf.tar.gz
clang-229253a4431d77d43c067e8d086bb8fd800f65bf.tar.bz2
clang-229253a4431d77d43c067e8d086bb8fd800f65bf.tar.xz
Revert r194097: "With this patch -Wwrite-strings is still implemented with the terrible
hack of passing -fconst-strings to -cc1" Passing or not a language option based on diagnostic settings is a bad idea, it breaks using a PCH that was compiled with different diagnostic settings. Also add a test case to make sure we don't regress. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200964 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/PCH')
-rw-r--r--test/PCH/different-diagnostic-level.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/PCH/different-diagnostic-level.c b/test/PCH/different-diagnostic-level.c
new file mode 100644
index 0000000000..ac1a0daab1
--- /dev/null
+++ b/test/PCH/different-diagnostic-level.c
@@ -0,0 +1,17 @@
+// RUN: %clang -x c-header %s -Weverything -o %t.h.pch
+// RUN: %clang -x c %s -w -include %t.h -fsyntax-only -Xclang -verify
+
+#ifndef HEADER
+#define HEADER
+
+extern int foo;
+
+#else
+
+void f() {
+ int a = foo;
+ // Make sure we parsed this by getting an error.
+ int b = bar; // expected-error {{undeclared}}
+}
+
+#endif