annotate clang/test/Misc/show-diag-options.c @ 173:0572611fdcc8 llvm10 llvm12

reorgnization done
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 11:55:54 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
1 // RUN: %clang_cc1 -fsyntax-only -fno-diagnostics-show-option %s 2>&1 \
150
anatofuz
parents:
diff changeset
2 // RUN: | FileCheck %s -check-prefix=BASE
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
3 // RUN: %clang_cc1 -fsyntax-only %s 2>&1 \
150
anatofuz
parents:
diff changeset
4 // RUN: | FileCheck %s -check-prefix=OPTION
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
5 // RUN: not %clang_cc1 -fsyntax-only -Werror %s 2>&1 \
150
anatofuz
parents:
diff changeset
6 // RUN: | FileCheck %s -check-prefix=OPTION_ERROR
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
7 // RUN: %clang_cc1 -fsyntax-only -std=c89 -pedantic %s 2>&1 \
150
anatofuz
parents:
diff changeset
8 // RUN: | FileCheck %s -check-prefix=OPTION_PEDANTIC
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
9 // RUN: %clang_cc1 -fsyntax-only -fno-diagnostics-show-option -fdiagnostics-show-category id %s 2>&1 \
150
anatofuz
parents:
diff changeset
10 // RUN: | FileCheck %s -check-prefix=CATEGORY_ID
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
11 // RUN: %clang_cc1 -fsyntax-only -fno-diagnostics-show-option -fdiagnostics-show-category name %s 2>&1 \
150
anatofuz
parents:
diff changeset
12 // RUN: | FileCheck %s -check-prefix=CATEGORY_NAME
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
13 // RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-show-category name -Werror %s 2>&1 \
150
anatofuz
parents:
diff changeset
14 // RUN: | FileCheck %s -check-prefix=OPTION_ERROR_CATEGORY
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 void test(int x, int y) {
anatofuz
parents:
diff changeset
17 if (x = y) ++x;
anatofuz
parents:
diff changeset
18 // BASE: {{.*}}: warning: {{[a-z ]+$}}
anatofuz
parents:
diff changeset
19 // OPTION: {{.*}}: warning: {{[a-z ]+}} [-Wparentheses]
anatofuz
parents:
diff changeset
20 // OPTION_ERROR: {{.*}}: error: {{[a-z ]+}} [-Werror,-Wparentheses]
anatofuz
parents:
diff changeset
21 // CATEGORY_ID: {{.*}}: warning: {{[a-z ]+}} [2]
anatofuz
parents:
diff changeset
22 // CATEGORY_NAME: {{.*}}: warning: {{[a-z ]+}} [Semantic Issue]
anatofuz
parents:
diff changeset
23 // OPTION_ERROR_CATEGORY: {{.*}}: error: {{[a-z ]+}} [-Werror,-Wparentheses,Semantic Issue]
anatofuz
parents:
diff changeset
24
anatofuz
parents:
diff changeset
25 // Leverage the fact that all these '//'s get warned about in C89 pedantic.
anatofuz
parents:
diff changeset
26 // OPTION_PEDANTIC: {{.*}}: warning: {{[/a-z ]+}} [-Wcomment]
anatofuz
parents:
diff changeset
27 }