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

[smoke-fort-limbo] Add openmp-ver test #1070

Merged
merged 2 commits into from
Sep 28, 2024
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
3 changes: 2 additions & 1 deletion test/smoke-fort-limbo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ TESTS_DIR = \
flang-444386 \
flang-474712 \
iso_fortran_env_impl \
iso_fortran_env_impl2
iso_fortran_env_impl2 \
openmp-ver

all:
@for test_dir in $(TESTS_DIR); do \
Expand Down
18 changes: 18 additions & 0 deletions test/smoke-fort-limbo/openmp-ver/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
include ../../Makefile.defs

TESTNAME = test
TESTSRC_MAIN = test.f90
TESTSRC_AUX =
TESTSRC_ALL = $(TESTSRC_MAIN) $(TESTSRC_AUX)

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

RUNENV = AOMP_GPU=${AOMP_GPU} FLANG=${FLANG}
RUNCMD = ./doit.sh

include ../Makefile.rules
45 changes: 45 additions & 0 deletions test/smoke-fort-limbo/openmp-ver/doit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash

echo "Verifying initial test"
exp=202111 # OpenMP 5.2 release date
echo " Saw:"
grep "var1 = " test
echo " Expected: $exp"
grep "var1 = $exp" test
mystat=$?
echo " status: $mystat"
allstat=$(($allstat+$mystat))

echo "Checking all other flags"
declare -A flags=(
[-fopenmp]=202111 # no specific version specified
[-fopenmp-version=11]=199911
[-fopenmp-version=20]=200011
[-fopenmp-version=25]=200505
[-fopenmp-version=30]=200805
[-fopenmp-version=31]=201107
[-fopenmp-version=40]=201307
[-fopenmp-version=45]=201511
[-fopenmp-version=50]=201811
[-fopenmp-version=51]=202011
[-fopenmp-version=52]=202111
)

IFS=$'\n' skeys=($(sort <<<"${!flags[@]}"))
unset IFS

for flag in ${skeys[@]}; do
cmd="${AOMP}/bin/${FLANG} -fopenmp $flag -cpp -E test.f90"
exp=${flags[$flag]}
echo $cmd
echo " Saw:"
$cmd | grep "var1 = "
echo " Expected: $exp"
$cmd | grep "var1 = $exp"
mystat=$?
echo " status: $mystat"
allstat=$(($allstat+$mystat))
done

echo "allstat: $allstat"
exit $allstat
2 changes: 2 additions & 0 deletions test/smoke-fort-limbo/openmp-ver/test.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
integer :: var1 = _OPENMP
end