This really only affects pointers in high memory, and only llvm 1.9, but make a regre...
[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.
4 ;instcombine in llvm 1.9 was dropping the uint cast which was causing a sign
5 ;extend
6 ;this only affected code with pointers in the high half of memory, so it wasn't
7 ;noticed much :)
8 ;compile a kernel though...
9
10 target datalayout = "e-p:32:32"
11 target endian = little
12 target pointersize = 32
13
14 %str = internal constant [6 x sbyte] c"%llx\0A\00"
15
16 implementation   ; Functions:
17
18 declare int %printf(sbyte*, ...)
19
20 int %main(int %x, sbyte** %a) {
21 entry:
22         %tmp = getelementptr [6 x sbyte]* %str, int 0, uint 0 
23         %tmp1 = load sbyte** %a
24         %tmp2 = cast sbyte* %tmp1 to uint               ; <uint> [#uses=1]
25         %tmp3 = cast uint %tmp2 to long         ; <long> [#uses=1]
26         %tmp = call int (sbyte*, ...)* %printf( sbyte* %tmp, long %tmp3 )
27         ret int 0
28 }