Author: Armin Rigo <[email protected]>
Branch: stm-thread-2
Changeset: r57084:c69c9b72c470
Date: 2012-09-02 17:12 +0200
http://bitbucket.org/pypy/pypy/changeset/c69c9b72c470/

Log:    For completeness, a test for 'P=W' in addition to 'W=P'.

diff --git a/pypy/translator/stm/test/test_transform2.py 
b/pypy/translator/stm/test/test_transform2.py
--- a/pypy/translator/stm/test/test_transform2.py
+++ b/pypy/translator/stm/test/test_transform2.py
@@ -262,6 +262,20 @@
         assert res == 1
         assert self.barriers == ['P2W', '=']
 
+    def test_pointer_compare_3(self):
+        X = lltype.GcStruct('X', ('foo', lltype.Signed))
+        def f1(x, y):
+            y.foo = 41
+            return x != y
+        x = lltype.malloc(X, immortal=True)
+        y = lltype.malloc(X, immortal=True)
+        res = self.interpret(f1, [x, y])
+        assert res == 1
+        assert self.barriers == ['P2W', '=']
+        res = self.interpret(f1, [x, x])
+        assert res == 0
+        assert self.barriers == ['P2W', '=']
+
     def test_pointer_compare_4(self):
         X = lltype.GcStruct('X', ('foo', lltype.Signed))
         def f1(x, y):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to