summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2011-09-29 01:01:08 +0000
committerDaniel Dunbar <daniel@zuster.org>2011-09-29 01:01:08 +0000
commitaa11138543d419a5152b35564d59a853687fa7fc (patch)
tree9f7a159e6c4490c8265e87f4499dfe3c94afa485 /clang/test
parentcc5f8d45173668385d047c7538acd92ba501e2df (diff)
downloadbcm5719-llvm-aa11138543d419a5152b35564d59a853687fa7fc.tar.gz
bcm5719-llvm-aa11138543d419a5152b35564d59a853687fa7fc.zip
Basic/Diagnostics: Add an isDefaultMappingAsError method, and switch TextDiagnosticPrinter to use that instead of extracting the current mapping via getDiagnosticLevel, which fixes one class of corner cases w.r.t. printing the "-Werror" diagnostic option marker.
- The TextDiagnosticPrinter code is still fragile as it is just "reverse engineering" what the diagnostic engine is doing. Not my current priority to fix though. llvm-svn: 140752
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Frontend/diagnostics-option-names.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Frontend/diagnostics-option-names.c b/clang/test/Frontend/diagnostics-option-names.c
new file mode 100644
index 00000000000..ed0d2ed8ef9
--- /dev/null
+++ b/clang/test/Frontend/diagnostics-option-names.c
@@ -0,0 +1,8 @@
+// RUN: not %clang_cc1 -fdiagnostics-show-option -Werror -Weverything %s 2> %t
+// RUN: FileCheck < %t %s
+
+int f0(int, unsigned);
+int f0(int x, unsigned y) {
+// CHECK: comparison of integers of different signs{{.*}} [-Werror,-Wsign-compare]
+ return x < y; // expected-error {{ : 'int' and 'unsigned int' }}
+}
OpenPOWER on IntegriCloud