xref: /llvm-project/clang/test/CodeGen/LoongArch/inline-asm-constraints-error.c (revision 394f30919a029331ebdfe02c180bd1586c0d9ace)
1 // RUN: not %clang_cc1 -triple loongarch32 -O2 -emit-llvm %s 2>&1 -o - | FileCheck %s
2 // RUN: not %clang_cc1 -triple loongarch64 -O2 -emit-llvm %s 2>&1 -o - | FileCheck %s
3 
test_l(void)4 void test_l(void) {
5 // CHECK: :[[#@LINE+1]]:27: error: value '32768' out of range for constraint 'l'
6   asm volatile ("" :: "l"(32768));
7 // CHECK: :[[#@LINE+1]]:27: error: value '-32769' out of range for constraint 'l'
8   asm volatile ("" :: "l"(-32769));
9 }
10 
test_I(void)11 void test_I(void) {
12 // CHECK: :[[#@LINE+1]]:27: error: value '2048' out of range for constraint 'I'
13   asm volatile ("" :: "I"(2048));
14 // CHECK: :[[#@LINE+1]]:27: error: value '-2049' out of range for constraint 'I'
15   asm volatile ("" :: "I"(-2049));
16 }
17 
test_K(void)18 void test_K(void) {
19 // CHECK: :[[#@LINE+1]]:27: error: value '4096' out of range for constraint 'K'
20   asm volatile ("" :: "K"(4096));
21 // CHECK: :[[#@LINE+1]]:27: error: value '-1' out of range for constraint 'K'
22   asm volatile ("" :: "K"(-1));
23 }
24