<s> import sys <EOL> import py <EOL> from pypy . rpython . lltypesystem import lltype , rffi <EOL> from pypy . rlib import jit <EOL> from pypy . jit . backend . x86 . test . test_zrpy_gc import compile_and_run <EOL> from pypy . jit . metainterp import pyjitpl <EOL> def test_stack_alignment ( ) : <EOL> if sys . platform != '<STR_LIT>' : <EOL> py . test . skip ( "<STR_LIT>" ) <EOL> externs = [ """<STR_LIT>""" ] <EOL> c_source = r"""<STR_LIT>""" <EOL> eci = rffi . ExternalCompilationInfo ( separate_module_sources = [ c_source ] , <EOL> post_include_bits = externs , <EOL> compile_extra = [ "<STR_LIT>" ] ) <EOL> check0 = rffi . llexternal ( '<STR_LIT>' , [ ] , lltype . Void , <EOL> compilation_info = eci , <EOL> _nowrapper = True ) <EOL> check1 = rffi . llexternal ( '<STR_LIT>' , [ lltype . Signed ] , lltype . Void , <EOL> compilation_info = eci , <EOL> _nowrapper = True ) <EOL> check2 = rffi . llexternal ( '<STR_LIT>' , [ lltype . Signed , lltype . Signed ] , <EOL> lltype . Void , <EOL> compilation_info = eci , <EOL> _nowrapper = True ) <EOL> check3 = rffi . llexternal ( '<STR_LIT>' , [ lltype . Signed , lltype . Signed , <EOL> lltype . Signed ] , <EOL> lltype . Void , <EOL> compilation_info = eci , <EOL> _nowrapper = True ) <EOL> myjitdriver = jit . JitDriver ( greens = [ ] , reds = [ '<STR_LIT:n>' ] ) <EOL> def entrypoint ( argv ) : <EOL> myjitdriver . set_param ( '<STR_LIT>' , <NUM_LIT:2> ) <EOL> myjitdriver . set_param ( '<STR_LIT>' , <NUM_LIT:0> ) <EOL> n = <NUM_LIT:16> <EOL> while n > <NUM_LIT:0> : <EOL> myjitdriver . can_enter_jit ( n = n ) <EOL> myjitdriver . jit_merge_point ( n = n ) <EOL> n -= <NUM_LIT:1> <EOL> check0 ( ) <EOL> check1 ( <NUM_LIT:0> ) <EOL> check2 ( <NUM_LIT:0> , <NUM_LIT:1> ) <EOL> check3 ( <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> ) <EOL> return <NUM_LIT:0> <EOL> output = compile_and_run ( entrypoint , '<STR_LIT>' , jit = True ) <EOL> for line in output . splitlines ( ) : <EOL> print line <EOL> assert int ( line . split ( ) [ - <NUM_LIT:1> ] ) == <NUM_LIT:8> </s>
