2004-11-06 23:32:43 +00:00
|
|
|
; RUN: llvm-as -f %s -o %t.bc
|
|
|
|
; RUN: lli %t.bc > /dev/null
|
|
|
|
|
2002-12-15 07:55:43 +00:00
|
|
|
|
2003-06-01 03:37:25 +00:00
|
|
|
|
2003-01-13 00:56:37 +00:00
|
|
|
int %foo() {
|
|
|
|
ret int 0
|
|
|
|
}
|
|
|
|
|
2002-12-15 07:55:43 +00:00
|
|
|
int %main() {
|
2003-01-13 00:56:37 +00:00
|
|
|
; cast bool to ...
|
|
|
|
cast bool true to bool
|
2004-05-07 21:10:28 +00:00
|
|
|
cast bool true to ubyte
|
|
|
|
cast bool true to sbyte
|
|
|
|
cast bool true to short
|
|
|
|
cast bool true to ushort
|
2002-12-15 07:55:43 +00:00
|
|
|
cast bool true to int
|
2004-05-07 21:10:28 +00:00
|
|
|
cast bool true to uint
|
2003-01-16 19:43:11 +00:00
|
|
|
cast bool true to long
|
|
|
|
cast bool true to ulong
|
|
|
|
cast bool true to float
|
|
|
|
cast bool true to double
|
2003-01-13 00:56:37 +00:00
|
|
|
|
|
|
|
; cast sbyte to ...
|
2004-05-07 21:10:28 +00:00
|
|
|
cast sbyte 0 to bool
|
|
|
|
cast sbyte 1 to bool
|
2003-01-13 00:56:37 +00:00
|
|
|
cast sbyte 0 to sbyte
|
2004-05-07 21:10:28 +00:00
|
|
|
cast sbyte -1 to ubyte
|
2003-01-13 00:56:37 +00:00
|
|
|
cast sbyte 4 to short
|
2004-05-07 21:10:28 +00:00
|
|
|
cast sbyte 4 to ushort
|
2003-01-13 00:56:37 +00:00
|
|
|
cast sbyte 4 to long
|
|
|
|
cast sbyte 4 to ulong
|
2004-05-07 21:10:28 +00:00
|
|
|
cast sbyte 4 to float
|
2003-01-13 00:56:37 +00:00
|
|
|
cast sbyte 4 to double
|
|
|
|
|
2003-05-12 20:35:29 +00:00
|
|
|
; cast ubyte to ...
|
2004-05-07 21:10:28 +00:00
|
|
|
cast ubyte 0 to bool
|
|
|
|
cast ubyte 1 to bool
|
|
|
|
cast ubyte 0 to sbyte
|
|
|
|
cast ubyte 1 to ubyte
|
|
|
|
cast ubyte 4 to short
|
|
|
|
cast ubyte 4 to ushort
|
|
|
|
cast ubyte 4 to long
|
|
|
|
cast ubyte 4 to ulong
|
2003-05-12 20:35:29 +00:00
|
|
|
cast ubyte 0 to float
|
|
|
|
cast ubyte 0 to double
|
|
|
|
|
2003-01-13 00:56:37 +00:00
|
|
|
; cast short to ...
|
2004-05-07 21:10:28 +00:00
|
|
|
cast short 1 to bool
|
|
|
|
cast short -1 to sbyte
|
|
|
|
cast short 255 to ubyte
|
2003-01-13 00:56:37 +00:00
|
|
|
cast short 0 to short
|
2004-05-07 21:10:28 +00:00
|
|
|
cast short 0 to ushort
|
2003-01-13 00:56:37 +00:00
|
|
|
cast short 0 to long
|
|
|
|
cast short 0 to ulong
|
2004-05-07 21:10:28 +00:00
|
|
|
cast short 0 to float
|
2003-01-13 00:56:37 +00:00
|
|
|
cast short 0 to double
|
|
|
|
|
2003-05-12 20:35:29 +00:00
|
|
|
; cast ushort to ...
|
2004-05-07 21:10:28 +00:00
|
|
|
cast ushort 1 to bool
|
|
|
|
cast ushort 1 to sbyte
|
|
|
|
cast ushort 255 to ubyte
|
|
|
|
cast ushort 0 to short
|
|
|
|
cast ushort 0 to ushort
|
|
|
|
cast ushort 0 to long
|
|
|
|
cast ushort 0 to ulong
|
2003-05-12 20:39:30 +00:00
|
|
|
cast ushort 0 to float
|
|
|
|
cast ushort 0 to double
|
2003-05-12 20:35:29 +00:00
|
|
|
|
2003-01-13 00:56:37 +00:00
|
|
|
; cast int to ...
|
2002-12-15 07:55:43 +00:00
|
|
|
cast int 6 to bool
|
2004-05-07 21:10:28 +00:00
|
|
|
cast int -6 to sbyte
|
|
|
|
cast int 6 to ubyte
|
2003-01-13 00:56:37 +00:00
|
|
|
cast int 6 to short
|
|
|
|
cast int 0 to int
|
|
|
|
cast int 0 to long
|
|
|
|
cast int 0 to ulong
|
2003-05-12 20:35:29 +00:00
|
|
|
cast int 0 to float
|
2003-01-13 00:56:37 +00:00
|
|
|
cast int 0 to double
|
|
|
|
|
|
|
|
; cast uint to ...
|
2004-05-07 21:10:28 +00:00
|
|
|
cast uint 6 to bool
|
|
|
|
cast uint 7 to sbyte
|
|
|
|
cast uint 8 to ubyte
|
|
|
|
cast uint 9 to short
|
|
|
|
cast uint 10 to int
|
2003-01-13 00:56:37 +00:00
|
|
|
cast uint 0 to long
|
|
|
|
cast uint 0 to ulong
|
2003-05-12 20:39:30 +00:00
|
|
|
cast uint 0 to float
|
|
|
|
cast uint 0 to double
|
2003-01-13 00:56:37 +00:00
|
|
|
|
|
|
|
; cast long to ...
|
2003-06-01 03:37:25 +00:00
|
|
|
cast long 0 to bool
|
2003-01-13 00:56:37 +00:00
|
|
|
cast long 0 to sbyte
|
|
|
|
cast long 0 to ubyte
|
|
|
|
cast long 0 to short
|
|
|
|
cast long 0 to ushort
|
|
|
|
cast long 0 to int
|
|
|
|
cast long 0 to uint
|
|
|
|
cast long 0 to long
|
|
|
|
cast long 0 to ulong
|
|
|
|
cast long 0 to float
|
|
|
|
cast long 0 to double
|
2003-06-01 03:37:25 +00:00
|
|
|
|
2004-05-07 21:10:28 +00:00
|
|
|
; cast ulong to ...
|
|
|
|
cast ulong 1 to bool
|
|
|
|
cast ulong 1 to sbyte
|
|
|
|
cast ulong 1 to ubyte
|
|
|
|
cast ulong 1 to short
|
|
|
|
cast ulong 1 to ushort
|
|
|
|
cast ulong 1 to int
|
|
|
|
cast ulong 1 to uint
|
|
|
|
cast ulong 1 to long
|
|
|
|
cast ulong 1 to ulong
|
|
|
|
cast ulong 1 to float
|
|
|
|
cast ulong 0 to double
|
2003-01-13 00:56:37 +00:00
|
|
|
|
|
|
|
; cast float to ...
|
2003-01-16 19:43:11 +00:00
|
|
|
;cast float 0.0 to bool
|
2003-01-13 00:56:37 +00:00
|
|
|
cast float 0.0 to float
|
|
|
|
cast float 0.0 to double
|
|
|
|
|
|
|
|
; cast double to ...
|
2003-01-16 19:43:11 +00:00
|
|
|
;cast double 0.0 to bool
|
2003-01-13 00:56:37 +00:00
|
|
|
cast double 0.0 to sbyte
|
|
|
|
cast double 0.0 to ubyte
|
|
|
|
cast double 0.0 to short
|
|
|
|
cast double 0.0 to ushort
|
|
|
|
cast double 0.0 to int
|
|
|
|
cast double 0.0 to uint
|
|
|
|
cast double 0.0 to long
|
|
|
|
;cast double 0.0 to ulong
|
|
|
|
cast double 0.0 to float
|
|
|
|
cast double 0.0 to double
|
2002-12-15 07:55:43 +00:00
|
|
|
|
|
|
|
ret int 0
|
|
|
|
}
|