[pypy-svn] r69822 - in pypy/trunk/pypy/jit/backend: test x86 x86/test
arigo at codespeak.net
arigo at codespeak.net
Wed Dec 2 11:32:26 CET 2009
Author: arigo
Date: Wed Dec 2 11:32:25 2009
New Revision: 69822
Modified:
pypy/trunk/pypy/jit/backend/test/support.py
pypy/trunk/pypy/jit/backend/x86/codebuf.py
pypy/trunk/pypy/jit/backend/x86/test/test_ztranslation.py
Log:
Write a test for the fact that the options really
are passed to gcc.
Modified: pypy/trunk/pypy/jit/backend/test/support.py
==============================================================================
--- pypy/trunk/pypy/jit/backend/test/support.py (original)
+++ pypy/trunk/pypy/jit/backend/test/support.py Wed Dec 2 11:32:25 2009
@@ -124,6 +124,7 @@
# XXX patch exceptions
cbuilder = CBuilder(t, entry_point, config=t.config)
cbuilder.generate_source()
+ self._check_cbuilder(cbuilder)
exe_name = cbuilder.compile()
debug_print('---------- Test starting ----------')
stdout = cbuilder.cmdexec(" ".join([str(arg) for arg in args]))
@@ -131,6 +132,9 @@
debug_print('---------- Test done (%d) ----------' % (res,))
return res
+ def _check_cbuilder(self, cbuilder):
+ pass
+
class CliCompiledMixin(BaseCompiledMixin):
type_system = 'ootype'
Modified: pypy/trunk/pypy/jit/backend/x86/codebuf.py
==============================================================================
--- pypy/trunk/pypy/jit/backend/x86/codebuf.py (original)
+++ pypy/trunk/pypy/jit/backend/x86/codebuf.py Wed Dec 2 11:32:25 2009
@@ -148,11 +148,11 @@
# ____________________________________________________________
if sys.platform == 'win32':
- ensure_sse2_floats = lambda self: None
+ ensure_sse2_floats = lambda : None
else:
_sse2_eci = ExternalCompilationInfo(
compile_extra = ['-msse2', '-mfpmath=sse'],
- separate_module_sources = ['void PYPY_NO_OP() {}'],
+ separate_module_sources = ['void PYPY_NO_OP(void) {}'],
)
ensure_sse2_floats = rffi.llexternal('PYPY_NO_OP', [], lltype.Void,
compilation_info=_sse2_eci)
Modified: pypy/trunk/pypy/jit/backend/x86/test/test_ztranslation.py
==============================================================================
--- pypy/trunk/pypy/jit/backend/x86/test/test_ztranslation.py (original)
+++ pypy/trunk/pypy/jit/backend/x86/test/test_ztranslation.py Wed Dec 2 11:32:25 2009
@@ -8,6 +8,12 @@
class TestTranslationX86(CCompiledMixin):
CPUClass = CPU386
+ def _check_cbuilder(self, cbuilder):
+ # We assume here that we have sse2. If not, the CPUClass
+ # needs to be changed to CPU386_NO_SSE2, but well.
+ assert '-msse2' in cbuilder.eci.compile_extra
+ assert '-mfpmath=sse' in cbuilder.eci.compile_extra
+
def test_stuff_translates(self):
# this is a basic test that tries to hit a number of features and their
# translation:
More information about the Pypy-commit
mailing list