diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2013-01-16 17:27:22 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2013-01-16 17:27:22 +0000 |
commit | fbb662f840c2f76988ff9f3f152695632cfc71be (patch) | |
tree | 55e8542b647a6f8916a7cecd930d566b21e6a0b8 /test/lit.cfg | |
parent | 6a3cbc35a75468d565385a0db8e7051478f383f4 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172627 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/lit.cfg')
-rw-r--r-- | test/lit.cfg | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/test/lit.cfg b/test/lit.cfg index 5a4cceda0e..128bbe927a 100644 --- a/test/lit.cfg +++ b/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 |