summaryrefslogtreecommitdiffstats
path: root/clang/test/Misc/serialized-diags-frontend.c
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-05-10 05:03:45 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-05-10 05:03:45 +0000
commitb16ff5d1cee060ba35c85d24b9270dbe01e432b6 (patch)
tree0755975308a60030f532a30e4c03fae3322a96e5 /clang/test/Misc/serialized-diags-frontend.c
parent3d081399f06680c5f1d95577f19c3e4f177bac86 (diff)
downloadbcm5719-llvm-b16ff5d1cee060ba35c85d24b9270dbe01e432b6.tar.gz
bcm5719-llvm-b16ff5d1cee060ba35c85d24b9270dbe01e432b6.zip
Fix an assertion hit when the serialized diagnostics writer receive a diagnostic
from the frontend when the location is invalid and the SourceManager null. Instead of keeping the SourceManager object in DiagnosticRenderer, propagate it to the calls accordingly (as reference when it is expected to not be null, or pointer when it may be null). This effectively makes DiagnosticRenderer not tied to a specific SourceManager, removing a hack from TextDiagnosticPrinter. rdar://11386874 llvm-svn: 156536
Diffstat (limited to 'clang/test/Misc/serialized-diags-frontend.c')
-rw-r--r--clang/test/Misc/serialized-diags-frontend.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Misc/serialized-diags-frontend.c b/clang/test/Misc/serialized-diags-frontend.c
new file mode 100644
index 00000000000..453ed1470aa
--- /dev/null
+++ b/clang/test/Misc/serialized-diags-frontend.c
@@ -0,0 +1,8 @@
+// RUN: rm -f %t
+// RUN: %clang -fsyntax-only %s -Wblahblah --serialize-diagnostics %t > /dev/null 2>&1 || true
+// RUN: c-index-test -read-diagnostics %t 2>&1 | FileCheck %s
+
+// This test case tests that we can handle frontend diagnostics.
+
+// CHECK: warning: unknown warning option '-Wblahblah'
+// CHECK: Number of diagnostics: 1
OpenPOWER on IntegriCloud