< prev index next >

hotspot/test/runtime/SelectionResolution/InvokeInterfaceICCE.java

Print this page




  36 import selectionresolution.ClassData;
  37 import selectionresolution.MethodData;
  38 import selectionresolution.Result;
  39 import selectionresolution.SelectionResolutionTest;
  40 import selectionresolution.SelectionResolutionTestCase;
  41 import selectionresolution.Template;
  42 
  43 public class InvokeInterfaceICCE extends SelectionResolutionTest {
  44 
  45     private static final SelectionResolutionTestCase.Builder initBuilder =
  46         new SelectionResolutionTestCase.Builder();
  47 
  48     static {
  49         initBuilder.setResult(Result.ICCE);
  50     }
  51 
  52     private static final Collection<TestGroup> testgroups =
  53         Arrays.asList(
  54                 /* invokeinterface tests */
  55 
  56                 /* resolved method is static*/
  57                 /* Group 168: methodref = expected */
  58                 new TestGroup.Simple(initBuilder,
  59                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
  60                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
  61                                              EnumSet.of(MethodData.Access.PUBLIC),
  62                                              EnumSet.of(MethodData.Context.STATIC),
  63                                              EnumSet.of(ClassData.Package.SAME,
  64                                                         ClassData.Package.DIFFERENT)),
  65                         Template.OverrideAbstractExpectedIface,
  66                         Template.MethodrefEqualsExpected,
  67                         Template.IgnoredAbstract,
  68                         Template.AllCallsiteCases,
  69                         Template.IfaceMethodrefSelection),
  70                 /* Group 169: methodref != expected */
  71                 new TestGroup.Simple(initBuilder,
  72                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
  73                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
  74                                              EnumSet.of(MethodData.Access.PUBLIC),
  75                                              EnumSet.of(MethodData.Context.STATIC),
  76                                              EnumSet.of(ClassData.Package.SAME,
  77                                                         ClassData.Package.DIFFERENT)),
  78                         Template.OverrideAbstractExpectedIface,
  79                         Template.IfaceMethodrefNotEqualsExpected,
  80                         Template.IgnoredAbstract,
  81                         Template.AllCallsiteCases,
  82                         Template.IfaceMethodrefSelection),
  83 
  84                 /* methodref is a class */
  85                 /* Group 170: methodref = expected */
  86                 new TestGroup.Simple(initBuilder,
  87                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
  88                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
  89                                              EnumSet.of(MethodData.Access.PUBLIC,
  90                                                         MethodData.Access.PACKAGE,
  91                                                         MethodData.Access.PROTECTED,
  92                                                         MethodData.Access.PRIVATE),
  93                                              EnumSet.of(MethodData.Context.STATIC),
  94                                              EnumSet.of(ClassData.Package.SAME,
  95                                                         ClassData.Package.DIFFERENT)),
  96                         Template.OverrideAbstractExpectedClass,
  97                         Template.MethodrefEqualsExpected,
  98                         Template.IgnoredAbstract,
  99                         Template.AllCallsiteCases,
 100                         Template.MethodrefSelectionResolvedIsClass),
 101                 /* Group 171: methodref != expected, expected is class */
 102                 new TestGroup.Simple(initBuilder,
 103                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 104                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 105                                              EnumSet.of(MethodData.Access.PUBLIC,
 106                                                         MethodData.Access.PACKAGE,
 107                                                         MethodData.Access.PROTECTED,
 108                                                         MethodData.Access.PRIVATE),
 109                                              EnumSet.of(MethodData.Context.STATIC),
 110                                              EnumSet.of(ClassData.Package.SAME,
 111                                                         ClassData.Package.DIFFERENT)),
 112                         Template.OverrideAbstractExpectedClass,
 113                         Template.MethodrefNotEqualsExpectedClass,
 114                         Template.IgnoredAbstract,
 115                         Template.AllCallsiteCases,
 116                         Template.MethodrefSelectionResolvedIsClass),
 117                 /* Group 172: methodref != expected expected is interface */
 118                 new TestGroup.Simple(initBuilder,
 119                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 120                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 121                                              EnumSet.of(MethodData.Access.PUBLIC,
 122                                                         MethodData.Access.PRIVATE),
 123                                              EnumSet.of(MethodData.Context.STATIC),
 124                                              EnumSet.of(ClassData.Package.SAME,
 125                                                         ClassData.Package.DIFFERENT)),
 126                         Template.OverrideAbstractExpectedIface,
 127                         Template.MethodrefNotEqualsExpectedIface,
 128                         Template.IgnoredAbstract,
 129                         Template.AllCallsiteCases,
 130                         Template.MethodrefSelectionResolvedIsIface),
 131                 /* Group 173: ambiguous resolution */
 132                 new TestGroup.Simple(initBuilder,
 133                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 134                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 135                                              EnumSet.of(MethodData.Access.PUBLIC),
 136                                              EnumSet.of(MethodData.Context.INSTANCE),
 137                                              EnumSet.of(ClassData.Package.SAME,
 138                                                         ClassData.Package.DIFFERENT)),
 139                         Template.OverrideAbstractExpectedIface,
 140                         Template.IfaceMethodrefAmbiguous,
 141                         Template.IgnoredAbstract,
 142                         Template.AllCallsiteCases,
 143                         Template.IfaceMethodrefSelectionNoOverride),
 144                 /* Group 174: ambiguous selection */
 145                 new TestGroup.Simple(initBuilder,
 146                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 147                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 148                                              EnumSet.of(MethodData.Access.PUBLIC),
 149                                              EnumSet.of(MethodData.Context.INSTANCE),
 150                                              EnumSet.of(ClassData.Package.SAME,
 151                                                         ClassData.Package.DIFFERENT)),
 152                         Template.OverrideAbstractExpectedIface,
 153                         Template.IfaceMethodrefNotEqualsExpected,
 154                         Template.IgnoredAbstract,
 155                         Template.AllCallsiteCases,
 156                         Template.IfaceMethodrefAmbiguousResolvedIsIface),
 157 
 158                 /* Group 175: private method in interface */
 159                 new TestGroup.Simple(initBuilder,
 160                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 161                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 162                                              EnumSet.of(MethodData.Access.PRIVATE),
 163                                              EnumSet.of(MethodData.Context.INSTANCE),
 164                                              EnumSet.of(ClassData.Package.SAME)),
 165                         Template.OverrideAbstractExpectedIface,
 166                         Template.MethodrefEqualsExpected,
 167                         Template.IgnoredAbstract,
 168                         Template.CallsiteEqualsMethodref,
 169                         Template.IfaceMethodrefSelection)
 170             );
 171 
 172     private InvokeInterfaceICCE() {
 173         super(testgroups);
 174     }
 175 
 176     public static void main(final String... args) {


  36 import selectionresolution.ClassData;
  37 import selectionresolution.MethodData;
  38 import selectionresolution.Result;
  39 import selectionresolution.SelectionResolutionTest;
  40 import selectionresolution.SelectionResolutionTestCase;
  41 import selectionresolution.Template;
  42 
  43 public class InvokeInterfaceICCE extends SelectionResolutionTest {
  44 
  45     private static final SelectionResolutionTestCase.Builder initBuilder =
  46         new SelectionResolutionTestCase.Builder();
  47 
  48     static {
  49         initBuilder.setResult(Result.ICCE);
  50     }
  51 
  52     private static final Collection<TestGroup> testgroups =
  53         Arrays.asList(
  54                 /* invokeinterface tests */
  55 
  56                 // /* resolved method is static*/
  57                 // /* Group 168: methodref = expected */
  58                 // new TestGroup.Simple(initBuilder,
  59                 //         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
  60                 //         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
  61                 //                              EnumSet.of(MethodData.Access.PUBLIC),
  62                 //                              EnumSet.of(MethodData.Context.STATIC),
  63                 //                              EnumSet.of(ClassData.Package.SAME,
  64                 //                                         ClassData.Package.DIFFERENT)),
  65                 //         Template.OverrideAbstractExpectedIface,
  66                 //         Template.MethodrefEqualsExpected,
  67                 //         Template.IgnoredAbstract,
  68                 //         Template.AllCallsiteCases,
  69                 //         Template.IfaceMethodrefSelection),
  70                 // /* Group 169: methodref != expected */
  71                 // new TestGroup.Simple(initBuilder,
  72                 //         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
  73                 //         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
  74                 //                              EnumSet.of(MethodData.Access.PUBLIC),
  75                 //                              EnumSet.of(MethodData.Context.STATIC),
  76                 //                              EnumSet.of(ClassData.Package.SAME,
  77                 //                                         ClassData.Package.DIFFERENT)),
  78                 //         Template.OverrideAbstractExpectedIface,
  79                 //         Template.IfaceMethodrefNotEqualsExpected,
  80                 //         Template.IgnoredAbstract,
  81                 //         Template.AllCallsiteCases,
  82                 //         Template.IfaceMethodrefSelection),
  83 
  84                 // /* methodref is a class */
  85                 // /* Group 170: methodref = expected */
  86                 // new TestGroup.Simple(initBuilder,
  87                 //         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
  88                 //         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
  89                 //                              EnumSet.of(MethodData.Access.PUBLIC,
  90                 //                                         MethodData.Access.PACKAGE,
  91                 //                                         MethodData.Access.PROTECTED,
  92                 //                                         MethodData.Access.PRIVATE),
  93                 //                              EnumSet.of(MethodData.Context.STATIC),
  94                 //                              EnumSet.of(ClassData.Package.SAME,
  95                 //                                         ClassData.Package.DIFFERENT)),
  96                 //         Template.OverrideAbstractExpectedClass,
  97                 //         Template.MethodrefEqualsExpected,
  98                 //         Template.IgnoredAbstract,
  99                 //         Template.AllCallsiteCases,
 100                 //         Template.MethodrefSelectionResolvedIsClass),
 101                 // /* Group 171: methodref != expected, expected is class */
 102                 // new TestGroup.Simple(initBuilder,
 103                 //         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 104                 //         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 105                 //                              EnumSet.of(MethodData.Access.PUBLIC,
 106                 //                                         MethodData.Access.PACKAGE,
 107                 //                                         MethodData.Access.PROTECTED,
 108                 //                                         MethodData.Access.PRIVATE),
 109                 //                              EnumSet.of(MethodData.Context.STATIC),
 110                 //                              EnumSet.of(ClassData.Package.SAME,
 111                 //                                         ClassData.Package.DIFFERENT)),
 112                 //         Template.OverrideAbstractExpectedClass,
 113                 //         Template.MethodrefNotEqualsExpectedClass,
 114                 //         Template.IgnoredAbstract,
 115                 //         Template.AllCallsiteCases,
 116                 //         Template.MethodrefSelectionResolvedIsClass),
 117                 // /* Group 172: methodref != expected expected is interface */
 118                 // new TestGroup.Simple(initBuilder,
 119                 //         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 120                 //         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 121                 //                              EnumSet.of(MethodData.Access.PUBLIC,
 122                 //                                         MethodData.Access.PRIVATE),
 123                 //                              EnumSet.of(MethodData.Context.STATIC),
 124                 //                              EnumSet.of(ClassData.Package.SAME,
 125                 //                                         ClassData.Package.DIFFERENT)),
 126                 //         Template.OverrideAbstractExpectedIface,
 127                 //         Template.MethodrefNotEqualsExpectedIface,
 128                 //         Template.IgnoredAbstract,
 129                 //         Template.AllCallsiteCases,
 130                 //         Template.MethodrefSelectionResolvedIsIface),
 131                 // /* Group 173: ambiguous resolution */
 132                 // new TestGroup.Simple(initBuilder,
 133                 //         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 134                 //         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 135                 //                              EnumSet.of(MethodData.Access.PUBLIC),
 136                 //                              EnumSet.of(MethodData.Context.INSTANCE),
 137                 //                              EnumSet.of(ClassData.Package.SAME,
 138                 //                                         ClassData.Package.DIFFERENT)),
 139                 //         Template.OverrideAbstractExpectedIface,
 140                 //         Template.IfaceMethodrefAmbiguous,
 141                 //         Template.IgnoredAbstract,
 142                 //         Template.AllCallsiteCases,
 143                 //         Template.IfaceMethodrefSelectionNoOverride),
 144                 // /* Group 174: ambiguous selection */
 145                 // new TestGroup.Simple(initBuilder,
 146                 //         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 147                 //         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 148                 //                              EnumSet.of(MethodData.Access.PUBLIC),
 149                 //                              EnumSet.of(MethodData.Context.INSTANCE),
 150                 //                              EnumSet.of(ClassData.Package.SAME,
 151                 //                                         ClassData.Package.DIFFERENT)),
 152                 //         Template.OverrideAbstractExpectedIface,
 153                 //         Template.IfaceMethodrefNotEqualsExpected,
 154                 //         Template.IgnoredAbstract,
 155                 //         Template.AllCallsiteCases,
 156                 //         Template.IfaceMethodrefAmbiguousResolvedIsIface),
 157 
 158                 /* Group 175: private method in interface */
 159                 new TestGroup.Simple(initBuilder,
 160                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 161                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 162                                              EnumSet.of(MethodData.Access.PRIVATE),
 163                                              EnumSet.of(MethodData.Context.INSTANCE),
 164                                              EnumSet.of(ClassData.Package.SAME)),
 165                         Template.OverrideAbstractExpectedIface,
 166                         Template.MethodrefEqualsExpected,
 167                         Template.IgnoredAbstract,
 168                         Template.CallsiteEqualsMethodref,
 169                         Template.IfaceMethodrefSelection)
 170             );
 171 
 172     private InvokeInterfaceICCE() {
 173         super(testgroups);
 174     }
 175 
 176     public static void main(final String... args) {
< prev index next >