Implement simple class merger.
BUG=
Change-Id: Ib22cf7a7d10797b0ba7ed6ef8fb5aa5fda9aaa60
diff --git a/src/test/examples/classmerging/Test.java b/src/test/examples/classmerging/Test.java
new file mode 100644
index 0000000..6d5c51f
--- /dev/null
+++ b/src/test/examples/classmerging/Test.java
@@ -0,0 +1,34 @@
+// Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+package classmerging;
+
+public class Test {
+
+ public static void main(String... args) {
+ GenericInterface iface = new GenericInterfaceImpl();
+ callMethodOnIface(iface);
+ GenericAbstractClass clazz = new GenericAbstractClassImpl();
+ callMethodOnAbstractClass(clazz);
+ ConflictingInterfaceImpl impl = new ConflictingInterfaceImpl();
+ callMethodOnIface(impl);
+ System.out.println(new SubClassThatReferencesSuperMethod().referencedMethod());
+ System.out.println(new Outer().getInstance().method());
+ System.out.println(new SubClass(42));
+ }
+
+ private static void callMethodOnIface(GenericInterface iface) {
+ System.out.println(iface.method());
+ }
+
+ private static void callMethodOnAbstractClass(GenericAbstractClass clazz) {
+ System.out.println(clazz.method());
+ System.out.println(clazz.otherMethod());
+ }
+
+ private static void callMethodOnIface(ConflictingInterface iface) {
+ System.out.println(iface.method());
+ System.out.println(ClassWithConflictingMethod.conflict(null));
+ System.out.println(OtherClassWithConflictingMethod.conflict(null));
+ }
+}