[flang-commits] [flang] bf57fc1 - [flang] Port test_any.sh tests to FileCheck: Hand port getsymbols tests

Richard Barton via flang-commits flang-commits at lists.llvm.org
Fri Jun 26 10:49:38 PDT 2020


Author: Richard Barton
Date: 2020-06-26T18:49:21+01:00
New Revision: bf57fc1c8ea3d8eaf2e9974691012767ac71a73e

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

LOG: [flang] Port test_any.sh tests to FileCheck: Hand port getsymbols tests

test_any.sh's FileCheck accepts the CHECK line matches in any order while
FileCheck checks in strict order. Re-order the CHECK lines to source code
order - they come from an ordered datastructure.

Some CHECK lines are sensitive to line number which are fixed up manually.

getsymbols02 had multiple test inputs which had their own EXEC lines.
Consolidate these together in one file.

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

Added: 
    

Modified: 
    flang/test/Semantics/Inputs/getsymbols02-a.f90
    flang/test/Semantics/Inputs/getsymbols02-b.f90
    flang/test/Semantics/getsymbols01.f90
    flang/test/Semantics/getsymbols02.f90
    flang/test/Semantics/getsymbols03-a.f90
    flang/test/Semantics/getsymbols04.f90
    flang/test/Semantics/getsymbols05.f90

Removed: 
    flang/test/Semantics/Inputs/getsymbols02-c.f90


################################################################################
diff  --git a/flang/test/Semantics/Inputs/getsymbols02-a.f90 b/flang/test/Semantics/Inputs/getsymbols02-a.f90
index 04786c0bea6d..d4fd43cbd3b5 100644
--- a/flang/test/Semantics/Inputs/getsymbols02-a.f90
+++ b/flang/test/Semantics/Inputs/getsymbols02-a.f90
@@ -1,5 +1,3 @@
-! EXEC: ${F18} -fparse-only %s
-
 module mm2a
 implicit none
 private

diff  --git a/flang/test/Semantics/Inputs/getsymbols02-b.f90 b/flang/test/Semantics/Inputs/getsymbols02-b.f90
index 1e6bb8b03a6c..390a0c7482bf 100644
--- a/flang/test/Semantics/Inputs/getsymbols02-b.f90
+++ b/flang/test/Semantics/Inputs/getsymbols02-b.f90
@@ -1,5 +1,3 @@
-! EXEC: ${F18} -fparse-only %s
-
 module mm2b
 use mm2a
 implicit none

diff  --git a/flang/test/Semantics/Inputs/getsymbols02-c.f90 b/flang/test/Semantics/Inputs/getsymbols02-c.f90
deleted file mode 100644
index 52a210b91699..000000000000
--- a/flang/test/Semantics/Inputs/getsymbols02-c.f90
+++ /dev/null
@@ -1,12 +0,0 @@
-! Tests -fget-symbols-sources with modules.
-
-PROGRAM helloworld
-    use mm2b
-    implicit none
-    integer::i
-    i = callget5()
-ENDPROGRAM
-
-! EXEC: ${F18} -fget-symbols-sources -fparse-only %s 2>&1 | ${FileCheck} %s
-! CHECK:callget5: mm2b
-! CHECK:get5: mm2a

diff  --git a/flang/test/Semantics/getsymbols01.f90 b/flang/test/Semantics/getsymbols01.f90
index 8142e43d3a71..8f50304825dc 100644
--- a/flang/test/Semantics/getsymbols01.f90
+++ b/flang/test/Semantics/getsymbols01.f90
@@ -1,4 +1,3 @@
-!RUN: %S/test_any.sh %s %t %f18
 ! Tests -fget-symbols-sources finding all symbols in file.
 module mm1
  private :: f
@@ -16,11 +15,11 @@ recursive pure function f() result(x)
  end function
 end module
 
-! EXEC: ${F18} -fget-symbols-sources -fparse-only %s 2>&1 | ${FileCheck} %s
-! CHECK-ONCE:mm1:.*getsymbols01.f90, 3, 8-11
-! CHECK-ONCE:f:.*getsymbols01.f90, 13, 26-27
-! CHECK-ONCE:s:.*getsymbols01.f90, 6, 18-19
-! CHECK-ONCE:ss:.*getsymbols01.f90, 10, 19-21
-! CHECK-ONCE:x:.*getsymbols01.f90, 6, 21-22
-! CHECK-ONCE:y:.*getsymbols01.f90, 6, 24-25
-! CHECK-ONCE:x:.*getsymbols01.f90, 14, 24-25
+! RUN: %f18 -fget-symbols-sources -fparse-only %s 2>&1 | FileCheck %s
+! CHECK-COUNT-1:mm1:{{.*}}getsymbols01.f90, 2, 8-11
+! CHECK-COUNT-1:s:{{.*}}getsymbols01.f90, 5, 18-19
+! CHECK-COUNT-1:x:{{.*}}getsymbols01.f90, 5, 21-22
+! CHECK-COUNT-1:y:{{.*}}getsymbols01.f90, 5, 24-25
+! CHECK-COUNT-1:ss:{{.*}}getsymbols01.f90, 9, 19-21
+! CHECK-COUNT-1:f:{{.*}}getsymbols01.f90, 12, 26-27
+! CHECK-COUNT-1:x:{{.*}}getsymbols01.f90, 13, 24-25

diff  --git a/flang/test/Semantics/getsymbols02.f90 b/flang/test/Semantics/getsymbols02.f90
index 86f10911a945..4c8f0710eb23 100644
--- a/flang/test/Semantics/getsymbols02.f90
+++ b/flang/test/Semantics/getsymbols02.f90
@@ -1 +1,14 @@
-!RUN: %S/test_any.sh '%S/Inputs/getsymbols02-*' %t %f18
+! Tests -fget-symbols-sources with modules.
+
+PROGRAM helloworld
+    use mm2b
+    implicit none
+    integer::i
+    i = callget5()
+ENDPROGRAM
+
+! RUN: %f18 -fparse-only %S/Inputs/getsymbols02-a.f90
+! RUN: %f18 -fparse-only %S/Inputs/getsymbols02-b.f90
+! RUN: %f18 -fget-symbols-sources -fparse-only %s 2>&1 | FileCheck %s
+! CHECK: get5: mm2a
+! CHECK: callget5: mm2b

diff  --git a/flang/test/Semantics/getsymbols03-a.f90 b/flang/test/Semantics/getsymbols03-a.f90
index 51199ce24eb2..c11aee03048c 100644
--- a/flang/test/Semantics/getsymbols03-a.f90
+++ b/flang/test/Semantics/getsymbols03-a.f90
@@ -1,5 +1,4 @@
 ! Tests -fget-symbols with INCLUDE
-!RUN: %S/test_any.sh %s %t %f18
 INCLUDE "Inputs/getsymbols03-b.f90"
 
 program main
@@ -8,8 +7,8 @@ program main
  x = f
 end program
 
-! EXEC: ${F18} -fget-symbols-sources -fparse-only %s 2>&1 | ${FileCheck} %s
-! CHECK:mm3:.*getsymbols03-b.f90, 1, 8-11
-! CHECK:f:.*getsymbols03-b.f90, 2, 12-13
-! CHECK:main:.*getsymbols03-a.f90, 5, 9-13
-! CHECK:x:.*getsymbols03-a.f90, 7, 13-14
+! RUN: %f18 -fget-symbols-sources -fparse-only %s 2>&1 | FileCheck %s
+! CHECK:mm3:{{.*}}getsymbols03-b.f90, 1, 8-11
+! CHECK:f:{{.*}}getsymbols03-b.f90, 2, 12-13
+! CHECK:main:{{.*}}getsymbols03-a.f90, 4, 9-13
+! CHECK:x:{{.*}}getsymbols03-a.f90, 6, 13-14

diff  --git a/flang/test/Semantics/getsymbols04.f90 b/flang/test/Semantics/getsymbols04.f90
index e0d3a40f4e20..4decfc78560a 100644
--- a/flang/test/Semantics/getsymbols04.f90
+++ b/flang/test/Semantics/getsymbols04.f90
@@ -1,4 +1,3 @@
-!RUN: %S/test_any.sh %s %t %f18
 ! Tests -fget-symbols-sources with COMMON.
 program main
   integer :: x
@@ -7,7 +6,7 @@ program main
   x = y
 end program
 
-! EXEC: ${F18} -fget-symbols-sources -fparse-only %s 2>&1 | ${FileCheck} %s
-! CHECK:x:.*getsymbols04.f90, 4, 14-15
-! CHECK:y:.*getsymbols04.f90, 5, 14-15
-! CHECK:x:.*getsymbols04.f90, 6, 11-12
+! RUN: %f18 -fget-symbols-sources -fparse-only %s 2>&1 | FileCheck %s
+! CHECK:x:{{.*}}getsymbols04.f90, 3, 14-15
+! CHECK:y:{{.*}}getsymbols04.f90, 4, 14-15
+! CHECK:x:{{.*}}getsymbols04.f90, 5, 11-12

diff  --git a/flang/test/Semantics/getsymbols05.f90 b/flang/test/Semantics/getsymbols05.f90
index 36bf61b4e738..30dcb2278e00 100644
--- a/flang/test/Semantics/getsymbols05.f90
+++ b/flang/test/Semantics/getsymbols05.f90
@@ -1,4 +1,3 @@
-!RUN: %S/test_any.sh %s %t %f18
 ! Tests -fget-symbols-sources with COMMON.
 program main
   integer :: x
@@ -10,7 +9,7 @@ program main
   x = y
 end program
 
-! EXEC: ${F18} -fget-symbols-sources -fparse-only %s 2>&1 | ${FileCheck} %s
-! CHECK:x:.*getsymbols05.f90, 4, 14-15
-! CHECK:y:.*getsymbols05.f90, 5, 14-15
-! CHECK:x:.*getsymbols05.f90, 7, 16-17
+! RUN: %f18 -fget-symbols-sources -fparse-only %s 2>&1 | FileCheck %s
+! CHECK:x:{{.*}}getsymbols05.f90, 3, 14-15
+! CHECK:y:{{.*}}getsymbols05.f90, 4, 14-15
+! CHECK:x:{{.*}}getsymbols05.f90, 6, 16-17


        


More information about the flang-commits mailing list