brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.1 KiB · 176e3f6 Raw
155 lines · plain
1; RUN: not llc --mtriple=loongarch32 < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LA322; RUN: not llc --mtriple=loongarch64 < %s 2>&1 | FileCheck %s3 4declare void @llvm.loongarch.dbar(i32)5declare void @llvm.loongarch.ibar(i32)6declare void @llvm.loongarch.break(i32)7declare void @llvm.loongarch.movgr2fcsr(i32, i32)8declare i32 @llvm.loongarch.movfcsr2gr(i32)9declare void @llvm.loongarch.syscall(i32)10declare i32 @llvm.loongarch.csrrd.w(i32 immarg)11declare i32 @llvm.loongarch.csrwr.w(i32, i32 immarg)12declare i32 @llvm.loongarch.csrxchg.w(i32, i32, i32 immarg)13 14define void @dbar_imm_out_of_hi_range() #0 {15; CHECK: llvm.loongarch.dbar: argument out of range.16entry:17  call void @llvm.loongarch.dbar(i32 32769)18  ret void19}20 21define void @dbar_imm_out_of_lo_range() #0 {22; CHECK: llvm.loongarch.dbar: argument out of range.23entry:24  call void @llvm.loongarch.dbar(i32 -1)25  ret void26}27 28define void @ibar_imm_out_of_hi_range() #0 {29; CHECK: llvm.loongarch.ibar: argument out of range.30entry:31  call void @llvm.loongarch.ibar(i32 32769)32  ret void33}34 35define void @ibar_imm_out_of_lo_range() #0 {36; CHECK: llvm.loongarch.ibar: argument out of range.37entry:38  call void @llvm.loongarch.ibar(i32 -1)39  ret void40}41 42define void @break_imm_out_of_hi_range() #0 {43; CHECK: llvm.loongarch.break: argument out of range.44entry:45  call void @llvm.loongarch.break(i32 32769)46  ret void47}48 49define void @break_imm_out_of_lo_range() #0 {50; CHECK: llvm.loongarch.break: argument out of range.51entry:52  call void @llvm.loongarch.break(i32 -1)53  ret void54}55 56define void @movgr2fcsr(i32 %a) nounwind {57; LA32: llvm.loongarch.movgr2fcsr: requires basic 'f' target feature.58entry:59  call void @llvm.loongarch.movgr2fcsr(i32 1, i32 %a)60  ret void61}62 63define void @movgr2fcsr_imm_out_of_hi_range(i32 %a) #0 {64; CHECK: llvm.loongarch.movgr2fcsr: argument out of range.65entry:66  call void @llvm.loongarch.movgr2fcsr(i32 32, i32 %a)67  ret void68}69 70define void @movgr2fcsr_imm_out_of_lo_range(i32 %a) #0 {71; CHECK: llvm.loongarch.movgr2fcsr: argument out of range.72entry:73  call void @llvm.loongarch.movgr2fcsr(i32 -1, i32 %a)74  ret void75}76 77define i32 @movfcsr2gr() nounwind {78; LA32: llvm.loongarch.movfcsr2gr: requires basic 'f' target feature.79entry:80  %res = call i32 @llvm.loongarch.movfcsr2gr(i32 1)81  ret i32 %res82}83 84define i32 @movfcsr2gr_imm_out_of_hi_range() #0 {85; CHECK: llvm.loongarch.movfcsr2gr: argument out of range.86entry:87  %res = call i32 @llvm.loongarch.movfcsr2gr(i32 32)88  ret i32 %res89}90 91define i32 @movfcsr2gr_imm_out_of_lo_range() #0 {92; CHECK: llvm.loongarch.movfcsr2gr: argument out of range.93entry:94  %res = call i32 @llvm.loongarch.movfcsr2gr(i32 -1)95  ret i32 %res96}97 98define void @syscall_imm_out_of_hi_range() #0 {99; CHECK: llvm.loongarch.syscall: argument out of range.100entry:101  call void @llvm.loongarch.syscall(i32 32769)102  ret void103}104 105define void @syscall_imm_out_of_lo_range() #0 {106; CHECK: llvm.loongarch.syscall: argument out of range.107entry:108  call void @llvm.loongarch.syscall(i32 -1)109  ret void110}111 112define i32 @csrrd_w_imm_out_of_hi_range() #0 {113; CHECK: llvm.loongarch.csrrd.w: argument out of range.114entry:115  %0 = call i32 @llvm.loongarch.csrrd.w(i32 16384)116  ret i32 %0117}118 119define i32 @csrrd_w_imm_out_of_lo_range() #0 {120; CHECK: llvm.loongarch.csrrd.w: argument out of range.121entry:122  %0 = call i32 @llvm.loongarch.csrrd.w(i32 -1)123  ret i32 %0124}125 126define i32 @csrwr_w_imm_out_of_hi_range(i32 %a) #0 {127; CHECK: llvm.loongarch.csrwr.w: argument out of range.128entry:129  %0 = call i32 @llvm.loongarch.csrwr.w(i32 %a, i32 16384)130  ret i32 %0131}132 133define i32 @csrwr_w_imm_out_of_lo_range(i32 %a) #0 {134; CHECK: llvm.loongarch.csrwr.w: argument out of range.135entry:136  %0 = call i32 @llvm.loongarch.csrwr.w(i32 %a, i32 -1)137  ret i32 %0138}139 140define i32 @csrxchg_w_imm_out_of_hi_range(i32 %a, i32 %b) #0 {141; CHECK: llvm.loongarch.csrxchg.w: argument out of range.142entry:143  %0 = call i32 @llvm.loongarch.csrxchg.w(i32 %a, i32 %b, i32 16384)144  ret i32 %0145}146 147define i32 @csrxchg_w_imm_out_of_lo_range(i32 %a, i32 %b) #0 {148; CHECK: llvm.loongarch.csrxchg.w: argument out of range.149entry:150  %0 = call i32 @llvm.loongarch.csrxchg.w(i32 %a, i32 %b, i32 -1)151  ret i32 %0152}153 154attributes #0 = { nounwind "target-features"="+f" }155