Skip to content

Commit 8c63cf0

Browse files
[NFC][OpenMP][Flang] Add test for OpenMP target parallel do
Added test which proves that end-to-end compilation of omp target parallel do costruct is successful for Flang compiler.
1 parent b120dae commit 8c63cf0

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
! Basic offloading test with a target region
2+
! REQUIRES: flang
3+
! UNSUPPORTED: nvptx64-nvidia-cuda-LTO
4+
! UNSUPPORTED: aarch64-unknown-linux-gnu
5+
! UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
6+
! UNSUPPORTED: x86_64-pc-linux-gnu
7+
! UNSUPPORTED: x86_64-pc-linux-gnu-LTO
8+
9+
! RUN: %libomptarget-compile-fortran-run-and-check-generic
10+
program main
11+
use omp_lib
12+
integer :: x(100)
13+
integer :: errors = 0
14+
integer :: i
15+
16+
!$omp target parallel do map(from: x)
17+
do i = 1, 100
18+
x(i) = i
19+
end do
20+
!$omp end target parallel do
21+
do i = 1, 100
22+
if ( x(i) .ne. i ) then
23+
errors = errors + 1
24+
end if
25+
end do
26+
27+
print *,"number of errors: ", errors
28+
29+
end program main
30+
31+
! CHECK: number of errors: 0

0 commit comments

Comments
 (0)