Author: Armin Rigo <[email protected]>
Branch: stmgc-c7
Changeset: r70189:55b694971c42
Date: 2014-03-23 10:02 +0100
http://bitbucket.org/pypy/pypy/changeset/55b694971c42/
Log: Add a test
diff --git a/rpython/translator/stm/test/test_readbarrier.py
b/rpython/translator/stm/test/test_readbarrier.py
--- a/rpython/translator/stm/test/test_readbarrier.py
+++ b/rpython/translator/stm/test/test_readbarrier.py
@@ -36,3 +36,15 @@
res = self.interpret(f1, [])
assert res == 42
assert self.read_barriers == []
+
+ def test_getarrayitem(self):
+ X = lltype.GcArray(lltype.Signed)
+ x1 = lltype.malloc(X, 5, immortal=True, zero=True)
+ x1[2] = 42
+
+ def f1(n):
+ return x1[n]
+
+ res = self.interpret(f1, [2])
+ assert res == 42
+ assert self.read_barriers == [x1]
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit