Home | History | Annotate | Download | only in GlobalsModRef
      1 ; RUN: opt < %s -basicaa -globalsmodref-aa -gvn -instcombine -S | \
      2 ; RUN:   grep {ret i32 0}
      3 
      4 @G = internal global i32* null		; <i32**> [#uses=3]
      5 
      6 
      7 declare i8* @malloc(i32)
      8 define void @test() {
      9 	%a = call i8* @malloc(i32 4)
     10         %A = bitcast i8* %a to i32*
     11 	store i32* %A, i32** @G
     12 	ret void
     13 }
     14 
     15 define i32 @test1(i32* %P) {
     16 	%g1 = load i32** @G		; <i32*> [#uses=2]
     17 	%h1 = load i32* %g1		; <i32> [#uses=1]
     18 	store i32 123, i32* %P
     19 	%g2 = load i32** @G		; <i32*> [#uses=0]
     20 	%h2 = load i32* %g1		; <i32> [#uses=1]
     21 	%X = sub i32 %h1, %h2		; <i32> [#uses=1]
     22 	ret i32 %X
     23 }
     24