Chris Lattner | a4c096d | 2002-12-15 07:55:43 +0000 | [diff] [blame] | 1 | |
Chris Lattner | af2f438 | 2003-06-01 03:37:25 +0000 | [diff] [blame] | 2 | |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 3 | int %foo() { |
| 4 | ret int 0 |
| 5 | } |
| 6 | |
Chris Lattner | a4c096d | 2002-12-15 07:55:43 +0000 | [diff] [blame] | 7 | int %main() { |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 8 | ; cast bool to ... |
| 9 | cast bool true to bool |
Brian Gaeke | 2c9a94c | 2004-05-07 21:10:28 +0000 | [diff] [blame^] | 10 | cast bool true to ubyte |
| 11 | cast bool true to sbyte |
| 12 | cast bool true to short |
| 13 | cast bool true to ushort |
Chris Lattner | a4c096d | 2002-12-15 07:55:43 +0000 | [diff] [blame] | 14 | cast bool true to int |
Brian Gaeke | 2c9a94c | 2004-05-07 21:10:28 +0000 | [diff] [blame^] | 15 | cast bool true to uint |
Chris Lattner | 20c1b4d | 2003-01-16 19:43:11 +0000 | [diff] [blame] | 16 | cast bool true to long |
| 17 | cast bool true to ulong |
| 18 | cast bool true to float |
| 19 | cast bool true to double |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 20 | |
| 21 | ; cast sbyte to ... |
Brian Gaeke | 2c9a94c | 2004-05-07 21:10:28 +0000 | [diff] [blame^] | 22 | cast sbyte 0 to bool |
| 23 | cast sbyte 1 to bool |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 24 | cast sbyte 0 to sbyte |
Brian Gaeke | 2c9a94c | 2004-05-07 21:10:28 +0000 | [diff] [blame^] | 25 | cast sbyte -1 to ubyte |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 26 | cast sbyte 4 to short |
Brian Gaeke | 2c9a94c | 2004-05-07 21:10:28 +0000 | [diff] [blame^] | 27 | cast sbyte 4 to ushort |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 28 | cast sbyte 4 to long |
| 29 | cast sbyte 4 to ulong |
Brian Gaeke | 2c9a94c | 2004-05-07 21:10:28 +0000 | [diff] [blame^] | 30 | cast sbyte 4 to float |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 31 | cast sbyte 4 to double |
| 32 | |
Chris Lattner | 4f91285 | 2003-05-12 20:35:29 +0000 | [diff] [blame] | 33 | ; cast ubyte to ... |
Brian Gaeke | 2c9a94c | 2004-05-07 21:10:28 +0000 | [diff] [blame^] | 34 | 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 Lattner | 4f91285 | 2003-05-12 20:35:29 +0000 | [diff] [blame] | 42 | cast ubyte 0 to float |
| 43 | cast ubyte 0 to double |
| 44 | |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 45 | ; cast short to ... |
Brian Gaeke | 2c9a94c | 2004-05-07 21:10:28 +0000 | [diff] [blame^] | 46 | cast short 1 to bool |
| 47 | cast short -1 to sbyte |
| 48 | cast short 255 to ubyte |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 49 | cast short 0 to short |
Brian Gaeke | 2c9a94c | 2004-05-07 21:10:28 +0000 | [diff] [blame^] | 50 | cast short 0 to ushort |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 51 | cast short 0 to long |
| 52 | cast short 0 to ulong |
Brian Gaeke | 2c9a94c | 2004-05-07 21:10:28 +0000 | [diff] [blame^] | 53 | cast short 0 to float |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 54 | cast short 0 to double |
| 55 | |
Chris Lattner | 4f91285 | 2003-05-12 20:35:29 +0000 | [diff] [blame] | 56 | ; cast ushort to ... |
Brian Gaeke | 2c9a94c | 2004-05-07 21:10:28 +0000 | [diff] [blame^] | 57 | 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 Lattner | 8c19194 | 2003-05-12 20:39:30 +0000 | [diff] [blame] | 64 | cast ushort 0 to float |
| 65 | cast ushort 0 to double |
Chris Lattner | 4f91285 | 2003-05-12 20:35:29 +0000 | [diff] [blame] | 66 | |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 67 | ; cast int to ... |
Chris Lattner | a4c096d | 2002-12-15 07:55:43 +0000 | [diff] [blame] | 68 | cast int 6 to bool |
Brian Gaeke | 2c9a94c | 2004-05-07 21:10:28 +0000 | [diff] [blame^] | 69 | cast int -6 to sbyte |
| 70 | cast int 6 to ubyte |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 71 | cast int 6 to short |
| 72 | cast int 0 to int |
| 73 | cast int 0 to long |
| 74 | cast int 0 to ulong |
Chris Lattner | 4f91285 | 2003-05-12 20:35:29 +0000 | [diff] [blame] | 75 | cast int 0 to float |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 76 | cast int 0 to double |
| 77 | |
| 78 | ; cast uint to ... |
Brian Gaeke | 2c9a94c | 2004-05-07 21:10:28 +0000 | [diff] [blame^] | 79 | 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 Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 84 | cast uint 0 to long |
| 85 | cast uint 0 to ulong |
Chris Lattner | 8c19194 | 2003-05-12 20:39:30 +0000 | [diff] [blame] | 86 | cast uint 0 to float |
| 87 | cast uint 0 to double |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 88 | |
| 89 | ; cast long to ... |
Chris Lattner | af2f438 | 2003-06-01 03:37:25 +0000 | [diff] [blame] | 90 | cast long 0 to bool |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 91 | 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 Lattner | af2f438 | 2003-06-01 03:37:25 +0000 | [diff] [blame] | 101 | |
Brian Gaeke | 2c9a94c | 2004-05-07 21:10:28 +0000 | [diff] [blame^] | 102 | ; 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 Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 114 | |
| 115 | ; cast float to ... |
Chris Lattner | 20c1b4d | 2003-01-16 19:43:11 +0000 | [diff] [blame] | 116 | ;cast float 0.0 to bool |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 117 | cast float 0.0 to float |
| 118 | cast float 0.0 to double |
| 119 | |
| 120 | ; cast double to ... |
Chris Lattner | 20c1b4d | 2003-01-16 19:43:11 +0000 | [diff] [blame] | 121 | ;cast double 0.0 to bool |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 122 | 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 Lattner | a4c096d | 2002-12-15 07:55:43 +0000 | [diff] [blame] | 132 | |
| 133 | ret int 0 |
| 134 | } |