Testing for default and native methods in vertical class merger
Change-Id: I8508ca29835325e11fdd4bb4680f98021aea485b
diff --git a/src/test/examplesAndroidO/classmerging/MergeDefaultMethodIntoClassTest.java b/src/test/examplesAndroidO/classmerging/MergeDefaultMethodIntoClassTest.java
new file mode 100644
index 0000000..10f995d
--- /dev/null
+++ b/src/test/examplesAndroidO/classmerging/MergeDefaultMethodIntoClassTest.java
@@ -0,0 +1,23 @@
+// Copyright (c) 2018, 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 MergeDefaultMethodIntoClassTest {
+
+ public static void main(String[] args) {
+ // Note: Important that the static type of [obj] is A, such that the call to f becomes an
+ // invoke-interface instruction and not invoke-virtual instruction.
+ A obj = new B();
+ obj.f();
+ }
+
+ public interface A {
+ default void f() {
+ System.out.println("In A.f");
+ }
+ }
+
+ public static class B implements A {}
+}