[pypy-svn] r15918 - in pypy/dist/pypy/translator/llvm2: module test

ericvrp at codespeak.net ericvrp at codespeak.net
Wed Aug 10 16:25:51 CEST 2005


Author: ericvrp
Date: Wed Aug 10 16:25:50 2005
New Revision: 15918

Modified:
   pypy/dist/pypy/translator/llvm2/module/support.py
   pypy/dist/pypy/translator/llvm2/test/test_exception.py
Log:
fixed int_neg_ovf and int_abs_ovf


Modified: pypy/dist/pypy/translator/llvm2/module/support.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/module/support.py	(original)
+++ pypy/dist/pypy/translator/llvm2/module/support.py	Wed Aug 10 16:25:50 2005
@@ -98,13 +98,8 @@
 
 
 int_ovf_test = """
-    ;integer overflow test
-    %cond2 = setge int %x, 0
-    br bool %cond2, label %return_block, label %block2
-block2:
-    %xneg = sub int 0, %x
-    %cond3 = setne int %x, %xneg
-    br bool %cond3, label %return_block, label %ovf
+    %cond2 = setne int %x, -2147483648  ;-sys.maxint-1
+    br bool %cond2, label %return_block, label %ovf
 ovf:
     call fastcc void %__prepare_OverflowError()
     unwind
@@ -131,7 +126,7 @@
     %%x2 = sub int 0, %%x
     %(int_ovf_test)s
 return_block:
-    %%result = phi int [%%x, %%block0], [%%x2, %%block1], [%%x2, %%block2]
+    %%result = phi int [%%x, %%block0], [%%x2, %%block1]
     ret int %%result
 }
 """ % locals())

Modified: pypy/dist/pypy/translator/llvm2/test/test_exception.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/test/test_exception.py	(original)
+++ pypy/dist/pypy/translator/llvm2/test/test_exception.py	Wed Aug 10 16:25:50 2005
@@ -139,7 +139,6 @@
         assert f(i) == zerodivrem_uint(i)
 
 def test_neg_int_ovf():
-    py.test.skip("test failing probably because llvm things x != -x is always true")    
     def neg_int_ovf(n):
         try:
             r=ovfcheck(-n)
@@ -151,7 +150,6 @@
         assert f(i) == neg_int_ovf(i)
 
 def test_abs_int_ovf():
-    py.test.skip("test failing probably because llvm things x != -x is always true")    
     def abs_int_ovf(n):
         try:
             r=ovfcheck(abs(n))



More information about the Pypy-commit mailing list