[flang] Port remaining test_any.sh tests to FileCheck
authorRichard Barton <richard.barton@arm.com>
Fri, 26 Jun 2020 18:28:43 +0000 (19:28 +0100)
committerRichard Barton <richard.barton@arm.com>
Fri, 26 Jun 2020 18:35:14 +0000 (19:35 +0100)
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

25 files changed:
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
flang/test/Semantics/test_any.sh [deleted file]

index a717450..3379953 100644 (file)
@@ -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)
index 0125467..69745c4 100644 (file)
@@ -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)
index 94ab11c..55b3fd2 100644 (file)
@@ -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
 
index 65a79d0..b252c98 100644 (file)
@@ -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.
index fe23091..788dc7a 100644 (file)
@@ -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
index a429873..dae6b38 100644 (file)
@@ -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
 
index b12b8bb..074ea9d 100644 (file)
@@ -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
index 5b38a19..1142640 100644 (file)
@@ -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
index 888461b..4d08597 100644 (file)
@@ -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)
index bb599bd..2720e13 100644 (file)
@@ -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
index 1ba96b5..d98db8d 100644 (file)
@@ -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
index 5882c13..d9c494e 100644 (file)
@@ -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)
index 26f98e5..fa4f37e 100644 (file)
@@ -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
index 40eb6f3..ecc21f9 100644 (file)
@@ -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
index 3180b0c..ea496fb 100644 (file)
@@ -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
index f962b03..fbcdb4f 100644 (file)
@@ -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
index ab948e1..16be4df 100644 (file)
@@ -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
index 5a73c74..a01b58e 100644 (file)
@@ -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
index 5b5c727..5785802 100644 (file)
@@ -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
index d3968e4..27644b6 100644 (file)
@@ -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)
index dc19e5d..ad234cc 100644 (file)
@@ -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'
 
index 8dbe7e4..c917a11 100644 (file)
@@ -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
index bdd5d68..f03156a 100644 (file)
@@ -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
 
index 700508a..ebb865c 100644 (file)
@@ -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 (executable)
index 3ad960d..0000000
+++ /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