blob: ba199dbf56080588d4f417bba7bca0eec8e91337 [file] [log] [blame]
Tanya Lattner246a1372008-02-17 20:02:20 +00001; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 > %t
Dan Gohman8c89a502007-08-15 13:36:28 +00002; RUN: grep fmsr %t | count 4
Dan Gohmanf17a25c2007-07-18 16:29:46 +00003; RUN: grep fsitos %t
Dan Gohman8c89a502007-08-15 13:36:28 +00004; RUN: grep fmrs %t | count 2
Dan Gohmanf17a25c2007-07-18 16:29:46 +00005; RUN: grep fsitod %t
Chris Lattner70278d52007-11-28 05:27:07 +00006; RUN: grep fmrrd %t | count 3
7; RUN: not grep fmdrr %t
Dan Gohmanf17a25c2007-07-18 16:29:46 +00008; RUN: grep fldd %t
9; RUN: grep fuitod %t
10; RUN: grep fuitos %t
11; RUN: grep 1065353216 %t
Dan Gohmanf17a25c2007-07-18 16:29:46 +000012
Tanya Lattner246a1372008-02-17 20:02:20 +000013define float @f(i32 %a) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000014entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000015 %tmp = sitofp i32 %a to float ; <float> [#uses=1]
16 ret float %tmp
Dan Gohmanf17a25c2007-07-18 16:29:46 +000017}
18
Tanya Lattner246a1372008-02-17 20:02:20 +000019define double @g(i32 %a) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000020entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000021 %tmp = sitofp i32 %a to double ; <double> [#uses=1]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000022 ret double %tmp
23}
24
Tanya Lattner246a1372008-02-17 20:02:20 +000025define double @uint_to_double(i32 %a) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000026entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000027 %tmp = uitofp i32 %a to double ; <double> [#uses=1]
28 ret double %tmp
Dan Gohmanf17a25c2007-07-18 16:29:46 +000029}
30
Tanya Lattner246a1372008-02-17 20:02:20 +000031define float @uint_to_float(i32 %a) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000032entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000033 %tmp = uitofp i32 %a to float ; <float> [#uses=1]
34 ret float %tmp
Dan Gohmanf17a25c2007-07-18 16:29:46 +000035}
36
Tanya Lattner246a1372008-02-17 20:02:20 +000037define double @h(double* %v) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000038entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000039 %tmp = load double* %v ; <double> [#uses=1]
40 ret double %tmp
Dan Gohmanf17a25c2007-07-18 16:29:46 +000041}
42
Tanya Lattner246a1372008-02-17 20:02:20 +000043define float @h2() {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000044entry:
45 ret float 1.000000e+00
46}
47
Tanya Lattner246a1372008-02-17 20:02:20 +000048define double @f2(double %a) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000049 ret double %a
50}
51
Tanya Lattner246a1372008-02-17 20:02:20 +000052define void @f3() {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000053entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000054 %tmp = call double @f5( ) ; <double> [#uses=1]
55 call void @f4( double %tmp )
56 ret void
Dan Gohmanf17a25c2007-07-18 16:29:46 +000057}
58
Tanya Lattner246a1372008-02-17 20:02:20 +000059declare void @f4(double)
60
61declare double @f5()
62