[flang-commits] [flang] 9d4a2ba - [flang][test] Remove RUN COMMANDS/EXPECTED OUTPUT/INPUT markers from test/Driver

Fangrui Song via flang-commits flang-commits at lists.llvm.org
Wed Jun 29 01:06:07 PDT 2022


Author: Fangrui Song
Date: 2022-06-29T01:06:01-07:00
New Revision: 9d4a2baaa2c304066199ec6644da80aca7638dc6

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

LOG: [flang][test] Remove RUN COMMANDS/EXPECTED OUTPUT/INPUT markers from test/Driver

Uses of these markers are contrary to all other llvm-project subprojects
and carry no information for people who know the basics of a lit test.

I understand that there is an argument "this makes beginners get started
quickly" but I am unsure whether this is strong enough to deviate from
all other projects. https://llvm.org/docs/TestingGuide.html covers the
basics. Actually, some contributors were confused by the markers.

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

Added: 
    

Modified: 
    flang/test/Driver/code-gen-aarch64.f90
    flang/test/Driver/code-gen-x86.f90
    flang/test/Driver/dump-pft.f90
    flang/test/Driver/emit-asm-aarch64.f90
    flang/test/Driver/emit-asm-from-llvm-bc.ll
    flang/test/Driver/emit-asm-from-llvm.ll
    flang/test/Driver/emit-asm-from-mlir.mlir
    flang/test/Driver/emit-asm-x86.f90
    flang/test/Driver/emit-llvm-bc.f90
    flang/test/Driver/emit-mlir.f90
    flang/test/Driver/linker-flags.f90
    flang/test/Driver/missing-triple.ll
    flang/test/Driver/override-triple.ll

Removed: 
    


################################################################################
diff  --git a/flang/test/Driver/code-gen-aarch64.f90 b/flang/test/Driver/code-gen-aarch64.f90
index aabfabb735fc..b6be48639531 100644
--- a/flang/test/Driver/code-gen-aarch64.f90
+++ b/flang/test/Driver/code-gen-aarch64.f90
@@ -2,9 +2,6 @@
 
 ! REQUIRES: aarch64-registered-target, x86-registered-target
 
-!-------------
-! RUN COMMANDS
-!-------------
 ! RUN: rm -f %t.o
 ! RUN: %flang_fc1 -emit-obj -triple aarch64-unknown-linux-gnu %s -o %t.o
 ! RUN: llvm-objdump --triple aarch64-unknown-linux-gnu --disassemble-all %t.o | FileCheck %s --check-prefix=CORRECT_TRIPLE
@@ -15,9 +12,6 @@
 ! RUN: %flang -c --target=aarch64-unknown-linux-gnu %s -o %t.o
 ! RUN: llvm-objdump --triple x86_64-unknown-linux-gnu --disassemble-all %t.o | FileCheck %s --check-prefix=INCORRECT_TRIPLE
 
-!----------------
-! EXPECTED OUTPUT
-!----------------
 ! CORRECT_TRIPLE-LABEL: <_QQmain>:
 ! CORRECT_TRIPLE-NEXT:  	ret
 
@@ -25,7 +19,4 @@
 ! INCORRECT_TRIPLE-LABEL: <_QQmain>:
 ! INCORRECT_TRIPLE-NOT:  	ret
 
-!------
-! INPUT
-!------
 end program

diff  --git a/flang/test/Driver/code-gen-x86.f90 b/flang/test/Driver/code-gen-x86.f90
index e6306774346e..fe92eaffa883 100644
--- a/flang/test/Driver/code-gen-x86.f90
+++ b/flang/test/Driver/code-gen-x86.f90
@@ -3,9 +3,6 @@
 ! REQUIRES: x86-registered-target, aarch64-registered-target
 ! UNSUPPORTED: darwin, macos
 
-!-------------
-! RUN COMMANDS
-!-------------
 ! RUN: rm -f %t.o
 ! RUN: %flang_fc1 -triple x86_64-unknown-linux-gnu -emit-obj %s -o %t.o
 ! RUN: llvm-objdump --triple x86_64-unknown-linux-gnu --disassemble-all %t.o | FileCheck %s --check-prefix=CORRECT_TRIPLE
@@ -16,9 +13,6 @@
 ! RUN: %flang -c --target=x86_64-unknown-linux-gnu %s -o %t.o
 ! RUN: llvm-objdump --triple aarch64-unknown-linux-gnu --disassemble-all %t.o | FileCheck %s --check-prefix=INCORRECT_TRIPLE
 
-!----------------
-! EXPECTED OUTPUT
-!----------------
 ! CORRECT_TRIPLE-LABEL: <_QQmain>:
 ! CORRECT_TRIPLE-NEXT:  	retq
 
@@ -26,7 +20,4 @@
 ! INCORRECT_TRIPLE-LABEL: <_QQmain>:
 ! INCORRECT_TRIPLE-NOT:  	ret
 
-!------
-! INPUT
-!------
 end program

diff  --git a/flang/test/Driver/dump-pft.f90 b/flang/test/Driver/dump-pft.f90
index 8e87a24ef695..6d98fc9f10b8 100644
--- a/flang/test/Driver/dump-pft.f90
+++ b/flang/test/Driver/dump-pft.f90
@@ -1,13 +1,7 @@
-!-------------
-! RUN COMMANDS
-!-------------
 ! RUN: %flang_fc1 -fdebug-dump-parse-tree %s 2>&1 | FileCheck %s --check-prefix=PARSE_TREE
 ! RUN: %flang_fc1 -fdebug-dump-pft %s 2>&1 | FileCheck %s --check-prefix=PFT
 ! RUN: bbc -pft-test %s 2>&1 | FileCheck %s --check-prefix=PFT
 
-!-----------------
-! EXPECTEED OUTPUT
-!-----------------
 ! PFT: 1 Subroutine test_routine: subroutine test_routine(a, b, n)
 ! PFT-NEXT:  1 EndSubroutineStmt: end subroutine
 ! PRF-NEXT: End Subroutine test_routine
@@ -25,8 +19,5 @@
 ! PARSE_TREE-NEXT: | EndSubroutineStmt ->
 ! PARSE_TREE-NO: Subroutine test_routine: subroutine test_routine(a, b, n)
 
-!-------
-! INPUT
-!-------
 subroutine test_routine(a, b, n)
 end subroutine

diff  --git a/flang/test/Driver/emit-asm-aarch64.f90 b/flang/test/Driver/emit-asm-aarch64.f90
index 4c849859a68a..3713fa04cc0f 100644
--- a/flang/test/Driver/emit-asm-aarch64.f90
+++ b/flang/test/Driver/emit-asm-aarch64.f90
@@ -2,20 +2,11 @@
 
 ! REQUIRES: aarch64-registered-target
 
-!-------------
-! RUN COMMANDS
-!-------------
 ! RUN: %flang_fc1 -S -triple aarch64-unknown-linux-gnu %s -o - | FileCheck %s
 ! RUN: %flang -S -target aarch64-unknown-linux-gnu %s -o - | FileCheck %s
 
-!----------------
-! EXPECTED OUTPUT
-!----------------
 ! CHECK-LABEL: _QQmain:
 ! CHECK-NEXT: .Lfunc_begin0:
 ! CHECK: ret
 
-!------
-! INPUT
-!------
 end program

diff  --git a/flang/test/Driver/emit-asm-from-llvm-bc.ll b/flang/test/Driver/emit-asm-from-llvm-bc.ll
index e46b3f2c793f..9effa420d6a0 100644
--- a/flang/test/Driver/emit-asm-from-llvm-bc.ll
+++ b/flang/test/Driver/emit-asm-from-llvm-bc.ll
@@ -2,9 +2,6 @@
 
 ; REQUIRES: aarch64-registered-target
 
-;-------------
-; RUN COMMANDS
-;-------------
 ; RUN: rm -f %t.bc
 ; RUN: %flang_fc1 -triple aarch64-unknown-linux-gnu -emit-llvm-bc %s -o %t.bc
 ; RUN: %flang_fc1 -S -triple aarch64-unknown-linux-gnu -o - %t.bc | FileCheck %s
@@ -15,15 +12,9 @@
 ; RUN: %flang -S -target aarch64-unknown-linux-gnu -o - %t.bc | FileCheck %s
 ; RUN: rm -f %t.bc
 
-;----------------
-; EXPECTED OUTPUT
-;----------------
 ; CHECK-LABEL: foo:
 ; CHECK: ret
 
-;------
-; INPUT
-;------
 define void @foo() {
   ret void
 }

diff  --git a/flang/test/Driver/emit-asm-from-llvm.ll b/flang/test/Driver/emit-asm-from-llvm.ll
index 16fc3dbdd695..f9a9457e8ac1 100644
--- a/flang/test/Driver/emit-asm-from-llvm.ll
+++ b/flang/test/Driver/emit-asm-from-llvm.ll
@@ -2,21 +2,12 @@
 
 ; REQUIRES: aarch64-registered-target
 
-;-------------
-; RUN COMMANDS
-;-------------
 ; RUN: %flang_fc1 -S -triple aarch64-unknown-linux-gnu %s -o - | FileCheck %s
 ; RUN: %flang -S -target aarch64-unknown-linux-gnu %s -o - | FileCheck %s
 
-;----------------
-; EXPECTED OUTPUT
-;----------------
 ; CHECK-LABEL: foo:
 ; CHECK: ret
 
-;------
-; INPUT
-;------
 define void @foo() {
   ret void
 }

diff  --git a/flang/test/Driver/emit-asm-from-mlir.mlir b/flang/test/Driver/emit-asm-from-mlir.mlir
index d0dbd7bdc41e..99640662606c 100644
--- a/flang/test/Driver/emit-asm-from-mlir.mlir
+++ b/flang/test/Driver/emit-asm-from-mlir.mlir
@@ -1,19 +1,10 @@
 ; Verify that the driver can consume MLIR/FIR files.
 
-;-------------
-; RUN COMMANDS
-;-------------
 ; RUN: %flang_fc1 -S %s -o - | FileCheck %s
 
-;----------------
-; EXPECTED OUTPUT
-;----------------
 ; CHECK-LABEL: foo:
 ; CHECK: ret
 
-;------
-; INPUT
-;------
 func.func @foo() {
   return
 }

diff  --git a/flang/test/Driver/emit-asm-x86.f90 b/flang/test/Driver/emit-asm-x86.f90
index c79406c4244d..47b1e10c63d9 100644
--- a/flang/test/Driver/emit-asm-x86.f90
+++ b/flang/test/Driver/emit-asm-x86.f90
@@ -2,20 +2,11 @@
 
 ! REQUIRES: x86-registered-target
 
-!-------------
-! RUN COMMANDS
-!-------------
 ! RUN: %flang_fc1 -S -triple x86_64-unknown-linux-gnu %s -o - | FileCheck %s
 ! RUN: %flang -S -target x86_64-unknown-linux-gnu %s -o - | FileCheck %s
 
-!----------------
-! EXPECTED OUTPUT
-!----------------
 ! CHECK-LABEL: _QQmain:
 ! CHECK-NEXT: .Lfunc_begin0:
 ! CHECK: ret
 
-!------
-! INPUT
-!------
 end program

diff  --git a/flang/test/Driver/emit-llvm-bc.f90 b/flang/test/Driver/emit-llvm-bc.f90
index 6634a117b735..e4129c475c46 100644
--- a/flang/test/Driver/emit-llvm-bc.f90
+++ b/flang/test/Driver/emit-llvm-bc.f90
@@ -1,19 +1,10 @@
 ! Test the options for generating LLVM byte-code `-emit-llvm-bc` option
 
-!-------------
-! RUN COMMANDS
-!-------------
 ! RUN: %flang -emit-llvm -c %s -o - | llvm-dis -o - | FileCheck %s
 ! RUN: %flang_fc1 -emit-llvm-bc %s -o - | llvm-dis -o - | FileCheck %s
 
-!----------------
-! EXPECTED OUTPUT
-!----------------
 ! CHECK: define void @_QQmain()
 ! CHECK-NEXT:  ret void
 ! CHECK-NEXT: }
 
-!------
-! INPUT
-!------
 end program

diff  --git a/flang/test/Driver/emit-mlir.f90 b/flang/test/Driver/emit-mlir.f90
index 006774a952f4..5392f0cb9296 100644
--- a/flang/test/Driver/emit-mlir.f90
+++ b/flang/test/Driver/emit-mlir.f90
@@ -1,8 +1,5 @@
 ! Test the `-emit-mlir` option
 
-!-------------
-! RUN COMMANDS
-!-------------
 ! RUN: %flang_fc1 -emit-mlir %s -o - | FileCheck %s
 ! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
 
@@ -12,16 +9,10 @@
 ! RUN: cp %s .
 ! RUN: %flang_fc1 -emit-mlir emit-mlir.f90 && ls emit-mlir.mlir
 
-!----------------
-! EXPECTED OUTPUT
-!----------------
 ! CHECK: module attributes {
 ! CHECK-LABEL: func @_QQmain() {
 ! CHECK-NEXT:  return
 ! CHECK-NEXT: }
 ! CHECK-NEXT: }
 
-!------
-! INPUT
-!------
 end program

diff  --git a/flang/test/Driver/linker-flags.f90 b/flang/test/Driver/linker-flags.f90
index 44205f9817e0..ae0f5b3c8f82 100644
--- a/flang/test/Driver/linker-flags.f90
+++ b/flang/test/Driver/linker-flags.f90
@@ -2,9 +2,6 @@
 ! invocation. These libraries are added on top of other standard runtime
 ! libraries that the Clang driver will include.
 
-!-------------
-! RUN COMMANDS
-!-------------
 ! RUN: %flang -### -flang-experimental-exec -target ppc64le-linux-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,GNU
 ! RUN: %flang -### -flang-experimental-exec -target aarch64-apple-darwin %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,DARWIN
 ! RUN: %flang -### -flang-experimental-exec -target x86_64-windows-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,MINGW
@@ -15,9 +12,6 @@
 !       Make sure they're not added.
 ! RUN: %flang -### -flang-experimental-exec -target aarch64-windows-msvc %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,MSVC --implicit-check-not libcmt --implicit-check-not oldnames
 
-!----------------
-! EXPECTED OUTPUT
-!----------------
 ! Compiler invocation to generate the object file
 ! CHECK-LABEL: {{.*}} "-emit-obj"
 ! CHECK-SAME:  "-o" "[[object_file:.*\.o]]" {{.*}}Inputs/hello.f90

diff  --git a/flang/test/Driver/missing-triple.ll b/flang/test/Driver/missing-triple.ll
index d3de54f8c689..53269d53ee55 100644
--- a/flang/test/Driver/missing-triple.ll
+++ b/flang/test/Driver/missing-triple.ll
@@ -2,20 +2,11 @@
 ; module triple is missing.
 ; NOTE: At the time of writing, the tested behaviour was consistent with Clang
 
-;-------------
-; RUN COMMANDS
-;-------------
 ; RUN: %flang_fc1 -S %s -o - 2>&1 | FileCheck %s
 ; RUN: %flang -S  %s -o - 2>&1 | FileCheck %s
 
-;----------------
-; EXPECTED OUTPUT
-;----------------
 ; CHECK: warning: overriding the module target triple with {{.*}}
 
-;------
-; INPUT
-;------
 define void @foo() {
   ret void
 }

diff  --git a/flang/test/Driver/override-triple.ll b/flang/test/Driver/override-triple.ll
index dc9863b79bde..f2d9f47ac8f0 100644
--- a/flang/test/Driver/override-triple.ll
+++ b/flang/test/Driver/override-triple.ll
@@ -2,20 +2,11 @@
 ; of a module triple.
 ; NOTE: At the time of writing, the tested behaviour was consistent with Clang
 
-;-------------
-; RUN COMMANDS
-;-------------
 ; RUN: %flang_fc1 -S %s -o - 2>&1 | FileCheck %s
 ; RUN: %flang -S  %s -o - 2>&1 | FileCheck %s
 
-;----------------
-; EXPECTED OUTPUT
-;----------------
 ; CHECK: warning: overriding the module target triple with {{.*}}
 
-;------
-; INPUT
-;------
 ; For the triple to be overridden by the driver, it needs to be 
diff erent to the host triple.
 ; Use a random string to guarantee that.
 target triple = "invalid-triple"


        


More information about the flang-commits mailing list