30 lines · plain
1! Ensure the driver correctly switches between fixed and free form based on the file extension.2! This test exploits the fact that the prescanner treats whitespace differently for free3! and fixed form input files.4 5!--------------------------6! FLANG DRIVER (flang)7!--------------------------8! RUN: %flang -E -Xflang -fno-reformat %S/Inputs/free-form-test.f90 2>&1 | FileCheck %s --check-prefix=FREEFORM9! RUN: %flang -E -Xflang -fno-reformat %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=FIXEDFORM10! RUN: %flang -E -Xflang -fno-reformat %S/Inputs/free-form-test.f90 %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=MULTIPLEFORMS11 12!-----------------------------------------13! FRONTEND FLANG DRIVER (flang_fc1)14!-----------------------------------------15! RUN: %flang_fc1 -E -fno-reformat %S/Inputs/free-form-test.f90 2>&1 | FileCheck %s --check-prefix=FREEFORM16! RUN: %flang_fc1 -E -fno-reformat %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=FIXEDFORM17! RUN: %flang_fc1 -E -fno-reformat %S/Inputs/free-form-test.f90 %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=MULTIPLEFORMS18 19! FREEFORM:program freeform20! FREEFORM-NOT:programfixedform21 22! FIXEDFORM:programfixedform23! FIXEDFORM-NOT:program freeform24 25! MULTIPLEFORMS:program freeform26! MULTIPLEFORMS-NOT:programfixedform27! MULTIPLEFORMS-NEXT:end28! MULTIPLEFORMS-NEXT:programfixedform29! MULTIPLEFORMS-NOT:program freeform30