[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / Sema / inline-asm-validate-riscv.c
blob43a5378bc3f25713b5817d863f9aa5b5c15a081e
1 // RUN: %clang_cc1 -triple riscv32 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -triple riscv64 -fsyntax-only -verify %s
4 void I(int i) {
5 static const int BelowMin = -2049;
6 static const int AboveMax = 2048;
7 asm volatile ("" :: "I"(BelowMin)); // expected-error{{value '-2049' out of range for constraint 'I'}}
8 asm volatile ("" :: "I"(AboveMax)); // expected-error{{value '2048' out of range for constraint 'I'}}
11 void J(int j) {
12 static const int BelowMin = -1;
13 static const int AboveMax = 1;
14 asm volatile ("" :: "J"(BelowMin)); // expected-error{{value '-1' out of range for constraint 'J'}}
15 asm volatile ("" :: "J"(AboveMax)); // expected-error{{value '1' out of range for constraint 'J'}}
18 void K(int k) {
19 static const int BelowMin = -1;
20 static const int AboveMax = 32;
21 asm volatile ("" :: "K"(BelowMin)); // expected-error{{value '-1' out of range for constraint 'K'}}
22 asm volatile ("" :: "K"(AboveMax)); // expected-error{{value '32' out of range for constraint 'K'}}
25 void test_clobber_conflict(void) {
26 register long x10 asm("x10");
27 asm volatile("" :: "r"(x10) : "x10"); // expected-error {{conflicts with asm clobber list}}
28 asm volatile("" :: "r"(x10) : "a0"); // expected-error {{conflicts with asm clobber list}}
29 asm volatile("" : "=r"(x10) :: "x10"); // expected-error {{conflicts with asm clobber list}}
30 asm volatile("" : "=r"(x10) :: "a0"); // expected-error {{conflicts with asm clobber list}}