1 // RUN: %clang_cc1 -fsyntax-only -verify %s -DSILENCE
2 // RUN: %clang_cc1 -fsyntax-only -verify %s -Wbitwise-op-parentheses
3 // RUN: %clang_cc1 -fsyntax-only -verify %s -Wparentheses
4 // RUN: %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits %s -Wbitwise-op-parentheses 2>&1 | FileCheck %s
7 // expected-no-diagnostics
10 void bitwise_op_parentheses(unsigned i
) {
13 // expected-warning@-2 {{'&' within '|'}}
14 // expected-note@-3 {{place parentheses around the '&' expression to silence this warning}}
16 // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:10-[[@LINE-5]]:10}:"("
17 // CHECK: fix-it:"{{.*}}":{[[@LINE-6]]:15-[[@LINE-6]]:15}:")"
21 // expected-warning@-2 {{'&' within '|'}}
22 // expected-note@-3 {{place parentheses around the '&' expression to silence this warning}}
24 // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:14-[[@LINE-5]]:14}:"("
25 // CHECK: fix-it:"{{.*}}":{[[@LINE-6]]:19-[[@LINE-6]]:19}:")"
29 // expected-warning@-2 {{'^' within '|'}}
30 // expected-note@-3 {{place parentheses around the '^' expression to silence this warning}}
32 // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:10-[[@LINE-5]]:10}:"("
33 // CHECK: fix-it:"{{.*}}":{[[@LINE-6]]:15-[[@LINE-6]]:15}:")"
37 // expected-warning@-2 {{'^' within '|'}}
38 // expected-note@-3 {{place parentheses around the '^' expression to silence this warning}}
40 // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:14-[[@LINE-5]]:14}:"("
41 // CHECK: fix-it:"{{.*}}":{[[@LINE-6]]:19-[[@LINE-6]]:19}:")"
45 // expected-warning@-2 {{'&' within '^'}}
46 // expected-note@-3 {{place parentheses around the '&' expression to silence this warning}}
48 // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:10-[[@LINE-5]]:10}:"("
49 // CHECK: fix-it:"{{.*}}":{[[@LINE-6]]:15-[[@LINE-6]]:15}:")"
53 // expected-warning@-2 {{'&' within '^'}}
54 // expected-note@-3 {{place parentheses around the '&' expression to silence this warning}}
56 // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:14-[[@LINE-5]]:14}:"("
57 // CHECK: fix-it:"{{.*}}":{[[@LINE-6]]:19-[[@LINE-6]]:19}:")"