summaryrefslogtreecommitdiffstats
path: root/test/Misc
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-03-20 20:49:45 +0000
committerTed Kremenek <kremenek@apple.com>2012-03-20 20:49:45 +0000
commit3739b32a01b9778176757425e62252c288b85383 (patch)
treef87117c4a5b24b93aa94466ae29a0ae032f74066 /test/Misc
parentfce80091da9e5d83d05944e36c834f9137dc329c (diff)
Don't include FixIts with a null replacement range. Fixes <rdar://problem/11040133>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153122 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Misc')
-rw-r--r--test/Misc/serialized-diags.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/Misc/serialized-diags.c b/test/Misc/serialized-diags.c
index f4de8401e9..73ac0507fc 100644
--- a/test/Misc/serialized-diags.c
+++ b/test/Misc/serialized-diags.c
@@ -25,9 +25,15 @@ void testMacro() {
// Test handling of issues from #includes.
#include "serialized-diags.h"
+// Test handling of warnings that have empty fixits.
+void rdar11040133() {
+ unsigned x;
+}
+
// RUN: rm -f %t
-// RUN: %clang -Wall -fsyntax-only %s --serialize-diagnostics %t > /dev/null 2>&1 || true
-// RUN: c-index-test -read-diagnostics %t 2>&1 | FileCheck %s
+// RUN: %clang -Wall -fsyntax-only %s --serialize-diagnostics %t.diag > /dev/null 2>&1 || true
+// RUN: c-index-test -read-diagnostics %t.diag > %t 2>&1
+// RUN: FileCheck --input-file=%t %s
// This test case tests that we can handle multiple diagnostics which contain
// FIXITs at different levels (one at the note, another at the main diagnostic).
@@ -55,5 +61,8 @@ void testMacro() {
// CHECK: {{.*[/\\]}}serialized-diags.h:5:7: warning: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int'; [-Wint-conversion]
// CHECK: Range: {{.*[/\\]}}serialized-diags.h:5:16 {{.*[/\\]}}serialized-diags.h:5:17
// CHECK: +-{{.*[/\\]}}serialized-diags.c:26:10: note: in file included from {{.*[/\\]}}serialized-diags.c:26: []
-// CHECK: Number of diagnostics: 5
+// CHECK: Number FIXITs = 0
+// CHECK: {{.*[/\\]}}serialized-diags.c:30:12: warning: unused variable 'x'
+// CHECK: Number FIXITs = 0
+// CHECK: Number of diagnostics: 6