summaryrefslogtreecommitdiffstats
path: root/test/Misc/diag-mapping2.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Misc/diag-mapping2.c')
-rw-r--r--test/Misc/diag-mapping2.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Misc/diag-mapping2.c b/test/Misc/diag-mapping2.c
new file mode 100644
index 0000000..7e0d774
--- /dev/null
+++ b/test/Misc/diag-mapping2.c
@@ -0,0 +1,19 @@
+// This should warn by default.
+// RUN: clang-cc %s 2>&1 | grep "warning:" &&
+
+// This should not emit anything.
+// RUN: clang-cc %s -w 2>&1 | not grep diagnostic &&
+// RUN: clang-cc %s -Wno-#warnings 2>&1 | not grep diagnostic &&
+
+// -Werror can map all warnings to error.
+// RUN: clang-cc %s -Werror 2>&1 | grep "error:" &&
+
+// -Werror can map this one warning to error.
+// RUN: clang-cc %s -Werror=#warnings 2>&1 | grep "error:" &&
+
+// -Wno-error= overrides -Werror. rdar://3158301
+// RUN: clang-cc %s -Werror -Wno-error=#warnings 2>&1 | grep "warning:"
+
+#warning foo
+
+
OpenPOWER on IntegriCloud