Author: Armin Rigo <[email protected]>
Branch: ppc-updated-backend
Changeset: r80084:b91501e7ca46
Date: 2015-10-09 15:13 +0200
http://bitbucket.org/pypy/pypy/changeset/b91501e7ca46/
Log: More tests
diff --git a/pypy/config/pypyoption.py b/pypy/config/pypyoption.py
--- a/pypy/config/pypyoption.py
+++ b/pypy/config/pypyoption.py
@@ -75,6 +75,11 @@
if "cppyy" in working_modules:
working_modules.remove("cppyy") # depends on ctypes
+if sys.platform.startswith("linux"):
+ _mach = os.popen('uname -m', 'r').read().strip()
+ if _mach.startswith('ppc'):
+ working_modules.remove("_continuation")
+
module_dependencies = {
'_multiprocessing': [('objspace.usemodules.time', True),
diff --git a/rpython/jit/backend/ppc/test/test_exception.py
b/rpython/jit/backend/ppc/test/test_exception.py
new file mode 100644
--- /dev/null
+++ b/rpython/jit/backend/ppc/test/test_exception.py
@@ -0,0 +1,11 @@
+
+import py
+from rpython.jit.backend.ppc.test.support import JitPPCMixin
+from rpython.jit.metainterp.test.test_exception import ExceptionTests
+
+class TestExceptions(JitPPCMixin, ExceptionTests):
+ # for the individual tests see
+ # ====> ../../../metainterp/test/test_exception.py
+
+ def test_bridge_from_interpreter_exc(self):
+ py.test.skip("Widening to trash")
diff --git a/rpython/jit/backend/ppc/test/test_fficall.py
b/rpython/jit/backend/ppc/test/test_fficall.py
new file mode 100644
--- /dev/null
+++ b/rpython/jit/backend/ppc/test/test_fficall.py
@@ -0,0 +1,23 @@
+import py
+from rpython.jit.metainterp.test import test_fficall
+from rpython.jit.backend.ppc.test.support import JitPPCMixin
+
+class TestFfiCall(JitPPCMixin, test_fficall.FfiCallTests):
+ # for the individual tests see
+ # ====> ../../../metainterp/test/test_fficall.py
+
+ def _add_libffi_types_to_ll2types_maybe(self):
+ # this is needed by test_guard_not_forced_fails, because it produces a
+ # loop which reads the value of types.* in a variable, then a guard
+ # fail and we switch to blackhole: the problem is that at this point
+ # the blackhole interp has a real integer, but it needs to convert it
+ # back to a lltype pointer (which is handled by ll2ctypes, deeply in
+ # the logic). The workaround is to teach ll2ctypes in advance which
+ # are the addresses of the various types.* structures.
+ # Try to comment this code out and run the test to see how it fails :)
+ from rpython.rtyper.lltypesystem import rffi, lltype, ll2ctypes
+ from rpython.rlib.jit_libffi import types
+ for key, value in types.__dict__.iteritems():
+ if isinstance(value, lltype._ptr):
+ addr = rffi.cast(lltype.Signed, value)
+ ll2ctypes._int2obj[addr] = value
diff --git a/rpython/jit/backend/ppc/test/test_quasiimmut.py
b/rpython/jit/backend/ppc/test/test_quasiimmut.py
new file mode 100644
--- /dev/null
+++ b/rpython/jit/backend/ppc/test/test_quasiimmut.py
@@ -0,0 +1,9 @@
+
+import py
+from rpython.jit.backend.ppc.test.support import JitPPCMixin
+from rpython.jit.metainterp.test import test_quasiimmut
+
+class TestLoopSpec(JitPPCMixin, test_quasiimmut.QuasiImmutTests):
+ # for the individual tests see
+ # ====> ../../../metainterp/test/test_loop.py
+ pass
diff --git a/rpython/jit/backend/ppc/test/test_rawmem.py
b/rpython/jit/backend/ppc/test/test_rawmem.py
new file mode 100644
--- /dev/null
+++ b/rpython/jit/backend/ppc/test/test_rawmem.py
@@ -0,0 +1,9 @@
+
+from rpython.jit.backend.ppc.test.support import JitPPCMixin
+from rpython.jit.metainterp.test.test_rawmem import RawMemTests
+
+
+class TestRawMem(JitPPCMixin, RawMemTests):
+ # for the individual tests see
+ # ====> ../../../metainterp/test/test_rawmem.py
+ pass
diff --git a/rpython/jit/backend/ppc/test/test_string.py
b/rpython/jit/backend/ppc/test/test_string.py
new file mode 100644
--- /dev/null
+++ b/rpython/jit/backend/ppc/test/test_string.py
@@ -0,0 +1,13 @@
+import py
+from rpython.jit.metainterp.test import test_string
+from rpython.jit.backend.ppc.test.support import JitPPCMixin
+
+class TestString(JitPPCMixin, test_string.TestLLtype):
+ # for the individual tests see
+ # ====> ../../../metainterp/test/test_string.py
+ pass
+
+class TestUnicode(JitPPCMixin, test_string.TestLLtypeUnicode):
+ # for the individual tests see
+ # ====> ../../../metainterp/test/test_string.py
+ pass
diff --git a/rpython/jit/backend/ppc/test/test_virtualizable.py
b/rpython/jit/backend/ppc/test/test_virtualizable.py
new file mode 100644
--- /dev/null
+++ b/rpython/jit/backend/ppc/test/test_virtualizable.py
@@ -0,0 +1,8 @@
+
+import py
+from rpython.jit.metainterp.test.test_virtualizable import
ImplicitVirtualizableTests
+from rpython.jit.backend.ppc.test.support import JitPPCMixin
+
+class TestVirtualizable(JitPPCMixin, ImplicitVirtualizableTests):
+ def test_blackhole_should_not_reenter(self):
+ py.test.skip("Assertion error & llinterp mess")
diff --git a/rpython/jit/backend/ppc/test/test_zrpy_releasegil.py
b/rpython/jit/backend/ppc/test/test_zrpy_releasegil.py
new file mode 100644
--- /dev/null
+++ b/rpython/jit/backend/ppc/test/test_zrpy_releasegil.py
@@ -0,0 +1,5 @@
+from rpython.jit.backend.llsupport.test.zrpy_releasegil_test import
ReleaseGILTests
+
+
+class TestShadowStack(ReleaseGILTests):
+ gcrootfinder = "shadowstack"
diff --git a/rpython/jit/metainterp/test/test_fficall.py
b/rpython/jit/metainterp/test/test_fficall.py
--- a/rpython/jit/metainterp/test/test_fficall.py
+++ b/rpython/jit/metainterp/test/test_fficall.py
@@ -70,6 +70,7 @@
cif_description.exchange_result = (len(avalues)+1) * 16
unroll_avalues = unrolling_iterable(avalues)
+ BIG_ENDIAN = (sys.byteorder == 'big')
def fake_call_impl_any(cif_description, func_addr, exchange_buffer):
ofs = 16
@@ -86,13 +87,19 @@
avalue = intmask(avalue)
assert got == avalue
ofs += 16
+ write_to_ofs = 0
if rvalue is not None:
write_rvalue = rvalue
+ if BIG_ENDIAN:
+ if (lltype.typeOf(write_rvalue) is rffi.SIGNEDCHAR or
+ lltype.typeOf(write_rvalue) is rffi.UCHAR):
+ # 'write_rvalue' is an int type smaller than Signed
+ write_to_ofs = rffi.sizeof(rffi.LONG) - 1
else:
write_rvalue = 12923 # ignored
TYPE = rffi.CArray(lltype.typeOf(write_rvalue))
data = rffi.ptradd(exchange_buffer, ofs)
- rffi.cast(lltype.Ptr(TYPE), data)[0] = write_rvalue
+ rffi.cast(lltype.Ptr(TYPE), data)[write_to_ofs] = write_rvalue
def f(i):
exbuf = lltype.malloc(rffi.CCHARP.TO, (len(avalues)+2) * 16,
@@ -181,7 +188,7 @@
kwds.setdefault('supports_singlefloats', True)
self._run([types.float] * 2, types.double,
[r_singlefloat(10.5), r_singlefloat(31.5)],
- -4.5)
+ -4.5, **kwds)
def test_simple_call_singlefloat(self, **kwds):
kwds.setdefault('supports_singlefloats', True)
diff --git a/rpython/memory/gc/env.py b/rpython/memory/gc/env.py
--- a/rpython/memory/gc/env.py
+++ b/rpython/memory/gc/env.py
@@ -135,7 +135,7 @@
arch = os.uname()[4] # machine
if arch.endswith('86') or arch == 'x86_64':
return get_L2cache_linux2_cpuinfo()
- if arch in ('alpha', 'ppc', 'ppc64'):
+ if arch in ('alpha', 'ppc'):
return get_L2cache_linux2_cpuinfo(label='L2 cache')
if arch == 'ia64':
return get_L2cache_linux2_ia64()
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit