[pypy-commit] pypy default: add pow_int test_zjit
bdkearns
noreply at buildbot.pypy.org
Fri Apr 18 07:15:20 CEST 2014
Author: Brian Kearns <bdkearns at gmail.com>
Branch:
Changeset: r70749:d13b267aa161
Date: 2014-04-18 00:58 -0400
http://bitbucket.org/pypy/pypy/changeset/d13b267aa161/
Log: add pow_int test_zjit
diff --git a/pypy/module/micronumpy/test/test_zjit.py b/pypy/module/micronumpy/test/test_zjit.py
--- a/pypy/module/micronumpy/test/test_zjit.py
+++ b/pypy/module/micronumpy/test/test_zjit.py
@@ -144,6 +144,34 @@
'setarrayitem_gc': 3,
})
+ def define_pow_int():
+ return """
+ a = astype(|30|, int)
+ b = astype([2], int)
+ c = a ** b
+ c -> 3
+ """
+
+ def test_pow_int(self):
+ result = self.run("pow_int")
+ assert result == 3 ** 2
+ self.check_trace_count(2) # extra one for the astype
+ del get_stats().loops[0] # we don't care about it
+ self.check_simple_loop({
+ 'call': 1,
+ 'getarrayitem_gc': 3,
+ 'guard_false': 1,
+ 'guard_not_invalidated': 1,
+ 'guard_true': 3,
+ 'int_add': 9,
+ 'int_ge': 1,
+ 'int_lt': 3,
+ 'jump': 1,
+ 'raw_load': 2,
+ 'raw_store': 1,
+ 'setarrayitem_gc': 3,
+ })
+
def define_sum():
return """
a = |30|
More information about the pypy-commit
mailing list