blob: 27215956b64d8c4c2c9308e1334864e5ac8301c3 [file] [log] [blame]
Dale Johannesenfe5293d2007-09-26 21:12:10 +00001; Make sure this testcase codegens to the sin and cos instructions, not calls
2; RUN: llvm-as < %s | \
3; RUN: llc -march=x86 -mattr=-sse,-sse2,-sse3 -enable-unsafe-fp-math | \
4; RUN: grep sin\$ | count 3
5; RUN: llvm-as < %s | \
6; RUN: llc -march=x86 -mattr=-sse,-sse2,-sse3 -enable-unsafe-fp-math | \
7; RUN: grep cos\$ | count 3
8
9declare float @sinf(float)
10
11declare double @sin(double)
12
13declare x86_fp80 @sinl(x86_fp80)
14
15define float @test1(float %X) {
16 %Y = call float @sinf(float %X)
17 ret float %Y
18}
19
20define double @test2(double %X) {
21 %Y = call double @sin(double %X)
22 ret double %Y
23}
24
25define x86_fp80 @test3(x86_fp80 %X) {
26 %Y = call x86_fp80 @sinl(x86_fp80 %X)
27 ret x86_fp80 %Y
28}
29
30declare float @cosf(float)
31
32declare double @cos(double)
33
34declare x86_fp80 @cosl(x86_fp80)
35
36define float @test4(float %X) {
37 %Y = call float @cosf(float %X)
38 ret float %Y
39}
40
41define double @test5(double %X) {
42 %Y = call double @cos(double %X)
43 ret double %Y
44}
45
46define x86_fp80 @test6(x86_fp80 %X) {
47 %Y = call x86_fp80 @cosl(x86_fp80 %X)
48 ret x86_fp80 %Y
49}
50