// RUN: %clang_cc1 -triple riscv32 -fsyntax-only -verify %s
// RUN: %clang_cc1 -triple riscv64 -fsyntax-only -verify %s
voidI(inti){staticconstint BelowMin =-2049;staticconstint AboveMax =2048;asmvolatile("" ::"I"(BelowMin));// expected-error{{value '-2049' out of range for constraint 'I'}}
asmvolatile("" ::"I"(AboveMax));// expected-error{{value '2048' out of range for constraint 'I'}}
}voidJ(intj){staticconstint BelowMin =-1;staticconstint AboveMax =1;asmvolatile("" ::"J"(BelowMin));// expected-error{{value '-1' out of range for constraint 'J'}}
asmvolatile("" ::"J"(AboveMax));// expected-error{{value '1' out of range for constraint 'J'}}
}voidK(intk){staticconstint BelowMin =-1;staticconstint AboveMax =32;asmvolatile("" ::"K"(BelowMin));// expected-error{{value '-1' out of range for constraint 'K'}}
asmvolatile("" ::"K"(AboveMax));// expected-error{{value '32' out of range for constraint 'K'}}
}voidtest_clobber_conflict(void){registerlong x10 asm("x10");asmvolatile("" ::"r"(x10):"x10");// expected-error {{conflicts with asm clobber list}}
asmvolatile("" ::"r"(x10):"a0");// expected-error {{conflicts with asm clobber list}}
asmvolatile("":"=r"(x10) ::"x10");// expected-error {{conflicts with asm clobber list}}
asmvolatile("":"=r"(x10) ::"a0");// expected-error {{conflicts with asm clobber list}}
}