Debian Codegraph @

rpython/rlib/test/test_compilerinfo.py

raw symbols SCIP
1 from rpython.rlib.compilerinfo import get_compiler_info
2 from rpython.translator.c.test.test_genc import compile
3
4
5 def test_untranslated():
6 assert get_compiler_info() == "(untranslated)"
7
8 def fn(index):
9 cc = get_compiler_info()
10 if index < len(cc):
11 return ord(cc[index])
12 return 0
13
14 def test_compiled():
15 fn2 = compile(fn, [int])
16 lst = []
17 index = 0
18 while True:
19 c = fn2(index)
20 if c == 0:
21 break
22 lst.append(chr(c))
23 index += 1
24 s = ''.join(lst)
25 print s
26 assert s.startswith('MSC ') or s.startswith('GCC ')