aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-06-13 21:32:28 -0400
committerAlon Zakai <alonzakai@gmail.com>2013-06-13 21:32:28 -0400
commit1a3cb10ca12c7fdfbea1fa3bd253ed46cf7a02ce (patch)
tree1ffa9cc90b4056772dff1fdcd69f298413433c5e /tests
parent886e3158cf5d95a2c2721e5eb9a1c3ac4461f805 (diff)
do not eliminate dead code in EXPORT_ALL
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runner.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 5e101024..73dbab13 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -10496,6 +10496,24 @@ f.close()
self.assertContained('result: 1', run_js(os.path.join(self.get_dir(), 'a.out.js')))
+ def test_export_all(self):
+ lib = r'''
+ #include <stdio.h>
+ void libf1() { printf("libf1\n"); }
+ void libf2() { printf("libf2\n"); }
+ '''
+ lib_name = os.path.join(self.get_dir(), 'lib.c')
+ open(lib_name, 'w').write(lib)
+
+ open('main.js', 'w').write('''
+ _libf1();
+ _libf2();
+ ''')
+
+ Building.emcc(lib_name, ['-s', 'EXPORT_ALL=1', '--post-js', 'main.js'], output_filename='a.out.js')
+
+ self.assertContained('libf1\nlibf2\n', run_js(os.path.join(self.get_dir(), 'a.out.js')))
+
def test_abspaths(self):
# Includes with absolute paths are generally dangerous, things like -I/usr/.. will get to system local headers, not our portable ones.