forked from OSchip/llvm-project
[clang][FPEnv] Clang floatng point model ffp-model=precise enables ffp-contract=on
This patch changes the ffp-model=precise to enables -ffp-contract=on (previously -ffp-model=precise enabled -ffp-contract=fast). This is a follow-up to Andy Kaylor's comments in the llvm-dev discussion "Floating Point semantic modes". From the same email thread, I put Andy's distillation of floating point options and floating point modes into UsersManual.rst Differential Revision: https://reviews.llvm.org/D74436
This commit is contained in:
parent
734213d7b5
commit
8daac37140
|
@ -1260,8 +1260,50 @@ installed.
|
|||
Controlling Floating Point Behavior
|
||||
-----------------------------------
|
||||
|
||||
Clang provides a number of ways to control floating point behavior. The options
|
||||
are listed below.
|
||||
Clang provides a number of ways to control floating point behavior, including
|
||||
with command line options and source pragmas. This section
|
||||
describes the various floating point semantic modes and the corresponding options.
|
||||
|
||||
.. csv-table:: Floating Point Semantic Modes
|
||||
:header: "Mode", "Values"
|
||||
:widths: 15, 30, 30
|
||||
|
||||
"except_behavior", "{ignore, strict, may_trap}", "ffp-exception-behavior"
|
||||
"fenv_access", "{off, on}", "(none)"
|
||||
"rounding_mode", "{dynamic, tonearest, downward, upward, towardzero}", "frounding-math"
|
||||
"contract", "{on, off, fast}", "ffp-contract"
|
||||
"denormal_fp_math", "{IEEE, PreserveSign, PositiveZero}", "fdenormal-fp-math"
|
||||
"denormal_fp32_math", "{IEEE, PreserveSign, PositiveZero}", "fdenormal-fp-math-fp32"
|
||||
"support_math_errno", "{on, off}", "fmath-errno"
|
||||
"no_honor_nans", "{on, off}", "fhonor-nans"
|
||||
"no_honor_infinities", "{on, off}", "fhonor-infinities"
|
||||
"no_signed_zeros", "{on, off}", "fsigned-zeros"
|
||||
"allow_reciprocal", "{on, off}", "freciprocal-math"
|
||||
"allow_approximate_fns", "{on, off}", "(none)"
|
||||
"allow_reassociation", "{on, off}", "fassociative-math"
|
||||
|
||||
|
||||
This table describes the option settings that correspond to the three
|
||||
floating point semantic models: precise (the default), strict, and fast.
|
||||
|
||||
|
||||
.. csv-table:: Floating Point Models
|
||||
:header: "Mode", "Precise", "Strict", "Fast"
|
||||
:widths: 25, 15, 15, 15
|
||||
|
||||
"except_behavior", "ignore", "strict", "ignore"
|
||||
"fenv_access", "off", "on", "off"
|
||||
"rounding_mode", "tonearest", "dynamic", "tonearest"
|
||||
"contract", "on", "off", "fast"
|
||||
"denormal_fp_math", "IEEE", "IEEE", "PreserveSign"
|
||||
"denormal_fp32_math", "IEEE","IEEE", "PreserveSign"
|
||||
"support_math_errno", "on", "on", "off"
|
||||
"no_honor_nans", "off", "off", "on"
|
||||
"no_honor_infinities", "off", "off", "on"
|
||||
"no_signed_zeros", "off", "off", "on"
|
||||
"allow_reciprocal", "off", "off", "on"
|
||||
"allow_approximate_fns", "off", "off", "on"
|
||||
"allow_reassociation", "off", "off", "on"
|
||||
|
||||
.. option:: -ffast-math
|
||||
|
||||
|
@ -1456,7 +1498,7 @@ Note that floating-point operations performed as part of constant initialization
|
|||
and ``fast``.
|
||||
Details:
|
||||
|
||||
* ``precise`` Disables optimizations that are not value-safe on floating-point data, although FP contraction (FMA) is enabled (``-ffp-contract=fast``). This is the default behavior.
|
||||
* ``precise`` Disables optimizations that are not value-safe on floating-point data, although FP contraction (FMA) is enabled (``-ffp-contract=on``). This is the default behavior.
|
||||
* ``strict`` Enables ``-frounding-math`` and ``-ffp-exception-behavior=strict``, and disables contractions (FMA). All of the ``-ffast-math`` enablements are disabled. Enables ``STDC FENV_ACCESS``: by default ``FENV_ACCESS`` is disabled. This option setting behaves as though ``#pragma STDC FENV_ACESS ON`` appeared at the top of the source file.
|
||||
* ``fast`` Behaves identically to specifying both ``-ffast-math`` and ``ffp-contract=fast``
|
||||
|
||||
|
|
|
@ -2631,7 +2631,7 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
|
|||
|
||||
llvm::DenormalMode DenormalFPMath = DefaultDenormalFPMath;
|
||||
llvm::DenormalMode DenormalFP32Math = DefaultDenormalFP32Math;
|
||||
StringRef FPContract = "";
|
||||
StringRef FPContract = "on";
|
||||
bool StrictFPModel = false;
|
||||
|
||||
|
||||
|
@ -2656,7 +2656,7 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
|
|||
ReciprocalMath = false;
|
||||
SignedZeros = true;
|
||||
// -fno_fast_math restores default denormal and fpcontract handling
|
||||
FPContract = "";
|
||||
FPContract = "on";
|
||||
DenormalFPMath = llvm::DenormalMode::getIEEE();
|
||||
|
||||
// FIXME: The target may have picked a non-IEEE default mode here based on
|
||||
|
@ -2676,20 +2676,18 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
|
|||
// ffp-model= is a Driver option, it is entirely rewritten into more
|
||||
// granular options before being passed into cc1.
|
||||
// Use the gcc option in the switch below.
|
||||
if (!FPModel.empty() && !FPModel.equals(Val)) {
|
||||
if (!FPModel.empty() && !FPModel.equals(Val))
|
||||
D.Diag(clang::diag::warn_drv_overriding_flag_option)
|
||||
<< Args.MakeArgString("-ffp-model=" + FPModel)
|
||||
<< Args.MakeArgString("-ffp-model=" + Val);
|
||||
FPContract = "";
|
||||
}
|
||||
if (Val.equals("fast")) {
|
||||
optID = options::OPT_ffast_math;
|
||||
FPModel = Val;
|
||||
FPContract = "fast";
|
||||
FPContract = Val;
|
||||
} else if (Val.equals("precise")) {
|
||||
optID = options::OPT_ffp_contract;
|
||||
FPModel = Val;
|
||||
FPContract = "fast";
|
||||
FPContract = "on";
|
||||
PreciseFPModel = true;
|
||||
} else if (Val.equals("strict")) {
|
||||
StrictFPModel = true;
|
||||
|
@ -2775,9 +2773,11 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
|
|||
case options::OPT_ffp_contract: {
|
||||
StringRef Val = A->getValue();
|
||||
if (PreciseFPModel) {
|
||||
// -ffp-model=precise enables ffp-contract=fast as a side effect
|
||||
// the FPContract value has already been set to a string literal
|
||||
// and the Val string isn't a pertinent value.
|
||||
// When -ffp-model=precise is seen on the command line,
|
||||
// the boolean PreciseFPModel is set to true which indicates
|
||||
// "the current option is actually PreciseFPModel". The optID
|
||||
// is changed to OPT_ffp_contract and FPContract is set to "on".
|
||||
// the argument Val string is "precise": it shouldn't be checked.
|
||||
;
|
||||
} else if (Val.equals("fast") || Val.equals("on") || Val.equals("off"))
|
||||
FPContract = Val;
|
||||
|
@ -2875,18 +2875,17 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
|
|||
// -fno_fast_math restores default denormal and fpcontract handling
|
||||
DenormalFPMath = DefaultDenormalFPMath;
|
||||
DenormalFP32Math = llvm::DenormalMode::getIEEE();
|
||||
FPContract = "";
|
||||
FPContract = "on";
|
||||
break;
|
||||
}
|
||||
if (StrictFPModel) {
|
||||
// If -ffp-model=strict has been specified on command line but
|
||||
// subsequent options conflict then emit warning diagnostic.
|
||||
if (HonorINFs && HonorNaNs &&
|
||||
!AssociativeMath && !ReciprocalMath &&
|
||||
SignedZeros && TrappingMath && RoundingFPMath &&
|
||||
(FPContract.equals("off") || FPContract.empty()) &&
|
||||
DenormalFPMath == llvm::DenormalMode::getIEEE() &&
|
||||
DenormalFP32Math == llvm::DenormalMode::getIEEE())
|
||||
if (HonorINFs && HonorNaNs && !AssociativeMath && !ReciprocalMath &&
|
||||
SignedZeros && TrappingMath && RoundingFPMath &&
|
||||
DenormalFPMath == llvm::DenormalMode::getIEEE() &&
|
||||
DenormalFP32Math == llvm::DenormalMode::getIEEE() &&
|
||||
FPContract.equals("off"))
|
||||
// OK: Current Arg doesn't conflict with -ffp-model=strict
|
||||
;
|
||||
else {
|
||||
|
|
|
@ -1,9 +1,46 @@
|
|||
// RUN: %clang_cc1 -O3 -ffp-contract=fast -triple=aarch64-apple-darwin -S -o - %s | FileCheck %s
|
||||
// RUN: %clang_cc1 -O3 -ffp-contract=fast -triple=aarch64-apple-darwin -S -o - %s | FileCheck --check-prefix=CHECK-FMADD %s
|
||||
// REQUIRES: aarch64-registered-target
|
||||
|
||||
float fma_test1(float a, float b, float c) {
|
||||
// CHECK: fmadd
|
||||
float x = a * b;
|
||||
float y = x + c;
|
||||
return y;
|
||||
// CHECK-FMADD: fmadd
|
||||
float x = a * b;
|
||||
float y = x + c;
|
||||
return y;
|
||||
}
|
||||
|
||||
// RUN: %clang_cc1 -triple=x86_64 %s -emit-llvm -o - \
|
||||
// RUN:| FileCheck --check-prefix=CHECK-DEFAULT %s
|
||||
//
|
||||
// RUN: %clang_cc1 -triple=x86_64 -ffp-contract=off %s -emit-llvm -o - \
|
||||
// RUN:| FileCheck --check-prefix=CHECK-DEFAULT %s
|
||||
// RUN: %clang_cc1 -triple=x86_64 -ffp-contract=on %s -emit-llvm -o - \
|
||||
// RUN:| FileCheck --check-prefix=CHECK-ON %s
|
||||
// RUN: %clang_cc1 -triple=x86_64 -ffp-contract=fast %s -emit-llvm -o - \
|
||||
// RUN:| FileCheck --check-prefix=CHECK-CONTRACTFAST %s
|
||||
//
|
||||
// RUN: %clang_cc1 -triple=x86_64 -ffast-math %s -emit-llvm -o - \
|
||||
// RUN:| FileCheck --check-prefix=CHECK-DEFAULTFAST %s
|
||||
// RUN: %clang_cc1 -triple=x86_64 -ffast-math -ffp-contract=off %s -emit-llvm -o - \
|
||||
// RUN:| FileCheck --check-prefix=CHECK-DEFAULTFAST %s
|
||||
// RUN: %clang_cc1 -triple=x86_64 -ffast-math -ffp-contract=on %s -emit-llvm -o - \
|
||||
// RUN:| FileCheck --check-prefix=CHECK-ONFAST %s
|
||||
// RUN: %clang_cc1 -triple=x86_64 -ffast-math -ffp-contract=fast %s -emit-llvm -o - \
|
||||
// RUN:| FileCheck --check-prefix=CHECK-FASTFAST %s
|
||||
float mymuladd( float x, float y, float z ) {
|
||||
return x * y + z;
|
||||
// CHECK-DEFAULT: = fmul float
|
||||
// CHECK-DEFAULT: = fadd float
|
||||
|
||||
// CHECK-ON: = call float @llvm.fmuladd.f32
|
||||
|
||||
// CHECK-CONTRACTFAST: = fmul contract float
|
||||
// CHECK-CONTRACTFAST: = fadd contract float
|
||||
|
||||
// CHECK-DEFAULTFAST: = fmul reassoc nnan ninf nsz arcp afn float
|
||||
// CHECK-DEFAULTFAST: = fadd reassoc nnan ninf nsz arcp afn float
|
||||
|
||||
// CHECK-ONFAST: = call reassoc nnan ninf nsz arcp afn float @llvm.fmuladd.f32
|
||||
|
||||
// CHECK-FASTFAST: = fmul fast float
|
||||
// CHECK-FASTFAST: = fadd fast float
|
||||
}
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
// REQUIRES: powerpc-registered-target
|
||||
|
||||
// RUN: %clang -S -emit-llvm -target powerpc64-unknown-linux-gnu -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
|
||||
// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK,CHECK-BE
|
||||
// RUN: -ffp-contract=off -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK,CHECK-BE
|
||||
// RUN: %clang -S -emit-llvm -target powerpc64le-unknown-linux-gnu -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
|
||||
// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK,CHECK-LE
|
||||
// RUN: -ffp-contract=off -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK,CHECK-LE
|
||||
|
||||
// CHECK-BE-DAG: @_mm_movemask_pd.perm_mask = internal constant <4 x i32> <i32 -2139062144, i32 -2139062144, i32 -2139062144, i32 -2139078656>, align 16
|
||||
// CHECK-BE-DAG: @_mm_shuffle_epi32.permute_selectors = internal constant [4 x i32] [i32 66051, i32 67438087, i32 134810123, i32 202182159], align 4
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
// REQUIRES: powerpc-registered-target
|
||||
|
||||
// RUN: %clang -S -emit-llvm -target powerpc64-unknown-linux-gnu -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
|
||||
// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK,CHECK-BE
|
||||
// RUN: -ffp-contract=off -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK,CHECK-BE
|
||||
// RUN: %clang -x c++ -fsyntax-only -target powerpc64-unknown-linux-gnu -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
|
||||
// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns
|
||||
// RUN: %clang -S -emit-llvm -target powerpc64le-unknown-linux-gnu -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
|
||||
// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK,CHECK-LE
|
||||
// RUN: -ffp-contract=off -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK,CHECK-LE
|
||||
// RUN: %clang -x c++ -fsyntax-only -target powerpc64le-unknown-linux-gnu -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
|
||||
// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns
|
||||
|
||||
|
|
|
@ -1,88 +1,90 @@
|
|||
// Test that incompatible combinations of -ffp-model= options
|
||||
// and other floating point options get a warning diagnostic.
|
||||
//
|
||||
// REQUIRES: clang-driver
|
||||
|
||||
// RUN: %clang -### -ffp-model=fast -ffp-contract=off -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -ffp-model=fast -ffp-contract=off -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=WARN %s
|
||||
// WARN: warning: overriding '-ffp-model=fast' option with '-ffp-contract=off' [-Woverriding-t-option]
|
||||
|
||||
// RUN: %clang -### -ffp-model=fast -ffp-contract=on -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -ffp-model=fast -ffp-contract=on -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=WARN1 %s
|
||||
// WARN1: warning: overriding '-ffp-model=fast' option with '-ffp-contract=on' [-Woverriding-t-option]
|
||||
|
||||
// RUN: %clang -### -ffp-model=strict -fassociative-math -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -ffp-model=strict -fassociative-math -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=WARN2 %s
|
||||
// WARN2: warning: overriding '-ffp-model=strict' option with '-fassociative-math' [-Woverriding-t-option]
|
||||
|
||||
// RUN: %clang -### -ffp-model=strict -ffast-math -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -ffp-model=strict -ffast-math -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=WARN3 %s
|
||||
// WARN3: warning: overriding '-ffp-model=strict' option with '-ffast-math' [-Woverriding-t-option]
|
||||
|
||||
// RUN: %clang -### -ffp-model=strict -ffinite-math-only -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -ffp-model=strict -ffinite-math-only -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=WARN4 %s
|
||||
// WARN4: warning: overriding '-ffp-model=strict' option with '-ffinite-math-only' [-Woverriding-t-option]
|
||||
|
||||
// RUN: %clang -### -ffp-model=strict -ffp-contract=fast -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -ffp-model=strict -ffp-contract=fast -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=WARN5 %s
|
||||
// WARN5: warning: overriding '-ffp-model=strict' option with '-ffp-contract=fast' [-Woverriding-t-option]
|
||||
|
||||
// RUN: %clang -### -ffp-model=strict -ffp-contract=on -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -ffp-model=strict -ffp-contract=fast -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=WARN6 %s
|
||||
// WARN6: warning: overriding '-ffp-model=strict' option with '-ffp-contract=fast' [-Woverriding-t-option]
|
||||
|
||||
// RUN: %clang -target x86_64 -### -ffp-model=strict -ffp-contract=on -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=WARN7 %s
|
||||
// WARN7: warning: overriding '-ffp-model=strict' option with '-ffp-contract=on' [-Woverriding-t-option]
|
||||
|
||||
// RUN: %clang -### -ffp-model=strict -fno-honor-infinities -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -ffp-model=strict -fno-honor-infinities -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=WARN8 %s
|
||||
// WARN8: warning: overriding '-ffp-model=strict' option with '-fno-honor-infinities' [-Woverriding-t-option]
|
||||
|
||||
// RUN: %clang -### -ffp-model=strict -fno-honor-nans -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -ffp-model=strict -fno-honor-nans -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=WARN9 %s
|
||||
// WARN9: warning: overriding '-ffp-model=strict' option with '-fno-honor-nans' [-Woverriding-t-option]
|
||||
|
||||
// RUN: %clang -### -ffp-model=strict -fno-rounding-math -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -ffp-model=strict -fno-rounding-math -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=WARNa %s
|
||||
// WARNa: warning: overriding '-ffp-model=strict' option with '-fno-rounding-math' [-Woverriding-t-option]
|
||||
|
||||
// RUN: %clang -### -ffp-model=strict -fno-signed-zeros -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -ffp-model=strict -fno-signed-zeros -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=WARNb %s
|
||||
// WARNb: warning: overriding '-ffp-model=strict' option with '-fno-signed-zeros' [-Woverriding-t-option]
|
||||
|
||||
// RUN: %clang -### -ffp-model=strict -fno-trapping-math -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -ffp-model=strict -fno-trapping-math -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=WARNc %s
|
||||
// WARNc: warning: overriding '-ffp-model=strict' option with '-fno-trapping-math' [-Woverriding-t-option]
|
||||
|
||||
// RUN: %clang -### -ffp-model=strict -freciprocal-math -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -ffp-model=strict -freciprocal-math -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=WARNd %s
|
||||
// WARNd: warning: overriding '-ffp-model=strict' option with '-freciprocal-math' [-Woverriding-t-option]
|
||||
|
||||
// RUN: %clang -### -ffp-model=strict -funsafe-math-optimizations -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -ffp-model=strict -funsafe-math-optimizations -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=WARNe %s
|
||||
// WARNe: warning: overriding '-ffp-model=strict' option with '-funsafe-math-optimizations' [-Woverriding-t-option]
|
||||
|
||||
// RUN: %clang -### -ffp-model=strict -Ofast -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -ffp-model=strict -Ofast -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=WARNf %s
|
||||
// WARNf: warning: overriding '-ffp-model=strict' option with '-Ofast' [-Woverriding-t-option]
|
||||
|
||||
// RUN: %clang -### -ffp-model=strict -fdenormal-fp-math=preserve-sign,preserve-sign -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -ffp-model=strict -fdenormal-fp-math=preserve-sign,preserve-sign -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=WARN10 %s
|
||||
// WARN10: warning: overriding '-ffp-model=strict' option with '-fdenormal-fp-math=preserve-sign,preserve-sign' [-Woverriding-t-option]
|
||||
|
||||
// RUN: %clang -### -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-NOROUND %s
|
||||
// CHECK-NOROUND: "-cc1"
|
||||
// CHECK-NOROUND: "-fno-rounding-math"
|
||||
|
||||
// RUN: %clang -### -frounding-math -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -frounding-math -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-ROUND --implicit-check-not ffp-exception-behavior=strict %s
|
||||
// CHECK-ROUND: "-cc1"
|
||||
// CHECK-ROUND: "-frounding-math"
|
||||
|
||||
// RUN: %clang -### -ftrapping-math -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -ftrapping-math -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-TRAP %s
|
||||
// CHECK-TRAP: "-cc1"
|
||||
// CHECK-TRAP: "-ffp-exception-behavior=strict"
|
||||
|
||||
// RUN: %clang -### -nostdinc -ffp-model=fast -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -nostdinc -ffp-model=fast -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-FPM-FAST %s
|
||||
// CHECK-FPM-FAST: "-cc1"
|
||||
// CHECK-FPM-FAST: "-menable-no-infs"
|
||||
|
@ -96,34 +98,35 @@
|
|||
// CHECK-FPM-FAST: "-ffast-math"
|
||||
// CHECK-FPM-FAST: "-ffinite-math-only"
|
||||
|
||||
// RUN: %clang -### -nostdinc -ffp-model=precise -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -nostdinc -ffp-model=precise -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-FPM-PRECISE %s
|
||||
// CHECK-FPM-PRECISE: "-cc1"
|
||||
// CHECK-FPM-PRECISE: "-ffp-contract=fast"
|
||||
// CHECK-FPM-PRECISE: "-ffp-contract=on"
|
||||
// CHECK-FPM-PRECISE: "-fno-rounding-math"
|
||||
|
||||
// RUN: %clang -### -nostdinc -ffp-model=strict -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -nostdinc -ffp-model=strict -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-FPM-STRICT %s
|
||||
// CHECK-FPM-STRICT: "-cc1"
|
||||
// CHECK-FPM-STRICT: "-fmath-errno"
|
||||
// CHECK-FPM-STRICT: "-ffp-contract=off"
|
||||
// CHECK-FPM-STRICT: "-frounding-math"
|
||||
// CHECK-FPM-STRICT: "-ffp-exception-behavior=strict"
|
||||
|
||||
|
||||
// RUN: %clang -### -nostdinc -ffp-exception-behavior=strict -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -nostdinc -ffp-exception-behavior=strict -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-FEB-STRICT %s
|
||||
// CHECK-FEB-STRICT: "-cc1"
|
||||
// CHECK-FEB-STRICT: "-fno-rounding-math"
|
||||
// CHECK-FEB-STRICT: "-ffp-exception-behavior=strict"
|
||||
|
||||
// RUN: %clang -### -nostdinc -ffp-exception-behavior=maytrap -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -nostdinc -ffp-exception-behavior=maytrap -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-FEB-MAYTRAP %s
|
||||
// CHECK-FEB-MAYTRAP: "-cc1"
|
||||
// CHECK-FEB-MAYTRAP: "-fno-rounding-math"
|
||||
// CHECK-FEB-MAYTRAP: "-ffp-exception-behavior=maytrap"
|
||||
|
||||
// RUN: %clang -### -nostdinc -ffp-exception-behavior=ignore -c %s 2>&1 \
|
||||
// RUN: %clang -target x86_64 -### -nostdinc -ffp-exception-behavior=ignore -c %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-FEB-IGNORE %s
|
||||
// CHECK-FEB-IGNORE: "-cc1"
|
||||
// CHECK-FEB-IGNORE: "-fno-rounding-math"
|
||||
// CHECK-FEB-IGNORE: "-ffp-exception-behavior=ignore"
|
||||
|
||||
|
|
Loading…
Reference in New Issue