summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorAndrew Kaylor <andrew.kaylor@intel.com>2013-10-11 22:47:10 +0000
committerAndrew Kaylor <andrew.kaylor@intel.com>2013-10-11 22:47:10 +0000
commit6587bcfdbc98d845c54771225b5c653989282579 (patch)
treed907494371fc63ff9bb7477bbb941ef8fbde9910 /llvm
parent8d41d9950230f03322d1debe588b12f66d8e39a9 (diff)
downloadbcm5719-llvm-6587bcfdbc98d845c54771225b5c653989282579.tar.gz
bcm5719-llvm-6587bcfdbc98d845c54771225b5c653989282579.zip
Fixing problems in lli's RemoteMemoryManager.
This fixes a problem from a previous check-in where a return value was omitted. Previously the remote/stubs-remote.ll and remote/stubs-sm-pic.ll tests were reporting passes, but they should have been failing. Those tests attempt to link against an external symbol and remote symbol resolution is not supported. The old RemoteMemoryManager implementation resulted in local symbols being used for resolution and the child process crashed but the test didn't notice. With this check-in remote symbol resolution fails, and so the test (correctly) fails. llvm-svn: 192514
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/remote/stubs-remote.ll3
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/remote/stubs-sm-pic.ll3
-rw-r--r--llvm/tools/lli/RemoteMemoryManager.h2
-rw-r--r--llvm/tools/lli/lli.cpp12
4 files changed, 11 insertions, 9 deletions
diff --git a/llvm/test/ExecutionEngine/MCJIT/remote/stubs-remote.ll b/llvm/test/ExecutionEngine/MCJIT/remote/stubs-remote.ll
index 99c2fe57f69..97932bc389a 100644
--- a/llvm/test/ExecutionEngine/MCJIT/remote/stubs-remote.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/remote/stubs-remote.ll
@@ -1,5 +1,6 @@
; RUN: %lli_mcjit -remote-mcjit -disable-lazy-compilation=false -mcjit-remote-process=lli-child-target %s
-; XFAIL: mips
+; XFAIL: *
+; This test should fail until remote symbol resolution is supported.
define i32 @main() nounwind {
entry:
diff --git a/llvm/test/ExecutionEngine/MCJIT/remote/stubs-sm-pic.ll b/llvm/test/ExecutionEngine/MCJIT/remote/stubs-sm-pic.ll
index 42e9d77e569..88faf21adb1 100644
--- a/llvm/test/ExecutionEngine/MCJIT/remote/stubs-sm-pic.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/remote/stubs-sm-pic.ll
@@ -1,5 +1,6 @@
; RUN: %lli_mcjit -remote-mcjit -disable-lazy-compilation=false -relocation-model=pic -code-model=small %s
-; XFAIL: mips, i686, i386, aarch64, arm
+; XFAIL: *
+; This function should fail until remote symbol resolution is supported.
define i32 @main() nounwind {
entry:
diff --git a/llvm/tools/lli/RemoteMemoryManager.h b/llvm/tools/lli/RemoteMemoryManager.h
index eabe042fff0..16d0a808b9b 100644
--- a/llvm/tools/lli/RemoteMemoryManager.h
+++ b/llvm/tools/lli/RemoteMemoryManager.h
@@ -78,7 +78,7 @@ public:
// interface does support this, but clients must provide their own
// mechanism for finding remote symbol addresses. MCJIT will resolve
// symbols from Modules it contains.
- uint64_t getSymbolAddress(const std::string &Name) {}
+ uint64_t getSymbolAddress(const std::string &Name) { return 0; }
void notifyObjectLoaded(ExecutionEngine *EE, const ObjectImage *Obj);
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
index 5578a1da31a..7117707691f 100644
--- a/llvm/tools/lli/lli.cpp
+++ b/llvm/tools/lli/lli.cpp
@@ -398,18 +398,18 @@ int main(int argc, char **argv, char * const *envp) {
return -1;
}
- // If the program doesn't explicitly call exit, we will need the Exit
- // function later on to make an explicit call, so get the function now.
- Constant *Exit = Mod->getOrInsertFunction("exit", Type::getVoidTy(Context),
- Type::getInt32Ty(Context),
- NULL);
-
// Reset errno to zero on entry to main.
errno = 0;
int Result;
if (!RemoteMCJIT) {
+ // If the program doesn't explicitly call exit, we will need the Exit
+ // function later on to make an explicit call, so get the function now.
+ Constant *Exit = Mod->getOrInsertFunction("exit", Type::getVoidTy(Context),
+ Type::getInt32Ty(Context),
+ NULL);
+
// Run static constructors.
if (UseMCJIT && !ForceInterpreter) {
// Give MCJIT a chance to apply relocations and set page permissions.
OpenPOWER on IntegriCloud