1 ; RUN: llvm-as < %s | llc
3 %a_fstr = internal constant [8 x sbyte] c"a = %f\0A\00"
4 %a_lstr = internal constant [10 x sbyte] c"a = %lld\0A\00"
5 %a_dstr = internal constant [8 x sbyte] c"a = %d\0A\00"
7 %b_dstr = internal constant [8 x sbyte] c"b = %d\0A\00"
8 %b_fstr = internal constant [8 x sbyte] c"b = %f\0A\00"
10 declare int %printf(sbyte*, ...)
11 %A = global double 2.0
17 %a_fs = getelementptr [8 x sbyte]* %a_fstr, long 0, long 0
18 call int (sbyte*, ...)* %printf(sbyte* %a_fs, double %a)
20 ;; cast double to long
21 %a_d2l = cast double %a to long
22 %a_ls = getelementptr [10 x sbyte]* %a_lstr, long 0, long 0
23 call int (sbyte*, ...)* %printf(sbyte* %a_ls, long %a_d2l)
26 %a_d2i = cast double %a to int
27 %a_ds = getelementptr [8 x sbyte]* %a_dstr, long 0, long 0
28 call int (sbyte*, ...)* %printf(sbyte* %a_ds, int %a_d2i)
30 ;; cast double to sbyte
31 %a_d2sb = cast double %a to sbyte
32 call int (sbyte*, ...)* %printf(sbyte* %a_ds, sbyte %a_d2sb)
35 %a_d2i2sb = cast int %a_d2i to sbyte
36 call int (sbyte*, ...)* %printf(sbyte* %a_ds, sbyte %a_d2i2sb)
40 %b_ds = getelementptr [8 x sbyte]* %b_dstr, long 0, long 0
41 call int (sbyte*, ...)* %printf(sbyte* %b_ds, int %b)
44 %b_i2d = cast int %b to double
45 %b_fs = getelementptr [8 x sbyte]* %b_fstr, long 0, long 0
46 call int (sbyte*, ...)* %printf(sbyte* %b_fs, double %b_i2d)