blob: 31f279180f9c4677e01b1e3ed364207eeaabc397 [file] [log] [blame]
Ted Kremeneka7e8a832011-11-11 00:46:43 +00001void foo() {
2 int voodoo;
3 voodoo = voodoo + 1;
4}
5
6void bar() {
7 int dragon;
8 dragon = dragon + 1
9}
10
11// RUN: %clang -Wall -fsyntax-only %s --serialize-diagnostics %t 2>&1 /dev/null || true
12// RUN: c-index-test -read-diagnostics %t 2>&1 | FileCheck %s
13// RUN: rm -f %t
14
15// This test case tests that we can handle multiple diagnostics which contain
16// FIXITs at different levels (one at the note, another at the main diagnostic).
17
18// CHECK: {{.*}}/serialized-diags.c:3:12: warning: variable 'voodoo' is uninitialized when used here [-Wuninitialized]
19// CHECK: Range: {{.*}}/serialized-diags.c:3:12 {{.*}}/serialized-diags.c:3:18
20// CHECK: +-{{.*}}/serialized-diags.c:2:13: note: initialize the variable 'voodoo' to silence this warning []
21// CHECK: +-FIXIT: ({{.*}}/serialized-diags.c:2:13 - {{.*}}/serialized-diags.c:2:13): " = 0Parse Issueexpected ';' after expression"
22// CHECK: {{.*}}/serialized-diags.c:8:22: error: expected ';' after expression []
23// CHECK: FIXIT: ({{.*}}/serialized-diags.c:8:22 - {{.*}}/serialized-diags.c:8:22): ";"