1
; RUN: opt < %s -instcombine -S -mtriple "i386-pc-linux" | FileCheck -check-prefix=DO-SIMPLIFY %s
2
; RUN: opt < %s -instcombine -S -mtriple "i386-pc-win32" | FileCheck -check-prefix=DONT-SIMPLIFY %s
3
; RUN: opt < %s -instcombine -S -mtriple "x86_64-pc-win32" | FileCheck -check-prefix=C89-SIMPLIFY %s
4
; RUN: opt < %s -instcombine -S -mtriple "i386-pc-mingw32" | FileCheck -check-prefix=DO-SIMPLIFY %s
5
; RUN: opt < %s -instcombine -S -mtriple "x86_64-pc-mingw32" | FileCheck -check-prefix=DO-SIMPLIFY %s
6
; RUN: opt < %s -instcombine -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)
28
declare double @ceil(double)
29
declare double @round(double)
30
declare double @nearbyint(double)
31
declare double @trunc(double)
32
declare double @fabs(double)
34
define float @test_floor(float %C) {
35
%D = fpext float %C to double
37
%E = call double @floor(double %D)
38
%F = fptrunc double %E to float
42
define float @test_ceil(float %C) {
43
%D = fpext float %C to double
45
%E = call double @ceil(double %D)
46
%F = fptrunc double %E to float
50
define float @test_round(float %C) {
51
%D = fpext float %C to double
53
%E = call double @round(double %D)
54
%F = fptrunc double %E to float
58
define float @test_nearbyint(float %C) {
59
%D = fpext float %C to double
61
%E = call double @nearbyint(double %D)
62
%F = fptrunc double %E to float
66
define float @test_trunc(float %C) {
67
%D = fpext float %C to double
69
%E = call double @trunc(double %D)
70
%F = fptrunc double %E to float
74
define float @test_fabs(float %C) {
75
%D = fpext float %C to double
77
%E = call double @fabs(double %D)
78
%F = fptrunc double %E to float