[pypy-svn] r22459 - pypy/dist/pypy/translator/llvm/test

rxe at codespeak.net rxe at codespeak.net
Thu Jan 19 19:48:16 CET 2006


Author: rxe
Date: Thu Jan 19 19:48:15 2006
New Revision: 22459

Modified:
   pypy/dist/pypy/translator/llvm/test/test_lladdresses.py
Log:
Exploring a bit at how flavoured mallocs could work in llvm with separate
policies - not much success - postponed until sprint.



Modified: pypy/dist/pypy/translator/llvm/test/test_lladdresses.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/test/test_lladdresses.py	(original)
+++ pypy/dist/pypy/translator/llvm/test/test_lladdresses.py	Thu Jan 19 19:48:15 2006
@@ -116,6 +116,20 @@
     fn = compile(f, [int])
     assert fn(1) == 2 
 
+def test_flavored_varmalloc_raw():
+    py.test.skip("flavored_malloc not working?")
+    A = lltype.Array(lltype.Signed)
+    VARS = lltype.GcStruct('test', ('a', lltype.Signed), ('b', A))
+    def f(x, y):
+        #s = lltype.flavored_malloc('gc', VARS, x)
+        s = lltype.malloc(VARS, n=x, flavor='gc')
+        s.a = 42
+        s.b[0] = y * 2
+        return s.b[0] - s.a
+
+    fn = compile(f, [int, int])
+    assert fn(2, 24) == 6
+
 def test_flavored_malloc_alloca():
     class A(object):
         _alloc_flavor_ = "stack"
@@ -128,3 +142,4 @@
         return result
     fn = compile(f, [int])
     assert fn(1) == 2 
+



More information about the Pypy-commit mailing list