blob: 753c9fa708447c89a12b62746b726f5cf523b537 [file] [log] [blame]
Chris Lattnera4c096d2002-12-15 07:55:43 +00001
Chris Lattneraf2f4382003-06-01 03:37:25 +00002
Chris Lattner102f5332003-01-13 00:56:37 +00003int %foo() {
4 ret int 0
5}
6
Chris Lattnera4c096d2002-12-15 07:55:43 +00007int %main() {
Chris Lattner102f5332003-01-13 00:56:37 +00008 ; cast bool to ...
9 cast bool true to bool
Chris Lattnera4c096d2002-12-15 07:55:43 +000010 cast bool true to int
Chris Lattner20c1b4d2003-01-16 19:43:11 +000011 cast bool true to long
12 cast bool true to ulong
13 cast bool true to float
14 cast bool true to double
Chris Lattner102f5332003-01-13 00:56:37 +000015
16 ; cast sbyte to ...
17 cast sbyte 0 to sbyte
18 cast sbyte 4 to short
19 cast sbyte 4 to long
20 cast sbyte 4 to ulong
21 cast sbyte 4 to double
22
Chris Lattner4f912852003-05-12 20:35:29 +000023 ; cast ubyte to ...
24 cast ubyte 0 to float
25 cast ubyte 0 to double
26
Chris Lattner102f5332003-01-13 00:56:37 +000027 ; cast short to ...
28 cast short 0 to short
29 cast short 0 to long
30 cast short 0 to ulong
31 cast short 0 to double
32
Chris Lattner4f912852003-05-12 20:35:29 +000033 ; cast ushort to ...
Chris Lattner8c191942003-05-12 20:39:30 +000034 cast ushort 0 to float
35 cast ushort 0 to double
Chris Lattner4f912852003-05-12 20:35:29 +000036
Chris Lattner102f5332003-01-13 00:56:37 +000037 ; cast int to ...
Chris Lattnera4c096d2002-12-15 07:55:43 +000038 cast int 6 to bool
Chris Lattner102f5332003-01-13 00:56:37 +000039 cast int 6 to short
40 cast int 0 to int
41 cast int 0 to long
42 cast int 0 to ulong
Chris Lattner4f912852003-05-12 20:35:29 +000043 cast int 0 to float
Chris Lattner102f5332003-01-13 00:56:37 +000044 cast int 0 to double
45
46 ; cast uint to ...
47 cast uint 0 to long
48 cast uint 0 to ulong
Chris Lattner8c191942003-05-12 20:39:30 +000049 cast uint 0 to float
50 cast uint 0 to double
Chris Lattner102f5332003-01-13 00:56:37 +000051
52 ; cast long to ...
Chris Lattneraf2f4382003-06-01 03:37:25 +000053 cast long 0 to bool
Chris Lattner102f5332003-01-13 00:56:37 +000054 cast long 0 to sbyte
55 cast long 0 to ubyte
56 cast long 0 to short
57 cast long 0 to ushort
58 cast long 0 to int
59 cast long 0 to uint
60 cast long 0 to long
61 cast long 0 to ulong
62 cast long 0 to float
63 cast long 0 to double
Chris Lattneraf2f4382003-06-01 03:37:25 +000064
65 cast ulong 0 to bool
Chris Lattner102f5332003-01-13 00:56:37 +000066
67 ; cast float to ...
Chris Lattner20c1b4d2003-01-16 19:43:11 +000068 ;cast float 0.0 to bool
Chris Lattner102f5332003-01-13 00:56:37 +000069 cast float 0.0 to float
70 cast float 0.0 to double
71
72 ; cast double to ...
Chris Lattner20c1b4d2003-01-16 19:43:11 +000073 ;cast double 0.0 to bool
Chris Lattner102f5332003-01-13 00:56:37 +000074 cast double 0.0 to sbyte
75 cast double 0.0 to ubyte
76 cast double 0.0 to short
77 cast double 0.0 to ushort
78 cast double 0.0 to int
79 cast double 0.0 to uint
80 cast double 0.0 to long
81 ;cast double 0.0 to ulong
82 cast double 0.0 to float
83 cast double 0.0 to double
Chris Lattnera4c096d2002-12-15 07:55:43 +000084
85 ret int 0
86}