diff options
author | Lang Hames <lhames@gmail.com> | 2012-07-06 00:59:19 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2012-07-06 00:59:19 +0000 |
commit | c9686716d2ceb5518178dca98670ec34c472a1be (patch) | |
tree | b4201afe672b4090ac1699d9190a28341428fa59 /test | |
parent | 36cbfbfce889642057bd007eac3569ea9f58e1e8 (diff) | |
download | clang-c9686716d2ceb5518178dca98670ec34c472a1be.tar.gz |
Add -ffp-contract = { fast | on | off } command line option support.
This flag sets the 'fp-contract' mode, which controls the formation of fused
floating point operations. Available modes are:
- Fast: Form fused operations anywhere.
- On: Form fused operations where allowed by FP_CONTRACT. This is the default
mode.
- Off: Don't form fused operations (in future this may be relaxed to forming
fused operations where it can be proved that the result won't be
affected).
Currently clang doesn't support the FP_CONTRACT pragma, so the 'On' and 'Off'
modes are equivalent.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159794 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/fp-contract.c | 8 | ||||
-rw-r--r-- | test/Driver/clang_f_opts.c | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGen/fp-contract.c b/test/CodeGen/fp-contract.c new file mode 100644 index 0000000000..c048d69586 --- /dev/null +++ b/test/CodeGen/fp-contract.c @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -O3 -ffp-contract=fast -triple=powerpc-apple-darwin10 -S -o - %s | FileCheck %s + +float fma_test1(float a, float b, float c) { +// CHECK: fmadds + float x = a * b; + float y = x + c; + return y; +} diff --git a/test/Driver/clang_f_opts.c b/test/Driver/clang_f_opts.c index 4eed4aa06f..b74b285501 100644 --- a/test/Driver/clang_f_opts.c +++ b/test/Driver/clang_f_opts.c @@ -29,3 +29,9 @@ // RUN: %clang -### -c -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s // DEPRECATED-ON-CHECK: -fdeprecated-macro // DEPRECATED-OFF-CHECK-NOT: -fdeprecated-macro + +// RUN: %clang -### -S -ffp-contract=fast %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-FAST-CHECK %s +// RUN: %clang -### -S -ffast-math %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-FAST-CHECK %s +// RUN: %clang -### -S -ffp-contract=off %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-OFF-CHECK %s +// FP-CONTRACT-FAST-CHECK: -ffp-contract=fast +// FP-CONTRACT-OFF-CHECK: -ffp-contract=off |