Bill Wendling | 90dd90a | 2013-10-21 04:09:17 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -disable-output -jump-threading |
| 2 | |
| 3 | %class.E = type { i32 (...)**, %class.C } |
| 4 | %class.C = type { %class.A } |
| 5 | %class.A = type { i32 } |
| 6 | %class.D = type { %class.F } |
| 7 | %class.F = type { %class.E } |
| 8 | %class.B = type { %class.D* } |
| 9 | |
| 10 | @_ZTV1D = unnamed_addr constant [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1D to i8*), i8* bitcast (void (%class.D*)* @_ZN1D7doApplyEv to i8*)] |
| 11 | @_ZTI1D = external unnamed_addr constant { i8*, i8*, i8* } |
| 12 | |
| 13 | define void @_ZN15EditCommandImpl5applyEv(%class.E* %this) uwtable align 2 { |
| 14 | entry: |
| 15 | %0 = bitcast %class.E* %this to void (%class.E*)*** |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 16 | %vtable = load void (%class.E*)**, void (%class.E*)*** %0, align 8 |
| 17 | %1 = load void (%class.E*)*, void (%class.E*)** %vtable, align 8 |
Bill Wendling | 90dd90a | 2013-10-21 04:09:17 +0000 | [diff] [blame] | 18 | call void %1(%class.E* %this) |
| 19 | ret void |
| 20 | } |
| 21 | |
| 22 | define void @_ZN1DC1Ev(%class.D* nocapture %this) unnamed_addr uwtable align 2 { |
| 23 | entry: |
| 24 | call void @_ZN24CompositeEditCommandImplC2Ev() |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 25 | %0 = getelementptr inbounds %class.D, %class.D* %this, i64 0, i32 0, i32 0, i32 0 |
David Blaikie | f72d05b | 2015-03-13 18:20:45 +0000 | [diff] [blame] | 26 | store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1D, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8 |
Bill Wendling | 90dd90a | 2013-10-21 04:09:17 +0000 | [diff] [blame] | 27 | ret void |
| 28 | } |
| 29 | |
| 30 | define void @_ZN1DC2Ev(%class.D* nocapture %this) unnamed_addr uwtable align 2 { |
| 31 | entry: |
| 32 | call void @_ZN24CompositeEditCommandImplC2Ev() |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 33 | %0 = getelementptr inbounds %class.D, %class.D* %this, i64 0, i32 0, i32 0, i32 0 |
David Blaikie | f72d05b | 2015-03-13 18:20:45 +0000 | [diff] [blame] | 34 | store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1D, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8 |
Bill Wendling | 90dd90a | 2013-10-21 04:09:17 +0000 | [diff] [blame] | 35 | ret void |
| 36 | } |
| 37 | |
| 38 | declare void @_ZN24CompositeEditCommandImplC2Ev() #1 |
| 39 | |
| 40 | define void @_ZN1D7doApplyEv(%class.D* nocapture %this) unnamed_addr nounwind readnone uwtable align 2 { |
| 41 | entry: |
| 42 | ret void |
| 43 | } |
| 44 | |
David Majnemer | 7fddecc | 2015-06-17 20:52:32 +0000 | [diff] [blame] | 45 | define void @_Z3fn1v() uwtable personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { |
Bill Wendling | 90dd90a | 2013-10-21 04:09:17 +0000 | [diff] [blame] | 46 | entry: |
| 47 | %call = call noalias i8* @_Znwm() #8 |
| 48 | invoke void @_ZN24CompositeEditCommandImplC2Ev() |
| 49 | to label %_ZN1DC1Ev.exit unwind label %lpad |
| 50 | |
| 51 | _ZN1DC1Ev.exit: ; preds = %entry |
| 52 | %0 = bitcast i8* %call to i32 (...)*** |
David Blaikie | f72d05b | 2015-03-13 18:20:45 +0000 | [diff] [blame] | 53 | store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1D, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 54 | %_ref.i.i.i = getelementptr inbounds i8, i8* %call, i64 8 |
Bill Wendling | 90dd90a | 2013-10-21 04:09:17 +0000 | [diff] [blame] | 55 | %1 = bitcast i8* %_ref.i.i.i to i32* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 56 | %2 = load i32, i32* %1, align 4 |
Bill Wendling | 90dd90a | 2013-10-21 04:09:17 +0000 | [diff] [blame] | 57 | %inc.i.i.i = add nsw i32 %2, 1 |
| 58 | store i32 %inc.i.i.i, i32* %1, align 4 |
| 59 | %3 = bitcast i8* %call to %class.D* |
| 60 | invoke void @_ZN1D7doApplyEv(%class.D* %3) |
| 61 | to label %_ZN15EditCommandImpl5applyEv.exit unwind label %lpad1 |
| 62 | |
| 63 | _ZN15EditCommandImpl5applyEv.exit: ; preds = %_ZN1DC1Ev.exit |
| 64 | invoke void @_ZN1D16deleteKeyPressedEv() |
| 65 | to label %invoke.cont7 unwind label %lpad1 |
| 66 | |
| 67 | invoke.cont7: ; preds = %_ZN15EditCommandImpl5applyEv.exit |
| 68 | ret void |
| 69 | |
| 70 | lpad: ; preds = %entry |
David Majnemer | 7fddecc | 2015-06-17 20:52:32 +0000 | [diff] [blame] | 71 | %4 = landingpad { i8*, i32 } |
Bill Wendling | 90dd90a | 2013-10-21 04:09:17 +0000 | [diff] [blame] | 72 | cleanup |
| 73 | call void @_ZdlPv() #9 |
| 74 | unreachable |
| 75 | |
| 76 | lpad1: ; preds = %_ZN1DC1Ev.exit, %_ZN15EditCommandImpl5applyEv.exit |
David Majnemer | 7fddecc | 2015-06-17 20:52:32 +0000 | [diff] [blame] | 77 | %5 = landingpad { i8*, i32 } |
Bill Wendling | 90dd90a | 2013-10-21 04:09:17 +0000 | [diff] [blame] | 78 | cleanup |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 79 | %6 = load i32, i32* %1, align 4 |
Bill Wendling | 90dd90a | 2013-10-21 04:09:17 +0000 | [diff] [blame] | 80 | %tobool.i.i.i = icmp eq i32 %6, 0 |
| 81 | br i1 %tobool.i.i.i, label %_ZN1BI1DED1Ev.exit, label %if.then.i.i.i |
| 82 | |
| 83 | if.then.i.i.i: ; preds = %lpad1 |
| 84 | br i1 undef, label %_ZN1BI1DED1Ev.exit, label %delete.notnull.i.i.i |
| 85 | |
| 86 | delete.notnull.i.i.i: ; preds = %if.then.i.i.i |
| 87 | call void @_ZdlPv() #9 |
| 88 | unreachable |
| 89 | |
| 90 | _ZN1BI1DED1Ev.exit: ; preds = %lpad1, %if.then.i.i.i |
| 91 | resume { i8*, i32 } undef |
| 92 | |
| 93 | terminate.lpad: ; No predecessors! |
David Majnemer | 7fddecc | 2015-06-17 20:52:32 +0000 | [diff] [blame] | 94 | %7 = landingpad { i8*, i32 } |
Bill Wendling | 90dd90a | 2013-10-21 04:09:17 +0000 | [diff] [blame] | 95 | catch i8* null |
| 96 | unreachable |
| 97 | } |
| 98 | |
| 99 | define void @_ZN1BI1DEC1EPS0_(%class.B* nocapture %this, %class.D* %p1) unnamed_addr uwtable align 2 { |
| 100 | entry: |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 101 | %m_ptr.i = getelementptr inbounds %class.B, %class.B* %this, i64 0, i32 0 |
Bill Wendling | 90dd90a | 2013-10-21 04:09:17 +0000 | [diff] [blame] | 102 | store %class.D* %p1, %class.D** %m_ptr.i, align 8 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 103 | %_ref.i.i = getelementptr inbounds %class.D, %class.D* %p1, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 104 | %0 = load i32, i32* %_ref.i.i, align 4 |
Bill Wendling | 90dd90a | 2013-10-21 04:09:17 +0000 | [diff] [blame] | 105 | %inc.i.i = add nsw i32 %0, 1 |
| 106 | store i32 %inc.i.i, i32* %_ref.i.i, align 4 |
| 107 | ret void |
| 108 | } |
| 109 | |
| 110 | declare noalias i8* @_Znwm() |
| 111 | |
| 112 | declare i32 @__gxx_personality_v0(...) |
| 113 | |
| 114 | declare void @_ZdlPv() |
| 115 | |
| 116 | define %class.D* @_ZN1BI1DEptEv(%class.B* nocapture readonly %this) nounwind readonly uwtable align 2 { |
| 117 | entry: |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 118 | %m_ptr = getelementptr inbounds %class.B, %class.B* %this, i64 0, i32 0 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 119 | %0 = load %class.D*, %class.D** %m_ptr, align 8 |
Bill Wendling | 90dd90a | 2013-10-21 04:09:17 +0000 | [diff] [blame] | 120 | ret %class.D* %0 |
| 121 | } |
| 122 | |
| 123 | declare void @_ZN1D16deleteKeyPressedEv() |
| 124 | |
| 125 | define void @_ZN1BI1DED1Ev(%class.B* nocapture readonly %this) unnamed_addr uwtable align 2 { |
| 126 | entry: |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 127 | %m_ptr.i = getelementptr inbounds %class.B, %class.B* %this, i64 0, i32 0 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 128 | %0 = load %class.D*, %class.D** %m_ptr.i, align 8 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 129 | %_ref.i.i = getelementptr inbounds %class.D, %class.D* %0, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 130 | %1 = load i32, i32* %_ref.i.i, align 4 |
Bill Wendling | 90dd90a | 2013-10-21 04:09:17 +0000 | [diff] [blame] | 131 | %tobool.i.i = icmp eq i32 %1, 0 |
| 132 | br i1 %tobool.i.i, label %_ZN1BI1DED2Ev.exit, label %if.then.i.i |
| 133 | |
| 134 | if.then.i.i: ; preds = %entry |
| 135 | br i1 undef, label %_ZN1BI1DED2Ev.exit, label %delete.notnull.i.i |
| 136 | |
| 137 | delete.notnull.i.i: ; preds = %if.then.i.i |
| 138 | call void @_ZdlPv() #9 |
| 139 | unreachable |
| 140 | |
| 141 | _ZN1BI1DED2Ev.exit: ; preds = %entry, %if.then.i.i |
| 142 | ret void |
| 143 | } |
| 144 | |
| 145 | declare hidden void @__clang_call_terminate() |
| 146 | |
| 147 | define void @_ZN1BI1DED2Ev(%class.B* nocapture readonly %this) unnamed_addr uwtable align 2 { |
| 148 | entry: |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 149 | %m_ptr = getelementptr inbounds %class.B, %class.B* %this, i64 0, i32 0 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 150 | %0 = load %class.D*, %class.D** %m_ptr, align 8 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 151 | %_ref.i = getelementptr inbounds %class.D, %class.D* %0, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 152 | %1 = load i32, i32* %_ref.i, align 4 |
Bill Wendling | 90dd90a | 2013-10-21 04:09:17 +0000 | [diff] [blame] | 153 | %tobool.i = icmp eq i32 %1, 0 |
| 154 | br i1 %tobool.i, label %_ZN1AI1CE5derefEv.exit, label %if.then.i |
| 155 | |
| 156 | if.then.i: ; preds = %entry |
| 157 | br i1 undef, label %_ZN1AI1CE5derefEv.exit, label %delete.notnull.i |
| 158 | |
| 159 | delete.notnull.i: ; preds = %if.then.i |
| 160 | call void @_ZdlPv() #9 |
| 161 | unreachable |
| 162 | |
| 163 | _ZN1AI1CE5derefEv.exit: ; preds = %entry, %if.then.i |
| 164 | ret void |
| 165 | } |
| 166 | |
| 167 | define void @_ZN1AI1CE5derefEv(%class.A* nocapture readonly %this) nounwind uwtable align 2 { |
| 168 | entry: |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 169 | %_ref = getelementptr inbounds %class.A, %class.A* %this, i64 0, i32 0 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 170 | %0 = load i32, i32* %_ref, align 4 |
Bill Wendling | 90dd90a | 2013-10-21 04:09:17 +0000 | [diff] [blame] | 171 | %tobool = icmp eq i32 %0, 0 |
| 172 | br i1 %tobool, label %if.end, label %if.then |
| 173 | |
| 174 | if.then: ; preds = %entry |
| 175 | br i1 undef, label %if.end, label %delete.notnull |
| 176 | |
| 177 | delete.notnull: ; preds = %if.then |
| 178 | call void @_ZdlPv() #9 |
| 179 | unreachable |
| 180 | |
| 181 | if.end: ; preds = %entry, %if.then |
| 182 | ret void |
| 183 | } |
| 184 | |
| 185 | define void @_ZN1BI1DEC2EPS0_(%class.B* nocapture %this, %class.D* %p1) unnamed_addr uwtable align 2 { |
| 186 | entry: |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 187 | %m_ptr = getelementptr inbounds %class.B, %class.B* %this, i64 0, i32 0 |
Bill Wendling | 90dd90a | 2013-10-21 04:09:17 +0000 | [diff] [blame] | 188 | store %class.D* %p1, %class.D** %m_ptr, align 8 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 189 | %_ref.i = getelementptr inbounds %class.D, %class.D* %p1, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 190 | %0 = load i32, i32* %_ref.i, align 4 |
Bill Wendling | 90dd90a | 2013-10-21 04:09:17 +0000 | [diff] [blame] | 191 | %inc.i = add nsw i32 %0, 1 |
| 192 | store i32 %inc.i, i32* %_ref.i, align 4 |
| 193 | ret void |
| 194 | } |
| 195 | |
| 196 | define void @_ZN1AI1CE3refEv(%class.A* nocapture %this) nounwind uwtable align 2 { |
| 197 | entry: |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 198 | %_ref = getelementptr inbounds %class.A, %class.A* %this, i64 0, i32 0 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 199 | %0 = load i32, i32* %_ref, align 4 |
Bill Wendling | 90dd90a | 2013-10-21 04:09:17 +0000 | [diff] [blame] | 200 | %inc = add nsw i32 %0, 1 |
| 201 | store i32 %inc, i32* %_ref, align 4 |
| 202 | ret void |
| 203 | } |