~shimon/dismaltc

ref: 1ed81693aae22a7be0136e601ee14b226cce74d4 dismaltc/clang/test/Misc/serialized-diags-driver.c -rw-r--r-- 897 bytes
1ed81693Itoh Shimon oops, re-enabled more tests. 1 year, 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Test that the driver correctly combines its own diagnostics with CC1's in the
// serialized diagnostics. To test this, we need to trigger diagnostics from
// both processes, so we compile code that has a warning (with an associated
// note) and then force the driver to crash. We compile stdin so that the crash
// doesn't litter the user's system with preprocessed output.

// RUN: rm -f %t
// RUN: %clang -Wx-typoed-warning -Wall -fsyntax-only --serialize-diagnostics %t.diag %s
// RUN: c-index-test -read-diagnostics %t.diag 2>&1 | FileCheck %s

// CHECK: warning: unknown warning option '-Wx-typoed-warning' [-Wunknown-warning-option] []

// CHECK: warning: variable 'voodoo' is uninitialized when used here [-Wuninitialized]
// CHECK: note: initialize the variable 'voodoo' to silence this warning []
// CHECK: Number of diagnostics: 2

void foo() {
  int voodoo;
  voodoo = voodoo + 1;
}