Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Flang] Add test for omp target teams distribute #814

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions test/smoke-fort/teams-distribute-no-parallel/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
include ../../Makefile.defs

TESTNAME = main
TESTSRC_MAIN = main.f95
TESTSRC_AUX =
TESTSRC_ALL = $(TESTSRC_MAIN) $(TESTSRC_AUX)

FLANG ?= flang-new
OMP_BIN = $(AOMP)/bin/$(FLANG)
CC = $(OMP_BIN) $(VERBOSE)
#-ccc-print-phases
#"-\#\#\#"

include ../Makefile.rules
26 changes: 26 additions & 0 deletions test/smoke-fort/teams-distribute-no-parallel/main.f95
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
program main
integer :: hostArray(10), errors = 0
do i = 1, 10
hostArray(i) = 0
end do
call writeIndex(hostArray)
do i = 1, 10
if ( hostArray(i) /= i ) then
errors = errors + 1
end if
end do
if ( errors /= 0 ) then
stop 1
end if
print*, "======= FORTRAN Test passed! ======="
end program main
subroutine writeIndex(int_array)
integer :: int_array(*)
!$omp target teams distribute map(tofrom:int_array(1:10))
do index_ = 1, 10
int_array(index_) = index_
end do
!$omp end target teams distribute

end subroutine writeIndex