@@ -0,0 +1,1952 @@
+/*%0A * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.%0A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.%0A *%0A * This code is free software; you can redistribute it and/or modify it%0A * under the terms of the GNU General Public License version 2 only, as%0A * published by the Free Software Foundation.%0A *%0A * This code is distributed in the hope that it will be useful, but WITHOUT%0A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or%0A * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License%0A * version 2 for more details (a copy is included in the LICENSE file that%0A * accompanied this code).%0A *%0A * You should have received a copy of the GNU General Public License version%0A * 2 along with this work; if not, write to the Free Software Foundation,%0A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.%0A *%0A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA%0A * or visit www.oracle.com if you need additional information or have any%0A * questions.%0A *%0A */%0A%0A/*%0A * @test%0A * @bug 8032024%0A * @bug 8025937%0A * @summary %5BJDK 8%5D Test invokespecial and invokeinterface with the same JVM_CONSTANT_InterfaceMethodref%0A * @run main InvokespecialInterface%0A */%0Aimport java.util.function.*;%0Aimport java.util.*;%0A%0Ainterface I %7B%0A  default void imethod() %7B System.out.println(%22I::imethod%22); %7D%0A%7D%0A%0Aclass C implements I %7B%0A  public void foo() %7B I.super.imethod(); %7D  // invokespecial InterfaceMethod%0A  public void bar() %7B I i = this; i.imethod(); %7D // invokeinterface same%0A  public void doSomeInvokedynamic() %7B%0A      String str = %22world%22;%0A      Supplier%3CString%3E foo = ()-%3E%22hello, %22+str;%0A      String res = foo.get();%0A      System.out.println(res);%0A  %7D%0A%7D%0A%0Apublic class InvokespecialInterface %7B%0A  public static void main(java.lang.String%5B%5D unused) %7B%0A     // need to create C and call I::foo()%0A     C c = new C();%0A     c.foo();%0A     c.bar();%0A     c.doSomeInvokedynamic();%0A  %7D%0A%7D;%0A%0A%0A

Test not added for bug 8025937: assert(existing_f1 == NULL || existing_f1 == f1) failed: illegal field,change Summary: Test didn't get hg added with original bug fix Reviewed-by: jrose, hseigel, lfoltan