Fix InstCombine/2007-10-31-StringCrash.ll by removing an obvious
[oota-llvm.git] / test / Transforms / InstCombine / 2007-02-07-PointerCast.ll
1 ;RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep zext
2
3 ; Make sure the uint isn't removed.  Instcombine in llvm 1.9 was dropping the 
4 ; uint cast which was causing a sign extend. This only affected code with 
5 ; pointers in the high half of memory, so it wasn't noticed much
6 ; compile a kernel though...
7
8 target datalayout = "e-p:32:32"
9 target endian = little
10 target pointersize = 32
11
12 %str = internal constant [6 x sbyte] c"%llx\0A\00"
13
14 implementation   ; Functions:
15
16 declare int %printf(sbyte*, ...)
17
18 int %main(int %x, sbyte** %a) {
19 entry:
20         %tmp = getelementptr [6 x sbyte]* %str, int 0, uint 0 
21         %tmp1 = load sbyte** %a
22         %tmp2 = cast sbyte* %tmp1 to uint               ; <uint> [#uses=1]
23         %tmp3 = cast uint %tmp2 to long         ; <long> [#uses=1]
24         %tmp = call int (sbyte*, ...)* %printf( sbyte* %tmp, long %tmp3 )
25         ret int 0
26 }