Ensure class merging needed for reproduction
Change-Id: I81e3310f4ea0b9dc74b793c0901181437848a81f
diff --git a/src/test/java/com/android/tools/r8/ir/optimize/inliner/Regress136250031.java b/src/test/java/com/android/tools/r8/ir/optimize/inliner/Regress136250031.java
index fbc405e..eb6d129 100644
--- a/src/test/java/com/android/tools/r8/ir/optimize/inliner/Regress136250031.java
+++ b/src/test/java/com/android/tools/r8/ir/optimize/inliner/Regress136250031.java
@@ -5,18 +5,36 @@
package com.android.tools.r8.ir.optimize.inliner;
import com.android.tools.r8.TestBase;
+import com.android.tools.r8.TestParameters;
+import com.android.tools.r8.TestParametersCollection;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
+import org.junit.runners.Parameterized.Parameters;
+@RunWith(Parameterized.class)
public class Regress136250031 extends TestBase {
+ @Parameter(0)
+ public TestParameters parameters;
+
+ @Parameters(name = "{0}")
+ public static TestParametersCollection data() {
+ return getTestParameters().withAllRuntimesAndApiLevels().build();
+ }
+
@Test
public void test() throws Exception {
- testForR8(Backend.CF)
- .addInnerClasses(Regress136250031.class)
- .addKeepMainRule(TestClass.class)
- .addKeepClassAndMembersRules(B.class)
- .run(TestClass.class)
- .assertSuccess();
+ testForR8(parameters.getBackend())
+ .addInnerClasses(getClass())
+ .addKeepMainRule(TestClass.class)
+ .addKeepClassAndMembersRules(B.class)
+ .addVerticallyMergedClassesInspector(
+ inspector -> inspector.assertMergedIntoSubtype(A.class).assertNoOtherClassesMerged())
+ .setMinApi(parameters)
+ .run(parameters.getRuntime(), TestClass.class)
+ .assertSuccessWithOutputLines("42");
}
static class TestClass {
@@ -25,19 +43,19 @@
}
}
- static class A {
+ public static class A {
A(String s) {
System.out.println(s);
}
}
- static class B extends A {
+ public static class B extends A {
B(C c) {
super(c.instance.toString());
}
}
- static class C {
+ public static class C {
public C instance;
C() {