[flang-commits] [flang] b537c81 - [flang] Port remaining test_any.sh tests to FileCheck

Richard Barton via flang-commits flang-commits at lists.llvm.org
Fri Jun 26 11:35:43 PDT 2020


Author: Richard Barton
Date: 2020-06-26T19:35:14+01:00
New Revision: b537c81b5fde154062ecf7521d41902b130dffe6

URL: https://github.com/llvm/llvm-project/commit/b537c81b5fde154062ecf7521d41902b130dffe6
DIFF: https://github.com/llvm/llvm-project/commit/b537c81b5fde154062ecf7521d41902b130dffe6.diff

LOG: [flang] Port remaining test_any.sh tests to FileCheck

Port the remaining tests which only require mechanical changes and delete
test_any.sh.

    * Delete old RUN lines
    * Replace:
        EXEC: ${F18} ... | ${FileCheck} ...
      with
        RUN: %f18 .. | FileCheck ...
    * Prepend RUN line with not when it is expected to fail

Also reinstate a de-activated EXEC line and port it in the same way.

Differential Revision: https://reviews.llvm.org/D82168

Added: 
    

Modified: 
    flang/test/Semantics/canondo01.f90
    flang/test/Semantics/canondo02.f90
    flang/test/Semantics/canondo03.f90
    flang/test/Semantics/canondo04.f90
    flang/test/Semantics/canondo05.f90
    flang/test/Semantics/canondo06.f90
    flang/test/Semantics/canondo07.f90
    flang/test/Semantics/canondo19.f90
    flang/test/Semantics/critical04.f90
    flang/test/Semantics/doconcurrent02.f90
    flang/test/Semantics/doconcurrent03.f90
    flang/test/Semantics/doconcurrent07.f90
    flang/test/Semantics/label02.f90
    flang/test/Semantics/label03.f90
    flang/test/Semantics/label04.f90
    flang/test/Semantics/label05.f90
    flang/test/Semantics/label06.f90
    flang/test/Semantics/label07.f90
    flang/test/Semantics/label08.f90
    flang/test/Semantics/label09.f90
    flang/test/Semantics/label10.f90
    flang/test/Semantics/label12.f90
    flang/test/Semantics/label13.f90
    flang/test/Semantics/label14.f90

Removed: 
    flang/test/Semantics/test_any.sh


################################################################################
diff  --git a/flang/test/Semantics/canondo01.f90 b/flang/test/Semantics/canondo01.f90
index a717450b953e..3379953b12d7 100644
--- a/flang/test/Semantics/canondo01.f90
+++ b/flang/test/Semantics/canondo01.f90
@@ -1,7 +1,5 @@
-! 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: %f18 -funparse-with-symbols %s 2>&1 | FileCheck %s
 ! CHECK: end do
 
 SUBROUTINE sub00(a,b,n,m)

diff  --git a/flang/test/Semantics/canondo02.f90 b/flang/test/Semantics/canondo02.f90
index 0125467a9f2a..69745c4ef458 100644
--- a/flang/test/Semantics/canondo02.f90
+++ b/flang/test/Semantics/canondo02.f90
@@ -1,7 +1,5 @@
-! 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: %f18 -funparse-with-symbols %s 2>&1 | FileCheck %s
 ! CHECK: end do
 
 SUBROUTINE sub00(a,b,n,m)

diff  --git a/flang/test/Semantics/canondo03.f90 b/flang/test/Semantics/canondo03.f90
index 94ab11cc39ee..55b3fd2fe8f1 100644
--- a/flang/test/Semantics/canondo03.f90
+++ b/flang/test/Semantics/canondo03.f90
@@ -1,7 +1,5 @@
-! 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: %f18 -funparse-with-symbols %s 2>&1 | FileCheck %s
 ! CHECK: 10 continue
 ! CHECK: end do
 

diff  --git a/flang/test/Semantics/canondo04.f90 b/flang/test/Semantics/canondo04.f90
index 65a79d0b491d..b252c9820159 100644
--- a/flang/test/Semantics/canondo04.f90
+++ b/flang/test/Semantics/canondo04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_any.sh %s %t %f18
-! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
+! RUN: %f18 -funparse-with-symbols %s 2>&1 | FileCheck %s
 ! CHECK-NOT: do [1-9]
 
 ! Figure out how to also execute this test.

diff  --git a/flang/test/Semantics/canondo05.f90 b/flang/test/Semantics/canondo05.f90
index fe23091b5964..788dc7a5de89 100644
--- a/flang/test/Semantics/canondo05.f90
+++ b/flang/test/Semantics/canondo05.f90
@@ -1,6 +1,5 @@
-! 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
+! RUN: %f18 -funparse-with-symbols %s 2>&1 | FileCheck %s
+! RUN: %f18 -fopenmp -funparse-with-symbols %s 2>&1 | FileCheck %s
 ! CHECK-NOT: do *[1-9]
 
 program P

diff  --git a/flang/test/Semantics/canondo06.f90 b/flang/test/Semantics/canondo06.f90
index a429873a1af3..dae6b3807bf3 100644
--- a/flang/test/Semantics/canondo06.f90
+++ b/flang/test/Semantics/canondo06.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_any.sh %s %t %f18
-! EXEC: ${F18} -fopenmp -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
+! RUN: %f18 -fopenmp -funparse-with-symbols %s 2>&1 | FileCheck %s
 ! CHECK-NOT: do *[1-9]
 ! CHECK: omp simd
 

diff  --git a/flang/test/Semantics/canondo07.f90 b/flang/test/Semantics/canondo07.f90
index b12b8bb60720..074ea9df8f98 100644
--- a/flang/test/Semantics/canondo07.f90
+++ b/flang/test/Semantics/canondo07.f90
@@ -1,8 +1,7 @@
-! RUN: %S/test_any.sh %s %t %f18
 ! Error test -- DO loop uses obsolete loop termination statement
 ! See R1131 and C1131
 
-! EXEC: ${F18} -funparse-with-symbols -Mstandard %s 2>&1 | ${FileCheck} %s
+! RUN: %f18 -funparse-with-symbols -Mstandard %s 2>&1 | FileCheck %s
 ! CHECK: A DO loop should terminate with an END DO or CONTINUE
 
 program endDo

diff  --git a/flang/test/Semantics/canondo19.f90 b/flang/test/Semantics/canondo19.f90
index 5b38a1909811..1142640267b7 100644
--- a/flang/test/Semantics/canondo19.f90
+++ b/flang/test/Semantics/canondo19.f90
@@ -1,8 +1,7 @@
-! 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.
 
-! EXEC: ${F18} -funparse-with-symbols -Mstandard %s 2>&1 | ${FileCheck} %s
+! RUN: %f18 -funparse-with-symbols -Mstandard %s 2>&1 | FileCheck %s
 
 ! CHECK: end do
 ! CHECK: 2 do

diff  --git a/flang/test/Semantics/critical04.f90 b/flang/test/Semantics/critical04.f90
index 888461b9ebba..4d08597fb7cd 100644
--- a/flang/test/Semantics/critical04.f90
+++ b/flang/test/Semantics/critical04.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_any.sh %s %t %f18
-! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
+! RUN: %f18 -funparse-with-symbols %s 2>&1 | FileCheck %s
 ! CHECK-NOT: Control flow escapes from CRITICAL
 
 subroutine test1(a, i)

diff  --git a/flang/test/Semantics/doconcurrent02.f90 b/flang/test/Semantics/doconcurrent02.f90
index bb599bd0aee3..2720e1356db1 100644
--- a/flang/test/Semantics/doconcurrent02.f90
+++ b/flang/test/Semantics/doconcurrent02.f90
@@ -1,8 +1,6 @@
-! 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
 
-! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
+! RUN: not %f18 -funparse-with-symbols %s 2>&1 | FileCheck %s
 ! CHECK-NOT: image control statement not allowed in DO CONCURRENT
 ! CHECK-NOT: RETURN not allowed in DO CONCURRENT
 ! CHECK-NOT: call to impure procedure in DO CONCURRENT not allowed

diff  --git a/flang/test/Semantics/doconcurrent03.f90 b/flang/test/Semantics/doconcurrent03.f90
index 1ba96b577723..d98db8dd60c8 100644
--- a/flang/test/Semantics/doconcurrent03.f90
+++ b/flang/test/Semantics/doconcurrent03.f90
@@ -1,5 +1,4 @@
-! 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: Control flow escapes from DO CONCURRENT
 ! CHECK: branch into loop body from outside
 ! CHECK: the loop branched into

diff  --git a/flang/test/Semantics/doconcurrent07.f90 b/flang/test/Semantics/doconcurrent07.f90
index 5882c130bb1b..d9c494efe0ab 100644
--- a/flang/test/Semantics/doconcurrent07.f90
+++ b/flang/test/Semantics/doconcurrent07.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_any.sh %s %t %f18
-! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
+! RUN: %f18 -funparse-with-symbols %s 2>&1 | FileCheck %s
 ! CHECK-NOT: exit from DO CONCURRENT construct
 
 subroutine do_concurrent_test1(n)

diff  --git a/flang/test/Semantics/label02.f90 b/flang/test/Semantics/label02.f90
index 26f98e578273..fa4f37ec3a44 100644
--- a/flang/test/Semantics/label02.f90
+++ b/flang/test/Semantics/label02.f90
@@ -1,7 +1,5 @@
-! 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: not %f18 -funparse-with-symbols %s 2>&1 | FileCheck %s
 ! CHECK: Label '0' is out of range
 ! CHECK: Label '100000' is out of range
 ! CHECK: Label '123456' is out of range

diff  --git a/flang/test/Semantics/label03.f90 b/flang/test/Semantics/label03.f90
index 40eb6f391f18..ecc21f92b93e 100644
--- a/flang/test/Semantics/label03.f90
+++ b/flang/test/Semantics/label03.f90
@@ -1,7 +1,5 @@
-! 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: not %f18 -funparse-with-symbols %s 2>&1 | FileCheck %s
 ! CHECK: DO loop doesn't properly nest
 ! CHECK: DO loop conflicts
 ! CHECK: Label '30' cannot be found

diff  --git a/flang/test/Semantics/label04.f90 b/flang/test/Semantics/label04.f90
index 3180b0c23bd7..ea496fb95789 100644
--- a/flang/test/Semantics/label04.f90
+++ b/flang/test/Semantics/label04.f90
@@ -1,7 +1,5 @@
-! 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: %f18 -funparse-with-symbols %s 2>&1 | FileCheck %s
 ! CHECK: branch into loop body from outside
 ! CHECK: do 10 i = 1, m
 ! CHECK: the loop branched into

diff  --git a/flang/test/Semantics/label05.f90 b/flang/test/Semantics/label05.f90
index f962b03dd719..fbcdb4f22cb9 100644
--- a/flang/test/Semantics/label05.f90
+++ b/flang/test/Semantics/label05.f90
@@ -1,7 +1,5 @@
-! 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: not %f18 -funparse-with-symbols %s 2>&1 | FileCheck %s
 ! CHECK: Label '50' was not found
 ! CHECK: Label '55' is not in scope
 ! CHECK: Label '70' is not a branch target

diff  --git a/flang/test/Semantics/label06.f90 b/flang/test/Semantics/label06.f90
index ab948e12f086..16be4df30cb0 100644
--- a/flang/test/Semantics/label06.f90
+++ b/flang/test/Semantics/label06.f90
@@ -1,7 +1,5 @@
-! 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: not %f18 -funparse-with-symbols %s 2>&1 | FileCheck %s
 ! CHECK: Label '10' is not in scope
 ! CHECK: Label '20' was not found
 ! CHECK: Label '30' is not a branch target

diff  --git a/flang/test/Semantics/label07.f90 b/flang/test/Semantics/label07.f90
index 5a73c74bde22..a01b58e16d32 100644
--- a/flang/test/Semantics/label07.f90
+++ b/flang/test/Semantics/label07.f90
@@ -1,7 +1,5 @@
-! 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: not %f18 -funparse-with-symbols %s 2>&1 | FileCheck %s
 ! CHECK: Label '30' is not a branch target
 ! CHECK: Control flow use of '30'
 ! CHECK: Label '10' is not in scope

diff  --git a/flang/test/Semantics/label08.f90 b/flang/test/Semantics/label08.f90
index 5b5c727d0ad6..57858022a526 100644
--- a/flang/test/Semantics/label08.f90
+++ b/flang/test/Semantics/label08.f90
@@ -1,7 +1,5 @@
-! 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: not %f18 -funparse-with-symbols %s 2>&1 | FileCheck %s
 ! CHECK: CYCLE construct-name is not in scope
 ! CHECK: IF construct name unexpected
 ! CHECK: unnamed IF statement

diff  --git a/flang/test/Semantics/label09.f90 b/flang/test/Semantics/label09.f90
index d3968e4b3d6e..27644b671471 100644
--- a/flang/test/Semantics/label09.f90
+++ b/flang/test/Semantics/label09.f90
@@ -1,5 +1,4 @@
-! 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: Label '60' was not found
 
 subroutine s(a)

diff  --git a/flang/test/Semantics/label10.f90 b/flang/test/Semantics/label10.f90
index dc19e5dacfc3..ad234ccb4bbb 100644
--- a/flang/test/Semantics/label10.f90
+++ b/flang/test/Semantics/label10.f90
@@ -1,5 +1,4 @@
-! 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: '60' not a FORMAT
 ! CHECK: data transfer use of '60'
 

diff  --git a/flang/test/Semantics/label12.f90 b/flang/test/Semantics/label12.f90
index 8dbe7e46ea04..c917a116e31e 100644
--- a/flang/test/Semantics/label12.f90
+++ b/flang/test/Semantics/label12.f90
@@ -1,5 +1,4 @@
-! 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: expected end of statement
 
 subroutine s

diff  --git a/flang/test/Semantics/label13.f90 b/flang/test/Semantics/label13.f90
index bdd5d68e66da..f03156aa1775 100644
--- a/flang/test/Semantics/label13.f90
+++ b/flang/test/Semantics/label13.f90
@@ -1,5 +1,4 @@
-! RUN: %S/test_any.sh %s %t %f18
-! EXEC: ${F18} -funparse-with-symbols %s 2>&1 | ${FileCheck} %s
+! RUN: %f18 -funparse-with-symbols %s 2>&1 | FileCheck %s
 ! CHECK: branch into loop body from outside
 ! CHECK: the loop branched into
 

diff  --git a/flang/test/Semantics/label14.f90 b/flang/test/Semantics/label14.f90
index 700508ab878b..ebb865c9e85b 100644
--- a/flang/test/Semantics/label14.f90
+++ b/flang/test/Semantics/label14.f90
@@ -1,9 +1,8 @@
-! 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
 
-! EXEC: ${F18} %s 2>&1 | ${FileCheck} %s
+! RUN: not %f18 %s 2>&1 | FileCheck %s
 ! CHECK: Label '20' is not in scope
 
 subroutine s1

diff  --git a/flang/test/Semantics/test_any.sh b/flang/test/Semantics/test_any.sh
deleted file mode 100755
index 3ad960de323a..000000000000
--- a/flang/test/Semantics/test_any.sh
+++ /dev/null
@@ -1,65 +0,0 @@
-#/usr/bin/env bash
-# Compile a source file with '-funparse-with-symbols' and verify
-# we get the right symbols in the output, i.e. the output should be
-# the same as the input, except for the copyright comment.
-# Change the compiler by setting the F18 environment variable.
-
-srcdir=$(dirname $0)
-source $srcdir/common.sh
-
-FileCheck=internal_check
-
-function internal_check() {
-  r=true
-  linput="$1"
-  lstdin=`mktemp`
-  lcheck=`mktemp`
-  cat - > ${lstdin}
-  egrep '^[[:space:]]*![[:space:]]*CHECK:[[:space:]]*' ${linput} | sed -e 's/^[[:space:]]*![[:space:]]*CHECK:[[:space:]]*//' > ${lcheck} 2>/dev/null
-  while read p; do
-    if egrep "${p}" ${lstdin} >/dev/null 2>&1; then
-      true
-    else
-      echo "Not found: ${p}" >&2
-      r=false
-    fi
-  done < ${lcheck}
-  egrep '^[[:space:]]*![[:space:]]*CHECK-NOT:[[:space:]]*' ${linput} | sed -e 's/^[[:space:]]*![[:space:]]*CHECK-NOT:[[:space:]]*//' > ${lcheck} 2>/dev/null
-  while read p; do
-    if egrep "${p}" ${lstdin} >/dev/null 2>&1; then
-      echo "Found: ${p}" >&2
-      r=false
-    fi
-  done < ${lcheck}
-  egrep '^[[:space:]]*![[:space:]]*CHECK-ONCE:[[:space:]]*' ${linput} | sed -e 's/^[[:space:]]*![[:space:]]*CHECK-ONCE:[[:space:]]*//' > ${lcheck} 2>/dev/null
-  while read p; do
-    count=$(egrep -o -e "${p}" ${lstdin} | wc -l)
-    if [ ${count} -eq 0 ]; then
-      echo "Not found: ${p}" >&2
-      r=false
-    fi
-    if [ ${count} -gt 1 ]; then
-      echo "Found duplicates: ${p}" >&2
-      r=false
-    fi
-  done < ${lcheck}
-  rm -f ${lstdin} ${lcheck}
-  ${r}
-}
-
-gr=0
-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")
-  if egrep -q -e '%t' <<< ${CMD} ; then
-    CMD=$(echo ${CMD} | sed -e "s:%t:$temp/t:g")
-  fi
-  if $(eval $CMD); then
-    echo "PASS  ${input}"
-  else
-    echo "FAIL  ${input}"
-    gr=1
-  fi
-done
-exit $gr


        


More information about the flang-commits mailing list