blob: 933d1e8a522dcff69244967156b5684654ebde8d [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
Brian Gaeke2c9a94c2004-05-07 21:10:28 +000010 cast bool true to ubyte
11 cast bool true to sbyte
12 cast bool true to short
13 cast bool true to ushort
Chris Lattnera4c096d2002-12-15 07:55:43 +000014 cast bool true to int
Brian Gaeke2c9a94c2004-05-07 21:10:28 +000015 cast bool true to uint
Chris Lattner20c1b4d2003-01-16 19:43:11 +000016 cast bool true to long
17 cast bool true to ulong
18 cast bool true to float
19 cast bool true to double
Chris Lattner102f5332003-01-13 00:56:37 +000020
21 ; cast sbyte to ...
Brian Gaeke2c9a94c2004-05-07 21:10:28 +000022 cast sbyte 0 to bool
23 cast sbyte 1 to bool
Chris Lattner102f5332003-01-13 00:56:37 +000024 cast sbyte 0 to sbyte
Brian Gaeke2c9a94c2004-05-07 21:10:28 +000025 cast sbyte -1 to ubyte
Chris Lattner102f5332003-01-13 00:56:37 +000026 cast sbyte 4 to short
Brian Gaeke2c9a94c2004-05-07 21:10:28 +000027 cast sbyte 4 to ushort
Chris Lattner102f5332003-01-13 00:56:37 +000028 cast sbyte 4 to long
29 cast sbyte 4 to ulong
Brian Gaeke2c9a94c2004-05-07 21:10:28 +000030 cast sbyte 4 to float
Chris Lattner102f5332003-01-13 00:56:37 +000031 cast sbyte 4 to double
32
Chris Lattner4f912852003-05-12 20:35:29 +000033 ; cast ubyte to ...
Brian Gaeke2c9a94c2004-05-07 21:10:28 +000034 cast ubyte 0 to bool
35 cast ubyte 1 to bool
36 cast ubyte 0 to sbyte
37 cast ubyte 1 to ubyte
38 cast ubyte 4 to short
39 cast ubyte 4 to ushort
40 cast ubyte 4 to long
41 cast ubyte 4 to ulong
Chris Lattner4f912852003-05-12 20:35:29 +000042 cast ubyte 0 to float
43 cast ubyte 0 to double
44
Chris Lattner102f5332003-01-13 00:56:37 +000045 ; cast short to ...
Brian Gaeke2c9a94c2004-05-07 21:10:28 +000046 cast short 1 to bool
47 cast short -1 to sbyte
48 cast short 255 to ubyte
Chris Lattner102f5332003-01-13 00:56:37 +000049 cast short 0 to short
Brian Gaeke2c9a94c2004-05-07 21:10:28 +000050 cast short 0 to ushort
Chris Lattner102f5332003-01-13 00:56:37 +000051 cast short 0 to long
52 cast short 0 to ulong
Brian Gaeke2c9a94c2004-05-07 21:10:28 +000053 cast short 0 to float
Chris Lattner102f5332003-01-13 00:56:37 +000054 cast short 0 to double
55
Chris Lattner4f912852003-05-12 20:35:29 +000056 ; cast ushort to ...
Brian Gaeke2c9a94c2004-05-07 21:10:28 +000057 cast ushort 1 to bool
58 cast ushort 1 to sbyte
59 cast ushort 255 to ubyte
60 cast ushort 0 to short
61 cast ushort 0 to ushort
62 cast ushort 0 to long
63 cast ushort 0 to ulong
Chris Lattner8c191942003-05-12 20:39:30 +000064 cast ushort 0 to float
65 cast ushort 0 to double
Chris Lattner4f912852003-05-12 20:35:29 +000066
Chris Lattner102f5332003-01-13 00:56:37 +000067 ; cast int to ...
Chris Lattnera4c096d2002-12-15 07:55:43 +000068 cast int 6 to bool
Brian Gaeke2c9a94c2004-05-07 21:10:28 +000069 cast int -6 to sbyte
70 cast int 6 to ubyte
Chris Lattner102f5332003-01-13 00:56:37 +000071 cast int 6 to short
72 cast int 0 to int
73 cast int 0 to long
74 cast int 0 to ulong
Chris Lattner4f912852003-05-12 20:35:29 +000075 cast int 0 to float
Chris Lattner102f5332003-01-13 00:56:37 +000076 cast int 0 to double
77
78 ; cast uint to ...
Brian Gaeke2c9a94c2004-05-07 21:10:28 +000079 cast uint 6 to bool
80 cast uint 7 to sbyte
81 cast uint 8 to ubyte
82 cast uint 9 to short
83 cast uint 10 to int
Chris Lattner102f5332003-01-13 00:56:37 +000084 cast uint 0 to long
85 cast uint 0 to ulong
Chris Lattner8c191942003-05-12 20:39:30 +000086 cast uint 0 to float
87 cast uint 0 to double
Chris Lattner102f5332003-01-13 00:56:37 +000088
89 ; cast long to ...
Chris Lattneraf2f4382003-06-01 03:37:25 +000090 cast long 0 to bool
Chris Lattner102f5332003-01-13 00:56:37 +000091 cast long 0 to sbyte
92 cast long 0 to ubyte
93 cast long 0 to short
94 cast long 0 to ushort
95 cast long 0 to int
96 cast long 0 to uint
97 cast long 0 to long
98 cast long 0 to ulong
99 cast long 0 to float
100 cast long 0 to double
Chris Lattneraf2f4382003-06-01 03:37:25 +0000101
Brian Gaeke2c9a94c2004-05-07 21:10:28 +0000102 ; cast ulong to ...
103 cast ulong 1 to bool
104 cast ulong 1 to sbyte
105 cast ulong 1 to ubyte
106 cast ulong 1 to short
107 cast ulong 1 to ushort
108 cast ulong 1 to int
109 cast ulong 1 to uint
110 cast ulong 1 to long
111 cast ulong 1 to ulong
112 cast ulong 1 to float
113 cast ulong 0 to double
Chris Lattner102f5332003-01-13 00:56:37 +0000114
115 ; cast float to ...
Chris Lattner20c1b4d2003-01-16 19:43:11 +0000116 ;cast float 0.0 to bool
Chris Lattner102f5332003-01-13 00:56:37 +0000117 cast float 0.0 to float
118 cast float 0.0 to double
119
120 ; cast double to ...
Chris Lattner20c1b4d2003-01-16 19:43:11 +0000121 ;cast double 0.0 to bool
Chris Lattner102f5332003-01-13 00:56:37 +0000122 cast double 0.0 to sbyte
123 cast double 0.0 to ubyte
124 cast double 0.0 to short
125 cast double 0.0 to ushort
126 cast double 0.0 to int
127 cast double 0.0 to uint
128 cast double 0.0 to long
129 ;cast double 0.0 to ulong
130 cast double 0.0 to float
131 cast double 0.0 to double
Chris Lattnera4c096d2002-12-15 07:55:43 +0000132
133 ret int 0
134}