blob: 38763a7306fb232348431818326740543ec8fc14 [file] [log] [blame]
Chris Lattner4d21cb42003-04-17 19:21:22 +00001; This test checks to make sure that constant exprs fold in some simple situations
2
3; RUN: if as < %s | dis | grep cast
4; RUN: then exit 1
5; RUN: else exit 0
6; RUN: fi
7
8%A = global int* cast (sbyte* null to int*) ; Cast null -> fold
9%B = global int** cast (int** %A to int**) ; Cast to same type -> fold
10%C = global int cast (long 42 to int) ; Integral casts
11%D = global int* cast(float* cast (int* %C to float*) to int*) ; cast of cast ptr->ptr
12%E = global int cast(float* cast (sbyte 5 to float*) to int) ; int -> ptr -> int
13
14; Test folding of binary instrs
15%F = global int* cast(int add (int 5, int -5) to int*)
16%G = global int* cast(int sub (int 5, int 5) to int*)
17