blob: 617ac8c6ef928e69224125828b98a7123d351372 [file] [log] [blame]
Justin Bogner5a6a2fc2014-10-23 22:20:11 +00001// Test that the driver correctly combines its own diagnostics with CC1's in the
2// serialized diagnostics. To test this, we need to trigger diagnostics from
3// both processes, so we compile code that has a warning (with an associated
4// note) and then force the driver to crash. We compile stdin so that the crash
5// doesn't litter the user's system with preprocessed output.
6
7// RUN: rm -f %t
Ehsan Akhgarid8518332016-01-25 21:14:52 +00008// RUN: %clang -Wx-typoed-warning -Wall -fsyntax-only --serialize-diagnostics %t.diag %s
Justin Bogner5a6a2fc2014-10-23 22:20:11 +00009// RUN: c-index-test -read-diagnostics %t.diag 2>&1 | FileCheck %s
10
Ehsan Akhgarid8518332016-01-25 21:14:52 +000011// CHECK: warning: unknown warning option '-Wx-typoed-warning' [-Wunknown-warning-option] []
Justin Bogner5a6a2fc2014-10-23 22:20:11 +000012
13// CHECK: warning: variable 'voodoo' is uninitialized when used here [-Wuninitialized]
14// CHECK: note: initialize the variable 'voodoo' to silence this warning []
15// CHECK: Number of diagnostics: 2
16
17void foo() {
18 int voodoo;
19 voodoo = voodoo + 1;
20}