blob: 4f72a650a242193e2f7af9f1e83f64988ce7c45e [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.debug;
import com.android.tools.r8.ToolHelper;
import com.android.tools.r8.ToolHelper.DexVm;
import com.android.tools.r8.ToolHelper.DexVm.Version;
import com.android.tools.r8.VmTestRunner;
import com.android.tools.r8.VmTestRunner.IgnoreIfVmOlderThan;
import java.util.Collections;
import org.junit.Assume;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(VmTestRunner.class)
public class ArraySimplificationLineNumberTestRunner extends DebugTestBase {
private static final Class CLASS = ArraySimplificationLineNumberTest.class;
private static final String FILE = CLASS.getSimpleName() + ".java";
private static final String NAME = CLASS.getCanonicalName();
@Test
@IgnoreIfVmOlderThan(Version.V6_0_1)
public void testHitOnEntryOnly() throws Throwable {
// TODO(b/199700280): Reenable on 12.0.0 when we have the libjdwp.so file include and the flags
// fixed.
Assume.assumeTrue(
"Skipping test " + testName.getMethodName() + " because debugging not enabled in 12.0.0",
!ToolHelper.getDexVm().isEqualTo(DexVm.ART_12_0_0_HOST));
DebugTestConfig cf = new CfDebugTestConfig().addPaths(ToolHelper.getClassPathForTests());
DebugTestConfig d8 = new D8DebugTestConfig().compileAndAdd(
temp, Collections.singletonList(ToolHelper.getClassFileForTestClass(CLASS)));
DebugTestConfig d8NoLocals = new D8DebugTestConfig().compileAndAdd(
temp,
Collections.singletonList(ToolHelper.getClassFileForTestClass(CLASS)),
options -> options.testing.noLocalsTableOnInput = true);
new DebugStreamComparator()
.add("CF", streamDebugTest(cf, NAME, NO_FILTER))
.add("D8", streamDebugTest(d8, NAME, ANDROID_FILTER))
.add("D8/nolocals", streamDebugTest(d8NoLocals, NAME, ANDROID_FILTER))
.setFilter(s -> s.getSourceFile().equals(FILE))
.setVerifyVariables(false)
.compare();
}
}