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 { 18 public Class<?> method1(); 19 public Class<?> method2(); 20 public Class<?> method3(); 21 public Class<?> method4(); 22 public Class<?> method5(); 23 public Class<?> method6(); 24 public Class<?> method7(); 25 public Class<?> method8(); 26 public Class<?> method9(); 27 public Class<?> method10(); 28 public Class<?> method11(); 29 public Class<?> method12(); 30 public Class<?> method13(); 31 public Class<?> method14(); 32 public Class<?> method15(); 33 public Class<?> method16(); 34 public Class<?> method17(); 35 public Class<?> method18(); 36 public Class<?> method19(); 37 public Class<?> method20(); 38 public Class<?> method21(); 39 public Class<?> method22(); 40 public Class<?> method23(); 41 public Class<?> method24(); 42 public Class<?> method25(); 43 public Class<?> method26(); 44 public Class<?> method27(); 45 public Class<?> method28(); 46 public Class<?> method29(); 47 public Class<?> method30(); 48 public Class<?> method31(); 49 public Class<?> method32(); 50 public Class<?> method33(); 51 public Class<?> method34(); 52 public Class<?> method35(); 53 public Class<?> method36(); 54 public Class<?> method37(); 55 public Class<?> method38(); 56 public Class<?> method39(); 57 public Class<?> method40(); 58 public Class<?> method41(); 59 public Class<?> method42(); 60 public Class<?> method43(); 61 public Class<?> method44(); 62 public Class<?> method45(); 63 public Class<?> method46(); 64 public Class<?> method47(); 65 public Class<?> method48(); 66 public Class<?> method49(); 67 public Class<?> method50(); 68 public Class<?> method51(); 69 public Class<?> method52(); 70 public Class<?> method53(); 71 public Class<?> method54(); 72 public Class<?> method55(); 73 public Class<?> method56(); 74 public Class<?> method57(); 75 public Class<?> method58(); 76 public Class<?> method59(); 77 public Class<?> method60(); 78 public Class<?> method61(); 79 public Class<?> method62(); 80 public Class<?> method63(); 81 public Class<?> method64(); 82 public Class<?> method65(); 83 public Class<?> method66(); 84 public Class<?> method67(); 85 public Class<?> method68(); 86 public Class<?> method69(); 87 public Class<?> method70(); 88 public Class<?> method71(); 89 public Class<?> method72(); 90 public Class<?> method73(); 91 public Class<?> method74(); 92 public Class<?> method75(); 93 public Class<?> method76(); 94 public Class<?> method77(); 95 public Class<?> method78(); 96 public Class<?> method79(); 97 } 98 99 public class Main implements Itf { 100 public static Itf main; 101 public static void main(String[] args) { 102 main = new Main(); 103 callMains(); 104 main = new SubMain(); 105 callSubMains(); 106 } 107 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 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 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 286 public Class<?> method1() { return Main.class; } 287 public Class<?> method2() { return Main.class; } 288 public Class<?> method3() { return Main.class; } 289 public Class<?> method4() { return Main.class; } 290 public Class<?> method5() { return Main.class; } 291 public Class<?> method6() { return Main.class; } 292 public Class<?> method7() { return Main.class; } 293 public Class<?> method8() { return Main.class; } 294 public Class<?> method9() { return Main.class; } 295 public Class<?> method10() { return Main.class; } 296 public Class<?> method11() { return Main.class; } 297 public Class<?> method12() { return Main.class; } 298 public Class<?> method13() { return Main.class; } 299 public Class<?> method14() { return Main.class; } 300 public Class<?> method15() { return Main.class; } 301 public Class<?> method16() { return Main.class; } 302 public Class<?> method17() { return Main.class; } 303 public Class<?> method18() { return Main.class; } 304 public Class<?> method19() { return Main.class; } 305 public Class<?> method20() { return Main.class; } 306 public Class<?> method21() { return Main.class; } 307 public Class<?> method22() { return Main.class; } 308 public Class<?> method23() { return Main.class; } 309 public Class<?> method24() { return Main.class; } 310 public Class<?> method25() { return Main.class; } 311 public Class<?> method26() { return Main.class; } 312 public Class<?> method27() { return Main.class; } 313 public Class<?> method28() { return Main.class; } 314 public Class<?> method29() { return Main.class; } 315 public Class<?> method30() { return Main.class; } 316 public Class<?> method31() { return Main.class; } 317 public Class<?> method32() { return Main.class; } 318 public Class<?> method33() { return Main.class; } 319 public Class<?> method34() { return Main.class; } 320 public Class<?> method35() { return Main.class; } 321 public Class<?> method36() { return Main.class; } 322 public Class<?> method37() { return Main.class; } 323 public Class<?> method38() { return Main.class; } 324 public Class<?> method39() { return Main.class; } 325 public Class<?> method40() { return Main.class; } 326 public Class<?> method41() { return Main.class; } 327 public Class<?> method42() { return Main.class; } 328 public Class<?> method43() { return Main.class; } 329 public Class<?> method44() { return Main.class; } 330 public Class<?> method45() { return Main.class; } 331 public Class<?> method46() { return Main.class; } 332 public Class<?> method47() { return Main.class; } 333 public Class<?> method48() { return Main.class; } 334 public Class<?> method49() { return Main.class; } 335 public Class<?> method50() { return Main.class; } 336 public Class<?> method51() { return Main.class; } 337 public Class<?> method52() { return Main.class; } 338 public Class<?> method53() { return Main.class; } 339 public Class<?> method54() { return Main.class; } 340 public Class<?> method55() { return Main.class; } 341 public Class<?> method56() { return Main.class; } 342 public Class<?> method57() { return Main.class; } 343 public Class<?> method58() { return Main.class; } 344 public Class<?> method59() { return Main.class; } 345 public Class<?> method60() { return Main.class; } 346 public Class<?> method61() { return Main.class; } 347 public Class<?> method62() { return Main.class; } 348 public Class<?> method63() { return Main.class; } 349 public Class<?> method64() { return Main.class; } 350 public Class<?> method65() { return Main.class; } 351 public Class<?> method66() { return Main.class; } 352 public Class<?> method67() { return Main.class; } 353 public Class<?> method68() { return Main.class; } 354 public Class<?> method69() { return Main.class; } 355 public Class<?> method70() { return Main.class; } 356 public Class<?> method71() { return Main.class; } 357 public Class<?> method72() { return Main.class; } 358 public Class<?> method73() { return Main.class; } 359 public Class<?> method74() { return Main.class; } 360 public Class<?> method75() { return Main.class; } 361 public Class<?> method76() { return Main.class; } 362 public Class<?> method77() { return Main.class; } 363 public Class<?> method78() { return Main.class; } 364 public Class<?> method79() { return Main.class; } 365 } 366 367 class SubMain extends Main { 368 public Class<?> method1() { return SubMain.class; } 369 public Class<?> method2() { return SubMain.class; } 370 public Class<?> method3() { return SubMain.class; } 371 public Class<?> method4() { return SubMain.class; } 372 public Class<?> method5() { return SubMain.class; } 373 public Class<?> method6() { return SubMain.class; } 374 public Class<?> method7() { return SubMain.class; } 375 public Class<?> method8() { return SubMain.class; } 376 public Class<?> method9() { return SubMain.class; } 377 public Class<?> method10() { return SubMain.class; } 378 public Class<?> method11() { return SubMain.class; } 379 public Class<?> method12() { return SubMain.class; } 380 public Class<?> method13() { return SubMain.class; } 381 public Class<?> method14() { return SubMain.class; } 382 public Class<?> method15() { return SubMain.class; } 383 public Class<?> method16() { return SubMain.class; } 384 public Class<?> method17() { return SubMain.class; } 385 public Class<?> method18() { return SubMain.class; } 386 public Class<?> method19() { return SubMain.class; } 387 public Class<?> method20() { return SubMain.class; } 388 public Class<?> method21() { return SubMain.class; } 389 public Class<?> method22() { return SubMain.class; } 390 public Class<?> method23() { return SubMain.class; } 391 public Class<?> method24() { return SubMain.class; } 392 public Class<?> method25() { return SubMain.class; } 393 public Class<?> method26() { return SubMain.class; } 394 public Class<?> method27() { return SubMain.class; } 395 public Class<?> method28() { return SubMain.class; } 396 public Class<?> method29() { return SubMain.class; } 397 public Class<?> method30() { return SubMain.class; } 398 public Class<?> method31() { return SubMain.class; } 399 public Class<?> method32() { return SubMain.class; } 400 public Class<?> method33() { return SubMain.class; } 401 public Class<?> method34() { return SubMain.class; } 402 public Class<?> method35() { return SubMain.class; } 403 public Class<?> method36() { return SubMain.class; } 404 public Class<?> method37() { return SubMain.class; } 405 public Class<?> method38() { return SubMain.class; } 406 public Class<?> method39() { return SubMain.class; } 407 public Class<?> method40() { return SubMain.class; } 408 public Class<?> method41() { return SubMain.class; } 409 public Class<?> method42() { return SubMain.class; } 410 public Class<?> method43() { return SubMain.class; } 411 public Class<?> method44() { return SubMain.class; } 412 public Class<?> method45() { return SubMain.class; } 413 public Class<?> method46() { return SubMain.class; } 414 public Class<?> method47() { return SubMain.class; } 415 public Class<?> method48() { return SubMain.class; } 416 public Class<?> method49() { return SubMain.class; } 417 public Class<?> method50() { return SubMain.class; } 418 public Class<?> method51() { return SubMain.class; } 419 public Class<?> method52() { return SubMain.class; } 420 public Class<?> method53() { return SubMain.class; } 421 public Class<?> method54() { return SubMain.class; } 422 public Class<?> method55() { return SubMain.class; } 423 public Class<?> method56() { return SubMain.class; } 424 public Class<?> method57() { return SubMain.class; } 425 public Class<?> method58() { return SubMain.class; } 426 public Class<?> method59() { return SubMain.class; } 427 public Class<?> method60() { return SubMain.class; } 428 public Class<?> method61() { return SubMain.class; } 429 public Class<?> method62() { return SubMain.class; } 430 public Class<?> method63() { return SubMain.class; } 431 public Class<?> method64() { return SubMain.class; } 432 public Class<?> method65() { return SubMain.class; } 433 public Class<?> method66() { return SubMain.class; } 434 public Class<?> method67() { return SubMain.class; } 435 public Class<?> method68() { return SubMain.class; } 436 public Class<?> method69() { return SubMain.class; } 437 public Class<?> method70() { return SubMain.class; } 438 public Class<?> method71() { return SubMain.class; } 439 public Class<?> method72() { return SubMain.class; } 440 public Class<?> method73() { return SubMain.class; } 441 public Class<?> method74() { return SubMain.class; } 442 public Class<?> method75() { return SubMain.class; } 443 public Class<?> method76() { return SubMain.class; } 444 public Class<?> method77() { return SubMain.class; } 445 public Class<?> method78() { return SubMain.class; } 446 public Class<?> method79() { return SubMain.class; } 447 } 448