llvm.org GIT mirror llvm / 41c3e9a
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 Joe Groff 7 years ago
1 changed file(s) with 31 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
None ; RUN: opt < %s -simplify-libcalls -S > %t
1 ; RUN: not grep {call.*floor(} %t
2 ; RUN: grep {call.*floorf(} %t
3 ; RUN: not grep {call.*ceil(} %t
4 ; RUN: grep {call.*ceilf(} %t
5 ; RUN: not grep {call.*nearbyint(} %t
6 ; RUN: grep {call.*nearbyintf(} %t
7 ; XFAIL: sparc
0 ; RUN: opt < %s -simplify-libcalls -S -mtriple "i386-pc-linux" | FileCheck -check-prefix=DO-SIMPLIFY %s
1 ; RUN: opt < %s -simplify-libcalls -S -mtriple "i386-pc-win32" | FileCheck -check-prefix=DONT-SIMPLIFY %s
2 ; RUN: opt < %s -simplify-libcalls -S -mtriple "x86_64-pc-win32" | FileCheck -check-prefix=C89-SIMPLIFY %s
3 ; RUN: opt < %s -simplify-libcalls -S -mtriple "i386-pc-mingw32" | FileCheck -check-prefix=DO-SIMPLIFY %s
4 ; RUN: opt < %s -simplify-libcalls -S -mtriple "x86_64-pc-mingw32" | FileCheck -check-prefix=DO-SIMPLIFY %s
5 ; RUN: opt < %s -simplify-libcalls -S -mtriple "sparc-sun-solaris" | FileCheck -check-prefix=DO-SIMPLIFY %s
6
7 ; DO-SIMPLIFY: call float @floorf(
8 ; DO-SIMPLIFY: call float @ceilf(
9 ; DO-SIMPLIFY: call float @roundf(
10 ; DO-SIMPLIFY: call float @nearbyintf(
11
12 ; C89-SIMPLIFY: call float @floorf(
13 ; C89-SIMPLIFY: call float @ceilf(
14 ; C89-SIMPLIFY: call double @round(
15 ; C89-SIMPLIFY: call double @nearbyint(
16
17 ; DONT-SIMPLIFY: call double @floor(
18 ; DONT-SIMPLIFY: call double @ceil(
19 ; DONT-SIMPLIFY: call double @round(
20 ; DONT-SIMPLIFY: call double @nearbyint(
821
922 declare double @floor(double)
1023
1124 declare double @ceil(double)
25
26 declare double @round(double)
1227
1328 declare double @nearbyint(double)
1429
2843 ret float %F
2944 }
3045
31 ; PR8466
32 ; XFAIL: win32
46 define float @test_round(float %C) {
47 %D = fpext float %C to double ; [#uses=1]
48 ; --> roundf
49 %E = call double @round( double %D ) ; [#uses=1]
50 %F = fptrunc double %E to float ; [#uses=1]
51 ret float %F
52 }
53
3354 define float @test_nearbyint(float %C) {
3455 %D = fpext float %C to double ; [#uses=1]
3556 ; --> nearbyintf