1 ; RUN: opt < %s -simplify-libcalls -S -mtriple "i386-pc-linux" | FileCheck -check-prefix=DO-SIMPLIFY %s
2 ; RUN: opt < %s -simplify-libcalls -S -mtriple "i386-pc-win32" | FileCheck -check-prefix=DONT-SIMPLIFY %s
3 ; RUN: opt < %s -simplify-libcalls -S -mtriple "x86_64-pc-win32" | FileCheck -check-prefix=C89-SIMPLIFY %s
4 ; RUN: opt < %s -simplify-libcalls -S -mtriple "i386-pc-mingw32" | FileCheck -check-prefix=DO-SIMPLIFY %s
5 ; RUN: opt < %s -simplify-libcalls -S -mtriple "x86_64-pc-mingw32" | FileCheck -check-prefix=DO-SIMPLIFY %s
6 ; RUN: opt < %s -simplify-libcalls -S -mtriple "sparc-sun-solaris" | FileCheck -check-prefix=DO-SIMPLIFY %s
8 ; DO-SIMPLIFY: call float @floorf(
9 ; DO-SIMPLIFY: call float @ceilf(
10 ; DO-SIMPLIFY: call float @roundf(
11 ; DO-SIMPLIFY: call float @nearbyintf(
12 ; DO-SIMPLIFY: call float @truncf(
13 ; DO-SIMPLIFY: call float @fabsf(
15 ; C89-SIMPLIFY: call float @floorf(
16 ; C89-SIMPLIFY: call float @ceilf(
17 ; C89-SIMPLIFY: call double @round(
18 ; C89-SIMPLIFY: call double @nearbyint(
20 ; DONT-SIMPLIFY: call double @floor(
21 ; DONT-SIMPLIFY: call double @ceil(
22 ; DONT-SIMPLIFY: call double @round(
23 ; DONT-SIMPLIFY: call double @nearbyint(
24 ; DONT-SIMPLIFY: call double @trunc(
25 ; DONT-SIMPLIFY: call double @fabs(
27 declare double @floor(double)
29 declare double @ceil(double)
31 declare double @round(double)
33 declare double @nearbyint(double)
35 declare double @trunc(double)
37 declare double @fabs(double)
39 define float @test_floor(float %C) {
40 %D = fpext float %C to double ; <double> [#uses=1]
42 %E = call double @floor( double %D ) ; <double> [#uses=1]
43 %F = fptrunc double %E to float ; <float> [#uses=1]
47 define float @test_ceil(float %C) {
48 %D = fpext float %C to double ; <double> [#uses=1]
50 %E = call double @ceil( double %D ) ; <double> [#uses=1]
51 %F = fptrunc double %E to float ; <float> [#uses=1]
55 define float @test_round(float %C) {
56 %D = fpext float %C to double ; <double> [#uses=1]
58 %E = call double @round( double %D ) ; <double> [#uses=1]
59 %F = fptrunc double %E to float ; <float> [#uses=1]
63 define float @test_nearbyint(float %C) {
64 %D = fpext float %C to double ; <double> [#uses=1]
66 %E = call double @nearbyint( double %D ) ; <double> [#uses=1]
67 %F = fptrunc double %E to float ; <float> [#uses=1]
71 define float @test_trunc(float %C) {
72 %D = fpext float %C to double
74 %E = call double @trunc(double %D)
75 %F = fptrunc double %E to float
79 define float @test_fabs(float %C) {
80 %D = fpext float %C to double
82 %E = call double @fabs(double %D)
83 %F = fptrunc double %E to float