blob: 2d33e9439376395295b424927fbccd999fc25baf [file] [log] [blame]
Bill Wendlingcd6df162012-04-24 09:15:38 +00001; RUN: opt < %s -basicaa -gvn -dce -S | FileCheck %s
Owen Anderson7827a3f2007-10-25 02:36:18 +00002
3 %struct.A = type { i32 }
4 %struct.B = type { %struct.A }
5@a = global %struct.B zeroinitializer ; <%struct.B*> [#uses=2]
6
7define i32 @_Z3fooP1A(%struct.A* %b) {
Bill Wendlingcd6df162012-04-24 09:15:38 +00008; CHECK: %tmp7 = load
9; CHECK: ret i32 %tmp7
Owen Anderson7827a3f2007-10-25 02:36:18 +000010entry:
David Blaikief72d05b2015-03-13 18:20:45 +000011 store i32 1, i32* getelementptr (%struct.B, %struct.B* @a, i32 0, i32 0, i32 0), align 8
David Blaikie79e6c742015-02-27 19:29:02 +000012 %tmp4 = getelementptr %struct.A, %struct.A* %b, i32 0, i32 0 ;<i32*> [#uses=1]
Owen Anderson7827a3f2007-10-25 02:36:18 +000013 store i32 0, i32* %tmp4, align 4
David Blaikief72d05b2015-03-13 18:20:45 +000014 %tmp7 = load i32, i32* getelementptr (%struct.B, %struct.B* @a, i32 0, i32 0, i32 0), align 8 ; <i32> [#uses=1]
Owen Anderson7827a3f2007-10-25 02:36:18 +000015 ret i32 %tmp7
16}