summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2013-01-16 17:27:22 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2013-01-16 17:27:22 +0000
commita51c6ed608dc6372bd20eccc27d09064751e82d8 (patch)
tree3b2154d91124244fba6d267b9736641f5ebe2e96
parent373feca7a02a75e5ab4788ac77fd061883c23ff6 (diff)
downloadbcm5719-llvm-a51c6ed608dc6372bd20eccc27d09064751e82d8.tar.gz
bcm5719-llvm-a51c6ed608dc6372bd20eccc27d09064751e82d8.zip
Introduce llvm::sys::getProcessTriple() function.
In r143502, we renamed getHostTriple() to getDefaultTargetTriple() as part of work to allow the user to supply a different default target triple at configure time. This change also affected the JIT. However, it is inappropriate to use the default target triple in the JIT in most circumstances because this will not necessarily match the current architecture used by the process, leading to illegal instruction and other such errors at run time. Introduce the getProcessTriple() function for use in the JIT and its clients, and cause the JIT to use it. On architectures with a single bitness, the host and process triples are identical. On other architectures, the host triple represents the architecture of the host CPU, while the process triple represents the architecture used by the host CPU to interpret machine code within the current process. For example, when executing 32-bit code on a 64-bit Linux machine, the host triple may be 'x86_64-unknown-linux-gnu', while the process triple may be 'i386-unknown-linux-gnu'. This fixes JIT for the 32-on-64-bit (and vice versa) build on non-Apple platforms. Differential Revision: http://llvm-reviews.chandlerc.com/D254 llvm-svn: 172627
-rw-r--r--llvm/Makefile.config.in3
-rw-r--r--llvm/include/llvm/Support/Host.h4
-rw-r--r--llvm/lib/ExecutionEngine/TargetSelect.cpp15
-rw-r--r--llvm/lib/Support/Host.cpp12
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/2002-12-16-ArgTest.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/2003-01-04-ArgumentBug.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/2003-01-04-LoopTest.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/2003-01-04-PhiTest.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/2003-01-09-SARTest.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/2003-01-10-FUCOM.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/2003-01-15-AlignmentTest.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/2003-05-06-LivenessClobber.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/2003-05-07-ArgumentTest.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/2003-05-11-PHIRegAllocBug.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/2003-06-04-bzip2-bug.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/2003-06-05-PHIBug.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/2003-08-15-AllocaAssertion.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/2003-08-21-EnvironmentTest.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/2003-08-23-RegisterAllocatePhysReg.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/2005-12-02-TailCallBug.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/2007-12-10-APIntLoadStore.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/2008-06-05-APInt-OverAShr.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/2010-01-15-UndefValue.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/fpbitcast.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/hello.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/hello2.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/pr13727.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/simplesttest.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/simpletest-remote.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/simpletest.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/stubs-remote.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/stubs.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-arith.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-branch.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-call-no-external-funcs.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-call.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-cast.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-common-symbols-alignment.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-common-symbols-remote.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-common-symbols.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-constantexpr.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-data-align-remote.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-data-align.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-fp-no-external-funcs-remote.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-fp-no-external-funcs.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-fp.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-global-ctors.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-global-init-nonzero-remote.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-global-init-nonzero.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-global.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-loadstore.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-local.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-logical.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-loop.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-phi.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-ptr-reloc-remote.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-ptr-reloc.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-ret.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-return.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-setcond-fp.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-setcond-int.ll2
-rw-r--r--llvm/test/ExecutionEngine/MCJIT/test-shift.ll2
-rw-r--r--llvm/test/Makefile3
-rw-r--r--llvm/test/lit.cfg16
-rw-r--r--llvm/test/lit.site.cfg.in1
-rw-r--r--llvm/tools/llvm-jitlistener/llvm-jitlistener.cpp2
-rw-r--r--llvm/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h2
68 files changed, 95 insertions, 81 deletions
diff --git a/llvm/Makefile.config.in b/llvm/Makefile.config.in
index 5cb3c58673f..10a524fb468 100644
--- a/llvm/Makefile.config.in
+++ b/llvm/Makefile.config.in
@@ -134,6 +134,9 @@ BUILD_CXX=@BUILD_CXX@
# Triple for configuring build tools when cross-compiling
BUILD_TRIPLE=@build@
+# Target triple (cpu-vendor-os) which LLVM is compiled for
+HOST_TRIPLE=@host@
+
# Target triple (cpu-vendor-os) for which we should generate code
TARGET_TRIPLE=@target@
diff --git a/llvm/include/llvm/Support/Host.h b/llvm/include/llvm/Support/Host.h
index 139aab20a33..3a444057391 100644
--- a/llvm/include/llvm/Support/Host.h
+++ b/llvm/include/llvm/Support/Host.h
@@ -42,6 +42,10 @@ namespace sys {
/// CPU_TYPE-VENDOR-KERNEL-OPERATING_SYSTEM
std::string getDefaultTargetTriple();
+ /// getProcessTriple() - Return an appropriate target triple for generating
+ /// code to be loaded into the current process, e.g. when using the JIT.
+ std::string getProcessTriple();
+
/// getHostCPUName - Get the LLVM name for the host CPU. The particular format
/// of the name is target dependent, and suitable for passing as -mcpu to the
/// target which matches the host.
diff --git a/llvm/lib/ExecutionEngine/TargetSelect.cpp b/llvm/lib/ExecutionEngine/TargetSelect.cpp
index 3c4da75dba0..ca4330fa22b 100644
--- a/llvm/lib/ExecutionEngine/TargetSelect.cpp
+++ b/llvm/lib/ExecutionEngine/TargetSelect.cpp
@@ -32,18 +32,7 @@ TargetMachine *EngineBuilder::selectTarget() {
// must use the host architecture.
if (UseMCJIT && WhichEngine != EngineKind::Interpreter && M)
TT.setTriple(M->getTargetTriple());
- else {
- TT.setTriple(LLVM_HOSTTRIPLE);
-#if defined(__APPLE__)
-#if defined(__LP64__)
- if (TT.isArch32Bit())
- TT = TT.get64BitArchVariant();
-#else
- if (TT.isArch64Bit())
- TT = TT.get32BitArchVariant();
-#endif
-#endif // APPLE
- }
+
return selectTarget(TT, MArch, MCPU, MAttrs);
}
@@ -55,7 +44,7 @@ TargetMachine *EngineBuilder::selectTarget(const Triple &TargetTriple,
const SmallVectorImpl<std::string>& MAttrs) {
Triple TheTriple(TargetTriple);
if (TheTriple.getTriple().empty())
- TheTriple.setTriple(sys::getDefaultTargetTriple());
+ TheTriple.setTriple(sys::getProcessTriple());
// Adjust the triple to match what the user requested.
const Target *TheTarget = 0;
diff --git a/llvm/lib/Support/Host.cpp b/llvm/lib/Support/Host.cpp
index 5ad5308c41e..afbf0bf07fc 100644
--- a/llvm/lib/Support/Host.cpp
+++ b/llvm/lib/Support/Host.cpp
@@ -15,6 +15,7 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
+#include "llvm/ADT/Triple.h"
#include "llvm/Config/config.h"
#include "llvm/Support/DataStream.h"
#include "llvm/Support/Debug.h"
@@ -578,3 +579,14 @@ bool sys::getHostCPUFeatures(StringMap<bool> &Features){
return false;
}
#endif
+
+std::string sys::getProcessTriple() {
+ Triple PT(LLVM_HOSTTRIPLE);
+
+ if (sizeof(void *) == 8 && PT.isArch32Bit())
+ PT = PT.get64BitArchVariant();
+ if (sizeof(void *) == 4 && PT.isArch64Bit())
+ PT = PT.get32BitArchVariant();
+
+ return PT.str();
+}
diff --git a/llvm/test/ExecutionEngine/MCJIT/2002-12-16-ArgTest.ll b/llvm/test/ExecutionEngine/MCJIT/2002-12-16-ArgTest.ll
index 28cc54a8680..babd8f6a780 100644
--- a/llvm/test/ExecutionEngine/MCJIT/2002-12-16-ArgTest.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/2002-12-16-ArgTest.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
@.LC0 = internal global [10 x i8] c"argc: %d\0A\00" ; <[10 x i8]*> [#uses=1]
diff --git a/llvm/test/ExecutionEngine/MCJIT/2003-01-04-ArgumentBug.ll b/llvm/test/ExecutionEngine/MCJIT/2003-01-04-ArgumentBug.ll
index 9f895983fdb..bbb81b88b16 100644
--- a/llvm/test/ExecutionEngine/MCJIT/2003-01-04-ArgumentBug.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/2003-01-04-ArgumentBug.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
define i32 @foo(i32 %X, i32 %Y, double %A) {
%cond212 = fcmp une double %A, 1.000000e+00 ; <i1> [#uses=1]
diff --git a/llvm/test/ExecutionEngine/MCJIT/2003-01-04-LoopTest.ll b/llvm/test/ExecutionEngine/MCJIT/2003-01-04-LoopTest.ll
index 997b2a9037e..7574267bdcd 100644
--- a/llvm/test/ExecutionEngine/MCJIT/2003-01-04-LoopTest.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/2003-01-04-LoopTest.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
define i32 @main() {
call i32 @mylog( i32 4 ) ; <i32>:1 [#uses=0]
diff --git a/llvm/test/ExecutionEngine/MCJIT/2003-01-04-PhiTest.ll b/llvm/test/ExecutionEngine/MCJIT/2003-01-04-PhiTest.ll
index ba35b5bcc43..261939ad202 100644
--- a/llvm/test/ExecutionEngine/MCJIT/2003-01-04-PhiTest.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/2003-01-04-PhiTest.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
define i32 @main() {
; <label>:0
diff --git a/llvm/test/ExecutionEngine/MCJIT/2003-01-09-SARTest.ll b/llvm/test/ExecutionEngine/MCJIT/2003-01-09-SARTest.ll
index f3c88adf843..f76f9983282 100644
--- a/llvm/test/ExecutionEngine/MCJIT/2003-01-09-SARTest.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/2003-01-09-SARTest.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
; We were accidentally inverting the signedness of right shifts. Whoops.
diff --git a/llvm/test/ExecutionEngine/MCJIT/2003-01-10-FUCOM.ll b/llvm/test/ExecutionEngine/MCJIT/2003-01-10-FUCOM.ll
index f925e79f248..2b83bb9e43e 100644
--- a/llvm/test/ExecutionEngine/MCJIT/2003-01-10-FUCOM.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/2003-01-10-FUCOM.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
define i32 @main() {
%X = fadd double 0.000000e+00, 1.000000e+00 ; <double> [#uses=1]
diff --git a/llvm/test/ExecutionEngine/MCJIT/2003-01-15-AlignmentTest.ll b/llvm/test/ExecutionEngine/MCJIT/2003-01-15-AlignmentTest.ll
index 5b426f6c330..d1ca2bee399 100644
--- a/llvm/test/ExecutionEngine/MCJIT/2003-01-15-AlignmentTest.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/2003-01-15-AlignmentTest.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
define i32 @bar(i8* %X) {
; pointer should be 4 byte aligned!
diff --git a/llvm/test/ExecutionEngine/MCJIT/2003-05-06-LivenessClobber.ll b/llvm/test/ExecutionEngine/MCJIT/2003-05-06-LivenessClobber.ll
index c0a7393f824..20ef0ff95cd 100644
--- a/llvm/test/ExecutionEngine/MCJIT/2003-05-06-LivenessClobber.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/2003-05-06-LivenessClobber.ll
@@ -1,6 +1,6 @@
; This testcase should return with an exit code of 1.
;
-; RUN: not %lli -mtriple=%mcjit_triple -use-mcjit %s
+; RUN: not %lli_mcjit %s
@test = global i64 0 ; <i64*> [#uses=1]
diff --git a/llvm/test/ExecutionEngine/MCJIT/2003-05-07-ArgumentTest.ll b/llvm/test/ExecutionEngine/MCJIT/2003-05-07-ArgumentTest.ll
index d3e6204a85b..c7bcc5450b0 100644
--- a/llvm/test/ExecutionEngine/MCJIT/2003-05-07-ArgumentTest.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/2003-05-07-ArgumentTest.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s test
+; RUN: %lli_mcjit %s test
declare i32 @puts(i8*)
diff --git a/llvm/test/ExecutionEngine/MCJIT/2003-05-11-PHIRegAllocBug.ll b/llvm/test/ExecutionEngine/MCJIT/2003-05-11-PHIRegAllocBug.ll
index 55a16975410..0512575d1b4 100644
--- a/llvm/test/ExecutionEngine/MCJIT/2003-05-11-PHIRegAllocBug.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/2003-05-11-PHIRegAllocBug.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
target datalayout = "e-p:32:32"
diff --git a/llvm/test/ExecutionEngine/MCJIT/2003-06-04-bzip2-bug.ll b/llvm/test/ExecutionEngine/MCJIT/2003-06-04-bzip2-bug.ll
index 79c6e7fe4ca..c292a818a09 100644
--- a/llvm/test/ExecutionEngine/MCJIT/2003-06-04-bzip2-bug.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/2003-06-04-bzip2-bug.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
; Testcase distilled from 256.bzip2.
diff --git a/llvm/test/ExecutionEngine/MCJIT/2003-06-05-PHIBug.ll b/llvm/test/ExecutionEngine/MCJIT/2003-06-05-PHIBug.ll
index ffd6df6e5e2..c0a83f5ecbd 100644
--- a/llvm/test/ExecutionEngine/MCJIT/2003-06-05-PHIBug.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/2003-06-05-PHIBug.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
; Testcase distilled from 256.bzip2.
diff --git a/llvm/test/ExecutionEngine/MCJIT/2003-08-15-AllocaAssertion.ll b/llvm/test/ExecutionEngine/MCJIT/2003-08-15-AllocaAssertion.ll
index 90839e96986..55ce689b865 100644
--- a/llvm/test/ExecutionEngine/MCJIT/2003-08-15-AllocaAssertion.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/2003-08-15-AllocaAssertion.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
; This testcase failed to work because two variable sized allocas confused the
; local register allocator.
diff --git a/llvm/test/ExecutionEngine/MCJIT/2003-08-21-EnvironmentTest.ll b/llvm/test/ExecutionEngine/MCJIT/2003-08-21-EnvironmentTest.ll
index 29ef2c556cd..2e999967a2c 100644
--- a/llvm/test/ExecutionEngine/MCJIT/2003-08-21-EnvironmentTest.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/2003-08-21-EnvironmentTest.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
;
; Regression Test: EnvironmentTest.ll
diff --git a/llvm/test/ExecutionEngine/MCJIT/2003-08-23-RegisterAllocatePhysReg.ll b/llvm/test/ExecutionEngine/MCJIT/2003-08-23-RegisterAllocatePhysReg.ll
index 2adb608acbb..659901b9b36 100644
--- a/llvm/test/ExecutionEngine/MCJIT/2003-08-23-RegisterAllocatePhysReg.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/2003-08-23-RegisterAllocatePhysReg.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
; This testcase exposes a bug in the local register allocator where it runs out
; of registers (due to too many overlapping live ranges), but then attempts to
diff --git a/llvm/test/ExecutionEngine/MCJIT/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll b/llvm/test/ExecutionEngine/MCJIT/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll
index 91bde469036..68e31a7074d 100644
--- a/llvm/test/ExecutionEngine/MCJIT/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
@A = global i32 0 ; <i32*> [#uses=1]
diff --git a/llvm/test/ExecutionEngine/MCJIT/2005-12-02-TailCallBug.ll b/llvm/test/ExecutionEngine/MCJIT/2005-12-02-TailCallBug.ll
index a7462d9e698..0bc010584f1 100644
--- a/llvm/test/ExecutionEngine/MCJIT/2005-12-02-TailCallBug.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/2005-12-02-TailCallBug.ll
@@ -1,5 +1,5 @@
; PR672
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s
+; RUN: %lli_mcjit %s
; XFAIL: mcjit-ia32
define i32 @main() {
diff --git a/llvm/test/ExecutionEngine/MCJIT/2007-12-10-APIntLoadStore.ll b/llvm/test/ExecutionEngine/MCJIT/2007-12-10-APIntLoadStore.ll
index 24065966025..43188f2be48 100644
--- a/llvm/test/ExecutionEngine/MCJIT/2007-12-10-APIntLoadStore.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/2007-12-10-APIntLoadStore.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit -force-interpreter %s
+; RUN: %lli_mcjit -force-interpreter %s
; PR1836
define i32 @main() {
diff --git a/llvm/test/ExecutionEngine/MCJIT/2008-06-05-APInt-OverAShr.ll b/llvm/test/ExecutionEngine/MCJIT/2008-06-05-APInt-OverAShr.ll
index d429d519e04..0912897c05f 100644
--- a/llvm/test/ExecutionEngine/MCJIT/2008-06-05-APInt-OverAShr.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/2008-06-05-APInt-OverAShr.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit -force-interpreter=true %s | grep 1
+; RUN: %lli_mcjit -force-interpreter=true %s | grep 1
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i686-pc-linux-gnu"
diff --git a/llvm/test/ExecutionEngine/MCJIT/2010-01-15-UndefValue.ll b/llvm/test/ExecutionEngine/MCJIT/2010-01-15-UndefValue.ll
index a6d18e7919c..7ed0e3870a3 100644
--- a/llvm/test/ExecutionEngine/MCJIT/2010-01-15-UndefValue.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/2010-01-15-UndefValue.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit -force-interpreter=true %s > /dev/null
+; RUN: %lli_mcjit -force-interpreter=true %s > /dev/null
define i32 @main() {
%a = add i32 0, undef
diff --git a/llvm/test/ExecutionEngine/MCJIT/fpbitcast.ll b/llvm/test/ExecutionEngine/MCJIT/fpbitcast.ll
index bb4957e9e66..fb5ab6f2421 100644
--- a/llvm/test/ExecutionEngine/MCJIT/fpbitcast.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/fpbitcast.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit -force-interpreter=true %s | grep 40091eb8
+; RUN: %lli_mcjit -force-interpreter=true %s | grep 40091eb8
;
define i32 @test(double %x) {
entry:
diff --git a/llvm/test/ExecutionEngine/MCJIT/hello.ll b/llvm/test/ExecutionEngine/MCJIT/hello.ll
index ceb9c12ab4b..b74470724de 100644
--- a/llvm/test/ExecutionEngine/MCJIT/hello.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/hello.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
@.LC0 = internal global [12 x i8] c"Hello World\00" ; <[12 x i8]*> [#uses=1]
diff --git a/llvm/test/ExecutionEngine/MCJIT/hello2.ll b/llvm/test/ExecutionEngine/MCJIT/hello2.ll
index 756fcadb1ca..cd033d50947 100644
--- a/llvm/test/ExecutionEngine/MCJIT/hello2.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/hello2.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
@X = global i32 7 ; <i32*> [#uses=0]
@msg = internal global [13 x i8] c"Hello World\0A\00" ; <[13 x i8]*> [#uses=1]
diff --git a/llvm/test/ExecutionEngine/MCJIT/pr13727.ll b/llvm/test/ExecutionEngine/MCJIT/pr13727.ll
index c33bf328108..1c719c5b7c2 100644
--- a/llvm/test/ExecutionEngine/MCJIT/pr13727.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/pr13727.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit -O0 -disable-lazy-compilation=false %s
+; RUN: %lli_mcjit -O0 -disable-lazy-compilation=false %s
; The intention of this test is to verify that symbols mapped to COMMON in ELF
; work as expected.
diff --git a/llvm/test/ExecutionEngine/MCJIT/simplesttest.ll b/llvm/test/ExecutionEngine/MCJIT/simplesttest.ll
index 02ad0061fd1..318baf4e8ff 100644
--- a/llvm/test/ExecutionEngine/MCJIT/simplesttest.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/simplesttest.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
define i32 @main() {
ret i32 0
diff --git a/llvm/test/ExecutionEngine/MCJIT/simpletest-remote.ll b/llvm/test/ExecutionEngine/MCJIT/simpletest-remote.ll
index 272204c63c6..9ceaf545c5e 100644
--- a/llvm/test/ExecutionEngine/MCJIT/simpletest-remote.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/simpletest-remote.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit -remote-mcjit %s > /dev/null
+; RUN: %lli_mcjit -remote-mcjit %s > /dev/null
; XFAIL: arm, mips
define i32 @bar() {
diff --git a/llvm/test/ExecutionEngine/MCJIT/simpletest.ll b/llvm/test/ExecutionEngine/MCJIT/simpletest.ll
index 958b783067e..5b0f2dd3055 100644
--- a/llvm/test/ExecutionEngine/MCJIT/simpletest.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/simpletest.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
define i32 @bar() {
ret i32 0
diff --git a/llvm/test/ExecutionEngine/MCJIT/stubs-remote.ll b/llvm/test/ExecutionEngine/MCJIT/stubs-remote.ll
index 4c7684fd20e..15cb5d037ef 100644
--- a/llvm/test/ExecutionEngine/MCJIT/stubs-remote.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/stubs-remote.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit -remote-mcjit -disable-lazy-compilation=false %s
+; RUN: %lli_mcjit -remote-mcjit -disable-lazy-compilation=false %s
; XFAIL: arm, mips
define i32 @main() nounwind {
diff --git a/llvm/test/ExecutionEngine/MCJIT/stubs.ll b/llvm/test/ExecutionEngine/MCJIT/stubs.ll
index 9e5d5b2e418..f4aac333945 100644
--- a/llvm/test/ExecutionEngine/MCJIT/stubs.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/stubs.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit -disable-lazy-compilation=false %s
+; RUN: %lli_mcjit -disable-lazy-compilation=false %s
define i32 @main() nounwind {
entry:
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-arith.ll b/llvm/test/ExecutionEngine/MCJIT/test-arith.ll
index b73227fe635..e1cc23b9fcd 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-arith.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-arith.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
define i32 @main() {
%A = add i8 0, 12 ; <i8> [#uses=1]
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-branch.ll b/llvm/test/ExecutionEngine/MCJIT/test-branch.ll
index 8f3c7279051..cdf10350ec1 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-branch.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-branch.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
; test unconditional branch
define i32 @main() {
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-call-no-external-funcs.ll b/llvm/test/ExecutionEngine/MCJIT/test-call-no-external-funcs.ll
index 20150b2de62..8a36cf2953f 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-call-no-external-funcs.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-call-no-external-funcs.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
define i32 @_Z14func_exit_codev() nounwind uwtable {
entry:
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-call.ll b/llvm/test/ExecutionEngine/MCJIT/test-call.ll
index 51d19fe9917..1a0f0084168 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-call.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-call.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
declare void @exit(i32)
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-cast.ll b/llvm/test/ExecutionEngine/MCJIT/test-cast.ll
index dcc97f46656..335ec508eff 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-cast.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-cast.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
define i32 @foo() {
ret i32 0
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-common-symbols-alignment.ll b/llvm/test/ExecutionEngine/MCJIT/test-common-symbols-alignment.ll
index d666a2aa4aa..989a4734233 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-common-symbols-alignment.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-common-symbols-alignment.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit -O0 %s
+; RUN: %lli_mcjit -O0 %s
; This test checks that common symbols have been allocated addresses honouring
; the alignment requirement.
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-common-symbols-remote.ll b/llvm/test/ExecutionEngine/MCJIT/test-common-symbols-remote.ll
index 285ce5cea14..3b8ee9dd1cc 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-common-symbols-remote.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-common-symbols-remote.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit -remote-mcjit -O0 -disable-lazy-compilation=false %s
+; RUN: %lli_mcjit -remote-mcjit -O0 -disable-lazy-compilation=false %s
; XFAIL: arm, mips
; The intention of this test is to verify that symbols mapped to COMMON in ELF
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-common-symbols.ll b/llvm/test/ExecutionEngine/MCJIT/test-common-symbols.ll
index 8c8190291f1..13ee06a6507 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-common-symbols.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-common-symbols.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit -O0 -disable-lazy-compilation=false %s
+; RUN: %lli_mcjit -O0 -disable-lazy-compilation=false %s
; The intention of this test is to verify that symbols mapped to COMMON in ELF
; work as expected.
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-constantexpr.ll b/llvm/test/ExecutionEngine/MCJIT/test-constantexpr.ll
index 56c1290448a..8f15cbd7f7e 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-constantexpr.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-constantexpr.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
; This tests to make sure that we can evaluate weird constant expressions
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-data-align-remote.ll b/llvm/test/ExecutionEngine/MCJIT/test-data-align-remote.ll
index a1591d0fc4f..5e0bb4076b3 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-data-align-remote.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-data-align-remote.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit -remote-mcjit -O0 %s
+; RUN: %lli_mcjit -remote-mcjit -O0 %s
; XFAIL: arm, mips
; Check that a variable is always aligned as specified.
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-data-align.ll b/llvm/test/ExecutionEngine/MCJIT/test-data-align.ll
index 0493cba87fd..2472d95e777 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-data-align.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-data-align.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit -O0 %s
+; RUN: %lli_mcjit -O0 %s
; Check that a variable is always aligned as specified.
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-fp-no-external-funcs-remote.ll b/llvm/test/ExecutionEngine/MCJIT/test-fp-no-external-funcs-remote.ll
index 69c73b99c91..847d2253a0e 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-fp-no-external-funcs-remote.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-fp-no-external-funcs-remote.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit -remote-mcjit %s > /dev/null
+; RUN: %lli_mcjit -remote-mcjit %s > /dev/null
; XFAIL: arm, mips
define double @test(double* %DP, double %Arg) {
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-fp-no-external-funcs.ll b/llvm/test/ExecutionEngine/MCJIT/test-fp-no-external-funcs.ll
index 7af1d8b5391..f094f3d9192 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-fp-no-external-funcs.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-fp-no-external-funcs.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
define double @test(double* %DP, double %Arg) {
%D = load double* %DP ; <double> [#uses=1]
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-fp.ll b/llvm/test/ExecutionEngine/MCJIT/test-fp.ll
index f7e6fb9ba18..b10e9d6c169 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-fp.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-fp.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
define double @test(double* %DP, double %Arg) {
%D = load double* %DP ; <double> [#uses=1]
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-global-ctors.ll b/llvm/test/ExecutionEngine/MCJIT/test-global-ctors.ll
index fbe9118d536..4510d9b6a49 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-global-ctors.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-global-ctors.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
@var = global i32 1, align 4
@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @ctor_func }]
@llvm.global_dtors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @dtor_func }]
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-global-init-nonzero-remote.ll b/llvm/test/ExecutionEngine/MCJIT/test-global-init-nonzero-remote.ll
index 8b7c83e018b..b8d94b50cfe 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-global-init-nonzero-remote.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-global-init-nonzero-remote.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit -remote-mcjit %s > /dev/null
+; RUN: %lli_mcjit -remote-mcjit %s > /dev/null
; XFAIL: arm, mips
@count = global i32 1, align 4
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-global-init-nonzero.ll b/llvm/test/ExecutionEngine/MCJIT/test-global-init-nonzero.ll
index ec6cbad2f14..b9f74b8be40 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-global-init-nonzero.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-global-init-nonzero.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
@count = global i32 1, align 4
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-global.ll b/llvm/test/ExecutionEngine/MCJIT/test-global.ll
index e7972f978e9..6a8c042ef89 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-global.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-global.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
@count = global i32 0, align 4
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-loadstore.ll b/llvm/test/ExecutionEngine/MCJIT/test-loadstore.ll
index f450d0ab528..90381947e8f 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-loadstore.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-loadstore.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
define void @test(i8* %P, i16* %P.upgrd.1, i32* %P.upgrd.2, i64* %P.upgrd.3) {
%V = load i8* %P ; <i8> [#uses=1]
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-local.ll b/llvm/test/ExecutionEngine/MCJIT/test-local.ll
index d4e9f444e42..d7c17342797 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-local.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-local.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
define i32 @main() nounwind uwtable {
entry:
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-logical.ll b/llvm/test/ExecutionEngine/MCJIT/test-logical.ll
index 32f45ef119e..a03833e5c51 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-logical.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-logical.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
define i32 @main() {
%A = and i8 4, 8 ; <i8> [#uses=2]
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-loop.ll b/llvm/test/ExecutionEngine/MCJIT/test-loop.ll
index ebc689664d6..5ed8c4020f7 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-loop.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-loop.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
define i32 @main() {
; <label>:0
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-phi.ll b/llvm/test/ExecutionEngine/MCJIT/test-phi.ll
index 1408533d7ae..4245ccabed7 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-phi.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-phi.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
; test phi node
@Y = global i32 6 ; <i32*> [#uses=1]
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-ptr-reloc-remote.ll b/llvm/test/ExecutionEngine/MCJIT/test-ptr-reloc-remote.ll
index 773e4a195f2..f2c2cd6199f 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-ptr-reloc-remote.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-ptr-reloc-remote.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit -remote-mcjit -O0 %s
+; RUN: %lli_mcjit -remote-mcjit -O0 %s
; XFAIL: arm, mips
@.str = private unnamed_addr constant [6 x i8] c"data1\00", align 1
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-ptr-reloc.ll b/llvm/test/ExecutionEngine/MCJIT/test-ptr-reloc.ll
index 93b6a6deffd..871d8bfa29e 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-ptr-reloc.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-ptr-reloc.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit -O0 %s
+; RUN: %lli_mcjit -O0 %s
@.str = private unnamed_addr constant [6 x i8] c"data1\00", align 1
@ptr = global i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0), align 4
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-ret.ll b/llvm/test/ExecutionEngine/MCJIT/test-ret.ll
index af282926907..6bfc48052d0 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-ret.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-ret.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
; test return instructions
define void @test1() {
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-return.ll b/llvm/test/ExecutionEngine/MCJIT/test-return.ll
index 67f7107c3d7..4db1c3fe39f 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-return.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-return.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
define i32 @main() nounwind uwtable {
entry:
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-setcond-fp.ll b/llvm/test/ExecutionEngine/MCJIT/test-setcond-fp.ll
index a8f4bd8529f..b4367d0337a 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-setcond-fp.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-setcond-fp.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
define i32 @main() {
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-setcond-int.ll b/llvm/test/ExecutionEngine/MCJIT/test-setcond-int.ll
index ed52b5065c8..8c7d815446c 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-setcond-int.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-setcond-int.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
define i32 @main() {
%int1 = add i32 0, 0 ; <i32> [#uses=6]
diff --git a/llvm/test/ExecutionEngine/MCJIT/test-shift.ll b/llvm/test/ExecutionEngine/MCJIT/test-shift.ll
index 5a5c10d5605..8d9a94ef12c 100644
--- a/llvm/test/ExecutionEngine/MCJIT/test-shift.ll
+++ b/llvm/test/ExecutionEngine/MCJIT/test-shift.ll
@@ -1,4 +1,4 @@
-; RUN: %lli -mtriple=%mcjit_triple -use-mcjit %s > /dev/null
+; RUN: %lli_mcjit %s > /dev/null
define i32 @main() {
%shamt = add i8 0, 1 ; <i8> [#uses=8]
diff --git a/llvm/test/Makefile b/llvm/test/Makefile
index 4e690cc325e..f6ed44da792 100644
--- a/llvm/test/Makefile
+++ b/llvm/test/Makefile
@@ -131,7 +131,8 @@ endif
lit.site.cfg: FORCE
@echo "Making LLVM 'lit.site.cfg' file..."
- @$(ECHOPATH) s=@TARGET_TRIPLE@=$(TARGET_TRIPLE)=g > lit.tmp
+ @$(ECHOPATH) s=@LLVM_HOSTTRIPLE@=$(HOST_TRIPLE)=g > lit.tmp
+ @$(ECHOPATH) s=@TARGET_TRIPLE@=$(TARGET_TRIPLE)=g >> lit.tmp
@$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g >> lit.tmp
@$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> lit.tmp
@$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(ToolDir)=g >> lit.tmp
diff --git a/llvm/test/lit.cfg b/llvm/test/lit.cfg
index 5a4cceda0e1..128bbe927a3 100644
--- a/llvm/test/lit.cfg
+++ b/llvm/test/lit.cfg
@@ -140,12 +140,16 @@ if config.test_exec_root is None:
###
-# Provide a target triple for mcjit tests
-mcjit_triple = config.target_triple
-# Force ELF format on Windows
-if re.search(r'cygwin|mingw32|win32', mcjit_triple):
- mcjit_triple += "-elf"
-config.substitutions.append( ('%mcjit_triple', mcjit_triple) )
+# Provide a command line for mcjit tests
+lli_mcjit = 'lli -use-mcjit'
+# The target triple used by default by lli is the process target triple (some
+# triple appropriate for generating code for the current process) but because
+# we don't support COFF in MCJIT well enough for the tests, force ELF format on
+# Windows. FIXME: the process target triple should be used here, but this is
+# difficult to obtain on Windows.
+if re.search(r'cygwin|mingw32|win32', config.host_triple):
+ lli_mcjit += ' -mtriple='+config.host_triple+'-elf'
+config.substitutions.append( ('%lli_mcjit', lli_mcjit) )
# Provide a substition for those tests that need to run the jit to obtain data
# but simply want use the currently considered most reliable jit for platform
diff --git a/llvm/test/lit.site.cfg.in b/llvm/test/lit.site.cfg.in
index 7a328f0f28e..bfd901a0797 100644
--- a/llvm/test/lit.site.cfg.in
+++ b/llvm/test/lit.site.cfg.in
@@ -1,5 +1,6 @@
## Autogenerated by LLVM/Clang configuration.
# Do not edit!
+config.host_triple = "@LLVM_HOSTTRIPLE@"
config.target_triple = "@TARGET_TRIPLE@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
diff --git a/llvm/tools/llvm-jitlistener/llvm-jitlistener.cpp b/llvm/tools/llvm-jitlistener/llvm-jitlistener.cpp
index 2f72e424254..d6f5032d6e6 100644
--- a/llvm/tools/llvm-jitlistener/llvm-jitlistener.cpp
+++ b/llvm/tools/llvm-jitlistener/llvm-jitlistener.cpp
@@ -137,7 +137,7 @@ protected:
// Override the triple to generate ELF on Windows since that's supported
Triple Tuple(TheModule->getTargetTriple());
if (Tuple.getTriple().empty())
- Tuple.setTriple(LLVM_HOSTTRIPLE);
+ Tuple.setTriple(sys::getProcessTriple());
if (Tuple.isOSWindows() && Triple::ELF != Tuple.getEnvironment()) {
Tuple.setEnvironment(Triple::ELF);
diff --git a/llvm/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h b/llvm/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h
index 4604aa54994..fc774abd621 100644
--- a/llvm/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h
+++ b/llvm/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h
@@ -52,7 +52,7 @@ protected:
, MArch("")
, Builder(Context)
, MM(new SectionMemoryManager)
- , HostTriple(LLVM_HOSTTRIPLE)
+ , HostTriple(sys::getProcessTriple())
{
InitializeNativeTarget();
InitializeNativeTargetAsmPrinter();
OpenPOWER on IntegriCloud