llvm.org GIT mirror llvm / f61049b
MCJIT-remote: __main should be resolved in child context. - Mark tests as XFAIL:cygming in test/ExecutionEngine/MCJIT/remote. Rather to suppress them, I'd like to leave them running as XFAIL. - Revert r193472. RecordMemoryManager no longer resolves __main on cygming. There are a couple of issues. - X86 Codegen emits "call __main" in @main for targeting cygming. It is useless in JIT. FYI, tests are passing when emitting __main is disabled. - Current remote JIT does not resolve any symbols in child context. FIXME: __main should be disabled, or remote JIT should resolve __main. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193498 91177308-0d34-0410-b5e6-96231b3b80d8 NAKAMURA Takumi 6 years ago
10 changed file(s) with 25 addition(s) and 22 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: %lli_mcjit -extra-modules=%p/cross-module-b.ir -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target %s > /dev/null
1
2 ; This fails because __main is not resolved in remote mcjit.
3 ; XFAIL: cygwin,mingw32
14
25 declare i32 @FB()
36
0 ; RUN: %lli_mcjit -extra-modules=%p/multi-module-b.ir,%p/multi-module-c.ir -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target %s > /dev/null
1
2 ; This fails because __main is not resolved in remote mcjit.
3 ; XFAIL: cygwin,mingw32
14
25 declare i32 @FB()
36
0 ; RUN: %lli_mcjit -remote-mcjit -mcjit-remote-process=lli-child-target %s > /dev/null
1 ; XFAIL: mips
1
2 ; This fails because __main is not resolved in remote mcjit on cygming.
3 ; XFAIL: cygwin,mingw32,mips
24
35 define i32 @bar() {
46 ret i32 0
0 ; RUN: %lli_mcjit -remote-mcjit -O0 -disable-lazy-compilation=false -mcjit-remote-process=lli-child-target %s
1 ; XFAIL: mips
1
2 ; This fails because __main is not resolved in remote mcjit on cygming.
3 ; XFAIL: cygwin,mingw32,mips
24
35 ; The intention of this test is to verify that symbols mapped to COMMON in ELF
46 ; work as expected.
0 ; RUN: %lli_mcjit -remote-mcjit -O0 -mcjit-remote-process=lli-child-target %s
1 ; XFAIL: mips
1
2 ; This fails because __main is not resolved in remote mcjit on cygming.
3 ; XFAIL: cygwin,mingw32,mips
24
35 ; Check that a variable is always aligned as specified.
46
0 ; RUN: %lli_mcjit -remote-mcjit -mcjit-remote-process=lli-child-target %s > /dev/null
1 ; XFAIL: mips
1
2 ; This fails because __main is not resolved in remote mcjit on cygming.
3 ; XFAIL: cygwin,mingw32,mips
24
35 define double @test(double* %DP, double %Arg) {
46 %D = load double* %DP ; [#uses=1]
0 ; RUN: %lli_mcjit -remote-mcjit -mcjit-remote-process=lli-child-target %s > /dev/null
1 ; XFAIL: mips
1
2 ; This fails because __main is not resolved in remote mcjit on cygming.
3 ; XFAIL: cygwin,mingw32,mips
24
35 @count = global i32 1, align 4
46
0 ; RUN: %lli_mcjit -remote-mcjit -O0 -mcjit-remote-process=lli-child-target %s
1
2 ; This fails because __main is not resolved in remote mcjit.
3 ; XFAIL: cygwin,mingw32
14
25 @.str = private unnamed_addr constant [6 x i8] c"data1\00", align 1
36 @ptr = global i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0), align 4
203203 void RemoteMemoryManager::deallocateFunctionBody(void *Body) {
204204 llvm_unreachable("Unexpected!");
205205 }
206
207 static int jit_noop() {
208 return 0;
209 }
210
211 uint64_t RemoteMemoryManager::getSymbolAddress(const std::string &Name) {
212 // We should not invoke parent's ctors/dtors from generated main()!
213 // On Mingw and Cygwin, the symbol __main is resolved to
214 // callee's(eg. tools/lli) one, to invoke wrong duplicated ctors
215 // (and register wrong callee's dtors with atexit(3)).
216 // We expect ExecutionEngine::runStaticConstructorsDestructors()
217 // is called before ExecutionEngine::runFunctionAsMain() is called.
218 if (Name == "__main") return (uintptr_t)&jit_noop;
219
220 return 0;
221 }
7777 // interface does support this, but clients must provide their own
7878 // mechanism for finding remote symbol addresses. MCJIT will resolve
7979 // symbols from Modules it contains.
80 uint64_t getSymbolAddress(const std::string &Name);
80 uint64_t getSymbolAddress(const std::string &Name) { return 0; }
8181
8282 void notifyObjectLoaded(ExecutionEngine *EE, const ObjectImage *Obj);
8383