Signed-off-by: Vegard Nossum <vegard.nos...@gmail.com>
---
 Makefile                                  |    1 +
 regression/jvm/PutstaticPatchingTest.java |   33 +++++++++++++++++++++++++++++
 regression/run-suite.sh                   |    1 +
 3 files changed, 35 insertions(+), 0 deletions(-)
 create mode 100644 regression/jvm/PutstaticPatchingTest.java

diff --git a/Makefile b/Makefile
index a95dc29..43d907c 100644
--- a/Makefile
+++ b/Makefile
@@ -209,6 +209,7 @@ REGRESSION_TEST_SUITE_CLASSES = \
        regression/jvm/ArrayMemberTest.class \
        regression/jvm/BranchTest.class \
        regression/jvm/GetstaticPatchingTest.class \
+       regression/jvm/PutstaticPatchingTest.class \
        regression/jvm/ObjectArrayTest.class \
        regression/jvm/ExitStatusIsOneTest.class \
        regression/jvm/ExitStatusIsZeroTest.class \
diff --git a/regression/jvm/PutstaticPatchingTest.java 
b/regression/jvm/PutstaticPatchingTest.java
new file mode 100644
index 0000000..04145a2
--- /dev/null
+++ b/regression/jvm/PutstaticPatchingTest.java
@@ -0,0 +1,33 @@
+package jvm;
+
+public class PutstaticPatchingTest 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 = 0;
+
+        assertFalse(clinit_run);
+        /* Should trap, therefore clinit_run becomes true */
+        X.x = i;
+        assertTrue(clinit_run);
+
+        clinit_run = false;
+        /* Should not trap, therefore clinit_run remains false */
+        X.x = i;
+        X.y = i;
+        assertFalse(clinit_run);
+
+        exit();
+    }
+}
diff --git a/regression/run-suite.sh b/regression/run-suite.sh
index 3570c2c..3ec6fff 100755
--- a/regression/run-suite.sh
+++ b/regression/run-suite.sh
@@ -58,6 +58,7 @@ if [ -z "$CLASS_LIST" ]; then
     run_java jvm.ExitStatusIsZeroTest 0
     run_java jvm.ExitStatusIsOneTest 1
     run_java jvm.GetstaticPatchingTest 0
+    run_java jvm.PutstaticPatchingTest 0
     run_java jvm.LoadConstantsTest 0
     run_java jvm.IntegerArithmeticTest 0
     run_java jvm.LongArithmeticTest 0
-- 
1.6.0.4


------------------------------------------------------------------------------
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to