Chris Lattner | 4d21cb4 | 2003-04-17 19:21:22 +0000 | [diff] [blame] | 1 | ; This test checks to make sure that constant exprs fold in some simple situations |
| 2 | |
Misha Brukman | 14285c8 | 2003-09-15 20:02:53 +0000 | [diff] [blame^] | 3 | ; RUN: llvm-as < %s | llvm-dis | not grep cast |
Chris Lattner | 4d21cb4 | 2003-04-17 19:21:22 +0000 | [diff] [blame] | 4 | |
| 5 | %A = global int* cast (sbyte* null to int*) ; Cast null -> fold |
| 6 | %B = global int** cast (int** %A to int**) ; Cast to same type -> fold |
| 7 | %C = global int cast (long 42 to int) ; Integral casts |
| 8 | %D = global int* cast(float* cast (int* %C to float*) to int*) ; cast of cast ptr->ptr |
| 9 | %E = global int cast(float* cast (sbyte 5 to float*) to int) ; int -> ptr -> int |
| 10 | |
| 11 | ; Test folding of binary instrs |
| 12 | %F = global int* cast(int add (int 5, int -5) to int*) |
| 13 | %G = global int* cast(int sub (int 5, int 5) to int*) |
| 14 | |