aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-06-29 10:28:15 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-03 15:31:04 -0700
commitfd7ca56909bf7a8816af5aaab50ccd9d9bf31280 (patch)
treea58903bf80961d90bfe1bbe087be65ed50bf363e
parent7596d284a0fd54be6ed9661d377dd7903a27f072 (diff)
finish function table merging and enable testing
-rw-r--r--emlink.py3
-rwxr-xr-xtests/runner.py4
2 files changed, 3 insertions, 4 deletions
diff --git a/emlink.py b/emlink.py
index de06e9d4..b73a24a6 100644
--- a/emlink.py
+++ b/emlink.py
@@ -45,6 +45,8 @@ print 'Main module:', main
print 'Side module:', side
print 'Output:', out
+shared.try_delete(out)
+
class AsmModule():
def __init__(self, filename):
self.filename = filename
@@ -165,6 +167,7 @@ class AsmModule():
def update_fts(what):
def fix(m):
table = 'FUNCTION_TABLE_' + m.group(1)
+ if table not in f_sizes: return m.group(0) # table was not modified
contents = m.group(2)
assert '[' not in contents # TODO handle nesting
return '%s[%s&%d]' % (table, contents, f_sizes[table]-1)
diff --git a/tests/runner.py b/tests/runner.py
index 580f29ab..dbf30239 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -10610,8 +10610,6 @@ f.close()
assert not os.path.exists('a.out') and not os.path.exists('a.exe'), 'Must not leave unneeded linker stubs'
def test_static_link(self):
- print
-
def test(name, header, main, side, expected, first=True):
print name
#t = main ; main = side ; side = t
@@ -10685,8 +10683,6 @@ f.close()
static Class c("side");
''', ['new main\nnew side\n', 'new side\nnew main\n'])
- return # TODO the rest
-
# Class code used across modules
test('codecall', r'''
#include <stdio.h>