Skip to content

Commit

Permalink
[flang][test] Remove RUN COMMANDS/EXPECTED OUTPUT/INPUT markers from …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
MaskRay committed Jun 29, 2022
1 parent 348ea34 commit 9d4a2ba
Show file tree
Hide file tree
Showing 13 changed files with 0 additions and 114 deletions.
9 changes: 0 additions & 9 deletions flang/test/Driver/code-gen-aarch64.f90
Expand Up @@ -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
Expand All @@ -15,17 +12,11 @@
! 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

! When incorrect triple is used to disassemble, there won't be a ret instruction at all.
! INCORRECT_TRIPLE-LABEL: <_QQmain>:
! INCORRECT_TRIPLE-NOT: ret

!------
! INPUT
!------
end program
9 changes: 0 additions & 9 deletions flang/test/Driver/code-gen-x86.f90
Expand Up @@ -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
Expand All @@ -16,17 +13,11 @@
! 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

! When incorrect triple is used to disassemble, there won't be a ret(q) instruction at all.
! INCORRECT_TRIPLE-LABEL: <_QQmain>:
! INCORRECT_TRIPLE-NOT: ret

!------
! INPUT
!------
end program
9 changes: 0 additions & 9 deletions 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
Expand All @@ -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
9 changes: 0 additions & 9 deletions flang/test/Driver/emit-asm-aarch64.f90
Expand Up @@ -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
9 changes: 0 additions & 9 deletions flang/test/Driver/emit-asm-from-llvm-bc.ll
Expand Up @@ -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
Expand All @@ -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
}
9 changes: 0 additions & 9 deletions flang/test/Driver/emit-asm-from-llvm.ll
Expand Up @@ -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
}
9 changes: 0 additions & 9 deletions 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
}
9 changes: 0 additions & 9 deletions flang/test/Driver/emit-asm-x86.f90
Expand Up @@ -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
9 changes: 0 additions & 9 deletions 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
9 changes: 0 additions & 9 deletions 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

Expand All @@ -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
6 changes: 0 additions & 6 deletions flang/test/Driver/linker-flags.f90
Expand Up @@ -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
Expand All @@ -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
Expand Down
9 changes: 0 additions & 9 deletions flang/test/Driver/missing-triple.ll
Expand Up @@ -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
}
9 changes: 0 additions & 9 deletions flang/test/Driver/override-triple.ll
Expand Up @@ -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 different to the host triple.
; Use a random string to guarantee that.
target triple = "invalid-triple"
Expand Down

0 comments on commit 9d4a2ba

Please sign in to comment.