llvm.org GIT mirror llvm / 1214e71
Eliminate inappropriate use of FindProgramByName() from lli git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199835 91177308-0d34-0410-b5e6-96231b3b80d8 Alp Toker 6 years ago
15 changed file(s) with 23 addition(s) and 22 deletion(s). Raw diff Collapse all Expand all
None ; RUN: %lli_mcjit -extra-module=%p/Inputs/cross-module-b.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target %s > /dev/null
0 ; RUN: %lli_mcjit -extra-module=%p/Inputs/cross-module-b.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null
11
22 declare i32 @FB()
33
None ; RUN: %lli_mcjit -extra-module=%p/Inputs/cross-module-b.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target -relocation-model=pic -code-model=small %s > /dev/null
0 ; RUN: %lli_mcjit -extra-module=%p/Inputs/cross-module-b.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target%exeext -relocation-model=pic -code-model=small %s > /dev/null
11 ; XFAIL: mips, i686, i386, arm
22
33 declare i32 @FB()
None ; RUN: %lli_mcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target %s > /dev/null
0 ; RUN: %lli_mcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null
11
22 declare i32 @FB()
33
None ; RUN: %lli_mcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target -relocation-model=pic -code-model=small %s > /dev/null
0 ; RUN: %lli_mcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target%exeext -relocation-model=pic -code-model=small %s > /dev/null
11 ; XFAIL: mips, i686, i386, arm
22
33 declare i32 @FB()
None ; RUN: %lli_mcjit -remote-mcjit -mcjit-remote-process=lli-child-target %s > /dev/null
0 ; RUN: %lli_mcjit -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null
11
22 define i32 @bar() {
33 ret i32 0
None ; RUN: %lli_mcjit -remote-mcjit -disable-lazy-compilation=false -mcjit-remote-process=lli-child-target %s
0 ; RUN: %lli_mcjit -remote-mcjit -disable-lazy-compilation=false -mcjit-remote-process=lli-child-target%exeext %s
11 ; XFAIL: *
22 ; This test should fail until remote symbol resolution is supported.
33
None ; RUN: %lli_mcjit -remote-mcjit -O0 -disable-lazy-compilation=false -mcjit-remote-process=lli-child-target %s
0 ; RUN: %lli_mcjit -remote-mcjit -O0 -disable-lazy-compilation=false -mcjit-remote-process=lli-child-target%exeext %s
11
22 ; The intention of this test is to verify that symbols mapped to COMMON in ELF
33 ; work as expected.
None ; RUN: %lli_mcjit -remote-mcjit -O0 -mcjit-remote-process=lli-child-target %s
0 ; RUN: %lli_mcjit -remote-mcjit -O0 -mcjit-remote-process=lli-child-target%exeext %s
11
22 ; Check that a variable is always aligned as specified.
33
None ; RUN: %lli_mcjit -remote-mcjit -mcjit-remote-process=lli-child-target %s > /dev/null
0 ; RUN: %lli_mcjit -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null
11
22 define double @test(double* %DP, double %Arg) {
33 %D = load double* %DP ; [#uses=1]
None ; RUN: %lli_mcjit -remote-mcjit -mcjit-remote-process=lli-child-target %s > /dev/null
0 ; RUN: %lli_mcjit -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null
11
22 @count = global i32 1, align 4
33
None ; RUN: %lli_mcjit -remote-mcjit -O0 -mcjit-remote-process=lli-child-target %s
0 ; RUN: %lli_mcjit -remote-mcjit -O0 -mcjit-remote-process=lli-child-target%exeext %s
11
22 @.str = private unnamed_addr constant [6 x i8] c"data1\00", align 1
33 @ptr = global i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0), align 4
124124 @$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(ToolDir)=g >> lit.tmp
125125 @$(ECHOPATH) s=@SHLIBDIR@=$(SharedLibDir)=g >> lit.tmp
126126 @$(ECHOPATH) s=@SHLIBEXT@=$(SHLIBEXT)=g >> lit.tmp
127 @$(ECHOPATH) s=@EXEEXT@=$(EXEEXT)=g >> lit.tmp
127128 @$(ECHOPATH) s=@PYTHON_EXECUTABLE@=$(PYTHON)=g >> lit.tmp
128129 @$(ECHOPATH) s=@OCAMLOPT@=$(OCAMLOPT) -cc $(subst *,'\\\"',*$(subst =,"\\=",$(CXX_FOR_OCAMLOPT))*) -cclib -L$(LibDir) -I $(LibDir)/ocaml=g >> lit.tmp
129130 @$(ECHOPATH) s=@ENABLE_SHARED@=$(ENABLE_SHARED)=g >> lit.tmp
187187 config.substitutions.append( ('%ocamlopt', config.ocamlopt_executable) )
188188 config.substitutions.append( ('%llvmshlibdir', config.llvm_shlib_dir) )
189189 config.substitutions.append( ('%shlibext', config.llvm_shlib_ext) )
190 config.substitutions.append( ('%exeext', config.llvm_exe_ext) )
190191
191192 # For each occurrence of an llvm tool name as its own word, replace it
192193 # with the full path to the build directory holding that tool. This
88 config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
99 config.llvm_shlib_dir = "@SHLIBDIR@"
1010 config.llvm_shlib_ext = "@SHLIBEXT@"
11 config.llvm_exe_ext = "@EXEEXT@"
1112 config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
1213 config.python_executable = "@PYTHON_EXECUTABLE@"
1314 config.ocamlopt_executable = "@OCAMLOPT@"
9393 // execution. The child process will be executed and will communicate with
9494 // lli via stdin/stdout pipes.
9595 cl::opt
96 MCJITRemoteProcess("mcjit-remote-process",
97 cl::desc("Specify the filename of the process to launch "
98 "for remote MCJIT execution. If none is specified,"
99 "\n\tremote execution will be simulated in-process."),
100 cl::value_desc("filename"),
101 cl::init(""));
96 ChildExecPath("mcjit-remote-process",
97 cl::desc("Specify the filename of the process to launch "
98 "for remote MCJIT execution. If none is specified,"
99 "\n\tremote execution will be simulated in-process."),
100 cl::value_desc("filename"), cl::init(""));
102101
103102 // Determine optimization level.
104103 cl::opt
662661 // and send it to the target.
663662
664663 OwningPtr Target;
665 if (!MCJITRemoteProcess.empty()) { // Remote execution on a child process
664 if (!ChildExecPath.empty()) { // Remote execution on a child process
666665 if (!RemoteTarget::hostSupportsExternalRemoteTarget()) {
667666 errs() << "Warning: host does not support external remote targets.\n"
668667 << " Defaulting to simulated remote execution\n";
669668 Target.reset(RemoteTarget::createRemoteTarget());
670669 } else {
671 std::string ChildEXE = sys::FindProgramByName(MCJITRemoteProcess);
672 if (ChildEXE == "") {
673 errs() << "Unable to find child target: '\''" << MCJITRemoteProcess << "\'\n";
670 if (!sys::fs::exists(ChildExecPath)) {
671 errs() << "Unable to find child target: '" << ChildExecPath << "'\n";
674672 return -1;
675673 }
676 Target.reset(RemoteTarget::createExternalRemoteTarget(ChildEXE));
674 Target.reset(RemoteTarget::createExternalRemoteTarget(ChildExecPath));
677675 }
678676 } else {
679677 // No child process name provided, use simulated remote execution.