Use explicit secondary class loader context in test 727.
Do not rely on the default related to the --secondary
option as it is the wrong default and should be
changed for other tests as they currently reject the
resulting oat file. For example, the test 706 rejects
the 706-checker-scheduler-ex.odex file with
[...] ClassLoaderContext classpath size mismatch.
expected=0, found=1
(PCL[];PCL[<test-path>/706-checker-scheduler.jar*<checksum>] |
PCL[<test-path>/706-checker-scheduler.jar*<checksum>])
The test 727 needs two PCLs for the secondary dex file
both at dex2oat time and at run time and explicitly
constructs the class loader at run time.
Test: testrunner.py --host --optimizing -t 727
Bug: 166088871
Change-Id: I8ba94c2ec9e8ec3a4e5cb293726246050c24c368
diff --git a/test/727-checker-unresolved-class/run b/test/727-checker-unresolved-class/run
index 1c9dd11..d087a8f 100644
--- a/test/727-checker-unresolved-class/run
+++ b/test/727-checker-unresolved-class/run
@@ -17,11 +17,14 @@
if [[ "$TEST_RUNTIME" == "jvm" ]]; then
exec ${RUN} $@
else
+ # Compile the secondary dex file with the right class loader hierarchy with
+ # --secondary-class-loader-context.
# Append graphs for checker tests (we run dex2oat twice) with
# --dump-cfg-append.
# Make some classes unresolved for AOT compilation with
# --updatable-bcp-packages-file.
exec ${RUN} $@ \
+ --secondary-class-loader-context "PCL[];PCL[$DEX_LOCATION/$TEST_NAME.jar]" \
-Xcompiler-option --dump-cfg-append \
-Xcompiler-option --updatable-bcp-packages-file="$DEX_LOCATION/res/updateable.txt"
fi