xref: /llvm-project/llvm/test/CodeGen/X86/pr36553.ll (revision 0aef747b846586c29ed3285bbed20a3d607576fa)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=x86_64-apple-darwin10 | FileCheck %s
3
4; Make sure we don't crash because we negated an fma when we didn't have any fma instructions.
5
6define float @pr36553(float %a, float %b, float %c) nounwind {
7; CHECK-LABEL: pr36553:
8; CHECK:       ## %bb.0: ## %entry
9; CHECK-NEXT:    pushq %rax
10; CHECK-NEXT:    callq _fmaf
11; CHECK-NEXT:    xorps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
12; CHECK-NEXT:    popq %rax
13; CHECK-NEXT:    retq
14entry:
15  %0 = tail call float @llvm.fma.f32(float %a, float %b, float %c)
16  %sub = fsub float -0.000000e+00, %0
17  ret float %sub
18}
19
20declare float @llvm.fma.f32(float, float, float)
21