From 252e064bf61c48684a520978c90438f09c975b95 Mon Sep 17 00:00:00 2001 From: Dan Palermo Date: Mon, 29 Sep 2025 09:17:18 -0500 Subject: [PATCH] [smoke-fort-dev] Add chk tests for new flags/features --- test/smoke-fort-dev/chk-ffast-ama/Makefile | 18 ++++++++ test/smoke-fort-dev/chk-ffast-ama/test.f90 | 1 + test/smoke-fort-dev/chk-ffast-fmod/Makefile | 18 ++++++++ test/smoke-fort-dev/chk-ffast-fmod/test.f90 | 1 + .../chk-intdo-permutation/Makefile | 19 +++++++++ .../intdo-permutation.f90 | 42 +++++++++++++++++++ test/smoke-fort-dev/chk-intdo/Makefile | 19 +++++++++ test/smoke-fort-dev/chk-intdo/intdo.f90 | 31 ++++++++++++++ 8 files changed, 149 insertions(+) create mode 100644 test/smoke-fort-dev/chk-ffast-ama/Makefile create mode 100644 test/smoke-fort-dev/chk-ffast-ama/test.f90 create mode 100644 test/smoke-fort-dev/chk-ffast-fmod/Makefile create mode 100644 test/smoke-fort-dev/chk-ffast-fmod/test.f90 create mode 100644 test/smoke-fort-dev/chk-intdo-permutation/Makefile create mode 100644 test/smoke-fort-dev/chk-intdo-permutation/intdo-permutation.f90 create mode 100644 test/smoke-fort-dev/chk-intdo/Makefile create mode 100644 test/smoke-fort-dev/chk-intdo/intdo.f90 diff --git a/test/smoke-fort-dev/chk-ffast-ama/Makefile b/test/smoke-fort-dev/chk-ffast-ama/Makefile new file mode 100644 index 000000000..e10113255 --- /dev/null +++ b/test/smoke-fort-dev/chk-ffast-ama/Makefile @@ -0,0 +1,18 @@ +NOOPT = 1 +NOOMP = 1 +OMP_FLAGS = -DNO_OMP +include ../../Makefile.defs + +TESTNAME = test +TESTSRC_MAIN = test.f90 +TESTSRC_AUX = +TESTSRC_ALL = $(TESTSRC_MAIN) $(TESTSRC_AUX) + +FLANG ?= flang +OMP_BIN = $(AOMP)/bin/$(FLANG) +CFLAGS = -ffast-amd-memory-allocator +CC = $(OMP_BIN) $(VERBOSE) +#-ccc-print-phases +#"-\#\#\#" + +include ../Makefile.rules diff --git a/test/smoke-fort-dev/chk-ffast-ama/test.f90 b/test/smoke-fort-dev/chk-ffast-ama/test.f90 new file mode 100644 index 000000000..a6a9baf65 --- /dev/null +++ b/test/smoke-fort-dev/chk-ffast-ama/test.f90 @@ -0,0 +1 @@ +end diff --git a/test/smoke-fort-dev/chk-ffast-fmod/Makefile b/test/smoke-fort-dev/chk-ffast-fmod/Makefile new file mode 100644 index 000000000..d6d784667 --- /dev/null +++ b/test/smoke-fort-dev/chk-ffast-fmod/Makefile @@ -0,0 +1,18 @@ +NOOPT = 1 +NOOMP = 1 +OMP_FLAGS = -DNO_OMP +include ../../Makefile.defs + +TESTNAME = test +TESTSRC_MAIN = test.f90 +TESTSRC_AUX = +TESTSRC_ALL = $(TESTSRC_MAIN) $(TESTSRC_AUX) + +FLANG ?= flang +OMP_BIN = $(AOMP)/bin/$(FLANG) +CFLAGS = -ffast-real-mod +CC = $(OMP_BIN) $(VERBOSE) +#-ccc-print-phases +#"-\#\#\#" + +include ../Makefile.rules diff --git a/test/smoke-fort-dev/chk-ffast-fmod/test.f90 b/test/smoke-fort-dev/chk-ffast-fmod/test.f90 new file mode 100644 index 000000000..a6a9baf65 --- /dev/null +++ b/test/smoke-fort-dev/chk-ffast-fmod/test.f90 @@ -0,0 +1 @@ +end diff --git a/test/smoke-fort-dev/chk-intdo-permutation/Makefile b/test/smoke-fort-dev/chk-intdo-permutation/Makefile new file mode 100644 index 000000000..b7e5a75cd --- /dev/null +++ b/test/smoke-fort-dev/chk-intdo-permutation/Makefile @@ -0,0 +1,19 @@ +# NOOPT = 1 +# NOOMP = 1 +# OMP_FLAGS = -DNO_OMP +include ../../Makefile.defs + +TESTNAME = intdo-permutation +TESTSRC_MAIN = intdo-permutation.f90 +TESTSRC_AUX = +TESTSRC_ALL = $(TESTSRC_MAIN) $(TESTSRC_AUX) + +FLANG ?= flang +OMP_BIN = $(AOMP)/bin/$(FLANG) +CC = $(OMP_BIN) $(VERBOSE) +#-ccc-print-phases +#"-\#\#\#" + +RUNCMD = ./$(TESTNAME) 2>&1 | $(FILECHECK) $(TESTSRC_MAIN) + +include ../Makefile.rules diff --git a/test/smoke-fort-dev/chk-intdo-permutation/intdo-permutation.f90 b/test/smoke-fort-dev/chk-intdo-permutation/intdo-permutation.f90 new file mode 100644 index 000000000..a8a8e7f35 --- /dev/null +++ b/test/smoke-fort-dev/chk-intdo-permutation/intdo-permutation.f90 @@ -0,0 +1,42 @@ + +! RUN: %flang %flags %openmp_flags -fopenmp-version=60 %s -o %t.exe +! RUN: %t.exe | FileCheck %s --match-full-lines + +program interchange_intdo + integer :: i, j + print *, 'do' + + !$OMP INTERCHANGE PERMUTATION(2,3,1) + do i = 7, 15, 3 + do j = -1, 1, 2 + do k = 3, 1, -1 + print '("i=", I0, " j=", I0, " k=", I0)', i, j, k + end do + end do + end do + !$OMP END INTERCHANGE + + print *, 'done' +end program + + +! CHECK: do +! CHECK-NEXT: i=7 j=-1 k=3 +! CHECK-NEXT: i=10 j=-1 k=3 +! CHECK-NEXT: i=13 j=-1 k=3 +! CHECK-NEXT: i=7 j=-1 k=2 +! CHECK-NEXT: i=10 j=-1 k=2 +! CHECK-NEXT: i=13 j=-1 k=2 +! CHECK-NEXT: i=7 j=-1 k=1 +! CHECK-NEXT: i=10 j=-1 k=1 +! CHECK-NEXT: i=13 j=-1 k=1 +! CHECK-NEXT: i=7 j=1 k=3 +! CHECK-NEXT: i=10 j=1 k=3 +! CHECK-NEXT: i=13 j=1 k=3 +! CHECK-NEXT: i=7 j=1 k=2 +! CHECK-NEXT: i=10 j=1 k=2 +! CHECK-NEXT: i=13 j=1 k=2 +! CHECK-NEXT: i=7 j=1 k=1 +! CHECK-NEXT: i=10 j=1 k=1 +! CHECK-NEXT: i=13 j=1 k=1 +! CHECK-NEXT: done diff --git a/test/smoke-fort-dev/chk-intdo/Makefile b/test/smoke-fort-dev/chk-intdo/Makefile new file mode 100644 index 000000000..a65f4567d --- /dev/null +++ b/test/smoke-fort-dev/chk-intdo/Makefile @@ -0,0 +1,19 @@ +# NOOPT = 1 +# NOOMP = 1 +# OMP_FLAGS = -DNO_OMP +include ../../Makefile.defs + +TESTNAME = intdo +TESTSRC_MAIN = intdo.f90 +TESTSRC_AUX = +TESTSRC_ALL = $(TESTSRC_MAIN) $(TESTSRC_AUX) + +FLANG ?= flang +OMP_BIN = $(AOMP)/bin/$(FLANG) +CC = $(OMP_BIN) $(VERBOSE) +#-ccc-print-phases +#"-\#\#\#" + +RUNCMD = ./$(TESTNAME) 2>&1 | $(FILECHECK) $(TESTSRC_MAIN) + +include ../Makefile.rules diff --git a/test/smoke-fort-dev/chk-intdo/intdo.f90 b/test/smoke-fort-dev/chk-intdo/intdo.f90 new file mode 100644 index 000000000..fe6820f41 --- /dev/null +++ b/test/smoke-fort-dev/chk-intdo/intdo.f90 @@ -0,0 +1,31 @@ + +! RUN: %flang %flags %openmp_flags -fopenmp-version=60 %s -o %t.exe +! RUN: %t.exe | FileCheck %s --match-full-lines + +program interchange_intdo + integer :: i, j + print *, 'do' + + !$OMP INTERCHANGE + do i = 7, 15, 3 + do j = -1, 1 + print '("i=", I0, " j=", I0)', i, j + end do + end do + !$OMP END INTERCHANGE + + print *, 'done' +end program + + +! CHECK: do +! CHECK-NEXT: i=7 j=-1 +! CHECK-NEXT: i=10 j=-1 +! CHECK-NEXT: i=13 j=-1 +! CHECK-NEXT: i=7 j=0 +! CHECK-NEXT: i=10 j=0 +! CHECK-NEXT: i=13 j=0 +! CHECK-NEXT: i=7 j=1 +! CHECK-NEXT: i=10 j=1 +! CHECK-NEXT: i=13 j=1 +! CHECK-NEXT: done