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 | 20c1b4d | 2003-01-16 19:43:11 +0000 | [diff] [blame^] | 10 | cast bool true to long |
| 11 | cast bool true to ulong |
| 12 | cast bool true to float |
| 13 | cast bool true to double |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 14 | |
| 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 | |
| 22 | ; cast short to ... |
| 23 | cast short 0 to short |
| 24 | cast short 0 to long |
| 25 | cast short 0 to ulong |
| 26 | cast short 0 to double |
| 27 | |
| 28 | ; cast int to ... |
Chris Lattner | a4c096d | 2002-12-15 07:55:43 +0000 | [diff] [blame] | 29 | cast int 6 to bool |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 30 | cast int 6 to short |
| 31 | cast int 0 to int |
| 32 | cast int 0 to long |
| 33 | cast int 0 to ulong |
| 34 | cast int 0 to double |
| 35 | |
| 36 | ; cast uint to ... |
| 37 | cast uint 0 to long |
| 38 | cast uint 0 to ulong |
| 39 | |
| 40 | ; cast long to ... |
| 41 | cast long 0 to sbyte |
| 42 | cast long 0 to ubyte |
| 43 | cast long 0 to short |
| 44 | cast long 0 to ushort |
| 45 | cast long 0 to int |
| 46 | cast long 0 to uint |
| 47 | cast long 0 to long |
| 48 | cast long 0 to ulong |
| 49 | cast long 0 to float |
| 50 | cast long 0 to double |
| 51 | |
| 52 | ; cast float to ... |
Chris Lattner | 20c1b4d | 2003-01-16 19:43:11 +0000 | [diff] [blame^] | 53 | ;cast float 0.0 to bool |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 54 | cast float 0.0 to float |
| 55 | cast float 0.0 to double |
| 56 | |
| 57 | ; cast double to ... |
Chris Lattner | 20c1b4d | 2003-01-16 19:43:11 +0000 | [diff] [blame^] | 58 | ;cast double 0.0 to bool |
Chris Lattner | 102f533 | 2003-01-13 00:56:37 +0000 | [diff] [blame] | 59 | cast double 0.0 to sbyte |
| 60 | cast double 0.0 to ubyte |
| 61 | cast double 0.0 to short |
| 62 | cast double 0.0 to ushort |
| 63 | cast double 0.0 to int |
| 64 | cast double 0.0 to uint |
| 65 | cast double 0.0 to long |
| 66 | ;cast double 0.0 to ulong |
| 67 | cast double 0.0 to float |
| 68 | cast double 0.0 to double |
Chris Lattner | a4c096d | 2002-12-15 07:55:43 +0000 | [diff] [blame] | 69 | |
| 70 | ret int 0 |
| 71 | } |