[pypy-commit] pypy default: Add a test (it was already passing, thanks to optimizeopt).
arigo
noreply at buildbot.pypy.org
Thu Jul 28 18:00:22 CEST 2011
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r46045:7f452cc5f50d
Date: 2011-07-28 11:28 +0200
http://bitbucket.org/pypy/pypy/changeset/7f452cc5f50d/
Log: Add a test (it was already passing, thanks to optimizeopt).
diff --git a/pypy/jit/metainterp/test/test_string.py b/pypy/jit/metainterp/test/test_string.py
--- a/pypy/jit/metainterp/test/test_string.py
+++ b/pypy/jit/metainterp/test/test_string.py
@@ -358,3 +358,22 @@
self.check_loops(call=3, # str(), _str(), escape()
newunicode=1, unicodegetitem=0,
unicodesetitem=1, copyunicodecontent=1)
+
+ def test_str2unicode_fold(self):
+ _str = self._str
+ jitdriver = JitDriver(greens = ['g'], reds = ['m'])
+ @dont_look_inside
+ def escape(x):
+ print str(x)
+ def f(g, m):
+ g = str(g)
+ while m >= 0:
+ jitdriver.can_enter_jit(g=g, m=m)
+ jitdriver.jit_merge_point(g=g, m=m)
+ escape(_str(g))
+ m -= 1
+ return 42
+ self.meta_interp(f, [6, 7])
+ self.check_loops(call_pure=0, call=1,
+ newunicode=0, unicodegetitem=0,
+ unicodesetitem=0, copyunicodecontent=0)
More information about the pypy-commit
mailing list