From 597f22f6cd5c0bfa5ffc6ddf4cf5b2796efba867 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 2 Apr 2005 05:35:00 +0000 Subject: [PATCH] new testcase git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21016 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/Generic/fneg-fabs.ll | 26 ++++++++++++++++++++++++++ test/CodeGen/X86/fabs.ll | 10 ++++++++++ 2 files changed, 36 insertions(+) create mode 100644 test/CodeGen/Generic/fneg-fabs.ll create mode 100644 test/CodeGen/X86/fabs.ll diff --git a/test/CodeGen/Generic/fneg-fabs.ll b/test/CodeGen/Generic/fneg-fabs.ll new file mode 100644 index 00000000000..a533fe55996 --- /dev/null +++ b/test/CodeGen/Generic/fneg-fabs.ll @@ -0,0 +1,26 @@ +; RUN: llvm-as < %s | llc + +double %fneg(double %X) { + %Y = sub double -0.0, %X + ret double %Y +} + +float %fnegf(float %X) { + %Y = sub float -0.0, %X + ret float %Y +} + +declare double %fabs(double) +declare float %fabsf(float) + + +double %fabstest(double %X) { + %Y = call double %fabs(double %X) + ret double %Y +} + +float %fabsftest(float %X) { + %Y = call float %fabsf(float %X) + ret float %Y +} + diff --git a/test/CodeGen/X86/fabs.ll b/test/CodeGen/X86/fabs.ll new file mode 100644 index 00000000000..4eca7162145 --- /dev/null +++ b/test/CodeGen/X86/fabs.ll @@ -0,0 +1,10 @@ +; Make sure this testcase codegens to the fabs instruction, not a call to fabsf +; RUN: llvm-as < %s | llc -disable-pattern-isel=0 | grep 'fabs$' + +declare float %fabsf(float) + +float %fabsftest(float %X) { + %Y = call float %fabsf(float %X) + ret float %Y +} +