[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / Misc / ppc-inline-asm-clobber-warning.c
blobbc323243b6e2dc529a290ee320c58bf6615a57ca
1 /// This test checks that the warning includes the location in the C source
2 /// file that contains the inline asm. Although this warning is emitted in llvm
3 /// it cannot be tested from IR as it does not have that location information at
4 /// that stage.
6 // REQUIRES: powerpc-registered-target
8 // RUN: %clang --target=powerpc-unknown-unknown -mcpu=pwr7 \
9 // RUN: -c %s -o /dev/null 2>&1 | FileCheck %s
10 // RUN: %clang --target=powerpc64-unknown-unknown -mcpu=pwr7 \
11 // RUN: -c %s -o /dev/null 2>&1 | FileCheck %s
13 void test_r1_clobber() {
14 __asm__("nop":::"r1");
17 // CHECK: ppc-inline-asm-clobber-warning.c:14:11: warning: inline asm clobber list contains reserved registers: R1 [-Winline-asm]
18 // CHECK-NEXT: __asm__("nop":::"r1");
19 // CHECK-NEXT: ^
20 // CHECK-NEXT: ppc-inline-asm-clobber-warning.c:14:11: note: Reserved registers on the clobber list may not be preserved across the asm statement, and clobbering them may lead to undefined behaviour.
22 void test_1_clobber() {
23 __asm__("nop":::"1");
26 // CHECK: ppc-inline-asm-clobber-warning.c:23:11: warning: inline asm clobber list contains reserved registers: R1 [-Winline-asm]
27 // CHECK-NEXT: __asm__("nop":::"1");
28 // CHECK-NEXT: ^
29 // CHECK-NEXT: ppc-inline-asm-clobber-warning.c:23:11: note: Reserved registers on the clobber list may not be preserved across the asm statement, and clobbering them may lead to undefined behaviour.
31 void test_sp_clobber() {
32 __asm__("nop":::"sp");
35 // CHECK: ppc-inline-asm-clobber-warning.c:32:11: warning: inline asm clobber list contains reserved registers: R1 [-Winline-asm]
36 // CHECK-NEXT: __asm__("nop":::"sp");
37 // CHECK-NEXT: ^
38 // CHECK-NEXT: ppc-inline-asm-clobber-warning.c:32:11: note: Reserved registers on the clobber list may not be preserved across the asm statement, and clobbering them may lead to undefined behaviour.