diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
commit | 45b533945f0851ec234ca846e1af5ee1e4df0b6e (patch) | |
tree | 0a5b74c0b9ca73aded34df95c91fcaf3815230d8 /test/CodeGen/fp-contract-pragma.cpp | |
parent | 7e86edd64bfae4e324224452e4ea879b3371a4bd (diff) | |
download | src-45b533945f0851ec234ca846e1af5ee1e4df0b6e.tar.gz src-45b533945f0851ec234ca846e1af5ee1e4df0b6e.zip |
Vendor import of clang trunk r256633:vendor/clang/clang-trunk-r256633
Notes
Notes:
svn path=/vendor/clang/dist/; revision=292920
svn path=/vendor/clang/clang-trunk-r256633/; revision=292923; tag=vendor/clang/clang-trunk-r256633
Diffstat (limited to 'test/CodeGen/fp-contract-pragma.cpp')
-rw-r--r-- | test/CodeGen/fp-contract-pragma.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/CodeGen/fp-contract-pragma.cpp b/test/CodeGen/fp-contract-pragma.cpp index b4e24b9e6824..1c5921a53f97 100644 --- a/test/CodeGen/fp-contract-pragma.cpp +++ b/test/CodeGen/fp-contract-pragma.cpp @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -O3 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s -// Is FP_CONTRACT is honored in a simple case? +// Is FP_CONTRACT honored in a simple case? float fp_contract_1(float a, float b, float c) { // CHECK: _Z13fp_contract_1fff // CHECK: tail call float @llvm.fmuladd @@ -19,7 +19,7 @@ float fp_contract_2(float a, float b, float c) { return a * b + c; } -// Does FP_CONTRACT survive template instatiation? +// Does FP_CONTRACT survive template instantiation? class Foo {}; Foo operator+(Foo, Foo); @@ -62,3 +62,15 @@ float fp_contract_6(float a, float b, float c) { return a * b + c; } +// If the multiply has multiple uses, don't produce fmuladd. +// This used to assert (PR25719): +// https://llvm.org/bugs/show_bug.cgi?id=25719 + +float fp_contract_7(float a, float b, float c) { +// CHECK: _Z13fp_contract_7fff +// CHECK: %[[M:.+]] = fmul float %b, 2.000000e+00 +// CHECK-NEXT: fsub float %[[M]], %c + #pragma STDC FP_CONTRACT ON + return (a = 2 * b) - c; +} + |