aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-05-14 11:02:20 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-05-14 11:02:20 -0700
commite1ea1076ab66da581dc9472df232984d8f230f28 (patch)
tree60a46aa96581386a2ac62bfd1d05363c09c05717
parentdb3a765a9050790228f7ef8bec7779681dacb601 (diff)
do not fail on -fcatch-undefined-behavior
-rw-r--r--src/library.js2
-rwxr-xr-xtests/runner.py20
2 files changed, 22 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js
index 7e39bdca..57b204e1 100644
--- a/src/library.js
+++ b/src/library.js
@@ -4806,6 +4806,8 @@ LibraryManager.library = {
llvm_invariant_start: function() {},
llvm_invariant_end: function() {},
+ llvm_objectsize_i32: function() { return -1 }, // TODO: support this
+
// ==========================================================================
// math.h
// ==========================================================================
diff --git a/tests/runner.py b/tests/runner.py
index d25bd2d3..126be5aa 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -6419,6 +6419,26 @@ f.close()
# TODO: test normal project linking, static and dynamic: get_library should not need to be told what to link!
# TODO: deprecate llvm optimizations, dlmalloc, etc. in emscripten.py.
+ def test_catch_undef(self):
+ open(os.path.join(self.get_dir(), 'test.cpp'), 'w').write(r'''
+ #include <vector>
+ #include <stdio.h>
+
+ class Test {
+ public:
+ std::vector<int> vector;
+ };
+
+ Test globalInstance;
+
+ int main() {
+ printf("hello, world!\n");
+ return 1;
+ }
+ ''')
+ Popen(['python', EMCC, os.path.join(self.get_dir(), 'test.cpp'), '-fcatch-undefined-behavior']).communicate()
+ self.assertContained('hello, world!', run_js(os.path.join(self.get_dir(), 'a.out.js')))
+
def test_l_link(self):
# Linking with -lLIBNAME and -L/DIRNAME should work