blob: 3f31839ca01b1ddcf5059f017a4e8115428b3424 [file] [log] [blame]
// 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 com.android.tools.r8.ir.optimize.staticizer.movetohost;
public class MoveToHostTestClass {
private static int ID = 0;
private static String next() {
return Integer.toString(ID++);
}
public static void main(String[] args) {
MoveToHostTestClass test = new MoveToHostTestClass();
test.testOk();
test.testOkSideEffects();
test.testConflictMethod();
test.testConflictField();
}
private synchronized void testOk() {
System.out.println(HostOk.INSTANCE.foo());
System.out.println(HostOk.INSTANCE.bar(next()));
HostOk.INSTANCE.blah(next());
}
private synchronized void testOkSideEffects() {
System.out.println(HostOkSideEffects.INSTANCE.foo());
System.out.println(HostOkSideEffects.INSTANCE.bar(next()));
}
private synchronized void testConflictMethod() {
System.out.println(new HostConflictMethod().bar(next()));
System.out.println(HostConflictMethod.INSTANCE.foo());
System.out.println(HostConflictMethod.INSTANCE.bar(next()));
}
private synchronized void testConflictField() {
System.out.println(new HostConflictField().field);
System.out.println(CandidateConflictField.field);
System.out.println(HostConflictField.INSTANCE.foo());
System.out.println(HostConflictField.INSTANCE.bar(next()));
}
}