Skip to content

Commit e94c171

Browse files
committed
[clang][Driver] recognize -ffp-contract=fast-honor-pragmas
-ffp-contract=fast-honor-pragmas is a valid option recognized by clang -cc1 but it is missed by clang driver. Reviewed by: Matt Arsenault Differential Revision: https://reviews.llvm.org/D145648
1 parent 4e627a3 commit e94c171

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2955,7 +2955,8 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
29552955
// -ffp-model=precise sets PreciseFPModel to on and Val to
29562956
// "precise". FPContract is set.
29572957
;
2958-
} else if (Val.equals("fast") || Val.equals("on") || Val.equals("off")) {
2958+
} else if (Val.equals("fast") || Val.equals("on") || Val.equals("off") ||
2959+
Val.equals("fast-honor-pragmas")) {
29592960
FPContract = Val;
29602961
LastSeenFfpContractOption = Val;
29612962
} else

clang/test/Driver/fp-contract.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
// RUN: %clang -### -ffast-math -ffp-contract=fast -c %s 2>&1 \
2222
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
2323

24+
// RUN: %clang -### -ffast-math -ffp-contract=fast-honor-pragmas -c %s 2>&1 \
25+
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST-HONOR %s
26+
// CHECK-FPC-FAST-HONOR: "-ffp-contract=fast-honor-pragmas"
27+
2428
// RUN: %clang -### -ffp-contract=fast -ffast-math -c %s 2>&1 \
2529
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
2630
// RUN: %clang -### -ffp-contract=on -ffast-math -c %s 2>&1 \

0 commit comments

Comments
 (0)