Test updates
This excludes the proto schema from the R8 jar. We may want to
distribute this in some expected location, but that is to be determined.
A few more tests are updated now that the line number table is always
kept.
Change-Id: Ife6ab0ecbf39a1d410a4785aa77f27349f0da924
diff --git a/d8_r8/main/build.gradle.kts b/d8_r8/main/build.gradle.kts
index 9eaf601..fd3282d 100644
--- a/d8_r8/main/build.gradle.kts
+++ b/d8_r8/main/build.gradle.kts
@@ -223,6 +223,7 @@
}
exclude("META-INF/*.kotlin_module")
exclude("**/*.kotlin_metadata")
+ exclude("keepanno.proto")
destinationDirectory.set(getRoot().resolveAll("build", "libs"))
archiveFileName.set("r8-full-exclude-deps.jar")
}
diff --git a/src/test/java/com/android/tools/r8/debuginfo/NoKeepSourceFileAttributeTest.java b/src/test/java/com/android/tools/r8/debuginfo/NoKeepSourceFileAttributeTest.java
index 98d9629..dcf1db9 100644
--- a/src/test/java/com/android/tools/r8/debuginfo/NoKeepSourceFileAttributeTest.java
+++ b/src/test/java/com/android/tools/r8/debuginfo/NoKeepSourceFileAttributeTest.java
@@ -42,7 +42,11 @@
List<StackTraceLine> stackTraceLines = stacktrace.getStackTraceLines();
assertEquals(1, stackTraceLines.size());
StackTraceLine stackTraceLine = stackTraceLines.get(0);
- assertEquals("SourceFile", stackTraceLine.fileName);
+ if (parameters.getApiLevel().isLessThan(apiLevelWithPcAsLineNumberSupport())) {
+ assertEquals("SourceFile", stackTraceLine.fileName);
+ } else {
+ assertEquals("Unknown Source", stackTraceLine.fileName);
+ }
})
.inspectStackTrace(
stacktrace -> {
diff --git a/src/test/java/com/android/tools/r8/ir/optimize/string/StringBuilderTests.java b/src/test/java/com/android/tools/r8/ir/optimize/string/StringBuilderTests.java
index a78dbbf..04b2b4a 100644
--- a/src/test/java/com/android/tools/r8/ir/optimize/string/StringBuilderTests.java
+++ b/src/test/java/com/android/tools/r8/ir/optimize/string/StringBuilderTests.java
@@ -222,12 +222,8 @@
FoundMethodSubject foundMethodSubject = method.asFoundMethodSubject();
assertEquals(
stringBuilderTest.stringBuilders, countStringBuilderInits(foundMethodSubject));
- if ((parameters.isCfRuntime()
- || parameters
- .getApiLevel()
- .isGreaterThanOrEqualTo(apiLevelWithPcAsLineNumberSupport()))
- && (stringBuilderTest.getMethodName().equals("diamondWithUseTest")
- || stringBuilderTest.getMethodName().equals("intoPhiTest"))) {
+ if (stringBuilderTest.getMethodName().equals("diamondWithUseTest")
+ || stringBuilderTest.getMethodName().equals("intoPhiTest")) {
// We are not doing block suffix optimization in CF and line/pc info prohibits
// sharing.
assertEquals(