Skip to content

Commit deb5ec9

Browse files
committed
[SimplifyLibCalls] Added test for lib calls on win
Signed-off-by: Kushal Pal <[email protected]>
1 parent 755ca75 commit deb5ec9

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2+
; RUN: opt %s -passes=instcombine -S -mtriple=i386-pc-windows-msvc | FileCheck %s --check-prefixes=MSVC19
3+
4+
define double @fdim_double() {
5+
; MSVC19-LABEL: define double @fdim_double() {
6+
; MSVC19-NEXT: ret double 2.500000e+00
7+
;
8+
%dim = call double @fdim(double 10.5, double 8.0)
9+
ret double %dim
10+
}
11+
12+
;fdimf is not supported by windows
13+
define float @fdim_float() {
14+
; MSVC19-LABEL: define float @fdim_float() {
15+
; MSVC19-NEXT: [[DIM:%.*]] = call float @fdimf(float 1.500000e+00, float 8.000000e+00)
16+
; MSVC19-NEXT: ret float [[DIM]]
17+
;
18+
%dim = call float @fdimf(float 1.500000e+00, float 8.0)
19+
ret float %dim
20+
}
21+
22+
;fdiml is not supported by windows
23+
define fp128 @fdim_long() {
24+
; MSVC19-LABEL: define fp128 @fdim_long() {
25+
; MSVC19-NEXT: [[DIM:%.*]] = call fp128 @fdiml(fp128 0xL00000000000000000000000000000000, fp128 0xL00000000000000000000000000000000)
26+
; MSVC19-NEXT: ret fp128 [[DIM]]
27+
;
28+
%dim = call fp128 @fdiml(fp128 0xL00000000000000000000000000000000 , fp128 0xL00000000000000000000000000000000)
29+
ret fp128 %dim
30+
}
31+
32+
declare double @fdim(double, double) #0
33+
declare float @fdimf(float, float) #0
34+
declare fp128 @fdiml(fp128, fp128) #0
35+
36+
attributes #0 = { memory(none) }

0 commit comments

Comments
 (0)