@needs_dlfcn
@no_fastcomp('https://github.com/emscripten-core/emscripten/issues/8376')
def test_dylink_rtti(self):
    header = '\n    #include <cstddef>\n\n    class Foo {\n    public:\n      virtual ~Foo() {}\n    };\n\n    class Bar : public Foo {\n    public:\n      virtual ~Bar() {}\n    };\n\n    bool is_bar(Foo* foo);\n    '
    main = '\n    #include <stdio.h>\n    #include "header.h"\n\n    int main() {\n      Bar bar;\n      if (!is_bar(&bar)) {\n        puts("failure");\n        return 1;\n      }\n      puts("success");\n      return 0;\n    }\n    '
    side = '\n    #include "header.h"\n\n    bool is_bar(Foo* foo) {\n      return dynamic_cast<Bar*>(foo) != nullptr;\n    }\n    '
    self.dylink_test(main=main, side=side, header=header, expected='success')
@needs_dlfcn
@no_fastcomp('https://github.com/emscripten-core/emscripten/issues/8376')
def test_dylink_rtti(self):
    header = '\n    #include <cstddef>\n\n    class Foo {\n    public:\n      virtual ~Foo() {}\n    };\n\n    class Bar : public Foo {\n    public:\n      virtual ~Bar() {}\n    };\n\n    bool is_bar(Foo* foo);\n    '
    main = '\n    #include <stdio.h>\n    #include "header.h"\n\n    int main() {\n      Bar bar;\n      if (!is_bar(&bar)) {\n        puts("failure");\n        return 1;\n      }\n      puts("success");\n      return 0;\n    }\n    '
    side = '\n    #include "header.h"\n\n    bool is_bar(Foo* foo) {\n      return dynamic_cast<Bar*>(foo) != nullptr;\n    }\n    '
    self.dylink_test(main=main, side=side, header=header, expected='success')