[flang][test] Remove RUN LINES?/EXPECTED OUTPUT.*/INPUT markers from test/Driver

Follow-up to D128763.
This commit is contained in:
Fangrui Song 2022-06-29 22:08:02 -07:00
parent 67854f9ed0
commit d5d420bb3b
55 changed files with 7 additions and 361 deletions

View File

@ -5,9 +5,6 @@
! RUN: %flang_fc1 -E -cpp -DX=A %s 2>&1 | FileCheck %s --check-prefix=DEFINED ! RUN: %flang_fc1 -E -cpp -DX=A %s 2>&1 | FileCheck %s --check-prefix=DEFINED
! RUN: %flang_fc1 -E -nocpp -DX=A %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED ! RUN: %flang_fc1 -E -nocpp -DX=A %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED
!-----------------
! EXPECTED OUTPUT
!-----------------
! UNDEFINED:program B ! UNDEFINED:program B
! UNDEFINED-NOT:program A ! UNDEFINED-NOT:program A

View File

@ -5,9 +5,6 @@
! RUN: %flang_fc1 -E -cpp %s 2>&1 | FileCheck %s --check-prefix=DEFINED ! RUN: %flang_fc1 -E -cpp %s 2>&1 | FileCheck %s --check-prefix=DEFINED
! RUN: %flang_fc1 -E -nocpp %s 2>&1 | FileCheck %s --check-prefix=NOT_DEFINED ! RUN: %flang_fc1 -E -nocpp %s 2>&1 | FileCheck %s --check-prefix=NOT_DEFINED
!-----------------
! EXPECTED OUTPUT
!-----------------
! DEFINED: flang = 1 ! DEFINED: flang = 1
! DEFINED-NEXT: flang_major = {{[1-9][0-9]*$}} ! DEFINED-NEXT: flang_major = {{[1-9][0-9]*$}}

View File

@ -1,13 +1,7 @@
! Ensure argument -fdebug-measure-parse-tree works as expected. ! Ensure argument -fdebug-measure-parse-tree works as expected.
!----------
! RUN LINE
!----------
! RUN: %flang_fc1 -fdebug-measure-parse-tree %s 2>&1 | FileCheck %s --check-prefix=FRONTEND ! RUN: %flang_fc1 -fdebug-measure-parse-tree %s 2>&1 | FileCheck %s --check-prefix=FRONTEND
!-----------------
! EXPECTED OUTPUT
!-----------------
! FRONTEND:Parse tree comprises {{[0-9]+}} objects and occupies {{[0-9]+}} total bytes. ! FRONTEND:Parse tree comprises {{[0-9]+}} objects and occupies {{[0-9]+}} total bytes.
program A program A

View File

@ -1,31 +1,25 @@
! RUN: %flang_fc1 -fdebug-dump-parsing-log %s 2>&1 | FileCheck %s ! RUN: %flang_fc1 -fdebug-dump-parsing-log %s 2>&1 | FileCheck %s
!-----------------
! EXPECTED OUTPUT
!-----------------
! Below are just few lines extracted from the dump. The actual output is much _much_ bigger. ! Below are just few lines extracted from the dump. The actual output is much _much_ bigger.
! CHECK: {{.*[/\\]}}debug-parsing-log.f90:31:1: IMPLICIT statement ! CHECK: {{.*[/\\]}}debug-parsing-log.f90:25:1: IMPLICIT statement
! CHECK-NEXT: END PROGRAM ! CHECK-NEXT: END PROGRAM
! CHECK-NEXT: ^ ! CHECK-NEXT: ^
! CHECK-NEXT: fail 3 ! CHECK-NEXT: fail 3
! CHECK-NEXT: {{.*[/\\]}}debug-parsing-log.f90:31:1: error: expected 'IMPLICIT NONE' ! CHECK-NEXT: {{.*[/\\]}}debug-parsing-log.f90:25:1: error: expected 'IMPLICIT NONE'
! CHECK-NEXT: END PROGRAM ! CHECK-NEXT: END PROGRAM
! CHECK-NEXT: ^ ! CHECK-NEXT: ^
! CHECK-NEXT: {{.*[/\\]}}debug-parsing-log.f90:31:1: in the context: IMPLICIT statement ! CHECK-NEXT: {{.*[/\\]}}debug-parsing-log.f90:25:1: in the context: IMPLICIT statement
! CHECK-NEXT: END PROGRAM ! CHECK-NEXT: END PROGRAM
! CHECK-NEXT: ^ ! CHECK-NEXT: ^
! CHECK-NEXT: {{.*[/\\]}}debug-parsing-log.f90:31:1: in the context: implicit part ! CHECK-NEXT: {{.*[/\\]}}debug-parsing-log.f90:25:1: in the context: implicit part
! CHECK-NEXT: END PROGRAM ! CHECK-NEXT: END PROGRAM
! CHECK-NEXT: ^ ! CHECK-NEXT: ^
! CHECK-NEXT: {{.*[/\\]}}debug-parsing-log.f90:31:1: in the context: specification part ! CHECK-NEXT: {{.*[/\\]}}debug-parsing-log.f90:25:1: in the context: specification part
! CHECK-NEXT: END PROGRAM ! CHECK-NEXT: END PROGRAM
! CHECK-NEXT: ^ ! CHECK-NEXT: ^
! CHECK-NEXT: {{.*[/\\]}}debug-parsing-log.f90:31:1: in the context: main program ! CHECK-NEXT: {{.*[/\\]}}debug-parsing-log.f90:25:1: in the context: main program
! CHECK-NEXT: END PROGRAM ! CHECK-NEXT: END PROGRAM
! CHECK-NEXT: ^ ! CHECK-NEXT: ^
!-----------------
! TEST INPUT
!-----------------
END PROGRAM END PROGRAM

View File

@ -1,13 +1,7 @@
! Ensure argument -fdebug-dump-provenance works as expected. ! Ensure argument -fdebug-dump-provenance works as expected.
!----------
! RUN LINE
!----------
! RUN: %flang_fc1 -fdebug-dump-provenance %s 2>&1 | FileCheck %s ! RUN: %flang_fc1 -fdebug-dump-provenance %s 2>&1 | FileCheck %s
!----------------
! EXPECTED OUTPUT
!----------------
! CHECK: AllSources: ! CHECK: AllSources:
! CHECK-NEXT: AllSources range_ [{{[0-9]*}}..{{[0-9]*}}] ({{[0-9]*}} bytes) ! CHECK-NEXT: AllSources range_ [{{[0-9]*}}..{{[0-9]*}}] ({{[0-9]*}} bytes)
! CHECK-NEXT: [1..1] (1 bytes) -> compiler '?'(0x3f) ! CHECK-NEXT: [1..1] (1 bytes) -> compiler '?'(0x3f)
@ -21,8 +15,5 @@
! CHECK-NEXT: provenances [{{[0-9]*}}..{{[0-9]*}}] ({{[0-9]*}} bytes) -> offsets [{{[0-9]*}}..{{[0-9]*}}] ! CHECK-NEXT: provenances [{{[0-9]*}}..{{[0-9]*}}] ({{[0-9]*}} bytes) -> offsets [{{[0-9]*}}..{{[0-9]*}}]
! CHECK-EMPTY: ! CHECK-EMPTY:
!-------------
! TEST INPUT
!------------
program A program A
end end

View File

@ -2,22 +2,13 @@
! REQUIRES: aarch64-registered-target ! REQUIRES: aarch64-registered-target
!-----------
! RUN LINES
!-----------
! RUN: %flang_fc1 -S -O2 %s -triple aarch64-unknown-linux-gnu -mllvm -debug-pass=Structure -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-O2 ! RUN: %flang_fc1 -S -O2 %s -triple aarch64-unknown-linux-gnu -mllvm -debug-pass=Structure -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-O2
! RUN: %flang_fc1 -S -O3 %s -triple aarch64-unknown-linux-gnu -mllvm -debug-pass=Structure -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-O3 ! RUN: %flang_fc1 -S -O3 %s -triple aarch64-unknown-linux-gnu -mllvm -debug-pass=Structure -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-O3
!-----------------------
! EXPECTED OUTPUT
!-----------------------
! CHECK-O2-NOT: SVE intrinsics optimizations ! CHECK-O2-NOT: SVE intrinsics optimizations
! CHECK-O3: SVE intrinsics optimizations ! CHECK-O3: SVE intrinsics optimizations
!-------
! INPUT
!-------
subroutine simple_loop subroutine simple_loop
integer :: i integer :: i
do i=1,5 do i=1,5

View File

@ -1,25 +1,16 @@
! Verify that`-O{n}` is indeed taken into account when defining the LLVM optimization/middle-end pass pipeline. ! Verify that`-O{n}` is indeed taken into account when defining the LLVM optimization/middle-end pass pipeline.
!-----------
! RUN LINES
!-----------
! RUN: %flang -S -O0 %s -Xflang -fdebug-pass-manager -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-O0 ! RUN: %flang -S -O0 %s -Xflang -fdebug-pass-manager -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-O0
! RUN: %flang_fc1 -S -O0 %s -fdebug-pass-manager -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-O0 ! RUN: %flang_fc1 -S -O0 %s -fdebug-pass-manager -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-O0
! RUN: %flang -S -O2 %s -Xflang -fdebug-pass-manager -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-O2 ! RUN: %flang -S -O2 %s -Xflang -fdebug-pass-manager -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-O2
! RUN: %flang_fc1 -S -O2 %s -fdebug-pass-manager -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-O2 ! RUN: %flang_fc1 -S -O2 %s -fdebug-pass-manager -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-O2
!-----------------------
! EXPECTED OUTPUT
!-----------------------
! CHECK-O0-NOT: Running pass: SimplifyCFGPass on simple_loop_ ! CHECK-O0-NOT: Running pass: SimplifyCFGPass on simple_loop_
! CHECK-O0: Running analysis: TargetLibraryAnalysis on simple_loop_ ! CHECK-O0: Running analysis: TargetLibraryAnalysis on simple_loop_
! CHECK-O2: Running pass: SimplifyCFGPass on simple_loop_ ! CHECK-O2: Running pass: SimplifyCFGPass on simple_loop_
!-------
! INPUT
!-------
subroutine simple_loop subroutine simple_loop
integer :: i integer :: i
do i=1,5 do i=1,5

View File

@ -11,9 +11,6 @@
! RUN: not %flang_fc1 --help-hidden 2>&1 | FileCheck %s --check-prefix=ERROR-FLANG-FC1 ! RUN: not %flang_fc1 --help-hidden 2>&1 | FileCheck %s --check-prefix=ERROR-FLANG-FC1
! RUN: not %flang_fc1 -help-hidden 2>&1 | FileCheck %s --check-prefix=ERROR-FLANG-FC1 ! RUN: not %flang_fc1 -help-hidden 2>&1 | FileCheck %s --check-prefix=ERROR-FLANG-FC1
!----------------------------------------------------
! EXPECTED OUTPUT FOR FLANG DRIVER (flang-new)
!----------------------------------------------------
! CHECK:USAGE: flang-new ! CHECK:USAGE: flang-new
! CHECK-EMPTY: ! CHECK-EMPTY:
! CHECK-NEXT:OPTIONS: ! CHECK-NEXT:OPTIONS:
@ -69,14 +66,8 @@
! CHECK-NEXT: -W<warning> Enable the specified warning ! CHECK-NEXT: -W<warning> Enable the specified warning
! CHECK-NEXT: -Xflang <arg> Pass <arg> to the flang compiler ! CHECK-NEXT: -Xflang <arg> Pass <arg> to the flang compiler
!-------------------------------------------------------------
! EXPECTED OUTPUT FOR FLANG DRIVER (flang-new)
!-------------------------------------------------------------
! ERROR-FLANG: error: unknown argument '-help-hidden'; did you mean '--help-hidden'? ! ERROR-FLANG: error: unknown argument '-help-hidden'; did you mean '--help-hidden'?
!-------------------------------------------------------------
! EXPECTED OUTPUT FOR FLANG FRONTEND DRIVER (flang-new -fc1)
!-------------------------------------------------------------
! Frontend driver -help-hidden is not supported ! Frontend driver -help-hidden is not supported
! ERROR-FLANG-FC1: error: unknown argument: '{{.*}}' ! ERROR-FLANG-FC1: error: unknown argument: '{{.*}}'

View File

@ -11,9 +11,6 @@
! RUN: %flang_fc1 -help 2>&1 | FileCheck %s --check-prefix=HELP-FC1 ! RUN: %flang_fc1 -help 2>&1 | FileCheck %s --check-prefix=HELP-FC1
! RUN: not %flang_fc1 -helps 2>&1 | FileCheck %s --check-prefix=ERROR ! RUN: not %flang_fc1 -helps 2>&1 | FileCheck %s --check-prefix=ERROR
!----------------------------------------------------
! EXPECTED OUTPUT FOR FLANG DRIVER (flang)
!----------------------------------------------------
! HELP:USAGE: flang ! HELP:USAGE: flang
! HELP-EMPTY: ! HELP-EMPTY:
! HELP-NEXT:OPTIONS: ! HELP-NEXT:OPTIONS:
@ -67,9 +64,6 @@
! HELP-NEXT: -W<warning> Enable the specified warning ! HELP-NEXT: -W<warning> Enable the specified warning
! HELP-NEXT: -Xflang <arg> Pass <arg> to the flang compiler ! HELP-NEXT: -Xflang <arg> Pass <arg> to the flang compiler
!-------------------------------------------------------------
! EXPECTED OUTPUT FOR FLANG FRONTEND DRIVER (flang -fc1)
!-------------------------------------------------------------
! HELP-FC1:USAGE: flang ! HELP-FC1:USAGE: flang
! HELP-FC1-EMPTY: ! HELP-FC1-EMPTY:
! HELP-FC1-NEXT:OPTIONS: ! HELP-FC1-NEXT:OPTIONS:
@ -147,7 +141,4 @@
! HELP-FC1-NEXT: -version Print the compiler version ! HELP-FC1-NEXT: -version Print the compiler version
! HELP-FC1-NEXT: -W<warning> Enable the specified warning ! HELP-FC1-NEXT: -W<warning> Enable the specified warning
!---------------
! EXPECTED ERROR
!---------------
! ERROR: error: unknown argument '-helps'; did you mean '-help' ! ERROR: error: unknown argument '-helps'; did you mean '-help'

View File

@ -1,15 +1,9 @@
!-----------
! RUN LINES
!-----------
! RUN: %flang --version 2>&1 | FileCheck %s --check-prefix=VERSION ! RUN: %flang --version 2>&1 | FileCheck %s --check-prefix=VERSION
! RUN: not %flang --versions 2>&1 | FileCheck %s --check-prefix=ERROR ! RUN: not %flang --versions 2>&1 | FileCheck %s --check-prefix=ERROR
! RUN: %flang_fc1 -version 2>&1 | FileCheck %s --check-prefix=VERSION-FC1 ! RUN: %flang_fc1 -version 2>&1 | FileCheck %s --check-prefix=VERSION-FC1
! RUN: not %flang_fc1 --version 2>&1 | FileCheck %s --check-prefix=ERROR-FC1 ! RUN: not %flang_fc1 --version 2>&1 | FileCheck %s --check-prefix=ERROR-FC1
!-----------------------
! EXPECTED OUTPUT
!-----------------------
! VERSION: flang-new version ! VERSION: flang-new version
! VERSION-NEXT: Target: ! VERSION-NEXT: Target:
! VERSION-NEXT: Thread model: ! VERSION-NEXT: Thread model:

View File

@ -5,16 +5,10 @@
!---------- !----------
! RUN: not %flang_fc1 -fdebug-dump-all %s 2>&1 | FileCheck %s ! RUN: not %flang_fc1 -fdebug-dump-all %s 2>&1 | FileCheck %s
!----------------
! EXPECTED OUTPUT
!----------------
! CHECK: error: Semantic errors in ! CHECK: error: Semantic errors in
! CHECK: Flang: parse tree dump ! CHECK: Flang: parse tree dump
! CHECK: Flang: symbols dump ! CHECK: Flang: symbols dump
!-------
! INPUT
!-------
program bad program bad
real,pointer :: x real,pointer :: x
x = null() ! Error - must be pointer assignment x = null() ! Error - must be pointer assignment

View File

@ -4,15 +4,9 @@
!---------- !----------
! RUN: %flang_fc1 -fdebug-dump-all %s 2>&1 | FileCheck %s ! RUN: %flang_fc1 -fdebug-dump-all %s 2>&1 | FileCheck %s
!----------------
! EXPECTED OUTPUT
!----------------
! CHECK: Flang: parse tree dump ! CHECK: Flang: parse tree dump
! CHECK: Flang: symbols dump ! CHECK: Flang: symbols dump
!-------
! INPUT
!-------
parameter(i=1) parameter(i=1)
integer :: j integer :: j
end program end program

View File

@ -4,9 +4,6 @@
! RUN: %flang_fc1 -fdebug-dump-parse-tree %s 2>&1 | FileCheck %s --check-prefix=SEMA_ON ! RUN: %flang_fc1 -fdebug-dump-parse-tree %s 2>&1 | FileCheck %s --check-prefix=SEMA_ON
! RUN: %flang_fc1 -fdebug-dump-parse-tree-no-sema %s 2>&1 | FileCheck %s --check-prefix=SEMA_OFF ! RUN: %flang_fc1 -fdebug-dump-parse-tree-no-sema %s 2>&1 | FileCheck %s --check-prefix=SEMA_OFF
!-----------------
! EXPECTEED OUTPUT
!-----------------
! SEMA_ON: | | | NamedConstant -> Name = 'i' ! SEMA_ON: | | | NamedConstant -> Name = 'i'
! SEMA_ON-NEXT: | | | Constant -> Expr = '1_4' ! SEMA_ON-NEXT: | | | Constant -> Expr = '1_4'
! SEMA_ON-NEXT: | | | | LiteralConstant -> IntLiteralConstant = '1' ! SEMA_ON-NEXT: | | | | LiteralConstant -> IntLiteralConstant = '1'
@ -14,9 +11,6 @@
! SEMA_OFF: | | | NamedConstant -> Name = 'i' ! SEMA_OFF: | | | NamedConstant -> Name = 'i'
! SEMA_OFF-NEXT: | | | Constant -> Expr -> LiteralConstant -> IntLiteralConstant = '1' ! SEMA_OFF-NEXT: | | | Constant -> Expr -> LiteralConstant -> IntLiteralConstant = '1'
!-------
! INPUT
!-------
parameter(i=1) parameter(i=1)
integer :: j integer :: j
end program end program

View File

@ -3,20 +3,11 @@
! UNSUPPORTED: system-windows ! UNSUPPORTED: system-windows
! Windows is currently not supported in flang/lib/Optimizer/CodeGen/Target.cpp ! Windows is currently not supported in flang/lib/Optimizer/CodeGen/Target.cpp
!------------
! RUN COMMAND
!------------
! RUN: %flang_fc1 -emit-llvm %s -o - | FileCheck %s ! RUN: %flang_fc1 -emit-llvm %s -o - | FileCheck %s
!----------------
! EXPECTED OUTPUT
!----------------
! CHECK: ; ModuleID = 'FIRModule' ! CHECK: ; ModuleID = 'FIRModule'
! CHECK: define void @_QQmain() ! CHECK: define void @_QQmain()
! CHECK-NEXT: ret void ! CHECK-NEXT: ret void
! CHECK-NEXT: } ! CHECK-NEXT: }
!------
! INPUT
!------
end program end program

View File

@ -14,16 +14,10 @@
! RUN: %flang_fc1 -E -fbackslash -fno-backslash %s 2>&1 | FileCheck %s --check-prefix=ESCAPED ! RUN: %flang_fc1 -E -fbackslash -fno-backslash %s 2>&1 | FileCheck %s --check-prefix=ESCAPED
! RUN: %flang_fc1 -E -fbackslash %s 2>&1 | FileCheck %s --check-prefix=UNESCAPED ! RUN: %flang_fc1 -E -fbackslash %s 2>&1 | FileCheck %s --check-prefix=UNESCAPED
!-----------------------------------------
! EXPECTED OUTPUT FOR ESCAPED BACKSLASHES
!-----------------------------------------
! ESCAPED:program Backslash ! ESCAPED:program Backslash
! ESCAPED-NEXT:New\\nline ! ESCAPED-NEXT:New\\nline
! ESCAPED-NOT:New\nline ! ESCAPED-NOT:New\nline
!-------------------------------------------
! EXPECTED OUTPUT FOR UNESCAPED BACKSLASHES
!-------------------------------------------
! UNESCAPED:program Backslash ! UNESCAPED:program Backslash
! UNESCAPED-NEXT:New\nline ! UNESCAPED-NEXT:New\nline
! UNESCAPED-NOT:New\\nline ! UNESCAPED-NOT:New\\nline

View File

@ -23,30 +23,18 @@
! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=DOUBLE8 ! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=DOUBLE8
! RUN: not %flang_fc1 -fsyntax-only -fdefault-double-8 %s 2>&1 | FileCheck %s --check-prefix=ERROR ! RUN: not %flang_fc1 -fsyntax-only -fdefault-double-8 %s 2>&1 | FileCheck %s --check-prefix=ERROR
!-----------------------------------------
! EXPECTED OUTPUT FOR NO SPECIFICATION
!-----------------------------------------
! NOOPTION: integer(4),parameter::real_kind=4_4 ! NOOPTION: integer(4),parameter::real_kind=4_4
! NOOPTION-NEXT: intrinsic::kind ! NOOPTION-NEXT: intrinsic::kind
! NOOPTION-NEXT: integer(4),parameter::double_kind=8_4 ! NOOPTION-NEXT: integer(4),parameter::double_kind=8_4
!-------------------------------------------
! EXPECTED OUTPUT FOR ONLY -fdefault-real-8
!-------------------------------------------
! REAL8: integer(4),parameter::real_kind=8_4 ! REAL8: integer(4),parameter::real_kind=8_4
! REAL8-NEXT: intrinsic::kind ! REAL8-NEXT: intrinsic::kind
! REAL8-NEXT: integer(4),parameter::double_kind=16_4 ! REAL8-NEXT: integer(4),parameter::double_kind=16_4
!-------------------------------------------------------------
! EXPECTED OUTPUT FOR -fdefault-real-8 AND -fdefault-double-8
!-------------------------------------------------------------
! DOUBLE8: integer(4),parameter::real_kind=8_4 ! DOUBLE8: integer(4),parameter::real_kind=8_4
! DOUBLE8-NEXT: intrinsic::kind ! DOUBLE8-NEXT: intrinsic::kind
! DOUBLE8-NEXT: integer(4),parameter::double_kind=8_4 ! DOUBLE8-NEXT: integer(4),parameter::double_kind=8_4
!------------------------------------------------------
! EXPECTED OUTPUT FOR PROVIDING ONLY -fdefault-double-8
!------------------------------------------------------
! ERROR: Use of `-fdefault-double-8` requires `-fdefault-real-8` ! ERROR: Use of `-fdefault-double-8` requires `-fdefault-real-8`
module m module m

View File

@ -16,21 +16,12 @@
! RUN: %flang_fc1 -E -fno-reformat %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=FIXEDFORM ! RUN: %flang_fc1 -E -fno-reformat %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=FIXEDFORM
! RUN: %flang_fc1 -E -fno-reformat %S/Inputs/free-form-test.f90 %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=MULTIPLEFORMS ! RUN: %flang_fc1 -E -fno-reformat %S/Inputs/free-form-test.f90 %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=MULTIPLEFORMS
!-------------------------------------
! EXPECTED OUTPUT FOR A FREE FORM FILE
!-------------------------------------
! FREEFORM:program freeform ! FREEFORM:program freeform
! FREEFORM-NOT:programfixedform ! FREEFORM-NOT:programfixedform
!---------------------------------------
! EXPECTED OUTPUT FOR A FIXED FORM FILE
!---------------------------------------
! FIXEDFORM:programfixedform ! FIXEDFORM:programfixedform
! FIXEDFORM-NOT:program freeform ! FIXEDFORM-NOT:program freeform
!------------------------------------------------
! EXPECTED OUTPUT FOR 2 FILES OF DIFFERENT FORMS
!------------------------------------------------
! MULTIPLEFORMS:program freeform ! MULTIPLEFORMS:program freeform
! MULTIPLEFORMS-NOT:programfixedform ! MULTIPLEFORMS-NOT:programfixedform
! MULTIPLEFORMS-NEXT:end ! MULTIPLEFORMS-NEXT:end

View File

@ -12,12 +12,6 @@
! RUN: not %flang_fc1 -fsyntax-only -ffree-form %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=FREEFORM ! RUN: not %flang_fc1 -fsyntax-only -ffree-form %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=FREEFORM
! RUN: %flang_fc1 -fsyntax-only -ffixed-form %S/Inputs/free-form-test.f90 2>&1 | FileCheck %s --check-prefix=FIXEDFORM ! RUN: %flang_fc1 -fsyntax-only -ffixed-form %S/Inputs/free-form-test.f90 2>&1 | FileCheck %s --check-prefix=FIXEDFORM
!------------------------------------
! EXPECTED OUTPUT FOR FREE FORM MODE
!------------------------------------
! FREEFORM: Could not parse ! FREEFORM: Could not parse
!-------------------------------------
! EXPECTED OUTPUT FOR FIXED FORM MODE
!-------------------------------------
! FIXEDFORM:free-form-test.f90:1:1: warning: Character in fixed-form label field must be a digit ! FIXEDFORM:free-form-test.f90:1:1: warning: Character in fixed-form label field must be a digit

View File

@ -26,29 +26,14 @@
! RUN: %flang -E -Xflang -fno-reformat -ffixed-line-length-13 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=LENGTH13 ! RUN: %flang -E -Xflang -fno-reformat -ffixed-line-length-13 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=LENGTH13
! RUN: %flang_fc1 -E -fno-reformat -ffixed-line-length-13 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=LENGTH13 ! RUN: %flang_fc1 -E -fno-reformat -ffixed-line-length-13 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=LENGTH13
!-------------------------------------
! EXPECTED OUTPUT WITH DEFAULT LENGTH
!-------------------------------------
! The line should be trimmed to 72 characters when reading based on the default value of fixed line length. ! The line should be trimmed to 72 characters when reading based on the default value of fixed line length.
! DEFAULTLENGTH: program{{(a{58})}} ! DEFAULTLENGTH: program{{(a{58})}}
!-----------------------------------------
! EXPECTED OUTPUT WITH A NEGATIVE LENGTH
!-----------------------------------------
! NEGATIVELENGTH: invalid value '-2' in 'ffixed-line-length=', value must be 'none' or a positive integer ! NEGATIVELENGTH: invalid value '-2' in 'ffixed-line-length=', value must be 'none' or a positive integer
!-----------------------------------------
! EXPECTED OUTPUT WITH LENGTH LESS THAN 7
!-----------------------------------------
! INVALIDLENGTH: invalid value '3' in 'ffixed-line-length=', value must be '7' or greater ! INVALIDLENGTH: invalid value '3' in 'ffixed-line-length=', value must be '7' or greater
!---------------------------------------
! EXPECTED OUTPUT WITH UNLIMITED LENGTH
!---------------------------------------
! The line should not be trimmed and so 73 characters (including spaces) should be read. ! The line should not be trimmed and so 73 characters (including spaces) should be read.
! UNLIMITEDLENGTH: program{{(a{59})}} ! UNLIMITEDLENGTH: program{{(a{59})}}
!--------------------------------
! EXPECTED OUTPUT WITH LENGTH 13
!--------------------------------
! LENGTH13: program ! LENGTH13: program

View File

@ -1,14 +1,8 @@
! Test for warnings generated when parsing driver options. You can use this file for relatively small tests and to avoid creating ! Test for warnings generated when parsing driver options. You can use this file for relatively small tests and to avoid creating
! new test files. ! new test files.
!-----------
! RUN LINES
!-----------
! RUN: %flang -### -S -O4 %s 2>&1 | FileCheck %s ! RUN: %flang -### -S -O4 %s 2>&1 | FileCheck %s
!-----------------------
! EXPECTED OUTPUT
!-----------------------
! CHECK: warning: -O4 is equivalent to -O3 ! CHECK: warning: -O4 is equivalent to -O3
! CHECK-LABEL: "-fc1" ! CHECK-LABEL: "-fc1"
! CHECK: -O3 ! CHECK: -O3

View File

@ -17,15 +17,9 @@
! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -flarge-sizes -module-dir %t/dir-flang-new %s 2>&1 ! RUN: rm -rf %t/dir-flang-new && mkdir -p %t/dir-flang-new && %flang_fc1 -fsyntax-only -flarge-sizes -module-dir %t/dir-flang-new %s 2>&1
! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=LARGE ! RUN: cat %t/dir-flang-new/m.mod | FileCheck %s --check-prefix=LARGE
!-----------------------------------------
! EXPECTED OUTPUT WITHOUT -flarge-sizes
!-----------------------------------------
! NOLARGE: real(4)::z(1_8:10_8) ! NOLARGE: real(4)::z(1_8:10_8)
! NOLARGE-NEXT: integer(4),parameter::size_kind=4_4 ! NOLARGE-NEXT: integer(4),parameter::size_kind=4_4
!-----------------------------------------
! EXPECTED OUTPUT FOR -flarge-sizes
!-----------------------------------------
! LARGE: real(4)::z(1_8:10_8) ! LARGE: real(4)::z(1_8:10_8)
! LARGE-NEXT: integer(4),parameter::size_kind=8_4 ! LARGE-NEXT: integer(4),parameter::size_kind=8_4

View File

@ -1,9 +1,6 @@
! Verify that the driver correctly rejects invalid values for -fget-definition ! Verify that the driver correctly rejects invalid values for -fget-definition
!----------- ! RUN: not %flang_fc1 -fget-definition 36 1 2 %s 2>&1 | FileCheck --check-prefix=OK %s
! RUN LINES
!-----------
! RUN: not %flang_fc1 -fget-definition 45 1 2 %s 2>&1 | FileCheck --check-prefix=OK %s
! RUN: not %flang_fc1 -fget-definition a 1 1 %s 2>&1 | FileCheck --check-prefix=ERROR-a %s ! RUN: not %flang_fc1 -fget-definition a 1 1 %s 2>&1 | FileCheck --check-prefix=ERROR-a %s
! RUN: not %flang_fc1 -fget-definition 1 b 1 %s 2>&1 | FileCheck --check-prefix=ERROR-b %s ! RUN: not %flang_fc1 -fget-definition 1 b 1 %s 2>&1 | FileCheck --check-prefix=ERROR-b %s
! RUN: not %flang_fc1 -fget-definition 1 1 c %s 2>&1 | FileCheck --check-prefix=ERROR-c %s ! RUN: not %flang_fc1 -fget-definition 1 1 c %s 2>&1 | FileCheck --check-prefix=ERROR-c %s
@ -12,9 +9,6 @@
! RUN: not %flang_fc1 -fget-definition 1 b c %s 2>&1 | FileCheck --check-prefix=ERROR-bc %s ! RUN: not %flang_fc1 -fget-definition 1 b c %s 2>&1 | FileCheck --check-prefix=ERROR-bc %s
! RUN: not %flang_fc1 -fget-definition a 1 c %s 2>&1 | FileCheck --check-prefix=ERROR-ac %s ! RUN: not %flang_fc1 -fget-definition a 1 c %s 2>&1 | FileCheck --check-prefix=ERROR-ac %s
!-----------------
! EXPECTED OUTPUT
!-----------------
! OK: String range: >m< ! OK: String range: >m<
! OK-NOT: error ! OK-NOT: error
@ -39,8 +33,5 @@
! ERROR-abc: error: invalid value 'a' in 'fget-definition' ! ERROR-abc: error: invalid value 'a' in 'fget-definition'
! ERROR-abc-NOT: String range: >m< ! ERROR-abc-NOT: String range: >m<
!-------
! INPUT
!-------
module m module m
end module end module

View File

@ -14,14 +14,8 @@
! RUN: %flang_fc1 -fsyntax-only -fimplicit-none -fno-implicit-none %s 2>&1 | FileCheck %s --allow-empty --check-prefix=DEFAULT ! RUN: %flang_fc1 -fsyntax-only -fimplicit-none -fno-implicit-none %s 2>&1 | FileCheck %s --allow-empty --check-prefix=DEFAULT
! RUN: not %flang_fc1 -fsyntax-only -fimplicit-none %s 2>&1 | FileCheck %s --check-prefix=WITH_IMPL_NONE ! RUN: not %flang_fc1 -fsyntax-only -fimplicit-none %s 2>&1 | FileCheck %s --check-prefix=WITH_IMPL_NONE
!--------------------------------------
! EXPECTED OUTPUT FOR NO IMPLICIT NONE
!--------------------------------------
! DEFAULT-NOT:error ! DEFAULT-NOT:error
!------------------------------------------
! EXPECTED OUTPUT FOR IMPLICIT NONE ALWAYS
!------------------------------------------
! WITH_IMPL_NONE:No explicit type declared for 'a' ! WITH_IMPL_NONE:No explicit type declared for 'a'
! WITH_IMPL_NONE:No explicit type declared for 'b' ! WITH_IMPL_NONE:No explicit type declared for 'b'

View File

@ -16,16 +16,10 @@
! RUN: %flang_fc1 -E -I %S/Inputs -I %S/Inputs/header-dir %s 2>&1 | FileCheck %s --check-prefix=MAINDIRECTORY ! RUN: %flang_fc1 -E -I %S/Inputs -I %S/Inputs/header-dir %s 2>&1 | FileCheck %s --check-prefix=MAINDIRECTORY
! RUN: %flang_fc1 -E -I %S/Inputs/header-dir -I %S/Inputs %s 2>&1 | FileCheck %s --check-prefix=SUBDIRECTORY ! RUN: %flang_fc1 -E -I %S/Inputs/header-dir -I %S/Inputs %s 2>&1 | FileCheck %s --check-prefix=SUBDIRECTORY
!--------------------------------------------
! EXPECTED OUTPUT FOR MISSING INCLUDED FILE
!--------------------------------------------
! UNINCLUDED:#include: Source file 'basic-header-one.h' was not found ! UNINCLUDED:#include: Source file 'basic-header-one.h' was not found
! UNINCLUDED-NOT:program b ! UNINCLUDED-NOT:program b
! UNINCLUDED-NOT:program c ! UNINCLUDED-NOT:program c
!---------------------------------------------
! EXPECTED OUTPUT FOR A SINGLE INCLUDED FOLDER
!--------------------------------------------
! SINGLEINCLUDE:program MainDirectoryOne ! SINGLEINCLUDE:program MainDirectoryOne
! SINGLEINCLUDE-NOT:program X ! SINGLEINCLUDE-NOT:program X
! SINGLEINCLUDE-NOT:program B ! SINGLEINCLUDE-NOT:program B
@ -33,9 +27,6 @@
! SINGLEINCLUDE-NOT:program Y ! SINGLEINCLUDE-NOT:program Y
! SINGLEINCLUDE-NOT:program C ! SINGLEINCLUDE-NOT:program C
!-------------------------------------------------------
! EXPECTED OUTPUT FOR Inputs/ DIRECTORY SPECIFIED FIRST
!-------------------------------------------------------
! MAINDIRECTORY:program MainDirectoryOne ! MAINDIRECTORY:program MainDirectoryOne
! MAINDIRECTORY-NOT:program SubDirectoryOne ! MAINDIRECTORY-NOT:program SubDirectoryOne
! MAINDIRECTORY-NOT:program B ! MAINDIRECTORY-NOT:program B
@ -43,9 +34,6 @@
! MAINDIRECTORY-NOT:program SubDirectoryTwo ! MAINDIRECTORY-NOT:program SubDirectoryTwo
! MAINDIRECTORY-NOT:program C ! MAINDIRECTORY-NOT:program C
!------------------------------------------------------------------
! EXPECTED OUTPUT FOR Inputs/header-dir/ DIRECTORY SPECIFIED FIRST
!------------------------------------------------------------------
! SUBDIRECTORY:program SubDirectoryOne ! SUBDIRECTORY:program SubDirectoryOne
! SUBDIRECTORY-NOT:program MainDirectoryOne ! SUBDIRECTORY-NOT:program MainDirectoryOne
! SUBDIRECTORY-NOT:program B ! SUBDIRECTORY-NOT:program B

View File

@ -5,9 +5,6 @@
! source file takes precedence over other search paths. Hence adding omp_lib.h in the current directory will make Flang use that ! source file takes precedence over other search paths. Hence adding omp_lib.h in the current directory will make Flang use that
! header file instead of the one shipped with Flang. ! header file instead of the one shipped with Flang.
!----------
! RUN LINES
!----------
! This should just work ! This should just work
! RUN: not rm omp_lib.h ! RUN: not rm omp_lib.h
! RUN: %flang -fsyntax-only -fopenmp %s 2>&1 ! RUN: %flang -fsyntax-only -fopenmp %s 2>&1
@ -17,14 +14,8 @@
! RUN: not %flang -fsyntax-only -fopenmp %s 2>&1 | FileCheck %s ! RUN: not %flang -fsyntax-only -fopenmp %s 2>&1 | FileCheck %s
! RUN: rm omp_lib.h ! RUN: rm omp_lib.h
!--------------------------
! EXPECTED OUTPUT
!--------------------------
! CHECK: error: Must have INTEGER type, but is REAL(4) ! CHECK: error: Must have INTEGER type, but is REAL(4)
!-------
! INPUT
!-------
include "omp_lib.h" include "omp_lib.h"
integer :: x, y integer :: x, y

View File

@ -2,9 +2,6 @@
; REQUIRES: aarch64-registered-target ; REQUIRES: aarch64-registered-target
;----------
; RUN LINES
;----------
; Input type is implicit - assumed to be Fortran. As the input is provided via ; Input type is implicit - assumed to be Fortran. As the input is provided via
; stdin, the file extension is not relevant here. ; stdin, the file extension is not relevant here.
; RUN: cat %s | not %flang -S - -o - ; RUN: cat %s | not %flang -S - -o -
@ -14,15 +11,9 @@
; RUN: cat %s | %flang -x ir -S -target aarch64-unknown-linux-gnu - -o - | FileCheck %s ; RUN: cat %s | %flang -x ir -S -target aarch64-unknown-linux-gnu - -o - | FileCheck %s
; RUN: cat %s | %flang_fc1 -x ir -S -triple aarch64-unknown-linux-gnu - -o - | FileCheck %s ; RUN: cat %s | %flang_fc1 -x ir -S -triple aarch64-unknown-linux-gnu - -o - | FileCheck %s
;----------------
; EXPECTED OUTPUT
;----------------
; CHECK-LABEL: foo: ; CHECK-LABEL: foo:
; CHECK: ret ; CHECK: ret
;------
; INPUT
;------
define void @foo() { define void @foo() {
ret void ret void
} }

View File

@ -25,15 +25,9 @@
! RUN: cat %s | %flang -fc1 -test-io -cpp | FileCheck %s --check-prefix=IO --match-full-lines ! RUN: cat %s | %flang -fc1 -test-io -cpp | FileCheck %s --check-prefix=IO --match-full-lines
! RUN: cat %s | %flang -fc1 -DNEW -cpp -test-io | FileCheck %s --check-prefix=IO --match-full-lines ! RUN: cat %s | %flang -fc1 -DNEW -cpp -test-io | FileCheck %s --check-prefix=IO --match-full-lines
!-------------------------
! EXPECTED OUTPUT for `-E`
!-------------------------
! PP-NOT-DEFINED: Program B ! PP-NOT-DEFINED: Program B
! PP-DEFINED: Program A ! PP-DEFINED: Program A
!-------------------------------
! EXPECTED OUTPUT for `-test-io`
!-------------------------------
! IO: #ifdef NEW ! IO: #ifdef NEW
! IO-NEXT: Program A ! IO-NEXT: Program A
! IO-NEXT: #else ! IO-NEXT: #else

View File

@ -9,15 +9,9 @@
! RUN: %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty --check-prefix=WITHOUT ! RUN: %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty --check-prefix=WITHOUT
! RUN: not %flang_fc1 -fsyntax-only -fintrinsic-modules-path %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=GIVEN ! RUN: not %flang_fc1 -fsyntax-only -fintrinsic-modules-path %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=GIVEN
!-----------------------------------------
! EXPECTED OUTPUT WITHOUT
!-----------------------------------------
! WITHOUT-NOT: 'ieee_arithmetic.mod' was not found ! WITHOUT-NOT: 'ieee_arithmetic.mod' was not found
! WITHOUT-NOT: 'iso_fortran_env.mod' was not found ! WITHOUT-NOT: 'iso_fortran_env.mod' was not found
!-----------------------------------------
! EXPECTED OUTPUT WITH
!-----------------------------------------
! GIVEN: error: Cannot read module file for module 'ieee_arithmetic': File has invalid checksum ! GIVEN: error: Cannot read module file for module 'ieee_arithmetic': File has invalid checksum
! GIVEN: error: Cannot read module file for module 'iso_fortran_env': File has invalid checksum ! GIVEN: error: Cannot read module file for module 'iso_fortran_env': File has invalid checksum

View File

@ -14,15 +14,9 @@
! RUN: %flang_fc1 -E -P -DX=A %s 2>&1 | FileCheck %s --check-prefix=DEFINED ! RUN: %flang_fc1 -E -P -DX=A %s 2>&1 | FileCheck %s --check-prefix=DEFINED
! RUN: %flang_fc1 -E -P -DX -UX %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED ! RUN: %flang_fc1 -E -P -DX -UX %s 2>&1 | FileCheck %s --check-prefix=UNDEFINED
!--------------------------------------------
! EXPECTED OUTPUT FOR AN UNDEFINED MACRO
!--------------------------------------------
! UNDEFINED:program B ! UNDEFINED:program B
! UNDEFINED-NOT:program X ! UNDEFINED-NOT:program X
!--------------------------------------------
! EXPECTED OUTPUT FOR MACRO 'X' DEFINED AS A
!--------------------------------------------
! DEFINED:program A ! DEFINED:program A
! DEFINED-NOT:program B ! DEFINED-NOT:program B

View File

@ -10,9 +10,6 @@
!----------------------------------------- !-----------------------------------------
! RUN: printf -- "-DX=A\\\\\nTHIS_SHOULD_NOT_EXIST_IN_THE_OUTPUT\n" | xargs %flang_fc1 -E -P %s 2>&1 | FileCheck --strict-whitespace --match-full-lines %s ! RUN: printf -- "-DX=A\\\\\nTHIS_SHOULD_NOT_EXIST_IN_THE_OUTPUT\n" | xargs %flang_fc1 -E -P %s 2>&1 | FileCheck --strict-whitespace --match-full-lines %s
!-------------------------------
! EXPECTED OUTPUT FOR MACRO 'X'
!-------------------------------
! CHECK: START A END ! CHECK: START A END
! CHECK-NOT:THIS_SHOULD_NOT_EXIST_IN_THE_OUTPUT ! CHECK-NOT:THIS_SHOULD_NOT_EXIST_IN_THE_OUTPUT
! CHECK-NOT:this_should_not_exist_in_the_output ! CHECK-NOT:this_should_not_exist_in_the_output

View File

@ -13,7 +13,4 @@
! RUN: not %flang_fc1 -E %s -module-suffix 2>&1 | FileCheck %s ! RUN: not %flang_fc1 -E %s -module-suffix 2>&1 | FileCheck %s
! RUN: not %flang_fc1 -E %s -fintrinsic-modules-path 2>&1 | FileCheck %s ! RUN: not %flang_fc1 -E %s -fintrinsic-modules-path 2>&1 | FileCheck %s
!-----------------------
! EXPECTED OUTPUT
!-----------------------
! CHECK: error: argument to '-{{.*}}' is missing (expected 1 value) ! CHECK: error: argument to '-{{.*}}' is missing (expected 1 value)

View File

@ -17,9 +17,6 @@
! RUN: not %flang_fc1 %t.f90 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-NONEXISTENT-FILE ! RUN: not %flang_fc1 %t.f90 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-NONEXISTENT-FILE
! RUN: not %flang_fc1 %S 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-DIR ! RUN: not %flang_fc1 %S 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-DIR
!-----------------------
! EXPECTED OUTPUT
!-----------------------
! FLANG-NO-FILE: flang-new: error: no input files ! FLANG-NO-FILE: flang-new: error: no input files
! FLANG-NONEXISTENT-FILE: flang-new: error: no such file or directory: {{.*}} ! FLANG-NONEXISTENT-FILE: flang-new: error: no such file or directory: {{.*}}

View File

@ -1,8 +1,5 @@
! Test the `-mllvm` option ! Test the `-mllvm` option
!------------
! RUN COMMAND
!------------
! 1. Test typical usage. ! 1. Test typical usage.
! RUN: %flang -S -mllvm -print-before-all %s -o - 2>&1 | FileCheck %s --check-prefix=OUTPUT ! RUN: %flang -S -mllvm -print-before-all %s -o - 2>&1 | FileCheck %s --check-prefix=OUTPUT
! RUN: %flang_fc1 -S -mllvm -print-before-all %s -o - 2>&1 | FileCheck %s --check-prefix=OUTPUT ! RUN: %flang_fc1 -S -mllvm -print-before-all %s -o - 2>&1 | FileCheck %s --check-prefix=OUTPUT
@ -10,16 +7,10 @@
! 2. Test invalid usage (`-print-before` requires an argument) ! 2. Test invalid usage (`-print-before` requires an argument)
! RUN: not %flang -S -mllvm -print-before %s -o - 2>&1 | FileCheck %s --check-prefix=INVALID_USAGE ! RUN: not %flang -S -mllvm -print-before %s -o - 2>&1 | FileCheck %s --check-prefix=INVALID_USAGE
!----------------
! EXPECTED OUTPUT
!----------------
! OUTPUT: *** IR Dump Before Pre-ISel Intrinsic Lowering (pre-isel-intrinsic-lowering) *** ! OUTPUT: *** IR Dump Before Pre-ISel Intrinsic Lowering (pre-isel-intrinsic-lowering) ***
! OUTPUT-NEXT: ; ModuleID = 'FIRModule' ! OUTPUT-NEXT: ; ModuleID = 'FIRModule'
! OUTPUT-NEXT: source_filename = "FIRModule" ! OUTPUT-NEXT: source_filename = "FIRModule"
! INVALID_USAGE: flang (LLVM option parsing): for the --print-before option: requires a value! ! INVALID_USAGE: flang (LLVM option parsing): for the --print-before option: requires a value!
!------
! INPUT
!------
end program end program

View File

@ -3,15 +3,9 @@
! In practice, '-mmlir --help' is a super-set of '-mllvm --help' and that limits what we can test here. With a better seperation of ! In practice, '-mmlir --help' is a super-set of '-mllvm --help' and that limits what we can test here. With a better seperation of
! LLVM, MLIR and Flang global options, we should be able to write a stricter test. ! LLVM, MLIR and Flang global options, we should be able to write a stricter test.
!------------
! RUN COMMAND
!------------
! RUN: %flang_fc1 -mmlir --help | FileCheck %s --check-prefix=MLIR ! RUN: %flang_fc1 -mmlir --help | FileCheck %s --check-prefix=MLIR
! RUN: %flang_fc1 -mllvm --help | FileCheck %s --check-prefix=MLLVM ! RUN: %flang_fc1 -mllvm --help | FileCheck %s --check-prefix=MLLVM
!----------------
! EXPECTED OUTPUT
!----------------
! MLIR: flang (MLIR option parsing) [options] ! MLIR: flang (MLIR option parsing) [options]
! MLIR: --mlir-{{.*}} ! MLIR: --mlir-{{.*}}

View File

@ -7,9 +7,6 @@
! RUN: cd %t && %flang_fc1 -fsyntax-only -module-suffix .f18.mod -module-dir %t/dir-flang %s ! RUN: cd %t && %flang_fc1 -fsyntax-only -module-suffix .f18.mod -module-dir %t/dir-flang %s
! RUN: ls %t/dir-flang/testmodule.f18.mod && not ls %t/dir-flang/testmodule.mod ! RUN: ls %t/dir-flang/testmodule.f18.mod && not ls %t/dir-flang/testmodule.mod
!--------------------------
! INPUT
!--------------------------
module testmodule module testmodule
type::t2 type::t2
end type end type

View File

@ -6,7 +6,4 @@
! RUN: not %flang_fc1 -E -o %t.doesnotexist/somename %s 2> %t ! RUN: not %flang_fc1 -E -o %t.doesnotexist/somename %s 2> %t
! RUN: FileCheck -check-prefix=OUTPUTFAIL -DMSG=%errc_ENOENT -input-file=%t %s ! RUN: FileCheck -check-prefix=OUTPUTFAIL -DMSG=%errc_ENOENT -input-file=%t %s
!-----------------------
! EXPECTED OUTPUT
!-----------------------
! OUTPUTFAIL: error: unable to open output file '{{.*}}doesnotexist{{.}}somename': '[[MSG]]' ! OUTPUTFAIL: error: unable to open output file '{{.*}}doesnotexist{{.}}somename': '[[MSG]]'

View File

@ -2,9 +2,6 @@
; Fortran (with the `-x` flag). This way we verify that the driver ; Fortran (with the `-x` flag). This way we verify that the driver
; correctly rejects invalid Fortran input. ; correctly rejects invalid Fortran input.
;----------
; RUN LINES
;----------
; Input type is implicit (correctly assumed to be LLVM IR) ; Input type is implicit (correctly assumed to be LLVM IR)
; RUN: %flang_fc1 -S %s -o - ; RUN: %flang_fc1 -S %s -o -

View File

@ -2,9 +2,6 @@
; FIR (with the `-x` flag). This way we verify that the driver ; FIR (with the `-x` flag). This way we verify that the driver
; correctly rejects invalid FIR input. ; correctly rejects invalid FIR input.
;----------
; RUN LINES
;----------
; Input type is implicit (correctly assumed to be LLVM IR) ; Input type is implicit (correctly assumed to be LLVM IR)
; RUN: %flang_fc1 -S %s -o - ; RUN: %flang_fc1 -S %s -o -

View File

@ -2,17 +2,11 @@
! LLVM file (with the `-x` flag). This way we verify that the driver correctly ! LLVM file (with the `-x` flag). This way we verify that the driver correctly
! rejects invalid LLVM IR input. ! rejects invalid LLVM IR input.
!----------
! RUN LINES
!----------
! Input type is implicit (correctly assumed to be Fortran) ! Input type is implicit (correctly assumed to be Fortran)
! RUN: %flang_fc1 -S -o /dev/null %s ! RUN: %flang_fc1 -S -o /dev/null %s
! Input type is explicitly set as LLVM IR ! Input type is explicitly set as LLVM IR
! RUN: not %flang -S -x ir %s 2>&1 | FileCheck %s ! RUN: not %flang -S -x ir %s 2>&1 | FileCheck %s
!----------------
! EXPECTED OUTPUT
!----------------
! CHECK: error: Could not parse IR ! CHECK: error: Could not parse IR
end program end program

View File

@ -1,15 +1,9 @@
! This test verifies the phase control in Flang compiler driver. ! This test verifies the phase control in Flang compiler driver.
!-----------
! RUN LINES
!-----------
! RUN: %flang -E -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=PP ! RUN: %flang -E -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=PP
! RUN: %flang -fsyntax-only -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=COMPILE ! RUN: %flang -fsyntax-only -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=COMPILE
! RUN: %flang -c -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=EMIT_OBJ ! RUN: %flang -c -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=EMIT_OBJ
!-----------------------
! EXPECTED OUTPUT
!-----------------------
! PP: +- 0: input, "{{.*}}phases.f90", f95-cpp-input ! PP: +- 0: input, "{{.*}}phases.f90", f95-cpp-input
! PP-NEXT: 1: preprocessor, {0}, f95 ! PP-NEXT: 1: preprocessor, {0}, f95

View File

@ -1,16 +1,10 @@
! Verify that in contrast to Clang, Flang does not default to generating position independent executables/code ! Verify that in contrast to Clang, Flang does not default to generating position independent executables/code
!-------------
! RUN COMMANDS
!-------------
! RUN: %flang -### %s --target=aarch64-linux-gnu 2>&1 | FileCheck %s --check-prefix=CHECK-NOPIE ! RUN: %flang -### %s --target=aarch64-linux-gnu 2>&1 | FileCheck %s --check-prefix=CHECK-NOPIE
! RUN: %flang -### %s --target=aarch64-linux-gnu -fno-pie 2>&1 | FileCheck %s --check-prefix=CHECK-NOPIE ! RUN: %flang -### %s --target=aarch64-linux-gnu -fno-pie 2>&1 | FileCheck %s --check-prefix=CHECK-NOPIE
! RUN: %flang -### %s --target=aarch64-linux-gnu -fpie 2>&1 | FileCheck %s --check-prefix=CHECK-PIE ! RUN: %flang -### %s --target=aarch64-linux-gnu -fpie 2>&1 | FileCheck %s --check-prefix=CHECK-PIE
!----------------
! EXPECTED OUTPUT
!----------------
! CHECK-NOPIE: "-fc1" ! CHECK-NOPIE: "-fc1"
! CHECk-NOPIE-NOT: "-fpic" ! CHECk-NOPIE-NOT: "-fpic"
! CHECK-NOPIE: "{{.*}}ld" ! CHECK-NOPIE: "{{.*}}ld"

View File

@ -10,9 +10,6 @@
!----------------------------------------- !-----------------------------------------
! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s --ignore-case ! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s --ignore-case
!-----------------
! EXPECTED OUTPUT
!-----------------
! CHECK: flang = 1 ! CHECK: flang = 1
! CHECK: flang_major = {{[1-9][0-9]*$}} ! CHECK: flang_major = {{[1-9][0-9]*$}}
! CHECK: flang_minor = {{[0-9]+$}} ! CHECK: flang_minor = {{[0-9]+$}}

View File

@ -1,11 +1,5 @@
! Test that -print-target-triple prints correct triple. ! Test that -print-target-triple prints correct triple.
!-----------------------------------------
! RUN LINE
!-----------------------------------------
! RUN: %flang -print-effective-triple 2>&1 --target=thumb-linux-gnu | FileCheck %s ! RUN: %flang -print-effective-triple 2>&1 --target=thumb-linux-gnu | FileCheck %s
!-----------------
! EXPECTED OUTPUT
!-----------------
! CHECK: armv4t-unknown-linux-gnu ! CHECK: armv4t-unknown-linux-gnu

View File

@ -1,16 +1,10 @@
! Test that -print-target-triple prints correct triple ! Test that -print-target-triple prints correct triple
!-----------------------------------------
! RUN LINES
!-----------------------------------------
! RUN: %flang -print-target-triple 2>&1 --target=aarch64-linux-gnu \ ! RUN: %flang -print-target-triple 2>&1 --target=aarch64-linux-gnu \
! RUN: | FileCheck --check-prefix=AARCH64 %s ! RUN: | FileCheck --check-prefix=AARCH64 %s
! RUN: %flang -print-target-triple 2>&1 --target=x86_64-linux-gnu \ ! RUN: %flang -print-target-triple 2>&1 --target=x86_64-linux-gnu \
! RUN: | FileCheck --check-prefix=X86_64 %s ! RUN: | FileCheck --check-prefix=X86_64 %s
!-----------------
! EXPECTED OUTPUT
!-----------------
! X86_64: x86_64-unknown-linux-gnu ! X86_64: x86_64-unknown-linux-gnu
! AARCH64: aarch64-unknown-linux-gnu ! AARCH64: aarch64-unknown-linux-gnu

View File

@ -5,7 +5,4 @@
!----------------------------------------- !-----------------------------------------
! RUN: not %flang_fc1 -std=90 %s 2>&1 | FileCheck %s --check-prefix=WRONG ! RUN: not %flang_fc1 -std=90 %s 2>&1 | FileCheck %s --check-prefix=WRONG
!-----------------------------------------
! EXPECTED OUTPUT WITH WRONG
!-----------------------------------------
! WRONG: Only -std=f2018 is allowed currently. ! WRONG: Only -std=f2018 is allowed currently.

View File

@ -7,14 +7,8 @@
! RUN: %flang_fc1 -fsyntax-only -std=f2018 %s 2>&1 | FileCheck %s --check-prefix=GIVEN ! RUN: %flang_fc1 -fsyntax-only -std=f2018 %s 2>&1 | FileCheck %s --check-prefix=GIVEN
! RUN: %flang_fc1 -fsyntax-only -pedantic %s 2>&1 | FileCheck %s --check-prefix=GIVEN ! RUN: %flang_fc1 -fsyntax-only -pedantic %s 2>&1 | FileCheck %s --check-prefix=GIVEN
!-----------------------------------------
! EXPECTED OUTPUT WITHOUT
!-----------------------------------------
! WITHOUT-NOT: A DO loop should terminate with an END DO or CONTINUE ! WITHOUT-NOT: A DO loop should terminate with an END DO or CONTINUE
!-----------------------------------------
! EXPECTED OUTPUT WITH
!-----------------------------------------
! GIVEN: A DO loop should terminate with an END DO or CONTINUE ! GIVEN: A DO loop should terminate with an END DO or CONTINUE
subroutine foo2() subroutine foo2()

View File

@ -7,9 +7,6 @@
! runs `-fsyntax-only` by default (i.e. that's the default action), so the flag ! runs `-fsyntax-only` by default (i.e. that's the default action), so the flag
! can be skipped. ! can be skipped.
!-----------
! RUN LINES
!-----------
! RUN: %flang -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty ! RUN: %flang -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty
! RUN: %flang_fc1 %s 2>&1 | FileCheck %s --allow-empty ! RUN: %flang_fc1 %s 2>&1 | FileCheck %s --allow-empty
@ -17,13 +14,7 @@
! RUN: not %flang -c %s -o %t/non-existent-dir/syntax-only.o 2>&1 | FileCheck %s --check-prefix=NO_FSYNTAX_ONLY ! RUN: not %flang -c %s -o %t/non-existent-dir/syntax-only.o 2>&1 | FileCheck %s --check-prefix=NO_FSYNTAX_ONLY
! RUN: not %flang_fc1 -emit-obj %s -o %t/non-existent-dir/syntax-only.o 2>&1 | FileCheck %s --check-prefix=NO_FSYNTAX_ONLY ! RUN: not %flang_fc1 -emit-obj %s -o %t/non-existent-dir/syntax-only.o 2>&1 | FileCheck %s --check-prefix=NO_FSYNTAX_ONLY
!-----------------
! EXPECTED OUTPUT
!-----------------
! CHECK-NOT: error ! CHECK-NOT: error
! NO_FSYNTAX_ONLY: error: failed to create the output file ! NO_FSYNTAX_ONLY: error: failed to create the output file
!-------
! INPUT
!-------
end program end program

View File

@ -1,13 +1,7 @@
! Test that --target indeed sets the target ! Test that --target indeed sets the target
!-----------------------------------------
! RUN LINES
!-----------------------------------------
! RUN: %flang --target=unknown-unknown-unknown -emit-llvm -c %s \ ! RUN: %flang --target=unknown-unknown-unknown -emit-llvm -c %s \
! RUN: -o %t.o -### 2>&1 | FileCheck %s ! RUN: -o %t.o -### 2>&1 | FileCheck %s
!-----------------
! EXPECTED OUTPUT
!-----------------
! CHECK: Target: unknown-unknown-unknown ! CHECK: Target: unknown-unknown-unknown
! CHECK: "-triple" "unknown-unknown-unknown" ! CHECK: "-triple" "unknown-unknown-unknown"

View File

@ -6,25 +6,16 @@
! RUN: %flang_fc1 -fdebug-unparse %s | FileCheck %s --check-prefix=DEFAULT ! RUN: %flang_fc1 -fdebug-unparse %s | FileCheck %s --check-prefix=DEFAULT
! RUN: %flang_fc1 -fdebug-unparse -fno-analyzed-objects-for-unparse %s | FileCheck %s --check-prefix=DISABLED ! RUN: %flang_fc1 -fdebug-unparse -fno-analyzed-objects-for-unparse %s | FileCheck %s --check-prefix=DISABLED
!------------------------------------------------
! EXPECTED OUTPUT: default - use analyzed objects
!------------------------------------------------
! DEFAULT: PROGRAM test ! DEFAULT: PROGRAM test
! DEFAULT-NEXT: REAL, PARAMETER :: val = 3.43e2_4 ! DEFAULT-NEXT: REAL, PARAMETER :: val = 3.43e2_4
! DEFAULT-NEXT: PRINT *, 3.47e2_4 ! DEFAULT-NEXT: PRINT *, 3.47e2_4
! DEFAULT-NEXT: END PROGRAM ! DEFAULT-NEXT: END PROGRAM
!-----------------------------------------------------------
! EXPECTED OUTPUT: disabled - don't use the analyzed objects
!-----------------------------------------------------------
! DISABLED: PROGRAM test ! DISABLED: PROGRAM test
! DISABLED-NEXT: REAL, PARAMETER :: val = 343.0 ! DISABLED-NEXT: REAL, PARAMETER :: val = 343.0
! DISABLED-NEXT: PRINT *, val+4 ! DISABLED-NEXT: PRINT *, val+4
! DISABLED-NEXT: END PROGRAM ! DISABLED-NEXT: END PROGRAM
!--------------------------
! INPUT
!--------------------------
program test program test
real, parameter :: val = 343.0 real, parameter :: val = 343.0
print *, val + 4 print *, val + 4

View File

@ -14,9 +14,6 @@
! RUN: not %flang_fc1 -fsyntax-only -J %S/Inputs/module-dir -module-dir %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE ! RUN: not %flang_fc1 -fsyntax-only -J %S/Inputs/module-dir -module-dir %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE
! RUN: not %flang_fc1 -fsyntax-only -module-dir %S/Inputs/module-dir -J%S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE ! RUN: not %flang_fc1 -fsyntax-only -module-dir %S/Inputs/module-dir -J%S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE
!-----------------------------------------
! EXPECTED OUTPUT FOR MISSING MODULE FILE
!-----------------------------------------
! DOUBLEINCLUDE:error: Only one '-module-dir/-J' option allowed ! DOUBLEINCLUDE:error: Only one '-module-dir/-J' option allowed
program too_many_module_dirs program too_many_module_dirs

View File

@ -30,22 +30,13 @@
! RUN: not %flang_fc1 -fsyntax-only -J %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=SINGLEINCLUDE ! RUN: not %flang_fc1 -fsyntax-only -J %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=SINGLEINCLUDE
! RUN: not %flang_fc1 -fsyntax-only -module-dir %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=SINGLEINCLUDE ! RUN: not %flang_fc1 -fsyntax-only -module-dir %S/Inputs/module-dir %s 2>&1 | FileCheck %s --check-prefix=SINGLEINCLUDE
!------------------------------------
! EXPECTED OUTPUT: all modules found
!------------------------------------
! INCLUDED-NOT: error ! INCLUDED-NOT: error
!------------------------------------------------------------------
! EXPECTED OUTPUT: include dir for `basictestingmoduletwo` is missing
!------------------------------------------------------------------
! MISSING_MOD2-NOT:error: Cannot read module file for module 'basictestmoduleone'' ! MISSING_MOD2-NOT:error: Cannot read module file for module 'basictestmoduleone''
! MISSING_MOD2-NOT:error: Derived type 't1' not found ! MISSING_MOD2-NOT:error: Derived type 't1' not found
! MISSING_MOD2:error: Cannot read module file for module 'basictestmoduletwo' ! MISSING_MOD2:error: Cannot read module file for module 'basictestmoduletwo'
! MISSING_MOD2:error: Derived type 't2' not found ! MISSING_MOD2:error: Derived type 't2' not found
!----------------------------------------------------------------------
! EXPECTED OUTPUT: `Inputs` is not included, and hence `t1` is undefined
!---------------------------------------------------------------------
! SINGLEINCLUDE-NOT:error: Cannot read module file for module 'basictestmoduleone' ! SINGLEINCLUDE-NOT:error: Cannot read module file for module 'basictestmoduleone'
! SINGLEINCLUDE:error: Derived type 't1' not found ! SINGLEINCLUDE:error: Derived type 't1' not found
! SINGLEINCLUDE-NOT:error: Cannot read module file for module 'basictestmoduletwo' ! SINGLEINCLUDE-NOT:error: Cannot read module file for module 'basictestmoduletwo'

View File

@ -15,14 +15,8 @@
! RUN: %flang_fc1 -std=f2018 -fdebug-unparse %s 2>&1 | FileCheck %s --allow-empty --check-prefix=WITHOUT ! RUN: %flang_fc1 -std=f2018 -fdebug-unparse %s 2>&1 | FileCheck %s --allow-empty --check-prefix=WITHOUT
! RUN: %flang_fc1 -std=f2018 -fdebug-dump-symbols %s 2>&1 | FileCheck %s --allow-empty --check-prefix=WITHOUT ! RUN: %flang_fc1 -std=f2018 -fdebug-dump-symbols %s 2>&1 | FileCheck %s --allow-empty --check-prefix=WITHOUT
!-----------------------------------------
! EXPECTED OUTPUT WITH -Werror
!-----------------------------------------
! WITH: Could not parse ! WITH: Could not parse
!-----------------------------------------
! EXPECTED OUTPUT WITHOUT -Werror
!-----------------------------------------
! WITHOUT-NOT: Could not parse ! WITHOUT-NOT: Could not parse
#ifndef _OM_NO_IOSTREAM #ifndef _OM_NO_IOSTREAM

View File

@ -11,14 +11,8 @@
! RUN: %flang_fc1 -fdebug-dump-provenance %s 2>&1 | FileCheck %s --check-prefix=WITHOUT ! RUN: %flang_fc1 -fdebug-dump-provenance %s 2>&1 | FileCheck %s --check-prefix=WITHOUT
! RUN: %flang_fc1 -fdebug-measure-parse-tree %s 2>&1 | FileCheck %s --check-prefix=WITHOUT ! RUN: %flang_fc1 -fdebug-measure-parse-tree %s 2>&1 | FileCheck %s --check-prefix=WITHOUT
!-----------------------------------------
! EXPECTED OUTPUT WITH -Werror
!-----------------------------------------
! WITH: Could not scan ! WITH: Could not scan
!-----------------------------------------
! EXPECTED OUTPUT WITHOUT -Werror
!-----------------------------------------
! WITHOUT-NOT: Could not scan ! WITHOUT-NOT: Could not scan
1 continue 1 continue

View File

@ -15,14 +15,8 @@
! RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s --allow-empty --check-prefix=WITHOUT ! RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s --allow-empty --check-prefix=WITHOUT
! RUN: %flang_fc1 -fdebug-dump-symbols %s 2>&1 | FileCheck %s --allow-empty --check-prefix=WITHOUT ! RUN: %flang_fc1 -fdebug-dump-symbols %s 2>&1 | FileCheck %s --allow-empty --check-prefix=WITHOUT
!-----------------------------------------
! EXPECTED OUTPUT WITH -Werror
!-----------------------------------------
! WITH: Semantic errors in ! WITH: Semantic errors in
!-----------------------------------------
! EXPECTED OUTPUT WITHOUT -Werror
!-----------------------------------------
! WITHOUT-NOT: Semantic errors in ! WITHOUT-NOT: Semantic errors in
PROGRAM werror PROGRAM werror

View File

@ -3,7 +3,4 @@
! RUN: not %flang_fc1 -fsyntax-only -Wall %s 2>&1 | FileCheck %s --check-prefix=WRONG ! RUN: not %flang_fc1 -fsyntax-only -Wall %s 2>&1 | FileCheck %s --check-prefix=WRONG
! RUN: not %flang_fc1 -fsyntax-only -WX %s 2>&1 | FileCheck %s --check-prefix=WRONG ! RUN: not %flang_fc1 -fsyntax-only -WX %s 2>&1 | FileCheck %s --check-prefix=WRONG
!-----------------------------------------
! EXPECTED OUTPUT WITH -W<opt>
!-----------------------------------------
! WRONG: Only `-Werror` is supported currently. ! WRONG: Only `-Werror` is supported currently.