Skip to content

Commit b9ea833

Browse files
committed
tests: [diag] print cxxabi type_info vtable resolution (si vs vmi)
1 parent 46884e7 commit b9ea833

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

tests/jit-min/main.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,26 @@ int main(int argc, char** argv)
133133
else
134134
fail("process-symbols generator", G.takeError());
135135

136+
// DIAG: how do the cxxabi type_info vtables resolve? si works (c06), vmi
137+
// crashes (c10) -- compare the raw GetProcAddress value against the JIT lookup.
138+
for(const char* sym :
139+
{"_ZTVN10__cxxabiv117__class_type_infoE",
140+
"_ZTVN10__cxxabiv120__si_class_type_infoE",
141+
"_ZTVN10__cxxabiv121__vmi_class_type_infoE", "__dynamic_cast"})
142+
{
143+
void* gpa = sys::DynamicLibrary::SearchForAddressOfSymbol(sym);
144+
errs() << "[diag] " << sym << " GetProcAddr=" << gpa;
145+
if(auto a = (*jit)->lookup(sym))
146+
errs() << " JIT=" << (void*)a->getValue();
147+
else
148+
{
149+
consumeError(a.takeError());
150+
errs() << " JIT=NOTFOUND";
151+
}
152+
errs() << "\n";
153+
errs().flush();
154+
}
155+
136156
// x86_64-w64-windows-gnu always lowers thread_local through emulated TLS
137157
// (__emutls_get_address); compiler-rt provides it but the host exe doesn't
138158
// export it, so DynamicLibrarySearchGenerator can't see it. Bind it directly.

0 commit comments

Comments
 (0)