[SimplifyLibCalls] Add test to ensure transform is not executed if fast-math
authorDavide Italiano <davide@freebsd.org>
Sat, 31 Oct 2015 20:59:32 +0000 (20:59 +0000)
committerDavide Italiano <davide@freebsd.org>
Sat, 31 Oct 2015 20:59:32 +0000 (20:59 +0000)
commitd35fbff07e990d3ba7eb4bae23bac303439f86c9
tree403045468b468e4056248624e61b11f7fdd50b17
parent22258251b9b75c1acc89bc4a6d54d7316158ab35
[SimplifyLibCalls] Add test to ensure transform is not executed if fast-math
attribute is not present.

During my refactor in r251595 I changed the behavior of optimizeSqrt(),
skipping the transformation if the function wasn't marked with unsafe-fp-math
attribute. This fixed a bug, as confirmed by Sanjay (before the optimization
was silently executed anyway), although it wasn't my primary aim.
This commit adds a test to ensure the code doesn't break again.

Reported by: Marcello Maggioni
Discussed with: Sanjay Patel

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251747 91177308-0d34-0410-b5e6-96231b3b80d8
test/Transforms/InstCombine/sqrt-nofast.ll [new file with mode: 0644]