summaryrefslogtreecommitdiffstats
path: root/llvm/tools/lli/lli.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-12-01 22:48:23 +0000
committerChris Lattner <sabre@nondot.org>2005-12-01 22:48:23 +0000
commitef2d8ca0b6f1e28779d3f67e695835301740720d (patch)
tree676e155bd00159a07ebb82bd27b20bcec9f75c1f /llvm/tools/lli/lli.cpp
parent05b0b4575b8a8fe88684b70ab050da7dfc622a4a (diff)
downloadbcm5719-llvm-ef2d8ca0b6f1e28779d3f67e695835301740720d.tar.gz
bcm5719-llvm-ef2d8ca0b6f1e28779d3f67e695835301740720d.zip
If a module has a main, but it is defined externally, refuse to run it.
Attempting to run it will find lli's main, which isn't the desired effect. llvm-svn: 24569
Diffstat (limited to 'llvm/tools/lli/lli.cpp')
-rw-r--r--llvm/tools/lli/lli.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
index c1b7478a376..93eb6fce5d1 100644
--- a/llvm/tools/lli/lli.cpp
+++ b/llvm/tools/lli/lli.cpp
@@ -85,7 +85,7 @@ int main(int argc, char **argv, char * const *envp) {
// EnvVars to determine envp.
//
Function *Fn = MP->getModule()->getMainFunction();
- if (!Fn) {
+ if (!Fn || Fn->isExternal()) {
std::cerr << "'main' function not found in module.\n";
return -1;
}
OpenPOWER on IntegriCloud