${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
)
-add_subdirectory(Semantics)
-
set(FLANG_TEST_PARAMS
flang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py)
${CMAKE_CURRENT_BINARY_DIR}
PARAMS ${FLANG_TEST_PARAMS}
DEPENDS ${FLANG_TEST_DEPENDS}
- )
+)
set_target_properties(check-flang PROPERTIES FOLDER "Tests")
add_lit_testsuites(FLANG ${CMAKE_CURRENT_SOURCE_DIR}
-! RUN: %S/test_folding.sh %s %flang %t
+! RUN: %S/test_folding.sh %s %t %f18
! Test intrinsic operation folding
-! RUN: %S/test_folding.sh %s %flang %t
+! RUN: %S/test_folding.sh %s %t %f18
! Check intrinsic function folding with host runtime library
module m
-! RUN: %S/test_folding.sh %s %flang %t
+! RUN: %S/test_folding.sh %s %t %f18
! Test operation folding edge case (both expected value and messages)
! These tests make assumptions regarding real(4) and integer(4) extrema.
-! RUN: %S/test_folding.sh %s %flang %t
+! RUN: %S/test_folding.sh %s %t %f18
! Test intrinsic function folding edge case (both expected value and messages)
! These tests make assumptions regarding real(4) extrema.
-! RUN: %S/test_folding.sh %s %flang %t
+! RUN: %S/test_folding.sh %s %t %f18
! Test transformational intrinsic function folding
module m
-! RUN: %S/test_folding.sh %s %flang %t
+! RUN: %S/test_folding.sh %s %t %f18
! Test numeric model inquiry intrinsics
module m
-! RUN: %S/test_folding.sh %s %flang %t
+! RUN: %S/test_folding.sh %s %t %f18
! Test folding of LBOUND and UBOUND
module m
-! RUN: %S/test_folding.sh %s %flang %t
+! RUN: %S/test_folding.sh %s %t %f18
! Test folding of IS_CONTIGUOUS on simply contiguous items (9.5.4)
! When IS_CONTIGUOUS() is constant, it's .TRUE.
# - test_x is not folded (it is neither .true. nor .false.). This means the
# compiler could not fold the expression.
-CMD="$2 -fdebug-dump-symbols -fparse-only"
-
if [[ $# < 3 ]]; then
- echo "Usage: $0 <fortran-source> <f18-executable> <temp test dir>"
+ echo "Usage: $0 <fortran-source> <temp test dir> <f18-executable>"
exit 1
fi
src=$1
[[ ! -f $src ]] && echo "File not found: $src" && exit 1
+shift
-temp=$3
+temp=$1
mkdir -p $temp
+shift
+
+CMD="$* -fdebug-dump-symbols -fparse-only"
# Check if tests should assume folding is using libpgmath
if [[ $LIBPGMATH ]]; then
-! RUN: %f18_with_includes -fdebug-pre-fir-tree -fparse-only %s | FileCheck %s
+! RUN: %f18 -fdebug-pre-fir-tree -fparse-only %s | FileCheck %s
! Test Pre-FIR Tree captures all the coarray related statements
+++ /dev/null
-configure_file(test_errors.sh.in ${FLANG_BINARY_DIR}/test/Semantics/test_errors.sh @ONLY)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check for semantic errors in ALLOCATE statements
! Creating a symbol that allocate should accept
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check for semantic errors in ALLOCATE statements
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check for semantic errors in ALLOCATE statements
subroutine C933_a(b1, ca3, ca4, cp3, cp3mold, cp4, cp7, cp8, bsrc)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check for semantic errors in ALLOCATE statements
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check for semantic errors in ALLOCATE statements
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check for semantic errors in ALLOCATE statements
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check for semantic errors in ALLOCATE statements
subroutine C936(param_ca_4_assumed, param_ta_4_assumed, param_ca_4_deferred)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check for semantic errors in ALLOCATE statements
subroutine C945_a(srca, srcb, srcc, src_complex, src_logical, &
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check for semantic errors in ALLOCATE statements
subroutine C946(param_ca_4_assumed, param_ta_4_assumed, param_ca_4_deferred)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check for semantic errors in ALLOCATE statements
!TODO: mixing expr and source-expr?
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check for semantic errors in ALLOCATE statements
! TODO: Function Pointer in allocate and derived types!
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check for semantic errors in ALLOCATE statements
subroutine C941_C942b_C950(xsrc, x1, a2, b2, cx1, ca2, cb1, cb2, c1)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check for semantic errors in ALLOCATE statements
module not_iso_fortran_env
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check calls with alt returns
CALL TEST (N, *100, *200 )
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check subroutine with alt return
SUBROUTINE TEST (N, *, *)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check for various alt return error conditions
SUBROUTINE TEST (N, *, *)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Functions cannot use alt return
REAL FUNCTION altreturn01(X)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test extension: RETURN from main program
return !ok
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! 10.2.3.1(2) All masks and LHS of assignments in a WHERE must conform
subroutine s1
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Pointer assignment constraints 10.2.2.2
module m1
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Pointer assignment constraints 10.2.2.2 (see also assign02.f90)
module m
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! 9.4.5
subroutine s1
type :: t(k, l)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test ASSIGN statement, assigned GOTO, and assigned format labels
! (see subclause 8.2.4 in Fortran 90 (*not* 2018!)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test ASSIGN statement, assigned GOTO, and assigned format labels
! (see subclause 8.2.4 in Fortran 90 (*not* 2018!)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Forward references to derived types (error cases)
! C732 A parent-type-name shall be the name of a previously defined
! extensible type (7.5.7).
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Confirm enforcement of constraints and restrictions in 7.5.7.3
! and C733, C734 and C779, C780, C781, C782, C783, C784, and C785.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test BLOCK DATA subprogram (14.3)
block data foo
!ERROR: IMPORT is not allowed in a BLOCK DATA subprogram
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C1107 -- COMMON, EQUIVALENCE, INTENT, NAMELIST, OPTIONAL, VALUE or
! STATEMENT FUNCTIONS not allow in specification part
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C1108 -- Save statement in a BLOCK construct shall not conatin a
! saved-entity-list that does not specify a common-block-name
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Tests implemented for this standard:
! Block Construct
! C1109
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Enforce 18.2.3.3
program test
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Confirm enforcement of constraints and restrictions in 15.6.2.1
non_recursive function f01(n) result(res)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! 15.5.1 procedure reference constraints and restrictions
subroutine s01(elem, subr)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test 15.5.2.4 constraints and restrictions for non-POINTER non-ALLOCATABLE
! dummy arguments.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test 8.5.10 & 8.5.18 constraints on dummy argument declarations
module m
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test 15.5.2.5 constraints and restrictions for POINTER & ALLOCATABLE
! arguments when both sides of the call have the same attributes.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test 15.5.2.6 constraints and restrictions for ALLOCATABLE
! dummy arguments.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test 15.5.2.7 constraints and restrictions for POINTER dummy arguments.
module m
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test 15.5.2.8 coarray dummy arguments
module m
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test 15.5.2.9(2,3,5) dummy procedure requirements
module m
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test 15.7 (C1583-C1590, C1592-C1599) constraints and restrictions
! for pure procedures.
! (C1591 is tested in call11.f90; C1594 in call12.f90.)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test 15.7 C1591 & others: contexts requiring pure subprograms
module m
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test 15.7 C1594 - prohibited assignments in pure subprograms
module used
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test 15.4.2.2 constraints and restrictions for calls to implicit
! interfaces
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test 8.5.18 constraints on the VALUE attribute
module m
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C711 An assumed-type actual argument that corresponds to an assumed-rank
! dummy argument shall be assumed-shape or assumed-rank.
subroutine s(arg1, arg2, arg3)
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! negative test -- invalid labels, out of range
! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! negative test -- invalid labels, out of range
! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! negative test -- invalid labels, out of range
! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
! CHECK-NOT: do [1-9]
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
! XXXEXEC: ${F18} -fopenmp -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
! CHECK-NOT: do *[1-9]
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! EXEC: ${F18} -fopenmp -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
! CHECK-NOT: do *[1-9]
! CHECK: omp simd
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! Error test -- DO loop uses obsolete loop termination statement
! See R1131 and C1131
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! Error test -- DO loop uses obsolete loop termination statement
! See R1131 and C1133
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! Error test -- DO loop uses obsolete loop termination statement
! See R1131 and C1133
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! Error test -- DO loop uses obsolete loop termination statement
! See R1131 and C1133
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! Error test -- DO loop uses obsolete loop termination statement
! See R1131 and C1133
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! Error test -- DO loop uses obsolete loop termination statement
! See R1131 and C1133
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! Error test -- DO loop uses obsolete loop termination statement
! See R1131 and C1133
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! Error test -- DO loop uses obsolete loop termination statement
! See R1131 and C1133
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! Error test -- DO loop uses obsolete loop termination statement
! See R1131 and C1133
-! RUN: %S/test_any.sh %s %f18 %t
+! RUN: %S/test_any.sh %s %t %f18
! Error test -- DO loop uses obsolete loop termination statement
! See R1131 and C1133
! By default, this is not an error and label do are rewritten to non-label do.
! A warning is generated with -Mstandard
-! EXEC: ${F18} -funparse-with-symbols -Mstandard -I../../include/flang %s 2>&1 | ${FileCheck} %s
+! EXEC: ${F18} -funparse-with-symbols -Mstandard %s 2>&1 | ${FileCheck} %s
! CHECK: end do
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! Error test -- DO loop uses obsolete loop termination statement
! See R1131 and C1133
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! Error test -- DO loop uses obsolete loop termination statement
! See R1131 and C1133
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! Check that if there is a label or a name on an label-do-stmt,
! then it is not lost when rewriting it to an non-label-do-stmt.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test SELECT CASE Constraints: C1145, C1146, C1147, C1148, C1149
program selectCaseProg
implicit none
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test selector and team-value in CHANGE TEAM statement
! OK
# Common functionality for test scripts
# Process arguments, expecting source file as 1st; optional path to f18 as 2nd
-# Set: $F18 to the path to f18; $temp to an empty temp directory; $src
-# to the full path of the single source argument; and $USER_OPTIONS to the
-# option list given in the $src file after string "OPTIONS:"
+# Set: $F18 to the path to f18 with options; $temp to an empty temp directory;
+# and $src to the full path of the single source argument.
function die {
echo "$(basename $0): $*" >&2
exit 1
}
if [[ $# < 3 ]]; then
- echo "Usage: $(basename $0) <fortran-source> <f18-executable> <temp test dir>"
+ echo "Usage: $(basename $0) <fortran-source> <temp test dir> <f18-command>"
exit 1
fi
case $1 in
- (/*) src=$1 ;;
- (*) src=$(dirname $0)/$1 ;;
+ (/*) src="$1" ;;
+ (*) src="$(dirname $0)/$1" ;;
esac
-USER_OPTIONS=`sed -n 's/^ *! *OPTIONS: *//p' $src`
-echo $USER_OPTIONS
-F18=$2
-[[ ! -f $F18 ]] && die "f18 executable not found: $F18"
-temp=$3
+shift
+temp=$1
mkdir -p $temp
+shift
+
+[[ ! -f $1 ]] && die "f18 executable not found: $1"
+F18="$*"
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C718 Each named constant in a complex literal constant shall be of type
! integer or real.
subroutine s()
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check that a basic computed goto compiles
INTEGER, DIMENSION (2) :: B
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check that computed goto express must be a scalar integer expression
! TODO: PGI, for example, accepts a float & converts the value to int.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
!C1117
subroutine test1(a, i)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
!C1118
subroutine test1
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
!C1119
subroutine test1(a, i)
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
! CHECK-NOT: Control flow escapes from CRITICAL
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
!Test for checking data constraints, C882-C887
module m1
type person
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check that expressions are analyzed in data statements
subroutine s1
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
!Testing data constraints : C874 - C875, C878 - C881
module m
integer, target :: modarray(1)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test that DEALLOCATE works
INTEGER, PARAMETER :: maxvalue=1024
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check for type errors in DEALLOCATE statements
INTEGER, PARAMETER :: maxvalue=1024
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check for semantic errors in DEALLOCATE statements
Module share
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C1141
! A reference to the procedure IEEE_SET_HALTING_MODE ! from the intrinsic
! module IEEE_EXCEPTIONS, shall not ! appear within a DO CONCURRENT construct.
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! negative tests: we don't want DO CONCURRENT semantics constraints checked
! when the loops are not DO CONCURRENT
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
! CHECK: Control flow escapes from DO CONCURRENT
! CHECK: branch into loop body from outside
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! C1122 The index-name shall be a named scalar variable of type integer.
! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
! CHECK: Must have INTEGER type, but is REAL\\(4\\)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C1167 -- An exit-stmt shall not appear within a DO CONCURRENT construct if
! it belongs to that construct or an outer construct.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C1167 -- An exit-stmt shall not appear within a DO CONCURRENT construct if
! it belongs to that construct or an outer construct.
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
! CHECK-NOT: exit from DO CONCURRENT construct
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C1140 -- A statement that might result in the deallocation of a polymorphic
! entity shall not appear within a DO CONCURRENT construct.
module m1
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C1131 -- check valid and invalid DO loop naming
PROGRAM C1131
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C1121 -- any procedure referenced in a concurrent header must be pure
! Also, check that the step expressions are not zero. This is prohibited by
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18 -Mstandard -Werror
+
! Issue 458 -- semantic checks for a normal DO loop. The DO variable
! and the initial, final, and step expressions must be INTEGER if the
! options for standard conformance and turning warnings into errors
! messages for the cases where REAL and DOUBLE PRECISION variables
! and expressions are used in the DO controls.
-!OPTIONS: -Mstandard -Werror
-
! C1120 -- DO variable (and associated expressions) must be INTEGER.
! This is extended by allowing REAL and DOUBLE PRECISION
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C1123 -- Expressions in DO CONCURRENT header cannot reference variables
! declared in the same header
PROGRAM dosemantics04
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test DO loop semantics for constraint C1130 --
! The constraint states that "If the locality-spec DEFAULT ( NONE ) appears in a
! DO CONCURRENT statement; a variable that is a local or construct entity of a
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C1131, C1133 -- check valid and invalid DO loop naming
! C1131 (R1119) If the do-stmt of a do-construct specifies a do-construct-name,
! the corresponding end-do shall be an end-do-stmt specifying the same
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
!C1132
! If the do-stmt is a nonlabel-do-stmt, the corresponding end-do shall be an
! end-do-stmt.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C1138 --
! A branch (11.2) within a DO CONCURRENT construct shall not have a branch
! target that is outside the construct.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
!C1129
!A variable that is referenced by the scalar-mask-expr of a
!concurrent-header or by any concurrent-limit or concurrent-step in that
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C1134 A CYCLE statement must be within a DO construct
!
! C1166 An EXIT statement must be within a DO construct
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C1135 A cycle-stmt shall not appear within a CHANGE TEAM, CRITICAL, or DO
! CONCURRENT construct if it belongs to an outer construct.
!
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
!
! Licensed under the Apache License, Version 2.0 (the "License");
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Tests valid and invalid ENTRY statements
module m1
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
subroutine s1
integer i, j
real r(2)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C1003 - can't parenthesize function call returning procedure pointer
module m1
type :: dt
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test specification expressions
module m
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
subroutine forall1
real :: a(9)
!ERROR: 'i' is already declared in this scoping unit
-!RUN: %S/test_any.sh %s %flang %t
+!RUN: %S/test_any.sh %s %t %f18
! Tests -fget-definition returning source position of symbol definition.
module m1
private :: f
-!RUN: %S/test_any.sh %s %flang %t
+!RUN: %S/test_any.sh %s %t %f18
! Tests -fget-definition with fixed form.
module m2
private :: f
! Tests -fget-definition with INCLUDE
-!RUN: %S/test_any.sh %s %flang %t
+!RUN: %S/test_any.sh %s %t %f18
INCLUDE "Inputs/getdefinition03-b.f90"
program main
-!RUN: %S/test_any.sh %s %flang %t
+!RUN: %S/test_any.sh %s %t %f18
! Tests -fget-definition with COMMON block with same name as variable.
program main
integer :: x
-!RUN: %S/test_any.sh %s %flang %t
+!RUN: %S/test_any.sh %s %t %f18
! Tests -fget-symbols-sources with BLOCK that contains same variable name as
! another in an outer scope.
program main
-!RUN: %S/test_any.sh %s %flang %t
+!RUN: %S/test_any.sh %s %t %f18
! Tests -fget-symbols-sources finding all symbols in file.
module mm1
private :: f
-!RUN: %S/test_any.sh '%S/Inputs/getsymbols02-*' %f18 %t
\ No newline at end of file
+!RUN: %S/test_any.sh '%S/Inputs/getsymbols02-*' %t %f18
! Tests -fget-symbols with INCLUDE
-!RUN: %S/test_any.sh %s %flang %t
+!RUN: %S/test_any.sh %s %t %f18
INCLUDE "Inputs/getsymbols03-b.f90"
program main
-!RUN: %S/test_any.sh %s %flang %t
+!RUN: %S/test_any.sh %s %t %f18
! Tests -fget-symbols-sources with COMMON.
program main
integer :: x
-!RUN: %S/test_any.sh %s %flang %t
+!RUN: %S/test_any.sh %s %t %f18
! Tests -fget-symbols-sources with COMMON.
program main
integer :: x
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check that a basic arithmetic if compiles.
if ( A ) 100, 200, 300
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check that only labels are allowed in arithmetic if statements.
! TODO: Revisit error message "expected 'ASSIGN'" etc.
! TODO: Revisit error message "expected one of '0123456789'"
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
!ERROR: Label '600' was not found
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Make sure arithmetic if expressions are non-complex numeric exprs.
INTEGER I
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Simple check that if constructs are ok.
if (a < b) then
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check that if constructs only accept scalar logical expressions.
! TODO: expand the test to check this restriction for more types.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Simple check that if statements are ok.
IF (A > 0.0) A = LOG (A)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
!ERROR: IF statement is not allowed in IF statement
IF (A > 0.0) IF (B < 0.0) A = LOG (A)
END
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check that non-logical expressions are not allowed.
! Check that non-scalar expressions are not allowed.
! TODO: Insure all non-logicals are prohibited.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
subroutine s1
implicit none
!ERROR: More than one IMPLICIT NONE statement
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
subroutine s1
implicit none
!ERROR: IMPLICIT statement after IMPLICIT NONE or IMPLICIT NONE(TYPE) statement
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
subroutine s1
implicit integer(a-z)
!ERROR: IMPLICIT NONE statement after IMPLICIT statement
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
subroutine s
parameter(a=1.0)
!ERROR: IMPLICIT NONE statement after PARAMETER statement
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
subroutine s
!ERROR: 'a' does not follow 'b' alphabetically
implicit integer(b-a)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
subroutine s1
implicit integer(a-c)
!ERROR: More than one implicit type specified for 'c'
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
implicit none(external)
external x
call x
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
subroutine s1
block
!ERROR: IMPLICIT statement is not allowed in a BLOCK construct
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Object pointer initializer error tests
subroutine test(j)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Fortran syntax considers signed int literals in complex literals
! to be a distinct production, not an application of unary +/- to
! an unsigned int literal, so they're used here to test overflow
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
character(len=20) :: access = "direcT"
character(len=20) :: access_(2) = (/"direcT", "streaM"/)
character(len=20) :: action_(2) = (/"reaD ", "writE"/)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
integer :: unit10 = 10
integer :: unit11 = 11
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
character(kind=1,len=50) internal_file
character(kind=2,len=50) internal_file2
character(kind=4,len=50) internal_file4
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
character(kind=1,len=50) internal_file
character(kind=1,len=100) msg
character(20) sign
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
character*20 c(25), cv
character(kind=1,len=59) msg
logical*2 v(5), lv
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
character(kind=1,len=100) msg1
character(kind=2,len=200) msg2
integer(1) stat1
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
1001 format(A)
!ERROR: Format statement must be labeled
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
write(*,*)
write(*,'()')
write(*,'(A)')
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
!ERROR: String edit descriptor in READ format expression
read(*,'("abc")')
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-!OPTIONS: -Mstandard
+! RUN: %S/test_errors.sh %s %t %f18 -Mstandard
write(*, '(B0)')
write(*, '(B3)')
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
!DEF: /MainProgram1/jk1 ObjectEntity INTEGER(1)
integer(kind=1) jk1
!DEF: /MainProgram1/js1 ObjectEntity INTEGER(1)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C712 The value of scalar-int-constant-expr shall be nonnegative and
! shall specify a representation method that exists on the processor.
! C714 The value of kind-param shall be nonnegative.
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
!DEF: /MainProgram1/ipdt DerivedType
!DEF: /MainProgram1/ipdt/k TypeParam INTEGER(4)
type :: ipdt(k)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C716 If both kind-param and exponent-letter appear, exponent-letter
! shall be E.
! C717 The value of kind-param shall specify an approximation method that
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! EXEC: ${F18} -funparse-with-symbols %s -o /dev/null 2>&1 | grep -v 'procedure conflicts' | ${FileCheck} %s
! CHECK-NOT: error:[[:space:]]
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! negative test -- invalid labels, out of range
! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! negative test -- invalid labels, out of range
! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! negative test -- invalid labels, out of range
! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! negative test -- invalid labels, out of range
! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! negative test -- invalid labels, out of range
! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! negative test -- invalid labels, out of range
! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! negative test -- invalid labels, out of range
! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
! CHECK: Label '60' was not found
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
! CHECK: '60' not a FORMAT
! CHECK: data transfer use of '60'
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
! CHECK: BLOCK DATA subprogram name mismatch
! CHECK: should be
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
! CHECK: expected end of statement
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
! CHECK: branch into loop body from outside
! CHECK: the loop branched into
-! RUN: %S/test_any.sh %s %flang %t
+! RUN: %S/test_any.sh %s %t %f18
! Tests implemented for this standard
! 11.1.4 - 4 It is permissible to branch to and end-block-stmt only withinh its
! Block Construct
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Miscellaneous constraint and requirement checking on declarations:
! - 8.5.6.2 & 8.5.6.3 constraints on coarrays
! - 8.5.19 constraints on the VOLATILE attribute
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Check correct modfile generation for type with private component.
module m
integer :: i
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Check modfile generation for private type in public API.
module m
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Check modfile generation with use-association.
module m1
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! modfile with subprograms
module m1
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Use-association with VOLATILE or ASYNCHRONOUS
module m1
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Check modfile generation for external interface
module m
interface
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Check modfile generation for generic interfaces
module m1
interface foo
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Check modfile generation for external declarations
module m
real, external :: a
-!RUN: %S/test_modfile.sh '%S/Inputs/modfile09-*' %f18 %t
+!RUN: %S/test_modfile.sh '%S/Inputs/modfile09-*' %t %f18
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Test writing procedure bindings in a derived type.
module m
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
module m
type t1(a, b, c)
integer, kind :: a
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
module m
integer(8), parameter :: a = 1, b = 2_8
parameter(n=3,l=-3,e=1.0/3.0)
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
module m
character(2) :: z
character(len=3) :: y
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
module m
type t1
contains
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
module m
type :: t
procedure(a), pointer, pass :: c
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
module m
character(2), parameter :: prefix = 'c_'
integer, bind(c, name='c_a') :: a
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Tests parameterized derived type instantiation with KIND parameters
module m
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Tests folding of array constructors
module m
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
module m
implicit complex(8)(z)
real :: x
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Test modfiles for entities with initialization
module m
integer, parameter :: k8 = 8
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
module m
logical b
bind(C) :: /cb2/
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Test character length conversions in constructors
module m
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Test that subprogram interfaces get all of the symbols that they need.
module m1
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Test declarations with coarray-spec
! Different ways of declaring the same coarray.
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Test compile-time analysis of shapes.
module m1
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Intrinsics SELECTED_INT_KIND, SELECTED_REAL_KIND, PRECISION, RANGE,
! RADIX, DIGITS
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Test folding of combined array references and structure component
! references.
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Test UTF-8 support in character literals
! Note: Module files are encoded in UTF-8.
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Check that implicitly typed entities get a type in the module file.
module m
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Verify miscellaneous bugs
! The function result must be declared after the dummy arguments
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Test 7.6 enum values
module m1
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Resolution of generic names in expressions.
! Test by using generic function in a specification expression that needs
! to be written to a .mod file.
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18 -flogical-abbreviations -fxor-operator
+
! Resolution of user-defined operators in expressions.
! Test by using generic function in a specification expression that needs
! to be written to a .mod file.
-!OPTIONS: -flogical-abbreviations -fxor-operator
-
! Numeric operators
module m1
type :: t
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
! Test resolution of type-bound generics.
module m1
-! RUN: %S/test_modfile.sh %s %f18 %t
+! RUN: %S/test_modfile.sh %s %t %f18
module m1
type :: t1
contains
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test for checking namelist constraints, C8103-C8105
module dup
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! NULL() intrinsic function error tests
subroutine test
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test that NULLIFY works
Module share
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Check for semantic errors in NULLIFY statements
INTEGER, PARAMETER :: maxvalue=1024
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-! OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
! Check OpenMP 2.13.6 atomic Construct
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-! OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
! Check OpenMP clause validity for the following directives:
!
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-! OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
program main
implicit none
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-! OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
! Check OpenMP declarative directives
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-! OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
! Check OpenMP clause validity for the following directives:
! 2.10 Device constructs
program main
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-! OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
! Check the association between OpenMPLoopConstruct and DoConstruct
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-! OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
! Check OpenMP 2.17 Nesting of Regions
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
! 2.4 An array section designates a subset of the elements in an array. Although
! Substring shares similar syntax but cannot be treated as valid array section.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
! Test the effect to name resolution from illegal clause
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
! 2.15.3 Although variables in common blocks can be accessed by use association
! or host association, common block names cannot. As a result, a common block
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
! 2.15.3 Data-Sharing Attribute Clauses
! A list item that specifies a given variable may not appear in more than
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
! 2.15.3 Data-Sharing Attribute Clauses
! 2.15.3.1 default Clause
-! RUN: %S/test_symbols.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_symbols.sh %s %t %f18 -fopenmp
! Test clauses that accept list.
! 2.1 Directive Format
-! RUN: %S/test_symbols.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_symbols.sh %s %t %f18 -fopenmp
! 1.4.1 Structure of the OpenMP Memory Model
-! RUN: %S/test_symbols.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_symbols.sh %s %t %f18 -fopenmp
! 1.4.1 Structure of the OpenMP Memory Model
! In the inner OpenMP region, SHARED `a` refers to the `a` in the outer OpenMP
-! RUN: %S/test_symbols.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_symbols.sh %s %t %f18 -fopenmp
! 2.15.3 Data-Sharing Attribute Clauses
! Both PARALLEL and DO (worksharing) directives need to create new scope,
-! RUN: %S/test_symbols.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_symbols.sh %s %t %f18 -fopenmp
! 2.15.2 threadprivate Directive
! The threadprivate directive specifies that variables are replicated,
-! RUN: %S/test_symbols.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_symbols.sh %s %t %f18 -fopenmp
! 2.15.3 Data-Sharing Attribute Clauses
! A list item that specifies a given variable may not appear in more than
-! RUN: %S/test_symbols.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_symbols.sh %s %t %f18 -fopenmp
! Generic tests
! 1. subroutine or function calls should not be fixed for DSA or DMA
-! RUN: %S/test_symbols.sh %s %flang %t
-!OPTIONS: -fopenmp
+! RUN: %S/test_symbols.sh %s %t %f18 -fopenmp
! 2.15.1.1 Predetermined rules for associated do-loops index variable
! a) The loop iteration variable(s) in the associated do-loop(s) of a do,
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
! Tests for "proc-interface" semantics.
! These cases are all valid.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
integer :: x
!ERROR: The type of 'x' has already been declared
real :: x
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
subroutine s
!ERROR: Declaration of 'x' conflicts with its use as internal procedure
real :: x
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
implicit none
integer :: x
!ERROR: No explicit type declared for 'y'
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
!ERROR: No explicit type declared for 'f'
function f()
implicit none
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
program p
integer :: p ! this is ok
end
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
implicit none
allocatable :: x
integer :: x
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
subroutine s1
integer :: x(2)
!ERROR: The dimensions of 'x' have already been declared
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
integer :: g(10)
f(i) = i + 1 ! statement function
g(i) = i + 2 ! mis-parsed array assignment
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
integer :: y
procedure() :: a
procedure(real) :: b
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m
public
type t
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m
public i
integer, private :: j
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m1
end
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m1
integer :: x
integer, private :: y
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m1
integer :: x
integer :: y
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m
real :: var
interface i
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m
interface
subroutine sub0
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m
integer :: foo
!Note: PGI, Intel, and GNU allow this; NAG and Sun do not
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m1
implicit none
contains
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m
interface a
subroutine s(x)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m
abstract interface
subroutine foo
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
subroutine s1
type :: t
integer :: i
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
subroutine s1
!OK: interface followed by type with same name
interface t
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m
type :: t
real :: y
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
subroutine test1
!ERROR: Generic interface 'foo' has both a function and a subroutine
interface foo
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m
interface foo
subroutine s1(x)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m1
interface
module subroutine s()
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m
interface
module subroutine s()
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
subroutine s
type t
end type
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m
type t1
end type
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
subroutine s1
integer x
block
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C735 If EXTENDS appears, SEQUENCE shall not appear.
! C738 The same private-or-sequence shall not appear more than once in a
! given derived-type-def .
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m2
public s2, s4
private s3
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Derived type parameters
! C731 The same type-param-name shall not appear more than once in a given
! derived-type-stmt.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Extended derived types
module m1
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Construct names
subroutine s1
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C1568 The procedure-name shall have been declared to be a separate module
! procedure in the containing program unit or an ancestor of that program unit.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C701 The type-param-value for a kind type parameter shall be a constant
! expression. This constraint looks like a mistake in the standard.
integer, parameter :: k = 8
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C772
module m1
type t1
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
subroutine s1
implicit none
real(8) :: x = 2.0
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
subroutine s1
namelist /nl/x
block
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m
implicit none
real, parameter :: a = 8.0
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
subroutine s1
!ERROR: Array 'z' without ALLOCATABLE or POINTER attribute must have explicit shape
common x, y(4), z(:)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Error tests for structure constructors.
! Errors caught by expression resolution are tested elsewhere; these are the
! errors meant to be caught by name resolution, as well as acceptable use
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Error tests for recursive use of derived types.
! C744 If neither the POINTER nor the ALLOCATABLE attribute is specified, the
! declaration-type-spec in the component-def-stmt shall specify an intrinsic
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
function f1(x, y)
integer x
!ERROR: SAVE attribute may not be applied to dummy argument 'x'
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C1030 - pointers to intrinsic procedures
program main
intrinsic :: cos ! a specific & generic intrinsic name
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m1
!ERROR: Logical constant '.true.' may not be used as a defined operator
interface operator(.TRUE.)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test correct use-association of a derived type.
module m1
implicit none
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test section subscript
program p1
real :: a(10,10)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test coarray association in CHANGE TEAM statement
subroutine s1
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test SELECT TYPE errors: C1157
subroutine s1()
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Tests for C760:
! The passed-object dummy argument shall be a scalar, nonpointer, nonallocatable
! dummy data object with the same declared type as the type being defined;
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! 15.4.3.4.5 Restrictions on generic declarations
! Specific procedures of generic interfaces must be distinguishable.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Tests based on examples in C.10.6
! C.10.6(10)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Tests for C1128:
! A variable-name that appears in a LOCAL or LOCAL_INIT locality-spec shall not
! have the ALLOCATABLE; INTENT (IN); or OPTIONAL attribute; shall not be of
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test that associations constructs can be correctly combined. The intrinsic
! functions are not what is tested here, they are only use to reveal the types
! of local variables.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Tests for the last sentence of C1128:
!A variable-name that is not permitted to appear in a variable definition
!context shall not appear in a LOCAL or LOCAL_INIT locality-spec.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
subroutine s1(x, y)
!ERROR: Array pointer 'x' must have deferred shape or assumed rank
real, pointer :: x(1:) ! C832
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Testing 15.6.2.2 point 4 (What function-name refers to depending on the
! presence of RESULT).
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Testing 7.6 enum
! OK
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
program p1
integer(8) :: a, b, c, d
pointer(a, b)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Resolve generic based on number of arguments
subroutine s1
interface f
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Invalid operand types when user-defined operator is available
module m1
type :: t
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
-!OPTIONS: -flogical-abbreviations -fxor-operator
+! RUN: %S/test_errors.sh %s %t %f18 -flogical-abbreviations -fxor-operator
! Like m4 in resolve63 but compiled with different options.
! Alternate operators are enabled so treat these as intrinsic.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test restrictions on what subprograms can be used for defined assignment.
module m1
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test that user-defined assignment is used in the right places
module m1
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test restrictions on what subprograms can be used for defined operators.
! See: 15.4.3.4.2
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Test resolution of type-bound generics.
module m1
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
subroutine s1()
! C701 (R701) The type-param-value for a kind type parameter shall be a
! constant expression.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C703 (R702) The derived-type-spec shall not specify an abstract type (7.5.7).
! This constraint refers to the derived-type-spec in a type-spec. A type-spec
! can appear in an ALLOCATE statement, an ac-spec for an array constructor, and
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C708 An entity declared with the CLASS keyword shall be a dummy argument
! or have the ALLOCATABLE or POINTER attribute.
subroutine s()
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C709 An assumed-type entity shall be a dummy data object that does not have
! the ALLOCATABLE, CODIMENSION, INTENT (OUT), POINTER, or VALUE attribute and
! is not an explicit-shape array.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C721 A type-param-value of * shall be used only
! * to declare a dummy argument,
! * to declare a named constant,
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C722 A function name shall not be declared with an asterisk type-param-value
! unless it is of type CHARACTER and is the name of a dummy function or the
! name of the result of an external function.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C726 The length specified for a character statement function or for a
! statement function dummy argument of type character shall be a constant
! expression.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! 15.6.2.5(3)
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Tests valid and invalid usage of forward references to procedures
! in specification expressions.
module m
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m
! C743 No component-attr-spec shall appear more than once in a
! given component-def-stmt.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m
! C755 The same proc-component-attr-spec shall not appear more than once in a
! given proc-component-def-stmt.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m
!C778 The same binding-attr shall not appear more than once in a given
!binding-attr-list.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C801 The same attr-spec shall not appear more than once in a given
! type-declaration-stmt.
!
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C815 An entity shall not be explicitly given any attribute more than once in
! a scoping unit.
!
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m
! For C1543
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C729 A derived type type-name shall not be DOUBLEPRECISION or the same as
! the name of any intrinsic type defined in this document.
subroutine s()
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
module m
! C730 The same type-attr-spec shall not appear more than once in a given
! derived-type-stmt.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C736 If EXTENDS appears and the type being defined has a coarray ultimate
! component, its parent type shall have a coarray ultimate component.
!
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C737 If EXTENDS appears and the type being defined has a potential
! subobject component of type EVENT_TYPE or LOCK_TYPE from the intrinsic
! module ISO_FORTRAN_ENV, its parent type shall be EVENT_TYPE or LOCK_TYPE
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C746, C747, and C748
module m
use ISO_FORTRAN_ENV
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! C750 Each bound in the explicit-shape-spec shall be a specification
! expression in which there are no references to specification functions or
! the intrinsic functions ALLOCATED, ASSOCIATED, EXTENDS_- TYPE_OF, PRESENT,
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
+
!Tests for SELECT RANK Construct(R1148)
program select_rank
implicit none
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
+
!Shape analysis related tests for SELECT RANK Construct(R1148)
program select_rank
implicit none
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! case 1: ma_create_new_fun' was not declared a separate module procedure
module m1
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! When a module subprogram has the MODULE prefix the following must match
! with the corresponding separate module procedure interface body:
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
program main
implicit none
integer :: i = -1
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Error tests for structure constructors.
! Errors caught by name resolution are tested elsewhere; these are the
! errors meant to be caught by expression semantic analysis, as well as
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Error tests for structure constructors: per-component type
! (in)compatibility.
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Error tests for structure constructors: C1594 violations
! from assigning globally-visible data to POINTER components.
! test/Semantics/structconst04.f90 is this same test without type
-! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
+! RUN: %S/test_errors.sh %s %t %f18
! Error tests for structure constructors: C1594 violations
! from assigning globally-visible data to POINTER components.
! This test is structconst03.f90 with the type parameters removed.
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
! Test that intent-stmt and subprogram prefix and suffix are resolved.
!DEF: /m Module
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
! Test host association in module subroutine and internal subroutine.
!DEF: /m Module
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
! Test host association in internal subroutine of main program.
!DEF: /main MainProgram
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
! Explicit and implicit entities in blocks
!DEF: /s1 (Subroutine) Subprogram
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
!DEF: /main MainProgram
program main
!DEF: /main/t1 DerivedType
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
!DEF: /main MainProgram
program main
implicit complex(z)
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
!DEF: /main MainProgram
program main
!DEF: /main/x POINTER ObjectEntity REAL(4)
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
!DEF: /s1 (Subroutine) Subprogram
subroutine s1
!DEF: /s1/a ObjectEntity REAL(4)
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
!DEF: /m1 Module
module m1
contains
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
!DEF: /s1 (Subroutine) Subprogram
subroutine s1
implicit none
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
! Verify that SAVE attribute is propagated by EQUIVALENCE
!DEF: /s1 (Subroutine) Subprogram
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
! Old-style "*length" specifiers (R723)
!DEF: /f1 (Function) Subprogram CHARACTER(1_8,1)
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
! "Bare" uses of type parameters and components
!DEF: /MainProgram1/t1 DerivedType
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
! Forward references in pointer initializers and TBP bindings.
!DEF: /m Module
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
! Statement functions
!DEF: /p1 MainProgram
-! RUN: %S/test_symbols.sh %s %flang %t
+! RUN: %S/test_symbols.sh %s %t %f18
! Forward references to derived types (non-error cases)
!DEF: /main MainProgram
}
gr=0
-for input in $1; do
+for input in $src; do
[[ ! -f $input ]] && die "File not found: $input"
CMD=$(cat ${input} | egrep '^[[:space:]]*![[:space:]]*EXEC:[[:space:]]*' | sed -e 's/^[[:space:]]*![[:space:]]*EXEC:[[:space:]]*//')
CMD=$(echo ${CMD} | sed -e "s:%s:${input}:g")
# Change the compiler by setting the F18 environment variable.
F18_OPTIONS="-fdebug-resolve-names -fparse-only"
-srcdir="@CMAKE_CURRENT_SOURCE_DIR@"
+srcdir=$(dirname $0)
source $srcdir/common.sh
[[ ! -f $src ]] && die "File not found: $src"
expect=$temp/expect
diffs=$temp/diffs
-include="@FLANG_INTRINSIC_MODULES_DIR@"
-cmd="$F18 $F18_OPTIONS $USER_OPTIONS -I$include $src"
+cmd="$F18 $F18_OPTIONS $src"
( cd $temp; $cmd ) > $log 2>&1
if [[ $? -ge 128 ]]; then
cat $log
(
cd $temp
ls -1 *.mod > prev_files
- $F18 $F18_OPTIONS $USER_OPTIONS $src
+ $F18 $F18_OPTIONS $src
ls -1 *.mod | comm -13 prev_files -
) > $actual_files
expected_files=$(sed -n 's/^!Expect: \(.*\)/\1/p' $src | sort)
$src > $src1
egrep -v '![DR]EF:' $src1 > $src2 # strip out DEF and REF comments
# compile, inserting comments for symbols:
-( cd $temp; $F18 $F18_OPTIONS $USER_OPTIONS $(basename $src2) ) > $src3
+( cd $temp; $F18 $F18_OPTIONS $(basename $src2) ) > $src3
if diff -w -U999999 $src1 $src3 > $diffs; then
echo PASS
if config.llvm_tools_dir != config.flang_llvm_tools_dir :
llvm_config.with_environment('PATH', config.flang_llvm_tools_dir, append_path=True)
-config.substitutions.append(('%B', config.flang_obj_root))
-
# For each occurrence of a flang tool name, replace it with the full path to
# the build directory holding that tool.
tools = [
- ToolSubst('%flang', command=FindTool('flang'), unresolved='fatal'),
- ToolSubst('%f18', command=FindTool('f18'), unresolved='fatal'),
- ToolSubst('%f18_with_includes', command=FindTool('f18'),
- extra_args=["-I" + config.flang_intrinsic_modules_dir], unresolved='fatal')
+ ToolSubst('%f18', command=FindTool('f18'),
+ extra_args=["-intrinsic-module-directory "+config.flang_intrinsic_modules_dir],
+ unresolved='fatal')
]
llvm_config.add_tool_substitutions(tools, [config.flang_llvm_tools_dir])