173
|
1 // RUN: %clang_cc1 -fsyntax-only -fno-diagnostics-show-option %s 2>&1 \
|
150
|
2 // RUN: | FileCheck %s -check-prefix=BASE
|
173
|
3 // RUN: %clang_cc1 -fsyntax-only %s 2>&1 \
|
150
|
4 // RUN: | FileCheck %s -check-prefix=OPTION
|
173
|
5 // RUN: not %clang_cc1 -fsyntax-only -Werror %s 2>&1 \
|
150
|
6 // RUN: | FileCheck %s -check-prefix=OPTION_ERROR
|
173
|
7 // RUN: %clang_cc1 -fsyntax-only -std=c89 -pedantic %s 2>&1 \
|
150
|
8 // RUN: | FileCheck %s -check-prefix=OPTION_PEDANTIC
|
173
|
9 // RUN: %clang_cc1 -fsyntax-only -fno-diagnostics-show-option -fdiagnostics-show-category id %s 2>&1 \
|
150
|
10 // RUN: | FileCheck %s -check-prefix=CATEGORY_ID
|
173
|
11 // RUN: %clang_cc1 -fsyntax-only -fno-diagnostics-show-option -fdiagnostics-show-category name %s 2>&1 \
|
150
|
12 // RUN: | FileCheck %s -check-prefix=CATEGORY_NAME
|
173
|
13 // RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-show-category name -Werror %s 2>&1 \
|
150
|
14 // RUN: | FileCheck %s -check-prefix=OPTION_ERROR_CATEGORY
|
|
15
|
|
16 void test(int x, int y) {
|
|
17 if (x = y) ++x;
|
|
18 // BASE: {{.*}}: warning: {{[a-z ]+$}}
|
|
19 // OPTION: {{.*}}: warning: {{[a-z ]+}} [-Wparentheses]
|
|
20 // OPTION_ERROR: {{.*}}: error: {{[a-z ]+}} [-Werror,-Wparentheses]
|
|
21 // CATEGORY_ID: {{.*}}: warning: {{[a-z ]+}} [2]
|
|
22 // CATEGORY_NAME: {{.*}}: warning: {{[a-z ]+}} [Semantic Issue]
|
|
23 // OPTION_ERROR_CATEGORY: {{.*}}: error: {{[a-z ]+}} [-Werror,-Wparentheses,Semantic Issue]
|
|
24
|
|
25 // Leverage the fact that all these '//'s get warned about in C89 pedantic.
|
|
26 // OPTION_PEDANTIC: {{.*}}: warning: {{[/a-z ]+}} [-Wcomment]
|
|
27 }
|