harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfur...@apache.org
Subject svn commit: r548324 - in /harmony/enhanced/drlvm/trunk/src/test/regression/H2092: ./ Test.java run.test.xml
Date Mon, 18 Jun 2007 11:32:38 GMT
Author: mfursov
Date: Mon Jun 18 04:32:36 2007
New Revision: 548324

URL: http://svn.apache.org/viewvc?view=rev&rev=548324
Log:
HARMONY-2092: fixes for volatile longs handling in Jitrino.OPT and Jitrino.JET jits with regression
test.


Added:
    harmony/enhanced/drlvm/trunk/src/test/regression/H2092/
    harmony/enhanced/drlvm/trunk/src/test/regression/H2092/Test.java
    harmony/enhanced/drlvm/trunk/src/test/regression/H2092/run.test.xml

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H2092/Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H2092/Test.java?view=auto&rev=548324
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H2092/Test.java (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H2092/Test.java Mon Jun 18 04:32:36 2007
@@ -0,0 +1,52 @@
+
+package org.apache.harmony.drlvm.tests.regression.H2092;
+
+import junit.framework.TestCase;
+
+public class Test extends TestCase { 
+
+    static int NTHREADS=10; 
+    static int NSECONDS=10; 
+    static volatile long val=1; 
+    static boolean passed = true; 
+
+
+    public void testMain() { 
+        Worker wks[] = new Worker[NTHREADS]; 
+        for (int i=0;i<NTHREADS;i++) { 
+            wks[i]=new Worker(); 
+            wks[i].start(); 
+        } 
+        try {
+            for (int i=0;i<NTHREADS;i++) { 
+                wks[i].join(); 
+            } 
+        } catch (Exception e) {
+            passed = false;
+        }
+        assertTrue(passed);
+/*        if (failed) { 
+            System.out.println("FAILED"); 
+        } else { 
+            System.out.println("PASSED"); 
+        } 
+*/
+    } 
+
+    static class Worker extends Thread{ 
+        public void run() { 
+            long endTime = System.currentTimeMillis() + NSECONDS*1000L; 
+            while (System.currentTimeMillis()<endTime && passed) { 
+                for (int i=0;i<10000;i++) { 
+                    long v = val; 
+                    val = -v; 
+                    if (v!=1 && v!=-1) { 
+                        System.out.println("v="+v); 
+                        passed = false; 
+                        break; 
+                    } 
+                } 
+            } 
+        } 
+    } 
+}

Added: harmony/enhanced/drlvm/trunk/src/test/regression/H2092/run.test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H2092/run.test.xml?view=auto&rev=548324
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H2092/run.test.xml (added)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H2092/run.test.xml Mon Jun 18 04:32:36
2007
@@ -0,0 +1,14 @@
+<project name="RUN HARMONY-2092 Regression Test">
+    <target name="run-test">
+        <run-junit-test
+            test="org.apache.harmony.drlvm.tests.regression.H2092.Test"
+            vmarg="-Xem:jet">
+        </run-junit-test>
+
+        <run-junit-test
+            test="org.apache.harmony.drlvm.tests.regression.H2092.Test"
+            vmarg="-Xem:opt">
+        </run-junit-test>
+    </target>
+</project>
+



Mime
View raw message