Home - Summaries: (main) : (py3.11) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

jit/backend/x86/test/test_ztranslation_call_assembler.py::TestTranslationCallAssemblerX86::()::test_direct_assembler_call_translates

self = <rpython.jit.backend.x86.test.test_ztranslation_call_assembler.TestTranslationCallAssemblerX86 object at 0x00007fe710b506b0>

    def test_direct_assembler_call_translates(self):
        """Test CALL_ASSEMBLER and the recursion limit"""
        # - also tests threadlocalref_get
        from rpython.rlib.rstackovf import StackOverflow
    
        class Thing(object):
            def __init__(self, val):
                self.val = val
    
        class Frame(object):
            _virtualizable_ = ['thing']
    
        driver = JitDriver(greens = ['codeno'], reds = ['i', 'frame'],
                           virtualizables = ['frame'],
                           get_printable_location = lambda codeno: str(codeno))
        class SomewhereElse(object):
            pass
    
        somewhere_else = SomewhereElse()
    
        class Foo(object):
            pass
        t = ThreadLocalReference(Foo, loop_invariant=True)
        tf = ThreadLocalField(lltype.Char, "test_call_assembler_")
    
        def change(newthing):
            somewhere_else.frame.thing = newthing
    
        def main(codeno):
            frame = Frame()
            somewhere_else.frame = frame
            frame.thing = Thing(0)
            portal(codeno, frame)
            return frame.thing.val
    
        def portal(codeno, frame):
            i = 0
            while i < 10:
                driver.can_enter_jit(frame=frame, codeno=codeno, i=i)
                driver.jit_merge_point(frame=frame, codeno=codeno, i=i)
                nextval = frame.thing.val
                if codeno == 0:
                    subframe = Frame()
                    subframe.thing = Thing(nextval)
                    nextval = portal(1, subframe)
                elif frame.thing.val > 40:
                    change(Thing(13))
                    nextval = 13
                frame.thing = Thing(nextval + 1)
                i += 1
                if t.get().nine != 9: raise ValueError
                if ord(tf.getraw()) != 0x92: raise ValueError
            return frame.thing.val
    
        driver2 = JitDriver(greens = [], reds = ['n'])
    
        def main2(bound):
            try:
                while portal2(bound) == -bound+1:
                    bound *= 2
            except StackOverflow:
                pass
            return bound
    
        def portal2(n):
            while True:
                driver2.jit_merge_point(n=n)
                n -= 1
                if n <= 0:
                    return n
                n = portal2(n)
        assert portal2(10) == -9
    
        def setup(value):
            foo = Foo()
            foo.nine = value
            t.set(foo)
            tf.setraw("\x92")
            return foo
    
        def mainall(codeno, bound):
            foo = setup(bound + 8)
            result = main(codeno) + main2(bound)
            keepalive_until_here(foo)
            return result
    
        tmp_obj = setup(9)
        expected_1 = main(0)
        res = self.meta_interp(mainall, [0, 1], inline=True,
>                              policy=StopAtXPolicy(change))

jit/backend/llsupport/test/ztranslation_test.py:223: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
jit/backend/test/support.py:75: in meta_interp
    return self._compile_and_run(t, entry_point, entry_point_graph, args)
jit/backend/test/support.py:132: in _compile_and_run
    exe_name = cbuilder.compile()
translator/c/genc.py:341: in compile
    extra_opts)
translator/platform/posix.py:277: in execute_makefile
    self._handle_error(returncode, stdout, stderr, path.join('make'))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Darwin_x86_64 cc=clang>, returncode = 2
stdout = 'clang -O3 -fomit-frame-pointer -Wno-duplicate-decl-specifier -mmacosx-version-min=10.13 -arch x86_64 -mdynamic-no-pic.../rpython"/rlib/rjitlog/src -I"/Users/matti/build-worker-x86_64/rpython-macos-x86-64/build/rpython"/rlib/rvmprof/src \n'
stderr = "testing_1.c:56:2: warning: 'GC_all_interior_pointers' is deprecated [-Wdeprecated-declarations]\n   56 |         GC_a...memcpy;\n       |                  ^ ~~~~~~\n1 error generated.\nmake: *** [rpython_jit_backend_llsupport.o] Error 1\n"
outname = local('/tmp/buildbot-x86_64/usession-pytest3.10-943/testing_1/make')

    def _handle_error(self, returncode, stdout, stderr, outname):
        if returncode != 0:
            errorfile = outname.new(ext='errors')
            errorfile.write(stderr, 'wb')
            if self.log_errors:
                stderrlines = stderr.splitlines()
                for line in stderrlines:
                    log.Error(line)
                # ^^^ don't use ERROR, because it might actually be fine.
                # Also, ERROR confuses lib-python/conftest.py.
>           raise CompilationError(stdout, stderr)
E           CompilationError: CompilationError(err="""
E           	testing_1.c:56:2: warning: 'GC_all_interior_pointers' is deprecated [-Wdeprecated-declarations]
E           	   56 |         GC_all_interior_pointers = 0;
E           	      |         ^
E           	/opt/homebrew_x86_64/Cellar/bdw-gc/8.2.12/include/gc/gc.h:193:8: note: 'GC_all_interior_pointers' has been explicitly marked deprecated here
E           	  193 | GC_API GC_ATTR_DEPRECATED int GC_all_interior_pointers;
E           	      |        ^
E           	/opt/homebrew_x86_64/Cellar/bdw-gc/8.2.12/include/gc/gc_config_macros.h:309:46: note: expanded from macro 'GC_ATTR_DEPRECATED'
E           	  309 | #   define GC_ATTR_DEPRECATED __attribute__((__deprecated__))
E           	      |                                              ^
E           	1 warning generated.
E           	rpython_jit_backend_llsupport.c:15086:11: error: incompatible function pointer types assigning to 'void (*)(void *, void *, size_t)' (aka 'void (*)(void *, void *, unsigned long)') from 'void *(void *, const void *, unsigned long)' [-Wincompatible-function-pointer-types]
E           	 15086 |         l_v15979 = memcpy;
E           	       |                  ^ ~~~~~~
E           	1 error generated.
E           	make: *** [rpython_jit_backend_llsupport.o] Error 1
E           	""")

translator/platform/__init__.py:155: CompilationError
 (somefailed=True in jit/backend/x86/test/test_ztranslation_call_assembler.py)
builder: rpython-macos-x86-64 build #278+
test: jit/backend/x86/test/test_ztranslation_call_assembler.py::TestTranslationCallAssemblerX86::()::test_direct_assembler_call_translates