[pypy-svn] commit/pypy: arigo: This test got the answer small enough by chance, because the

Bitbucket commits-noreply at bitbucket.org
Sun Dec 19 13:09:45 CET 2010


1 new changeset in pypy:

http://bitbucket.org/pypy/pypy/changeset/658d0b72a42f/
changeset:   r40127:658d0b72a42f
user:        arigo
date:        2010-12-19 13:09:34
summary:     This test got the answer small enough by chance, because the
parameters were such that no bridge would be generated from the
loop, but only from the entry bridge.  Multiplying the number of
iterations through the loop by 10, we actually get the answer
"5", which is ok too.  Added a comment about why it is ok too.
affected #:  1 file (173 bytes)

--- a/pypy/jit/backend/x86/test/test_ztranslation.py	Sun Dec 19 12:37:38 2010 +0100
+++ b/pypy/jit/backend/x86/test/test_ztranslation.py	Sun Dec 19 13:09:34 2010 +0100
@@ -189,14 +189,14 @@
 
         @dont_look_inside
         def f(x, total):
-            if x <= 3:
+            if x <= 30:
                 raise ImDone(total * 10)
-            if x > 20:
+            if x > 200:
                 return 2
             raise ValueError
         @dont_look_inside
         def g(x):
-            if x > 15:
+            if x > 150:
                 raise ValueError
             return 2
         class Base:
@@ -207,7 +207,7 @@
                 return 1
         @dont_look_inside
         def h(x):
-            if x < 2000:
+            if x < 20000:
                 return Sub()
             else:
                 return Base()
@@ -238,8 +238,8 @@
         logfile = udir.join('test_ztranslation.log')
         os.environ['PYPYLOG'] = 'jit-log-opt:%s' % (logfile,)
         try:
-            res = self.meta_interp(main, [40])
-            assert res == main(40)
+            res = self.meta_interp(main, [400])
+            assert res == main(400)
         finally:
             del os.environ['PYPYLOG']
 
@@ -248,5 +248,7 @@
             if 'guard_class' in line:
                 guard_class += 1
         # if we get many more guard_classes, it means that we generate
-        # guards that always fail
-        assert 0 < guard_class <= 4
+        # guards that always fail (the following assert's original purpose
+        # is to catch the following case: each GUARD_CLASS is misgenerated
+        # and always fails with "gcremovetypeptr")
+        assert 0 < guard_class < 10

Repository URL: https://bitbucket.org/pypy/pypy/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the Pypy-commit mailing list