summaryrefslogtreecommitdiffstats
path: root/clang/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
commit5de91cc35f62342e5eb70175cb3ff5cc5db811c4 (patch)
tree23742c6e4f310ba2bf56702f82a3e8ef0e76fd84 /clang/test/CodeGen/ffp-contract-option.c
parentb67c6cc24de76e0d74f932f3534a76f6f939d8a2 (diff)
downloadbcm5719-llvm-5de91cc35f62342e5eb70175cb3ff5cc5db811c4.tar.gz
bcm5719-llvm-5de91cc35f62342e5eb70175cb3ff5cc5db811c4.zip
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). llvm-svn: 164989
Diffstat (limited to 'clang/test/CodeGen/ffp-contract-option.c')
-rw-r--r--clang/test/CodeGen/ffp-contract-option.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGen/ffp-contract-option.c b/clang/test/CodeGen/ffp-contract-option.c
new file mode 100644
index 00000000000..eb95f1e2177
--- /dev/null
+++ b/clang/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;
+}
OpenPOWER on IntegriCloud