blob: dbb31ab5fed96083029a7975be91dae0f35fc868 [file] [log] [blame]
Chris Lattnera4c096d2002-12-15 07:55:43 +00001
Chris Lattner102f5332003-01-13 00:56:37 +00002int %foo() {
3 ret int 0
4}
5
Chris Lattnera4c096d2002-12-15 07:55:43 +00006int %main() {
Chris Lattner102f5332003-01-13 00:56:37 +00007 ; cast bool to ...
8 cast bool true to bool
Chris Lattnera4c096d2002-12-15 07:55:43 +00009 cast bool true to int
Chris Lattner20c1b4d2003-01-16 19:43:11 +000010 cast bool true to long
11 cast bool true to ulong
12 cast bool true to float
13 cast bool true to double
Chris Lattner102f5332003-01-13 00:56:37 +000014
15 ; cast sbyte to ...
16 cast sbyte 0 to sbyte
17 cast sbyte 4 to short
18 cast sbyte 4 to long
19 cast sbyte 4 to ulong
20 cast sbyte 4 to double
21
Chris Lattner4f912852003-05-12 20:35:29 +000022 ; cast ubyte to ...
23 cast ubyte 0 to float
24 cast ubyte 0 to double
25
Chris Lattner102f5332003-01-13 00:56:37 +000026 ; cast short to ...
27 cast short 0 to short
28 cast short 0 to long
29 cast short 0 to ulong
30 cast short 0 to double
31
Chris Lattner4f912852003-05-12 20:35:29 +000032 ; cast ushort to ...
33 ;cast ushort 0 to float
34 ;cast ushort 0 to double
35
Chris Lattner102f5332003-01-13 00:56:37 +000036 ; cast int to ...
Chris Lattnera4c096d2002-12-15 07:55:43 +000037 cast int 6 to bool
Chris Lattner102f5332003-01-13 00:56:37 +000038 cast int 6 to short
39 cast int 0 to int
40 cast int 0 to long
41 cast int 0 to ulong
Chris Lattner4f912852003-05-12 20:35:29 +000042 cast int 0 to float
Chris Lattner102f5332003-01-13 00:56:37 +000043 cast int 0 to double
44
45 ; cast uint to ...
46 cast uint 0 to long
47 cast uint 0 to ulong
Chris Lattner4f912852003-05-12 20:35:29 +000048 ;cast uint 0 to float
49 ;cast uint 0 to double
Chris Lattner102f5332003-01-13 00:56:37 +000050
51 ; cast long to ...
52 cast long 0 to sbyte
53 cast long 0 to ubyte
54 cast long 0 to short
55 cast long 0 to ushort
56 cast long 0 to int
57 cast long 0 to uint
58 cast long 0 to long
59 cast long 0 to ulong
60 cast long 0 to float
61 cast long 0 to double
62
63 ; cast float to ...
Chris Lattner20c1b4d2003-01-16 19:43:11 +000064 ;cast float 0.0 to bool
Chris Lattner102f5332003-01-13 00:56:37 +000065 cast float 0.0 to float
66 cast float 0.0 to double
67
68 ; cast double to ...
Chris Lattner20c1b4d2003-01-16 19:43:11 +000069 ;cast double 0.0 to bool
Chris Lattner102f5332003-01-13 00:56:37 +000070 cast double 0.0 to sbyte
71 cast double 0.0 to ubyte
72 cast double 0.0 to short
73 cast double 0.0 to ushort
74 cast double 0.0 to int
75 cast double 0.0 to uint
76 cast double 0.0 to long
77 ;cast double 0.0 to ulong
78 cast double 0.0 to float
79 cast double 0.0 to double
Chris Lattnera4c096d2002-12-15 07:55:43 +000080
81 ret int 0
82}