annotate clang/test/Index/pch-warn-as-error-code-split.cpp @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source local %s -Wuninitialized -Werror=unused 2>&1 | FileCheck -check-prefix=DIAGS %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 // Make sure -Wuninitialized works even though the header had a warn-as-error occurrence.
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 // DIAGS: error: unused variable 'x'
anatofuz
parents:
diff changeset
6 // DIAGS: warning: variable 'x1' is uninitialized
anatofuz
parents:
diff changeset
7 // DIAGS-NOT: error: use of undeclared identifier
anatofuz
parents:
diff changeset
8 // DIAGS: warning: variable 'x1' is uninitialized
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 #include "pch-warn-as-error-code-split.h"
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 void test() {
anatofuz
parents:
diff changeset
13 int x1; // expected-note {{initialize}}
anatofuz
parents:
diff changeset
14 int x2 = x1; // expected-warning {{uninitialized}}
anatofuz
parents:
diff changeset
15 (void)x2;
anatofuz
parents:
diff changeset
16 foo_head();
anatofuz
parents:
diff changeset
17 }