blob: cdb8b23b47a9a57d4767ffac8bcf29922af587f1 [file] [log] [blame]
// Copyright (c) 2023, 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.examples.regalloc;
import com.android.tools.r8.TestParameters;
import com.android.tools.r8.TestParametersCollection;
import com.android.tools.r8.examples.ExamplesTestBase;
import com.android.tools.r8.examples.regalloc.RegAlloc.BoxedInteger;
import com.android.tools.r8.utils.StringUtils;
import com.google.common.collect.ImmutableList;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
@RunWith(Parameterized.class)
public class RegAllocTestRunner extends ExamplesTestBase {
public RegAllocTestRunner(TestParameters parameters) {
super(parameters);
}
@Override
public Class<?> getMainClass() {
return RegAlloc.class;
}
@Override
public List<Class<?>> getTestClasses() throws Exception {
return ImmutableList.of(getMainClass(), BoxedInteger.class);
}
@Override
public String getExpected() {
return StringUtils.lines(
"binaryOpUsingHighRegistersArguments: 17016 257 507",
"binaryDoubleOpUsingHighRegistersArguments: 251.0 125.0",
"binaryOpUsingHighRegistersLocals 518",
"instance get many registers42",
"sum: 33670",
"binaryOpUsingHighRegistersLocals 518.0",
"sum: 33670.0");
}
}