diff options
-rw-r--r-- | src/library.js | 2 | ||||
-rwxr-xr-x | tests/runner.py | 20 |
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 |