blob: 7de7a1fe8e1fded3989240531af3a5bc3ab5c37a [file] [log] [blame]
Christoffer Quist Adamsen10c8a162018-06-11 09:53:03 +02001// Copyright (c) 2018, the R8 project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5package classmerging;
6
7public class ConflictingInterfaceSignaturesTest {
8
9 public static void main(String[] args) {
10 A a = new InterfaceImpl();
11 a.foo();
12
13 B b = new InterfaceImpl();
14 b.foo();
Christoffer Quist Adamsenbfdbe602019-10-18 12:03:31 +020015
16 // Ensure that the instantiations are not dead code eliminated.
17 escape(a);
18 escape(b);
19 }
20
21 @NeverInline
22 static void escape(Object o) {
23 if (System.currentTimeMillis() < 0) {
24 System.out.println(o);
25 }
Christoffer Quist Adamsen10c8a162018-06-11 09:53:03 +020026 }
27
28 public interface A {
29 void foo();
30 }
31
32 public interface B {
33 void foo();
34 }
35
36 public static final class InterfaceImpl implements A, B {
37
38 @Override
39 public void foo() {
40 System.out.println("In foo on InterfaceImpl");
41 }
42 }
43}