summaryrefslogtreecommitdiffstats
path: root/clang/test/Frontend/warning-mapping-6.c
diff options
context:
space:
mode:
authorJames Y Knight <jyknight@google.com>2019-01-29 19:33:48 +0000
committerJames Y Knight <jyknight@google.com>2019-01-29 19:33:48 +0000
commit3f8b9166989709d1d893524f5590f8064e824554 (patch)
treeb08a01cb714f049e320e9cc4b785ce6550ec23b2 /clang/test/Frontend/warning-mapping-6.c
parentd37ff4e888729c807fc4b9e8d2cac0846c5dcf73 (diff)
downloadbcm5719-llvm-3f8b9166989709d1d893524f5590f8064e824554.tar.gz
bcm5719-llvm-3f8b9166989709d1d893524f5590f8064e824554.zip
Fix the behavior of clang's -w flag.
It is intended to disable _all_ warnings, even those upgraded to errors via `-Werror=warningname` or `#pragma clang diagnostic error' Fixes: https://llvm.org/PR38231 Differential Revision: https://reviews.llvm.org/D53199 llvm-svn: 352535
Diffstat (limited to 'clang/test/Frontend/warning-mapping-6.c')
-rw-r--r--clang/test/Frontend/warning-mapping-6.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Frontend/warning-mapping-6.c b/clang/test/Frontend/warning-mapping-6.c
new file mode 100644
index 00000000000..ea22f72cc96
--- /dev/null
+++ b/clang/test/Frontend/warning-mapping-6.c
@@ -0,0 +1,9 @@
+// Check that "#pragma diagnostic error" is suppressed by -w.
+//
+// RUN: %clang_cc1 -verify -Werror -w %s
+
+// expected-no-diagnostics
+#pragma gcc diagnostic error "-Wsign-compare"
+int f0(int x, unsigned y) {
+ return x < y;
+}
OpenPOWER on IntegriCloud