llvm-project/flang/test/Driver/dash-x-f95-do-not-assume-fixed-form.f90
Iñaki Amatria Barral bdbe8fa1f3
[flang] Align -x language modes with gfortran (#130268)
This PR addresses some of the issues described in
https://github.com/llvm/llvm-project/issues/127617. Key changes:

- Stop assuming fixed-form for `-x f95` unless the input is a `.i` file.
This change ensures compatibility with `-save-temps` workflows while
preventing unintended fixed-form assumptions.
- Ensure `-x f95-cpp-input` enables `-cpp` by default, aligning Flang's
behavior with `gfortran`.
2025-03-12 16:45:33 +01:00

13 lines
388 B
Fortran

! This test verifies that using `-x f95` does not cause the driver to assume
! this file is in fixed-form.
program main
print *, "Hello, World!"
end
! RUN: %flang -### -x f95 %s 2>&1 | FileCheck --check-prefix=PRINT-PHASES %s
! PRINT-PHASES-NOT: -ffixed-form
! RUN: %flang -Werror -fsyntax-only -x f95 %s 2>&1 | FileCheck --check-prefix=COMPILE --allow-empty %s
! COMPILE-NOT: error