Commits

Konstantin Lopuhin  committed bf34393

add test program, ignore more lib-python startup stuff

  • Participants
  • Parent commits a4a0613
  • Branches bridge-logging

Comments (0)

Files changed (2)

File pypy/tool/jitlogparser/test/test_parser.py

         env={'PYPYLOG': 'jit-log-opt,jit-backend:%s' % log_filename})
     log, loops = import_log(log_filename)
     parse_log_counts(extract_category(log, 'jit-backend-count'), loops)
+    lib_re = re.compile("file '.*lib-python.*'")
     for loop in loops:
         loop.force_asm()
-        if re.search("file '.*lib-python.*'", loop.comment):
+        if lib_re.search(loop.comment) or \
+                lib_re.search(loop.operations[0].repr()):
             # do not care for _optimize_charset or _mk_bitmap
             continue
         else:

File pypy/tool/jitlogparser/test/y.py

+
+def fn_with_bridges(N):
+    result = 0
+    for x in xrange(N):
+        if x % 3 == 0:
+            result += 5
+        elif x % 5 == 0:
+            result += 3
+        elif is_prime(x):
+            result += x
+        elif x == 99:
+            result *= 2
+    return result
+
+
+def is_prime(x):
+    for y in xrange(2, x):
+        if x % y == 0:
+            return False
+    return True
+
+
+fn_with_bridges(10000)
+