File: intrinsic-error.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (154 lines) | stat: -rw-r--r-- 4,193 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
; RUN: not llc --mtriple=loongarch32 < %s 2>&1 | FileCheck %s
; RUN: not llc --mtriple=loongarch64 < %s 2>&1 | FileCheck %s

declare void @llvm.loongarch.dbar(i32)
declare void @llvm.loongarch.ibar(i32)
declare void @llvm.loongarch.break(i32)
declare void @llvm.loongarch.movgr2fcsr(i32, i32)
declare i32 @llvm.loongarch.movfcsr2gr(i32)
declare void @llvm.loongarch.syscall(i32)
declare i32 @llvm.loongarch.csrrd.w(i32 immarg)
declare i32 @llvm.loongarch.csrwr.w(i32, i32 immarg)
declare i32 @llvm.loongarch.csrxchg.w(i32, i32, i32 immarg)

define void @dbar_imm_out_of_hi_range() #0 {
; CHECK: llvm.loongarch.dbar: argument out of range.
entry:
  call void @llvm.loongarch.dbar(i32 32769)
  ret void
}

define void @dbar_imm_out_of_lo_range() #0 {
; CHECK: llvm.loongarch.dbar: argument out of range.
entry:
  call void @llvm.loongarch.dbar(i32 -1)
  ret void
}

define void @ibar_imm_out_of_hi_range() #0 {
; CHECK: llvm.loongarch.ibar: argument out of range.
entry:
  call void @llvm.loongarch.ibar(i32 32769)
  ret void
}

define void @ibar_imm_out_of_lo_range() #0 {
; CHECK: llvm.loongarch.ibar: argument out of range.
entry:
  call void @llvm.loongarch.ibar(i32 -1)
  ret void
}

define void @break_imm_out_of_hi_range() #0 {
; CHECK: llvm.loongarch.break: argument out of range.
entry:
  call void @llvm.loongarch.break(i32 32769)
  ret void
}

define void @break_imm_out_of_lo_range() #0 {
; CHECK: llvm.loongarch.break: argument out of range.
entry:
  call void @llvm.loongarch.break(i32 -1)
  ret void
}

define void @movgr2fcsr(i32 %a) nounwind {
; CHECK: llvm.loongarch.movgr2fcsr: requires basic 'f' target feature.
entry:
  call void @llvm.loongarch.movgr2fcsr(i32 1, i32 %a)
  ret void
}

define void @movgr2fcsr_imm_out_of_hi_range(i32 %a) #0 {
; CHECK: llvm.loongarch.movgr2fcsr: argument out of range.
entry:
  call void @llvm.loongarch.movgr2fcsr(i32 32, i32 %a)
  ret void
}

define void @movgr2fcsr_imm_out_of_lo_range(i32 %a) #0 {
; CHECK: llvm.loongarch.movgr2fcsr: argument out of range.
entry:
  call void @llvm.loongarch.movgr2fcsr(i32 -1, i32 %a)
  ret void
}

define i32 @movfcsr2gr() nounwind {
; CHECK: llvm.loongarch.movfcsr2gr: requires basic 'f' target feature.
entry:
  %res = call i32 @llvm.loongarch.movfcsr2gr(i32 1)
  ret i32 %res
}

define i32 @movfcsr2gr_imm_out_of_hi_range() #0 {
; CHECK: llvm.loongarch.movfcsr2gr: argument out of range.
entry:
  %res = call i32 @llvm.loongarch.movfcsr2gr(i32 32)
  ret i32 %res
}

define i32 @movfcsr2gr_imm_out_of_lo_range() #0 {
; CHECK: llvm.loongarch.movfcsr2gr: argument out of range.
entry:
  %res = call i32 @llvm.loongarch.movfcsr2gr(i32 -1)
  ret i32 %res
}

define void @syscall_imm_out_of_hi_range() #0 {
; CHECK: llvm.loongarch.syscall: argument out of range.
entry:
  call void @llvm.loongarch.syscall(i32 32769)
  ret void
}

define void @syscall_imm_out_of_lo_range() #0 {
; CHECK: llvm.loongarch.syscall: argument out of range.
entry:
  call void @llvm.loongarch.syscall(i32 -1)
  ret void
}

define i32 @csrrd_w_imm_out_of_hi_range() #0 {
; CHECK: llvm.loongarch.csrrd.w: argument out of range.
entry:
  %0 = call i32 @llvm.loongarch.csrrd.w(i32 16384)
  ret i32 %0
}

define i32 @csrrd_w_imm_out_of_lo_range() #0 {
; CHECK: llvm.loongarch.csrrd.w: argument out of range.
entry:
  %0 = call i32 @llvm.loongarch.csrrd.w(i32 -1)
  ret i32 %0
}

define i32 @csrwr_w_imm_out_of_hi_range(i32 %a) #0 {
; CHECK: llvm.loongarch.csrwr.w: argument out of range.
entry:
  %0 = call i32 @llvm.loongarch.csrwr.w(i32 %a, i32 16384)
  ret i32 %0
}

define i32 @csrwr_w_imm_out_of_lo_range(i32 %a) #0 {
; CHECK: llvm.loongarch.csrwr.w: argument out of range.
entry:
  %0 = call i32 @llvm.loongarch.csrwr.w(i32 %a, i32 -1)
  ret i32 %0
}

define i32 @csrxchg_w_imm_out_of_hi_range(i32 %a, i32 %b) #0 {
; CHECK: llvm.loongarch.csrxchg.w: argument out of range.
entry:
  %0 = call i32 @llvm.loongarch.csrxchg.w(i32 %a, i32 %b, i32 16384)
  ret i32 %0
}

define i32 @csrxchg_w_imm_out_of_lo_range(i32 %a, i32 %b) #0 {
; CHECK: llvm.loongarch.csrxchg.w: argument out of range.
entry:
  %0 = call i32 @llvm.loongarch.csrxchg.w(i32 %a, i32 %b, i32 -1)
  ret i32 %0
}

attributes #0 = { nounwind "target-features"="+f" }