1 ; RUN: not llc --mtriple=loongarch32 < %s 2>&1 | FileCheck %s
2 ; RUN: not llc --mtriple=loongarch64 < %s 2>&1 | FileCheck %s
4 declare void @llvm.loongarch.dbar(i32)
5 declare void @llvm.loongarch.ibar(i32)
6 declare void @llvm.loongarch.break(i32)
7 declare void @llvm.loongarch.movgr2fcsr(i32, i32)
8 declare i32 @llvm.loongarch.movfcsr2gr(i32)
9 declare void @llvm.loongarch.syscall(i32)
10 declare i32 @llvm.loongarch.csrrd.w(i32 immarg)
11 declare i32 @llvm.loongarch.csrwr.w(i32, i32 immarg)
12 declare i32 @llvm.loongarch.csrxchg.w(i32, i32, i32 immarg)
14 define void @dbar_imm_out_of_hi_range() #0 {
15 ; CHECK: llvm.loongarch.dbar: argument out of range.
17 call void @llvm.loongarch.dbar(i32 32769)
21 define void @dbar_imm_out_of_lo_range() #0 {
22 ; CHECK: llvm.loongarch.dbar: argument out of range.
24 call void @llvm.loongarch.dbar(i32 -1)
28 define void @ibar_imm_out_of_hi_range() #0 {
29 ; CHECK: llvm.loongarch.ibar: argument out of range.
31 call void @llvm.loongarch.ibar(i32 32769)
35 define void @ibar_imm_out_of_lo_range() #0 {
36 ; CHECK: llvm.loongarch.ibar: argument out of range.
38 call void @llvm.loongarch.ibar(i32 -1)
42 define void @break_imm_out_of_hi_range() #0 {
43 ; CHECK: llvm.loongarch.break: argument out of range.
45 call void @llvm.loongarch.break(i32 32769)
49 define void @break_imm_out_of_lo_range() #0 {
50 ; CHECK: llvm.loongarch.break: argument out of range.
52 call void @llvm.loongarch.break(i32 -1)
56 define void @movgr2fcsr(i32 %a) nounwind {
57 ; CHECK: llvm.loongarch.movgr2fcsr: requires basic 'f' target feature.
59 call void @llvm.loongarch.movgr2fcsr(i32 1, i32 %a)
63 define void @movgr2fcsr_imm_out_of_hi_range(i32 %a) #0 {
64 ; CHECK: llvm.loongarch.movgr2fcsr: argument out of range.
66 call void @llvm.loongarch.movgr2fcsr(i32 32, i32 %a)
70 define void @movgr2fcsr_imm_out_of_lo_range(i32 %a) #0 {
71 ; CHECK: llvm.loongarch.movgr2fcsr: argument out of range.
73 call void @llvm.loongarch.movgr2fcsr(i32 -1, i32 %a)
77 define i32 @movfcsr2gr() nounwind {
78 ; CHECK: llvm.loongarch.movfcsr2gr: requires basic 'f' target feature.
80 %res = call i32 @llvm.loongarch.movfcsr2gr(i32 1)
84 define i32 @movfcsr2gr_imm_out_of_hi_range() #0 {
85 ; CHECK: llvm.loongarch.movfcsr2gr: argument out of range.
87 %res = call i32 @llvm.loongarch.movfcsr2gr(i32 32)
91 define i32 @movfcsr2gr_imm_out_of_lo_range() #0 {
92 ; CHECK: llvm.loongarch.movfcsr2gr: argument out of range.
94 %res = call i32 @llvm.loongarch.movfcsr2gr(i32 -1)
98 define void @syscall_imm_out_of_hi_range() #0 {
99 ; CHECK: llvm.loongarch.syscall: argument out of range.
101 call void @llvm.loongarch.syscall(i32 32769)
105 define void @syscall_imm_out_of_lo_range() #0 {
106 ; CHECK: llvm.loongarch.syscall: argument out of range.
108 call void @llvm.loongarch.syscall(i32 -1)
112 define i32 @csrrd_w_imm_out_of_hi_range() #0 {
113 ; CHECK: llvm.loongarch.csrrd.w: argument out of range.
115 %0 = call i32 @llvm.loongarch.csrrd.w(i32 16384)
119 define i32 @csrrd_w_imm_out_of_lo_range() #0 {
120 ; CHECK: llvm.loongarch.csrrd.w: argument out of range.
122 %0 = call i32 @llvm.loongarch.csrrd.w(i32 -1)
126 define i32 @csrwr_w_imm_out_of_hi_range(i32 %a) #0 {
127 ; CHECK: llvm.loongarch.csrwr.w: argument out of range.
129 %0 = call i32 @llvm.loongarch.csrwr.w(i32 %a, i32 16384)
133 define i32 @csrwr_w_imm_out_of_lo_range(i32 %a) #0 {
134 ; CHECK: llvm.loongarch.csrwr.w: argument out of range.
136 %0 = call i32 @llvm.loongarch.csrwr.w(i32 %a, i32 -1)
140 define i32 @csrxchg_w_imm_out_of_hi_range(i32 %a, i32 %b) #0 {
141 ; CHECK: llvm.loongarch.csrxchg.w: argument out of range.
143 %0 = call i32 @llvm.loongarch.csrxchg.w(i32 %a, i32 %b, i32 16384)
147 define i32 @csrxchg_w_imm_out_of_lo_range(i32 %a, i32 %b) #0 {
148 ; CHECK: llvm.loongarch.csrxchg.w: argument out of range.
150 %0 = call i32 @llvm.loongarch.csrxchg.w(i32 %a, i32 %b, i32 -1)
154 attributes #0 = { nounwind "target-features"="+f" }