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