summaryrefslogtreecommitdiff
path: root/test/Transforms/SimplifyLibCalls
diff options
context:
space:
mode:
authorJoe Groff <arcata@gmail.com>2012-04-18 00:36:07 +0000
committerJoe Groff <arcata@gmail.com>2012-04-18 00:36:07 +0000
commit41c3e9a326979960c83fc48d21b54fb14d8d216c (patch)
tree11f289350871b4466d4c74aec3c9f4297cc9eec8 /test/Transforms/SimplifyLibCalls
parentd15c581100510d074a5b2b1e47b88e4514d93b1b (diff)
downloadllvm-41c3e9a326979960c83fc48d21b54fb14d8d216c.tar.gz
llvm-41c3e9a326979960c83fc48d21b54fb14d8d216c.tar.bz2
llvm-41c3e9a326979960c83fc48d21b54fb14d8d216c.tar.xz
FileCheckify, un-XFAIL SimplifyLibCalls/floor test
Fixes build on MSVC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154970 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/SimplifyLibCalls')
-rw-r--r--test/Transforms/SimplifyLibCalls/floor.ll41
1 files changed, 31 insertions, 10 deletions
diff --git a/test/Transforms/SimplifyLibCalls/floor.ll b/test/Transforms/SimplifyLibCalls/floor.ll
index 8780e32e0a..03dcdf585f 100644
--- a/test/Transforms/SimplifyLibCalls/floor.ll
+++ b/test/Transforms/SimplifyLibCalls/floor.ll
@@ -1,16 +1,31 @@
-; RUN: opt < %s -simplify-libcalls -S > %t
-; RUN: not grep {call.*floor(} %t
-; RUN: grep {call.*floorf(} %t
-; RUN: not grep {call.*ceil(} %t
-; RUN: grep {call.*ceilf(} %t
-; RUN: not grep {call.*nearbyint(} %t
-; RUN: grep {call.*nearbyintf(} %t
-; XFAIL: sparc
+; RUN: opt < %s -simplify-libcalls -S -mtriple "i386-pc-linux" | FileCheck -check-prefix=DO-SIMPLIFY %s
+; RUN: opt < %s -simplify-libcalls -S -mtriple "i386-pc-win32" | FileCheck -check-prefix=DONT-SIMPLIFY %s
+; RUN: opt < %s -simplify-libcalls -S -mtriple "x86_64-pc-win32" | FileCheck -check-prefix=C89-SIMPLIFY %s
+; RUN: opt < %s -simplify-libcalls -S -mtriple "i386-pc-mingw32" | FileCheck -check-prefix=DO-SIMPLIFY %s
+; RUN: opt < %s -simplify-libcalls -S -mtriple "x86_64-pc-mingw32" | FileCheck -check-prefix=DO-SIMPLIFY %s
+; RUN: opt < %s -simplify-libcalls -S -mtriple "sparc-sun-solaris" | FileCheck -check-prefix=DO-SIMPLIFY %s
+
+; DO-SIMPLIFY: call float @floorf(
+; DO-SIMPLIFY: call float @ceilf(
+; DO-SIMPLIFY: call float @roundf(
+; DO-SIMPLIFY: call float @nearbyintf(
+
+; C89-SIMPLIFY: call float @floorf(
+; C89-SIMPLIFY: call float @ceilf(
+; C89-SIMPLIFY: call double @round(
+; C89-SIMPLIFY: call double @nearbyint(
+
+; DONT-SIMPLIFY: call double @floor(
+; DONT-SIMPLIFY: call double @ceil(
+; DONT-SIMPLIFY: call double @round(
+; DONT-SIMPLIFY: call double @nearbyint(
declare double @floor(double)
declare double @ceil(double)
+declare double @round(double)
+
declare double @nearbyint(double)
define float @test_floor(float %C) {
@@ -29,8 +44,14 @@ define float @test_ceil(float %C) {
ret float %F
}
-; PR8466
-; XFAIL: win32
+define float @test_round(float %C) {
+ %D = fpext float %C to double ; <double> [#uses=1]
+ ; --> roundf
+ %E = call double @round( double %D ) ; <double> [#uses=1]
+ %F = fptrunc double %E to float ; <float> [#uses=1]
+ ret float %F
+}
+
define float @test_nearbyint(float %C) {
%D = fpext float %C to double ; <double> [#uses=1]
; --> nearbyintf