Skip to content

Commit

Permalink
Enable lw5 tests
Browse files Browse the repository at this point in the history
Signed-off-by: Theresa Mammarella <[email protected]>
  • Loading branch information
theresa-m committed Jan 31, 2024
1 parent 6209351 commit 5cb9808
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 69 deletions.
10 changes: 5 additions & 5 deletions test/functional/Valhalla/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@
<echo>===destdir: ${DEST}</echo>
<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" encoding="ISO-8859-1">
<src path="${src}"/>
<!-- uncomment when running with the latest Valhalla compiler (currently in lw5 branch but will eventually be merged) -->
<src path="${src_qtypes}"/>
<!-- <src path="${src_lw5}"/> -->
<!-- uncomment when running with the latest Valhalla compiler (currently in lw5 branch but will eventually be merged)-->
<!-- <src path="${src_qtypes}"/> -->
<src path="${src_lw5}"/>
<src path="${transformerListener}" />
<compilerarg line='--add-exports java.base/jdk.internal.misc=ALL-UNNAMED --add-exports java.base/jdk.internal.value=ALL-UNNAMED' />
<compilerarg line='--enable-preview -source 22'/>
<!-- uncomment when running with lw5 -->
<!--<compilerarg line='-XDenableNullRestrictedTypes' />-->
<compilerarg line='-XDenableNullRestrictedTypes' />
<!-- Also remove this line when running lw5 -->
<compilerarg line='-source 22 -XDenablePrimitiveClasses' />
<!--<compilerarg line='-source 22 -XDenablePrimitiveClasses' />-->
<classpath>
<pathelement location="${LIB_DIR}/testng.jar"/>
<pathelement location="${LIB_DIR}/jcommander.jar"/>
Expand Down
36 changes: 0 additions & 36 deletions test/functional/Valhalla/playlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@
<versions>
<version>Valhalla</version>
</versions>
<impls>
<impl>openj9</impl>
<impl>ibm</impl>
</impls>
</test>
<test>
<testCaseName>ValueTypeTestsJIT</testCaseName>
Expand Down Expand Up @@ -90,10 +86,6 @@
<versions>
<version>Valhalla</version>
</versions>
<impls>
<impl>openj9</impl>
<impl>ibm</impl>
</impls>
</test>
<test>
<testCaseName>ValueTypeArrayTests</testCaseName>
Expand Down Expand Up @@ -127,10 +119,6 @@
<versions>
<version>Valhalla</version>
</versions>
<impls>
<impl>openj9</impl>
<impl>ibm</impl>
</impls>
</test>
<test>
<testCaseName>ValueTypeArrayTestsJIT</testCaseName>
Expand Down Expand Up @@ -174,10 +162,6 @@
<versions>
<version>Valhalla</version>
</versions>
<impls>
<impl>openj9</impl>
<impl>ibm</impl>
</impls>
</test>
<test>
<testCaseName>ValueTypeUnsafeTests</testCaseName>
Expand Down Expand Up @@ -205,10 +189,6 @@
<versions>
<version>Valhalla</version>
</versions>
<impls>
<impl>openj9</impl>
<impl>ibm</impl>
</impls>
</test>
<test>
<testCaseName>ValueTypeOptTests</testCaseName>
Expand Down Expand Up @@ -246,10 +226,6 @@
<versions>
<version>Valhalla</version>
</versions>
<impls>
<impl>openj9</impl>
<impl>ibm</impl>
</impls>
</test>
<test>
<testCaseName>NullRestrictedTypeOptTests</testCaseName>
Expand Down Expand Up @@ -289,10 +265,6 @@
<versions>
<version>Valhalla</version>
</versions>
<impls>
<impl>openj9</impl>
<impl>ibm</impl>
</impls>
</test>
<test>
<testCaseName>ValhallaAttributeTests</testCaseName>
Expand Down Expand Up @@ -321,10 +293,6 @@
<versions>
<version>Valhalla</version>
</versions>
<impls>
<impl>openj9</impl>
<impl>ibm</impl>
</impls>
</test>
<test>
<testCaseName>ValueTypeSystemArraycopyTests</testCaseName>
Expand Down Expand Up @@ -371,9 +339,5 @@
<versions>
<version>Valhalla</version>
</versions>
<impls>
<impl>openj9</impl>
<impl>ibm</impl>
</impls>
</test>
</playlist>
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,10 @@ static public void testCheckCastRefClassOnNull() throws Throwable {
}

static void checkObject(Object ...objects) throws Throwable {
com.ibm.jvm.Dump.SystemDump();
// Access this method reflectively because I'm using OpenJDK to compile with thw lw5 javac
//com.ibm.jvm.Dump.SystemDump();
Class<?> c = Class.forName("com.ibm.jvm.Dump");
java.lang.reflect.Method m = c.getMethod("SystemDump");
m.invoke(null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex
<input>!stackslots $mainThreadId$</input>
<input>quit</input>
</command>
<output regex="no" type="success" showMatch="yes">I-Slot: a0[0x</output>
<saveoutput regex="no" type="required" saveName="objectAddr" splitIndex="1" splitBy="= " showMatch="yes">I-Slot: a0[0x</saveoutput>
<!-- this regex is a hack until reflection for ValueTypeTests.checkObject is no longer needed -->
<output regex="yes" javaUtilPattern="yes" type="success" showMatch="yes">checkObject.*\n.*\n.*\n.*\n.*</output>
<!-- navigate to I-Slot: a0[0x] = <address> after call to ValueTypeTests.checkObject -->
<saveoutput regex="yes" javaUtilPattern="yes" type="required" saveName="objectAddr" splitIndex="93" splitBy="= " showMatch="yes">checkObject.*\n.*\n.*\n.*\n.*</saveoutput>
<!--<output regex="no" type="success" showMatch="yes">I-Slot: a0[0x</output>
<saveoutput regex="no" type="required" saveName="objectAddr" splitIndex="1" splitBy="= " showMatch="yes">I-Slot: a0[0x</saveoutput>-->
<output regex="no" type="failure">Problem running command</output>
</test>

Expand Down Expand Up @@ -103,8 +107,7 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex
<input>!flatobject $flatSingleBackfillInstance$</input>
<input>quit</input>
</command>
<!-- TODO change to J l = 0xFAFBFCFD11223344 for lw5-->
<output regex="no" type="success" showMatch="yes">J j = 0xFAFBFCFD11223344</output>
<output regex="no" type="success" showMatch="yes">J l = 0xFAFBFCFD11223344</output>
<output regex="no" type="success" showMatch="yes">I i = 0x12123434</output>
<output regex="no" type="success" showMatch="yes">i (offset = 0) (ValueInt)</output>
<output regex="no" type="success" showMatch="yes">// FlatSingleBackfill</output>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@
<input>!stackslots $mainThreadId$</input>
<input>quit</input>
</command>
<output regex="no" type="success" showMatch="yes">I-Slot: a0[0x</output>
<saveoutput regex="no" type="required" saveName="objectAddr" splitIndex="1" splitBy="= " showMatch="yes">I-Slot: a0[0x</saveoutput>
<!-- this regex is a hack until reflection for ValueTypeTests.checkObject is no longer needed -->
<output regex="yes" javaUtilPattern="yes" type="success" showMatch="yes">checkObject.*\n.*\n.*\n.*\n.*</output>
<!-- navigate to I-Slot: a0[0x] = <address> after call to ValueTypeTests.checkObject -->
<saveoutput regex="yes" javaUtilPattern="yes" type="required" saveName="objectAddr" splitIndex="93" splitBy="= " showMatch="yes">checkObject.*\n.*\n.*\n.*\n.*</saveoutput>
<!--<output regex="no" type="success" showMatch="yes">I-Slot: a0[0x</output>
<saveoutput regex="no" type="required" saveName="objectAddr" splitIndex="1" splitBy="= " showMatch="yes">I-Slot: a0[0x</saveoutput>-->
<output regex="no" type="failure">Problem running command</output>
</test>

Expand Down Expand Up @@ -190,8 +194,13 @@
<input>!stackslots $mainThreadId$</input>
<input>quit</input>
</command>
<output regex="no" type="success" showMatch="yes">I-Slot: a0[0x</output>
<saveoutput regex="no" type="required" saveName="objectAddr" splitIndex="1" splitBy="= " showMatch="yes">I-Slot: a0[0x</saveoutput>

<!-- this regex is a hack until reflection for ValueTypeTests.checkObject is no longer needed -->
<output regex="yes" javaUtilPattern="yes" type="success" showMatch="yes">checkObject.*\n.*\n.*\n.*\n.*</output>
<!-- navigate to I-Slot: a0[0x] = <address> after call to ValueTypeTests.checkObject -->
<saveoutput regex="yes" javaUtilPattern="yes" type="required" saveName="objectAddr" splitIndex="93" splitBy="= " showMatch="yes">checkObject.*\n.*\n.*\n.*\n.*</saveoutput>
<!--<output regex="no" type="success" showMatch="yes">I-Slot: a0[0x</output>
<saveoutput regex="no" type="required" saveName="objectAddr" splitIndex="1" splitBy="= " showMatch="yes">I-Slot: a0[0x</saveoutput>-->
<output regex="no" type="failure">Problem running command</output>
</test>

Expand Down
18 changes: 1 addition & 17 deletions test/functional/cmdLineTests/valuetypeddrtests/playlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex
-DVALUETYPEJAR=$(Q)$(JVM_TEST_ROOT)$(D)functional$(D)Valhalla$(D)ValhallaTests.jar$(Q) \
-DCPDL=$(Q)$(P)$(Q) \
-jar $(CMDLINETESTER_JAR) \
-config $(Q)$(TEST_RESROOT)$(D)flattenedvaluetypeddrtests.xml$(Q) \
-config $(Q)$(TEST_RESROOT)$(D)flattenedvaluetypeddrtests_lw5.xml$(Q) \
-outputLimit 1000 -explainExcludes -nonZeroExitWhenError; \
${TEST_STATUS}
</command>
Expand All @@ -56,10 +56,6 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex
<versions>
<version>Valhalla</version>
</versions>
<impls>
<impl>openj9</impl>
<impl>ibm</impl>
</impls>
</test>
<test>
<testCaseName>cmdLineTester_unflattenedvaluetypeddrtests</testCaseName>
Expand Down Expand Up @@ -95,10 +91,6 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex
<versions>
<version>Valhalla</version>
</versions>
<impls>
<impl>openj9</impl>
<impl>ibm</impl>
</impls>
</test>
<test>
<testCaseName>cmdLineTester_flattened32bitRefBackfillTest</testCaseName>
Expand Down Expand Up @@ -135,10 +127,6 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex
<versions>
<version>Valhalla</version>
</versions>
<impls>
<impl>openj9</impl>
<impl>ibm</impl>
</impls>
</test>
<test>
<testCaseName>cmdLineTester_flattened32bitRefBackfillTestJIT</testCaseName>
Expand Down Expand Up @@ -175,9 +163,5 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex
<versions>
<version>Valhalla</version>
</versions>
<impls>
<impl>openj9</impl>
<impl>ibm</impl>
</impls>
</test>
</playlist>
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@
<input>!stackslots $mainThreadId$</input>
<input>quit</input>
</command>
<output regex="no" type="success" showMatch="yes">I-Slot: a0[0x</output>
<saveoutput regex="no" type="required" saveName="objectAddr" splitIndex="1" splitBy="= " showMatch="yes">I-Slot: a0[0x</saveoutput>
<!-- this regex is a hack until reflection for ValueTypeTests.checkObject is no longer needed -->
<output regex="yes" javaUtilPattern="yes" type="success" showMatch="yes">checkObject.*\n.*\n.*\n.*\n.*</output>
<!-- navigate to I-Slot: a0[0x] = <address> after call to ValueTypeTests.checkObject -->
<saveoutput regex="yes" javaUtilPattern="yes" type="required" saveName="objectAddr" splitIndex="93" splitBy="= " showMatch="yes">checkObject.*\n.*\n.*\n.*\n.*</saveoutput>
<!--<output regex="no" type="success" showMatch="yes">I-Slot: a0[0x</output>
<saveoutput regex="no" type="required" saveName="objectAddr" splitIndex="1" splitBy="= " showMatch="yes">I-Slot: a0[0x</saveoutput>-->
<output regex="no" type="failure">Problem running command</output>
</test>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ public void xmlStartElement(String elementName, Hashtable attributes) {
if (hasAllowedPlatform((String)attributes.get("platforms"))) {
String regex = (String)attributes.get("regex");
String javaUtilPattern = "no";
if (null != attributes.get("javaUtilPattern")) {
javaUtilPattern = (String)attributes.get("javaUtilPattern");
}
String showRegexMatch = "no";
if (null != attributes.get("showMatch")) {
showRegexMatch = (String)attributes.get("showMatch");
Expand Down

0 comments on commit 5cb9808

Please sign in to comment.