Signed-off-by: Vegard Nossum <[email protected]>
---
Makefile | 1 +
regression/jvm/GetstaticPatchingTest.java | 33 +++++++++++++++++++++++++++++
regression/run-suite.sh | 1 +
3 files changed, 35 insertions(+), 0 deletions(-)
create mode 100644 regression/jvm/GetstaticPatchingTest.java
diff --git a/Makefile b/Makefile
index 70ea284..a95dc29 100644
--- a/Makefile
+++ b/Makefile
@@ -208,6 +208,7 @@ REGRESSION_TEST_SUITE_CLASSES = \
regression/jvm/ArrayTest.class \
regression/jvm/ArrayMemberTest.class \
regression/jvm/BranchTest.class \
+ regression/jvm/GetstaticPatchingTest.class \
regression/jvm/ObjectArrayTest.class \
regression/jvm/ExitStatusIsOneTest.class \
regression/jvm/ExitStatusIsZeroTest.class \
diff --git a/regression/jvm/GetstaticPatchingTest.java
b/regression/jvm/GetstaticPatchingTest.java
new file mode 100644
index 0000000..107a58c
--- /dev/null
+++ b/regression/jvm/GetstaticPatchingTest.java
@@ -0,0 +1,33 @@
+package jvm;
+
+public class GetstaticPatchingTest extends TestCase {
+ static boolean clinit_run = false;
+
+ private static class X {
+ static int x;
+ static int y;
+
+ static {
+ x = 1;
+ y = 2;
+ clinit_run = true;
+ }
+ }
+
+ public static void main(String[] args) {
+ int i;
+
+ assertFalse(clinit_run);
+ /* Should trap, therefore clinit_run becomes true */
+ i = X.x;
+ assertTrue(clinit_run);
+
+ clinit_run = false;
+ /* Should not trap, therefore clinit_run remains false */
+ i = X.x;
+ i = X.y;
+ assertFalse(clinit_run);
+
+ exit();
+ }
+}
diff --git a/regression/run-suite.sh b/regression/run-suite.sh
index 7dfdc9e..3570c2c 100755
--- a/regression/run-suite.sh
+++ b/regression/run-suite.sh
@@ -57,6 +57,7 @@ if [ -z "$CLASS_LIST" ]; then
run_java jvm.ObjectArrayTest 0
run_java jvm.ExitStatusIsZeroTest 0
run_java jvm.ExitStatusIsOneTest 1
+ run_java jvm.GetstaticPatchingTest 0
run_java jvm.LoadConstantsTest 0
run_java jvm.IntegerArithmeticTest 0
run_java jvm.LongArithmeticTest 0
--
1.6.0.4
------------------------------------------------------------------------------
_______________________________________________
Jatovm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jatovm-devel