Chris Lattner | a4c096d | 2002-12-15 07:55:43 +0000 | [diff] [blame] | 1 | |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame^] | 2 | int %foo() { |
| 3 | ret int 0 |
| 4 | } |
| 5 | |
Chris Lattner | a4c096d | 2002-12-15 07:55:43 +0000 | [diff] [blame] | 6 | int %main() { |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame^] | 7 | ; cast bool to ... |
| 8 | cast bool true to bool |
Chris Lattner | a4c096d | 2002-12-15 07:55:43 +0000 | [diff] [blame] | 9 | cast bool true to int |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame^] | 10 | |
| 11 | ; cast sbyte to ... |
| 12 | cast sbyte 0 to sbyte |
| 13 | cast sbyte 4 to short |
| 14 | cast sbyte 4 to long |
| 15 | cast sbyte 4 to ulong |
| 16 | cast sbyte 4 to double |
| 17 | |
| 18 | ; cast short to ... |
| 19 | cast short 0 to short |
| 20 | cast short 0 to long |
| 21 | cast short 0 to ulong |
| 22 | cast short 0 to double |
| 23 | |
| 24 | ; cast int to ... |
Chris Lattner | a4c096d | 2002-12-15 07:55:43 +0000 | [diff] [blame] | 25 | cast int 6 to bool |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame^] | 26 | cast int 6 to short |
| 27 | cast int 0 to int |
| 28 | cast int 0 to long |
| 29 | cast int 0 to ulong |
| 30 | cast int 0 to double |
| 31 | |
| 32 | ; cast uint to ... |
| 33 | cast uint 0 to long |
| 34 | cast uint 0 to ulong |
| 35 | |
| 36 | ; cast long to ... |
| 37 | cast long 0 to sbyte |
| 38 | cast long 0 to ubyte |
| 39 | cast long 0 to short |
| 40 | cast long 0 to ushort |
| 41 | cast long 0 to int |
| 42 | cast long 0 to uint |
| 43 | cast long 0 to long |
| 44 | cast long 0 to ulong |
| 45 | cast long 0 to float |
| 46 | cast long 0 to double |
| 47 | |
| 48 | ; cast float to ... |
| 49 | cast float 0.0 to float |
| 50 | cast float 0.0 to double |
| 51 | |
| 52 | ; cast double to ... |
| 53 | cast double 0.0 to sbyte |
| 54 | cast double 0.0 to ubyte |
| 55 | cast double 0.0 to short |
| 56 | cast double 0.0 to ushort |
| 57 | cast double 0.0 to int |
| 58 | cast double 0.0 to uint |
| 59 | cast double 0.0 to long |
| 60 | ;cast double 0.0 to ulong |
| 61 | cast double 0.0 to float |
| 62 | cast double 0.0 to double |
Chris Lattner | a4c096d | 2002-12-15 07:55:43 +0000 | [diff] [blame] | 63 | |
| 64 | ret int 0 |
| 65 | } |