llvm-project/flang/test/Driver/frontend-forwarding.f90
Tom Eccles e7b6660243 [flang] Add -ffast-math and -Ofast
clang -cc1 accepts -Ofast. I did not add it to flang -fc1 because this
seems redundant because the compiler driver will always resolve -Ofast
into -O3 -ffast-math (I added a test for this).

-menable-infs is removed from the frontend-forwarding test because if
all of the fast-math component flags are present, these will be resolved
into the fast-math flag. Instead -menable-infs is tested in the
fast-math test.

Specifying -ffast-math to the compiler driver causes linker invocations
to include crtfastmath.o.

RFC: https://discourse.llvm.org/t/rfc-the-meaning-of-ofast/66554

Differential Revision: https://reviews.llvm.org/D138675
2022-12-09 19:55:58 +00:00

37 lines
1.0 KiB
Fortran

! Test that flang-new forwards Flang frontend
! options to flang-new -fc1 as expected.
! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 \
! RUN: -finput-charset=utf-8 \
! RUN: -fdefault-double-8 \
! RUN: -fdefault-integer-8 \
! RUN: -fdefault-real-8 \
! RUN: -flarge-sizes \
! RUN: -fconvert=little-endian \
! RUN: -ffp-contract=fast \
! RUN: -fno-honor-nans \
! RUN: -fapprox-func \
! RUN: -fno-signed-zeros \
! RUN: -fassociative-math \
! RUN: -freciprocal-math \
! RUN: -fpass-plugin=Bye%pluginext \
! RUN: -mllvm -print-before-all\
! RUN: -P \
! RUN: | FileCheck %s
! CHECK: "-P"
! CHECK: "-finput-charset=utf-8"
! CHECK: "-fdefault-double-8"
! CHECK: "-fdefault-integer-8"
! CHECK: "-fdefault-real-8"
! CHECK: "-flarge-sizes"
! CHECK: "-ffp-contract=fast"
! CHECK: "-menable-no-nans"
! CHECK: "-fapprox-func"
! CHECK: "-fno-signed-zeros"
! CHECK: "-mreassociate"
! CHECK: "-freciprocal-math"
! CHECK: "-fconvert=little-endian"
! CHECK: "-fpass-plugin=Bye
! CHECK: "-mllvm" "-print-before-all"