Skip to content

Commit 2dc746b

Browse files
committed
Add more tests
1 parent c954784 commit 2dc746b

File tree

1 file changed

+66
-4
lines changed

1 file changed

+66
-4
lines changed

flang/test/Lower/CUDA/cuda-device-proc.cuf

Lines changed: 66 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,20 +199,82 @@ end subroutine
199199
! CHECK: %[[ATOMIC:.*]] = llvm.cmpxchg %[[CAST]], %[[BCAST1]], %[[BCAST2]] acq_rel monotonic : !llvm.ptr, i64
200200
! CHECK: %[[RES:.*]] = llvm.extractvalue %[[ATOMIC]][1] : !llvm.struct<(i64, i1)>
201201

202-
203-
attributes(global) subroutine __ldXX(b)
202+
attributes(global) subroutine __ldXXi4(b)
204203
integer, device :: b(*)
205204
integer, device :: x(4)
206-
207205
x(1:4) = __ldca(b(i:j))
208206
x = __ldcg(b(i:j))
209207
x = __ldcs(b(i:j))
210208
x(1:4) = __ldlu(b(i:j))
211209
x(1:4) = __ldcv(b(i:j))
212210
end
213211

214-
! CHECK-LABEL: func.func @_QP__ldxx
212+
! CHECK-LABEL: func.func @_QP__ldxxi4
215213
! CHECK: __ldca_i4x4
216214
! CHECK: __ldcg_i4x4
217215
! CHECK: __ldcs_i4x4
218216
! CHECK: __ldlu_i4x4
217+
218+
attributes(global) subroutine __ldXXi8(b)
219+
integer(8), device :: b(*)
220+
integer(8), device :: x(2)
221+
x(1:2) = __ldca(b(i:j))
222+
x = __ldcg(b(i:j))
223+
x = __ldcs(b(i:j))
224+
x(1:2) = __ldlu(b(i:j))
225+
x(1:2) = __ldcv(b(i:j))
226+
end
227+
228+
! CHECK-LABEL: func.func @_QP__ldxxi8
229+
! CHECK: __ldca_i8x2
230+
! CHECK: __ldcg_i8x2
231+
! CHECK: __ldcs_i8x2
232+
! CHECK: __ldlu_i8x2
233+
234+
attributes(global) subroutine __ldXXr4(b)
235+
real, device :: b(*)
236+
real, device :: x(4)
237+
x(1:4) = __ldca(b(i:j))
238+
x = __ldcg(b(i:j))
239+
x = __ldcs(b(i:j))
240+
x(1:4) = __ldlu(b(i:j))
241+
x(1:4) = __ldcv(b(i:j))
242+
end
243+
244+
! CHECK-LABEL: func.func @_QP__ldxxr4
245+
! CHECK: __ldca_r4x4
246+
! CHECK: __ldcg_r4x4
247+
! CHECK: __ldcs_r4x4
248+
! CHECK: __ldlu_r4x4
249+
250+
attributes(global) subroutine __ldXXr2(b)
251+
real(2), device :: b(*)
252+
real(2), device :: x(2)
253+
x(1:2) = __ldca(b(i:j))
254+
x = __ldcg(b(i:j))
255+
x = __ldcs(b(i:j))
256+
x(1:2) = __ldlu(b(i:j))
257+
x(1:2) = __ldcv(b(i:j))
258+
end
259+
260+
! CHECK-LABEL: func.func @_QP__ldxxr2
261+
! CHECK: __ldca_r2x2
262+
! CHECK: __ldcg_r2x2
263+
! CHECK: __ldcs_r2x2
264+
! CHECK: __ldlu_r2x2
265+
266+
attributes(global) subroutine __ldXXr8(b)
267+
real(8), device :: b(*)
268+
real(8), device :: x(2)
269+
x(1:2) = __ldca(b(i:j))
270+
x = __ldcg(b(i:j))
271+
x = __ldcs(b(i:j))
272+
x(1:2) = __ldlu(b(i:j))
273+
x(1:2) = __ldcv(b(i:j))
274+
end
275+
276+
! CHECK-LABEL: func.func @_QP__ldxxr8
277+
! CHECK: __ldca_r8x2
278+
! CHECK: __ldcg_r8x2
279+
! CHECK: __ldcs_r8x2
280+
! CHECK: __ldlu_r8x2

0 commit comments

Comments
 (0)