1 ; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | grep 'sub i32' &&
2 ; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | not grep 'ret i32 0'
5 target datalayout = "e-p:32:32"
6 target triple = "i686-apple-darwin8"
7 %struct.CONSTRAINT = type { i32, i32, i32, i32 }
8 %struct.FILE_POS = type { i8, i8, i16, i32 }
9 %struct.FIRST_UNION = type { %struct.FILE_POS }
10 %struct.FOURTH_UNION = type { %struct.CONSTRAINT }
11 %struct.GAP = type { i8, i8, i16 }
12 %struct.LIST = type { %struct.rec*, %struct.rec* }
13 %struct.SECOND_UNION = type { { i16, i8, i8 } }
14 %struct.STYLE = type { { %struct.GAP }, { %struct.GAP }, i16, i16, i16, i8, i8 }
15 %struct.THIRD_UNION = type { { [2 x i32], [2 x i32] } }
16 %struct.closure_type = type { [2 x %struct.LIST], %struct.FIRST_UNION, %struct.SECOND_UNION, %struct.THIRD_UNION, %struct.FOURTH_UNION, %struct.rec*, { %struct.rec* } }
17 %struct.head_type = type { [2 x %struct.LIST], %struct.FIRST_UNION, %struct.SECOND_UNION, %struct.THIRD_UNION, %struct.FOURTH_UNION, %struct.rec*, { %struct.rec* }, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, i32 }
18 %struct.rec = type { %struct.head_type }
21 define i32 @test(%struct.closure_type* %tmp18169) {
22 %tmp18174 = getelementptr %struct.closure_type* %tmp18169, i32 0, i32 4, i32 0, i32 0 ; <i32*> [#uses=2]
23 %tmp18269 = bitcast i32* %tmp18174 to %struct.STYLE* ; <%struct.STYLE*> [#uses=1]
24 %A = load i32* %tmp18174 ; <i32> [#uses=1]
26 %tmp18272 = getelementptr %struct.STYLE* %tmp18269, i32 0, i32 0, i32 0, i32 2 ; <i16*> [#uses=1]
27 store i16 123, i16* %tmp18272
29 %Q = load i32* %tmp18174 ; <i32> [#uses=1]
30 %Z = sub i32 %A, %Q ; <i32> [#uses=1]