sunho 73c4033987 [ORC][ORC_RT][COFF] Support dynamic VC runtime.
Supports dynamic VC runtime. It implements atexits handling which is required to load msvcrt.lib successfully. (the object file containing atexit symbol somehow resolves to static vc runtim symbols) It also default to dynamic vc runtime which tends to be more robust.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D132525
2022-09-10 15:25:49 +09:00

18 lines
408 B
C++

// RUN: %clang_cl -MD -c -o %t %s
// RUN: %llvm_jitlink %t
extern "C" __declspec(dllimport) void llvm_jitlink_setTestResultOverride(
long Value);
extern "C" int init() { return -1; }
extern "C" int init2() { return -2; }
extern "C" int a = init();
extern "C" int b = 2;
extern "C" int c = init2();
int main(int argc, char *argv[]) {
llvm_jitlink_setTestResultOverride(a + b + c + 1);
return 0;
}