summaryrefslogtreecommitdiff
path: root/test/CodeGen/ffp-contract-option.c
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2012-10-02 04:45:10 +0000
committerLang Hames <lhames@gmail.com>2012-10-02 04:45:10 +0000
commitbe9af1288881110e406b87914162eaa59f1e5918 (patch)
treed5dad9578b613b3a7d8e5b6612e686b76bb22203 /test/CodeGen/ffp-contract-option.c
parentd13eff6f77216a6fb25e18f600b492db4f0492e8 (diff)
downloadclang-be9af1288881110e406b87914162eaa59f1e5918.tar.gz
Add FP_CONTRACT support for clang.
Clang will now honor the FP_CONTRACT pragma and emit LLVM fmuladd intrinsics for expressions of the form A * B + C (when they occur in a single statement). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164989 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ffp-contract-option.c')
-rw-r--r--test/CodeGen/ffp-contract-option.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/CodeGen/ffp-contract-option.c b/test/CodeGen/ffp-contract-option.c
new file mode 100644
index 0000000000..eb95f1e217
--- /dev/null
+++ b/test/CodeGen/ffp-contract-option.c
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -O3 -ffp-contract=fast -triple=powerpc-apple-darwin10 -S -o - %s | FileCheck %s
+// REQUIRES: ppc32-registered-target
+
+float fma_test1(float a, float b, float c) {
+// CHECK: fmadds
+ float x = a * b;
+ float y = x + c;
+ return y;
+}