diff options
-rwxr-xr-x | emcc | 2 | ||||
-rw-r--r-- | system/lib/libcxxabi/symbols | 1 | ||||
-rwxr-xr-x | tests/runner.py | 17 |
3 files changed, 19 insertions, 1 deletions
@@ -1036,7 +1036,7 @@ try: def create_libcxxabi(): if DEBUG: print >> sys.stderr, 'emcc: building libcxxabi for cache' os = [] - for src in ['private_typeinfo.cpp']: + for src in ['private_typeinfo.cpp', 'typeinfo.cpp']: o = in_temp(src + '.o') execute([shared.PYTHON, shared.EMXX, shared.path_from_root('system', 'lib', 'libcxxabi', 'src', src), '-o', o], stdout=stdout, stderr=stderr) os.append(o) diff --git a/system/lib/libcxxabi/symbols b/system/lib/libcxxabi/symbols index 8ef205ba..cc22a81b 100644 --- a/system/lib/libcxxabi/symbols +++ b/system/lib/libcxxabi/symbols @@ -10,3 +10,4 @@ D _ZTVN10__cxxabiv121__vmi_class_type_infoE D _ZTVN10__cxxabiv123__fundamental_type_infoE D _ZTVN10__cxxabiv129__pointer_to_member_type_infoE + D _ZTSSt9type_info diff --git a/tests/runner.py b/tests/runner.py index 89bc3d32..4c42bb6e 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -2845,6 +2845,23 @@ Exiting setjmp function, level: 0, prev_jmp: -1 ''' self.do_run(src, 'a1: 0\na2: 0\na3: 1\nb1: 0\nb2: 1\nb3: 1\nc1: 1\nc2: 1\nc3: 1\n') + def test_dynamic_cast_2(self): + if self.emcc_args is None: return self.skip('need libcxxabi') + + src = r''' + #include <stdio.h> + #include <typeinfo> + + class Class {}; + + int main() { + const Class* dp = dynamic_cast<const Class*>(&typeid(Class)); + // should return dp == NULL, + printf("pointer: %p\n", dp); + } + ''' + self.do_run(src, "pointer: (nil)") + def test_funcptr(self): src = ''' #include <stdio.h> |