From 9c98ed9cd41fc6662a5e90037f25cb3a80658b74 Mon Sep 17 00:00:00 2001 From: Richard Barton Date: Fri, 5 Jun 2020 19:09:12 +0100 Subject: [PATCH] [flang] Port test_any.sh tests to FileCheck: Hand port tests which use regexes The regex syntax used by test_any.sh's FileCheck is sometimes incompatible with real FileCheck. Hand port these tests to use FileCheck and it's regex format. Also remove FIXME from label01 that no longer applies. Also add second run-line that enables all tests. Add some new FIXMEs for issues in original tests Differential Revision: https://reviews.llvm.org/D82164 --- flang/test/Semantics/doconcurrent04.f90 | 5 ++--- flang/test/Semantics/label01.F90 | 18 ++++++++++-------- flang/test/Semantics/label11.f90 | 5 ++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/flang/test/Semantics/doconcurrent04.f90 b/flang/test/Semantics/doconcurrent04.f90 index cc73d3fdd8bf..079c8d423503 100644 --- a/flang/test/Semantics/doconcurrent04.f90 +++ b/flang/test/Semantics/doconcurrent04.f90 @@ -1,7 +1,6 @@ -! 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: not %f18 -funparse-with-symbols %s 2>&1 | FileCheck %s +! CHECK: Must have INTEGER type, but is REAL(4) subroutine do_concurrent_test1(n) implicit none diff --git a/flang/test/Semantics/label01.F90 b/flang/test/Semantics/label01.F90 index aa1b80025d84..4e7b9643480b 100644 --- a/flang/test/Semantics/label01.F90 +++ b/flang/test/Semantics/label01.F90 @@ -1,9 +1,7 @@ -! 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:]] - -! FIXME: filter out the array/function syntax issues (procedure conflicts) -! for now... +! RUN: %f18 -funparse-with-symbols -DSTRICT_F18 -Mstandard %s 2>&1 | FileCheck %s +! RUN: %f18 -funparse-with-symbols -DARCHAIC_FORTRAN %s 2>&1 | FileCheck %s +! CHECK-NOT: error:{{[[:space:]]}} +! FIXME: the above check line does not work because diags are not emitted with error: in them. ! these are the conformance tests ! define STRICT_F18 to eliminate tests of features not in F18 @@ -83,6 +81,7 @@ subroutine do_loop07(a,n) end do loopone end subroutine do_loop07 +#ifndef STRICT_F18 subroutine do_loop08(a,b,n,m,nn) integer :: n, m, nn real, dimension(n,n) :: a @@ -114,6 +113,7 @@ subroutine do_loop08(a,b,n,m,nn) end do loopone 111 print *, "done" end subroutine do_loop08 +#endif #ifndef STRICT_F18 ! extended ranges supported by PGI, gfortran gives warnings @@ -123,7 +123,7 @@ subroutine do_loop09(a,n,j) goto 400 200 print *, "found the index", j print *, "value at", j, "is", a(j) - goto 300 + goto 300 ! FIXME: emits diagnostic even without -Mstandard 400 do 100 i = 1, n if (i .eq. j) then goto 200 ! extension: extended GOTO ranges @@ -168,7 +168,7 @@ subroutine arith_if12(i) end subroutine arith_if12 #endif -#if 0 +#ifndef STRICT_F18 subroutine alt_return_spec13(i,*,*,*) 9 continue 8 labelme: if (i .lt. 42) then @@ -192,6 +192,7 @@ subroutine alt_return_spec14(i) end subroutine alt_return_spec14 #endif +#ifndef STRICT_F18 subroutine specifiers15(a,b,x) integer x OPEN (10, file="myfile.dat", err=100) @@ -212,6 +213,7 @@ subroutine specifiers15(a,b,x) 50 WRITE (11,30,err=100) b CLOSE (11) end subroutine specifiers15 +#endif #if !defined(STRICT_F18) && defined(ARCHAIC_FORTRAN) ! assigned goto was deleted in F95. PGI supports, gfortran gives warnings diff --git a/flang/test/Semantics/label11.f90 b/flang/test/Semantics/label11.f90 index 1e477e2a250c..3f139f3e4fb2 100644 --- a/flang/test/Semantics/label11.f90 +++ b/flang/test/Semantics/label11.f90 @@ -1,12 +1,11 @@ -! RUN: %S/test_any.sh %s %t %f18 -! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s +! RUN: not %f18 -funparse-with-symbols %s 2>&1 | FileCheck %s ! CHECK: BLOCK DATA subprogram name mismatch ! CHECK: should be ! CHECK: FUNCTION name mismatch ! CHECK: SUBROUTINE name mismatch ! CHECK: PROGRAM name mismatch ! CHECK: SUBMODULE name mismatch -! CHECK: INTERFACE generic-name .t7. mismatch +! CHECK: INTERFACE generic-name (t7) mismatch ! CHECK: mismatched INTERFACE ! CHECK: derived type definition name mismatch ! CHECK: MODULE PROCEDURE name mismatch