Bill Wendling | d5cc8b8 | 2012-04-24 09:15:38 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s |
Chris Lattner | 84efeda | 2007-01-14 05:56:45 +0000 | [diff] [blame] | 2 | ; PR1109 |
| 3 | |
| 4 | target datalayout = "e-p:32:32" |
Chris Lattner | 84efeda | 2007-01-14 05:56:45 +0000 | [diff] [blame] | 5 | target triple = "i686-apple-darwin8" |
| 6 | %struct.CONSTRAINT = type { i32, i32, i32, i32 } |
| 7 | %struct.FILE_POS = type { i8, i8, i16, i32 } |
| 8 | %struct.FIRST_UNION = type { %struct.FILE_POS } |
| 9 | %struct.FOURTH_UNION = type { %struct.CONSTRAINT } |
| 10 | %struct.GAP = type { i8, i8, i16 } |
| 11 | %struct.LIST = type { %struct.rec*, %struct.rec* } |
| 12 | %struct.SECOND_UNION = type { { i16, i8, i8 } } |
| 13 | %struct.STYLE = type { { %struct.GAP }, { %struct.GAP }, i16, i16, i16, i8, i8 } |
| 14 | %struct.THIRD_UNION = type { { [2 x i32], [2 x i32] } } |
| 15 | %struct.closure_type = type { [2 x %struct.LIST], %struct.FIRST_UNION, %struct.SECOND_UNION, %struct.THIRD_UNION, %struct.FOURTH_UNION, %struct.rec*, { %struct.rec* } } |
| 16 | %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 } |
| 17 | %struct.rec = type { %struct.head_type } |
| 18 | |
Bill Wendling | d5cc8b8 | 2012-04-24 09:15:38 +0000 | [diff] [blame] | 19 | ; CHECK: define i32 @test |
| 20 | ; CHECK: %Z = sub i32 %A, %Q |
| 21 | ; CHECK: ret i32 %Z |
Chris Lattner | 84efeda | 2007-01-14 05:56:45 +0000 | [diff] [blame] | 22 | |
Reid Spencer | e3ff5ad | 2007-01-26 08:25:06 +0000 | [diff] [blame] | 23 | define i32 @test(%struct.closure_type* %tmp18169) { |
Chris Lattner | 84efeda | 2007-01-14 05:56:45 +0000 | [diff] [blame] | 24 | %tmp18174 = getelementptr %struct.closure_type* %tmp18169, i32 0, i32 4, i32 0, i32 0 ; <i32*> [#uses=2] |
| 25 | %tmp18269 = bitcast i32* %tmp18174 to %struct.STYLE* ; <%struct.STYLE*> [#uses=1] |
| 26 | %A = load i32* %tmp18174 ; <i32> [#uses=1] |
| 27 | |
| 28 | %tmp18272 = getelementptr %struct.STYLE* %tmp18269, i32 0, i32 0, i32 0, i32 2 ; <i16*> [#uses=1] |
| 29 | store i16 123, i16* %tmp18272 |
| 30 | |
| 31 | %Q = load i32* %tmp18174 ; <i32> [#uses=1] |
| 32 | %Z = sub i32 %A, %Q ; <i32> [#uses=1] |
| 33 | ret i32 %Z |
| 34 | } |