Skip to content
Open
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
19 changes: 19 additions & 0 deletions test/smoke-fort-dev/llvm-180493/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#NOOPT = 1
#NOOMP = 1
#OMP_FLAGS = -DNO_OMP
include ../../Makefile.defs

TESTNAME = equiv
TESTSRC_MAIN = equiv.f90
TESTSRC_ALL = $(TESTSRC_MAIN)

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

RUNCMD = ./equiv

include ../Makefile.rules
54 changes: 54 additions & 0 deletions test/smoke-fort-dev/llvm-180493/equiv.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
program equiv
use omp_lib
implicit none
common/ba/ a,b,c
integer :: a,b,c
integer :: x,y,z

integer, parameter :: nthreads = 4
integer :: i
integer :: chk

logical :: failed

!$omp threadprivate(/ba/)

equivalence (x,a)
equivalence (y,a)

failed = .false.

!$omp parallel num_threads(nthreads) shared(failed) private(chk)
x = 21
chk = 21
!$omp masked filter(1)
x = 42
chk = 42
!$omp end masked

!$omp masked filter(2)
y = 10
chk = 10
!$omp end masked

!$omp barrier

a = a + omp_get_thread_num()
chk = chk + omp_get_thread_num()

!$omp barrier
do i = 0, nthreads-1
if (omp_get_thread_num() == i) then
print '(I3,I5)', omp_get_thread_num(), a
if (chk /= a) then
failed = .true.
end if
end if
!$omp barrier
end do
!$omp end parallel

if (failed) then
stop 1
end if
end program equiv