1 /* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 interface Itf { method1()18 public Class<?> method1(); method2()19 public Class<?> method2(); method3()20 public Class<?> method3(); method4()21 public Class<?> method4(); method5()22 public Class<?> method5(); method6()23 public Class<?> method6(); method7()24 public Class<?> method7(); method8()25 public Class<?> method8(); method9()26 public Class<?> method9(); method10()27 public Class<?> method10(); method11()28 public Class<?> method11(); method12()29 public Class<?> method12(); method13()30 public Class<?> method13(); method14()31 public Class<?> method14(); method15()32 public Class<?> method15(); method16()33 public Class<?> method16(); method17()34 public Class<?> method17(); method18()35 public Class<?> method18(); method19()36 public Class<?> method19(); method20()37 public Class<?> method20(); method21()38 public Class<?> method21(); method22()39 public Class<?> method22(); method23()40 public Class<?> method23(); method24()41 public Class<?> method24(); method25()42 public Class<?> method25(); method26()43 public Class<?> method26(); method27()44 public Class<?> method27(); method28()45 public Class<?> method28(); method29()46 public Class<?> method29(); method30()47 public Class<?> method30(); method31()48 public Class<?> method31(); method32()49 public Class<?> method32(); method33()50 public Class<?> method33(); method34()51 public Class<?> method34(); method35()52 public Class<?> method35(); method36()53 public Class<?> method36(); method37()54 public Class<?> method37(); method38()55 public Class<?> method38(); method39()56 public Class<?> method39(); method40()57 public Class<?> method40(); method41()58 public Class<?> method41(); method42()59 public Class<?> method42(); method43()60 public Class<?> method43(); method44()61 public Class<?> method44(); method45()62 public Class<?> method45(); method46()63 public Class<?> method46(); method47()64 public Class<?> method47(); method48()65 public Class<?> method48(); method49()66 public Class<?> method49(); method50()67 public Class<?> method50(); method51()68 public Class<?> method51(); method52()69 public Class<?> method52(); method53()70 public Class<?> method53(); method54()71 public Class<?> method54(); method55()72 public Class<?> method55(); method56()73 public Class<?> method56(); method57()74 public Class<?> method57(); method58()75 public Class<?> method58(); method59()76 public Class<?> method59(); method60()77 public Class<?> method60(); method61()78 public Class<?> method61(); method62()79 public Class<?> method62(); method63()80 public Class<?> method63(); method64()81 public Class<?> method64(); method65()82 public Class<?> method65(); method66()83 public Class<?> method66(); method67()84 public Class<?> method67(); method68()85 public Class<?> method68(); method69()86 public Class<?> method69(); method70()87 public Class<?> method70(); method71()88 public Class<?> method71(); method72()89 public Class<?> method72(); method73()90 public Class<?> method73(); method74()91 public Class<?> method74(); method75()92 public Class<?> method75(); method76()93 public Class<?> method76(); method77()94 public Class<?> method77(); method78()95 public Class<?> method78(); method79()96 public Class<?> method79(); 97 } 98 99 public class Main implements Itf { 100 public static Itf main; main(String[] args)101 public static void main(String[] args) { 102 main = new Main(); 103 callMains(); 104 main = new SubMain(); 105 callSubMains(); 106 } 107 callMains()108 public static void callMains() { 109 // We loop to artificially create branches. The compiler will 110 // not compile this method otherwise. 111 for (int i = 0; i < 2; ++i) { 112 expectEquals(main.method1(), Main.class); 113 expectEquals(main.method2(), Main.class); 114 expectEquals(main.method3(), Main.class); 115 expectEquals(main.method4(), Main.class); 116 expectEquals(main.method5(), Main.class); 117 expectEquals(main.method6(), Main.class); 118 expectEquals(main.method7(), Main.class); 119 expectEquals(main.method8(), Main.class); 120 expectEquals(main.method9(), Main.class); 121 expectEquals(main.method10(), Main.class); 122 expectEquals(main.method11(), Main.class); 123 expectEquals(main.method12(), Main.class); 124 expectEquals(main.method13(), Main.class); 125 expectEquals(main.method14(), Main.class); 126 expectEquals(main.method15(), Main.class); 127 expectEquals(main.method16(), Main.class); 128 expectEquals(main.method17(), Main.class); 129 expectEquals(main.method18(), Main.class); 130 expectEquals(main.method19(), Main.class); 131 expectEquals(main.method20(), Main.class); 132 expectEquals(main.method21(), Main.class); 133 expectEquals(main.method22(), Main.class); 134 expectEquals(main.method23(), Main.class); 135 expectEquals(main.method24(), Main.class); 136 expectEquals(main.method25(), Main.class); 137 expectEquals(main.method26(), Main.class); 138 expectEquals(main.method27(), Main.class); 139 expectEquals(main.method28(), Main.class); 140 expectEquals(main.method29(), Main.class); 141 expectEquals(main.method30(), Main.class); 142 expectEquals(main.method31(), Main.class); 143 expectEquals(main.method32(), Main.class); 144 expectEquals(main.method33(), Main.class); 145 expectEquals(main.method34(), Main.class); 146 expectEquals(main.method35(), Main.class); 147 expectEquals(main.method36(), Main.class); 148 expectEquals(main.method37(), Main.class); 149 expectEquals(main.method38(), Main.class); 150 expectEquals(main.method39(), Main.class); 151 expectEquals(main.method40(), Main.class); 152 expectEquals(main.method41(), Main.class); 153 expectEquals(main.method42(), Main.class); 154 expectEquals(main.method43(), Main.class); 155 expectEquals(main.method44(), Main.class); 156 expectEquals(main.method45(), Main.class); 157 expectEquals(main.method46(), Main.class); 158 expectEquals(main.method47(), Main.class); 159 expectEquals(main.method48(), Main.class); 160 expectEquals(main.method49(), Main.class); 161 expectEquals(main.method50(), Main.class); 162 expectEquals(main.method51(), Main.class); 163 expectEquals(main.method52(), Main.class); 164 expectEquals(main.method53(), Main.class); 165 expectEquals(main.method54(), Main.class); 166 expectEquals(main.method55(), Main.class); 167 expectEquals(main.method56(), Main.class); 168 expectEquals(main.method57(), Main.class); 169 expectEquals(main.method58(), Main.class); 170 expectEquals(main.method59(), Main.class); 171 expectEquals(main.method60(), Main.class); 172 expectEquals(main.method61(), Main.class); 173 expectEquals(main.method62(), Main.class); 174 expectEquals(main.method63(), Main.class); 175 expectEquals(main.method64(), Main.class); 176 expectEquals(main.method65(), Main.class); 177 expectEquals(main.method66(), Main.class); 178 expectEquals(main.method67(), Main.class); 179 expectEquals(main.method68(), Main.class); 180 expectEquals(main.method69(), Main.class); 181 expectEquals(main.method70(), Main.class); 182 expectEquals(main.method71(), Main.class); 183 expectEquals(main.method72(), Main.class); 184 expectEquals(main.method73(), Main.class); 185 expectEquals(main.method74(), Main.class); 186 expectEquals(main.method75(), Main.class); 187 expectEquals(main.method76(), Main.class); 188 expectEquals(main.method77(), Main.class); 189 expectEquals(main.method78(), Main.class); 190 expectEquals(main.method79(), Main.class); 191 } 192 } 193 callSubMains()194 public static void callSubMains() { 195 // We loop to artificially create branches. The compiler will 196 // not compile this method otherwise. 197 for (int i = 0; i < 2; ++i) { 198 expectEquals(main.method1(), SubMain.class); 199 expectEquals(main.method2(), SubMain.class); 200 expectEquals(main.method3(), SubMain.class); 201 expectEquals(main.method4(), SubMain.class); 202 expectEquals(main.method5(), SubMain.class); 203 expectEquals(main.method6(), SubMain.class); 204 expectEquals(main.method7(), SubMain.class); 205 expectEquals(main.method8(), SubMain.class); 206 expectEquals(main.method9(), SubMain.class); 207 expectEquals(main.method10(), SubMain.class); 208 expectEquals(main.method11(), SubMain.class); 209 expectEquals(main.method12(), SubMain.class); 210 expectEquals(main.method13(), SubMain.class); 211 expectEquals(main.method14(), SubMain.class); 212 expectEquals(main.method15(), SubMain.class); 213 expectEquals(main.method16(), SubMain.class); 214 expectEquals(main.method17(), SubMain.class); 215 expectEquals(main.method18(), SubMain.class); 216 expectEquals(main.method19(), SubMain.class); 217 expectEquals(main.method20(), SubMain.class); 218 expectEquals(main.method21(), SubMain.class); 219 expectEquals(main.method22(), SubMain.class); 220 expectEquals(main.method23(), SubMain.class); 221 expectEquals(main.method24(), SubMain.class); 222 expectEquals(main.method25(), SubMain.class); 223 expectEquals(main.method26(), SubMain.class); 224 expectEquals(main.method27(), SubMain.class); 225 expectEquals(main.method28(), SubMain.class); 226 expectEquals(main.method29(), SubMain.class); 227 expectEquals(main.method30(), SubMain.class); 228 expectEquals(main.method31(), SubMain.class); 229 expectEquals(main.method32(), SubMain.class); 230 expectEquals(main.method33(), SubMain.class); 231 expectEquals(main.method34(), SubMain.class); 232 expectEquals(main.method35(), SubMain.class); 233 expectEquals(main.method36(), SubMain.class); 234 expectEquals(main.method37(), SubMain.class); 235 expectEquals(main.method38(), SubMain.class); 236 expectEquals(main.method39(), SubMain.class); 237 expectEquals(main.method40(), SubMain.class); 238 expectEquals(main.method41(), SubMain.class); 239 expectEquals(main.method42(), SubMain.class); 240 expectEquals(main.method43(), SubMain.class); 241 expectEquals(main.method44(), SubMain.class); 242 expectEquals(main.method45(), SubMain.class); 243 expectEquals(main.method46(), SubMain.class); 244 expectEquals(main.method47(), SubMain.class); 245 expectEquals(main.method48(), SubMain.class); 246 expectEquals(main.method49(), SubMain.class); 247 expectEquals(main.method50(), SubMain.class); 248 expectEquals(main.method51(), SubMain.class); 249 expectEquals(main.method52(), SubMain.class); 250 expectEquals(main.method53(), SubMain.class); 251 expectEquals(main.method54(), SubMain.class); 252 expectEquals(main.method55(), SubMain.class); 253 expectEquals(main.method56(), SubMain.class); 254 expectEquals(main.method57(), SubMain.class); 255 expectEquals(main.method58(), SubMain.class); 256 expectEquals(main.method59(), SubMain.class); 257 expectEquals(main.method60(), SubMain.class); 258 expectEquals(main.method61(), SubMain.class); 259 expectEquals(main.method62(), SubMain.class); 260 expectEquals(main.method63(), SubMain.class); 261 expectEquals(main.method64(), SubMain.class); 262 expectEquals(main.method65(), SubMain.class); 263 expectEquals(main.method66(), SubMain.class); 264 expectEquals(main.method67(), SubMain.class); 265 expectEquals(main.method68(), SubMain.class); 266 expectEquals(main.method69(), SubMain.class); 267 expectEquals(main.method70(), SubMain.class); 268 expectEquals(main.method71(), SubMain.class); 269 expectEquals(main.method72(), SubMain.class); 270 expectEquals(main.method73(), SubMain.class); 271 expectEquals(main.method74(), SubMain.class); 272 expectEquals(main.method75(), SubMain.class); 273 expectEquals(main.method76(), SubMain.class); 274 expectEquals(main.method77(), SubMain.class); 275 expectEquals(main.method78(), SubMain.class); 276 expectEquals(main.method79(), SubMain.class); 277 } 278 } 279 expectEquals(Object actual, Object expected)280 public static void expectEquals(Object actual, Object expected) { 281 if (!actual.equals(expected)) { 282 throw new Error("Expected " + expected + ", got " + actual); 283 } 284 } 285 method1()286 public Class<?> method1() { return Main.class; } method2()287 public Class<?> method2() { return Main.class; } method3()288 public Class<?> method3() { return Main.class; } method4()289 public Class<?> method4() { return Main.class; } method5()290 public Class<?> method5() { return Main.class; } method6()291 public Class<?> method6() { return Main.class; } method7()292 public Class<?> method7() { return Main.class; } method8()293 public Class<?> method8() { return Main.class; } method9()294 public Class<?> method9() { return Main.class; } method10()295 public Class<?> method10() { return Main.class; } method11()296 public Class<?> method11() { return Main.class; } method12()297 public Class<?> method12() { return Main.class; } method13()298 public Class<?> method13() { return Main.class; } method14()299 public Class<?> method14() { return Main.class; } method15()300 public Class<?> method15() { return Main.class; } method16()301 public Class<?> method16() { return Main.class; } method17()302 public Class<?> method17() { return Main.class; } method18()303 public Class<?> method18() { return Main.class; } method19()304 public Class<?> method19() { return Main.class; } method20()305 public Class<?> method20() { return Main.class; } method21()306 public Class<?> method21() { return Main.class; } method22()307 public Class<?> method22() { return Main.class; } method23()308 public Class<?> method23() { return Main.class; } method24()309 public Class<?> method24() { return Main.class; } method25()310 public Class<?> method25() { return Main.class; } method26()311 public Class<?> method26() { return Main.class; } method27()312 public Class<?> method27() { return Main.class; } method28()313 public Class<?> method28() { return Main.class; } method29()314 public Class<?> method29() { return Main.class; } method30()315 public Class<?> method30() { return Main.class; } method31()316 public Class<?> method31() { return Main.class; } method32()317 public Class<?> method32() { return Main.class; } method33()318 public Class<?> method33() { return Main.class; } method34()319 public Class<?> method34() { return Main.class; } method35()320 public Class<?> method35() { return Main.class; } method36()321 public Class<?> method36() { return Main.class; } method37()322 public Class<?> method37() { return Main.class; } method38()323 public Class<?> method38() { return Main.class; } method39()324 public Class<?> method39() { return Main.class; } method40()325 public Class<?> method40() { return Main.class; } method41()326 public Class<?> method41() { return Main.class; } method42()327 public Class<?> method42() { return Main.class; } method43()328 public Class<?> method43() { return Main.class; } method44()329 public Class<?> method44() { return Main.class; } method45()330 public Class<?> method45() { return Main.class; } method46()331 public Class<?> method46() { return Main.class; } method47()332 public Class<?> method47() { return Main.class; } method48()333 public Class<?> method48() { return Main.class; } method49()334 public Class<?> method49() { return Main.class; } method50()335 public Class<?> method50() { return Main.class; } method51()336 public Class<?> method51() { return Main.class; } method52()337 public Class<?> method52() { return Main.class; } method53()338 public Class<?> method53() { return Main.class; } method54()339 public Class<?> method54() { return Main.class; } method55()340 public Class<?> method55() { return Main.class; } method56()341 public Class<?> method56() { return Main.class; } method57()342 public Class<?> method57() { return Main.class; } method58()343 public Class<?> method58() { return Main.class; } method59()344 public Class<?> method59() { return Main.class; } method60()345 public Class<?> method60() { return Main.class; } method61()346 public Class<?> method61() { return Main.class; } method62()347 public Class<?> method62() { return Main.class; } method63()348 public Class<?> method63() { return Main.class; } method64()349 public Class<?> method64() { return Main.class; } method65()350 public Class<?> method65() { return Main.class; } method66()351 public Class<?> method66() { return Main.class; } method67()352 public Class<?> method67() { return Main.class; } method68()353 public Class<?> method68() { return Main.class; } method69()354 public Class<?> method69() { return Main.class; } method70()355 public Class<?> method70() { return Main.class; } method71()356 public Class<?> method71() { return Main.class; } method72()357 public Class<?> method72() { return Main.class; } method73()358 public Class<?> method73() { return Main.class; } method74()359 public Class<?> method74() { return Main.class; } method75()360 public Class<?> method75() { return Main.class; } method76()361 public Class<?> method76() { return Main.class; } method77()362 public Class<?> method77() { return Main.class; } method78()363 public Class<?> method78() { return Main.class; } method79()364 public Class<?> method79() { return Main.class; } 365 } 366 367 class SubMain extends Main { method1()368 public Class<?> method1() { return SubMain.class; } method2()369 public Class<?> method2() { return SubMain.class; } method3()370 public Class<?> method3() { return SubMain.class; } method4()371 public Class<?> method4() { return SubMain.class; } method5()372 public Class<?> method5() { return SubMain.class; } method6()373 public Class<?> method6() { return SubMain.class; } method7()374 public Class<?> method7() { return SubMain.class; } method8()375 public Class<?> method8() { return SubMain.class; } method9()376 public Class<?> method9() { return SubMain.class; } method10()377 public Class<?> method10() { return SubMain.class; } method11()378 public Class<?> method11() { return SubMain.class; } method12()379 public Class<?> method12() { return SubMain.class; } method13()380 public Class<?> method13() { return SubMain.class; } method14()381 public Class<?> method14() { return SubMain.class; } method15()382 public Class<?> method15() { return SubMain.class; } method16()383 public Class<?> method16() { return SubMain.class; } method17()384 public Class<?> method17() { return SubMain.class; } method18()385 public Class<?> method18() { return SubMain.class; } method19()386 public Class<?> method19() { return SubMain.class; } method20()387 public Class<?> method20() { return SubMain.class; } method21()388 public Class<?> method21() { return SubMain.class; } method22()389 public Class<?> method22() { return SubMain.class; } method23()390 public Class<?> method23() { return SubMain.class; } method24()391 public Class<?> method24() { return SubMain.class; } method25()392 public Class<?> method25() { return SubMain.class; } method26()393 public Class<?> method26() { return SubMain.class; } method27()394 public Class<?> method27() { return SubMain.class; } method28()395 public Class<?> method28() { return SubMain.class; } method29()396 public Class<?> method29() { return SubMain.class; } method30()397 public Class<?> method30() { return SubMain.class; } method31()398 public Class<?> method31() { return SubMain.class; } method32()399 public Class<?> method32() { return SubMain.class; } method33()400 public Class<?> method33() { return SubMain.class; } method34()401 public Class<?> method34() { return SubMain.class; } method35()402 public Class<?> method35() { return SubMain.class; } method36()403 public Class<?> method36() { return SubMain.class; } method37()404 public Class<?> method37() { return SubMain.class; } method38()405 public Class<?> method38() { return SubMain.class; } method39()406 public Class<?> method39() { return SubMain.class; } method40()407 public Class<?> method40() { return SubMain.class; } method41()408 public Class<?> method41() { return SubMain.class; } method42()409 public Class<?> method42() { return SubMain.class; } method43()410 public Class<?> method43() { return SubMain.class; } method44()411 public Class<?> method44() { return SubMain.class; } method45()412 public Class<?> method45() { return SubMain.class; } method46()413 public Class<?> method46() { return SubMain.class; } method47()414 public Class<?> method47() { return SubMain.class; } method48()415 public Class<?> method48() { return SubMain.class; } method49()416 public Class<?> method49() { return SubMain.class; } method50()417 public Class<?> method50() { return SubMain.class; } method51()418 public Class<?> method51() { return SubMain.class; } method52()419 public Class<?> method52() { return SubMain.class; } method53()420 public Class<?> method53() { return SubMain.class; } method54()421 public Class<?> method54() { return SubMain.class; } method55()422 public Class<?> method55() { return SubMain.class; } method56()423 public Class<?> method56() { return SubMain.class; } method57()424 public Class<?> method57() { return SubMain.class; } method58()425 public Class<?> method58() { return SubMain.class; } method59()426 public Class<?> method59() { return SubMain.class; } method60()427 public Class<?> method60() { return SubMain.class; } method61()428 public Class<?> method61() { return SubMain.class; } method62()429 public Class<?> method62() { return SubMain.class; } method63()430 public Class<?> method63() { return SubMain.class; } method64()431 public Class<?> method64() { return SubMain.class; } method65()432 public Class<?> method65() { return SubMain.class; } method66()433 public Class<?> method66() { return SubMain.class; } method67()434 public Class<?> method67() { return SubMain.class; } method68()435 public Class<?> method68() { return SubMain.class; } method69()436 public Class<?> method69() { return SubMain.class; } method70()437 public Class<?> method70() { return SubMain.class; } method71()438 public Class<?> method71() { return SubMain.class; } method72()439 public Class<?> method72() { return SubMain.class; } method73()440 public Class<?> method73() { return SubMain.class; } method74()441 public Class<?> method74() { return SubMain.class; } method75()442 public Class<?> method75() { return SubMain.class; } method76()443 public Class<?> method76() { return SubMain.class; } method77()444 public Class<?> method77() { return SubMain.class; } method78()445 public Class<?> method78() { return SubMain.class; } method79()446 public Class<?> method79() { return SubMain.class; } 447 } 448