Commit Graph

201 Commits

Author SHA1 Message Date
Rafael Espindola
e87dadc44b Fix Addend computation for non external relocations on Macho.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180790 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-30 15:40:54 +00:00
Rafael Espindola
8e6e02a41b Collect the Addend for external relocs.
This fixes 2013-04-04-RelocAddend.ll. We don't have a testcase for non external
relocs with an Addend. I will try to write one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180767 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-30 01:29:57 +00:00
Rafael Espindola
59a0e79631 Add getSymbolAlignment to the ObjectFile interface.
For regular object files this is only meaningful for common symbols. An object
file format with direct support for atoms should be able to provide alignment
information for all symbols.

This replaces getCommonSymbolAlignment and fixes
test-common-symbols-alignment.ll on darwin. This also includes a fix to
MachOObjectFile::getSymbolFlags. It was marking undefined symbols as common
(already tested by existing mcjit tests now that it is used).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180736 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29 22:24:22 +00:00
Rafael Espindola
8a905e7e34 Disable the MCJIT tests on 32 bit darwin.
I recently enabled them on 32 and 64 bit darwin, but it looks like 32 bit is
still fairly broken.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180730 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29 21:09:32 +00:00
Rafael Espindola
87b5017139 Propagate relocation info to resolveRelocation.
This gets most of the MCJITs tests passing with MachO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180716 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29 17:24:34 +00:00
Nadav Rotem
0d840bb2fa Teach the interpreter to handle vector compares and additional vector arithmetic operations.
Patch by Yuri Veselov.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180626 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26 20:19:41 +00:00
Nadav Rotem
0fda0f3976 Revert r179409 because it caused some warnings and some of the build bots fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179418 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 22:02:26 +00:00
Nadav Rotem
affe889d08 Add support for additional vector instructions in the interpreter.
patch by Veselov, Yuri <Yuri.Veselov@intel.com>.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179409 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 20:45:20 +00:00
Eli Bendersky
20680b045a Rewrite test/ExecutionEngine tests to use FileCheck instead of grep
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179043 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-08 19:51:36 +00:00
Akira Hatanaka
84058c9acc [mips] XFAIL test-interp-vec-loadstore.ll in an attempt to turn builder
llvm-mips-linux green.

llvm-mips-linux runs on a big endian machine. This test passes if I change 'e'
to 'E' in the target data layout string.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178910 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-05 20:54:46 +00:00
Ulrich Weigand
03f018a713 Respect Addend when processing MCJIT relocations to local/global symbols.
When the RuntimeDyldELF::processRelocationRef routine finds the target
symbol of a relocation in the local or global symbol table, it performs
a section-relative relocation:

    Value.SectionID = lsi->second.first;
    Value.Addend = lsi->second.second;

At this point, however, any Addend that might have been specified in
the original relocation record is lost.  This is somewhat difficult to
trigger for relocations within the code section since they usually
do not contain non-zero Addends (when built with the default JIT code
model, in any case).  However, the problem can be reliably triggered
by a relocation within the data section caused by code like:

 int test[2] = { -1, 0 };
 int *p = &test[1];

The initializer of "p" will need a relocation to "test + 4".  On
platforms using RelA relocations this means an Addend of 4 is required.
Current code ignores this addend when processing the relocation,
resulting in incorrect execution.

Fixed by taking the Addend into account when processing relocations
to symbols found in the local or global symbol table.

Tested on x86_64-linux and powerpc64-linux.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178869 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-05 13:29:04 +00:00
Nadav Rotem
953783e00c Add support for vector data types in the LLVM interpreter.
Patch by:
Veselov, Yuri <Yuri.Veselov@intel.com>



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178469 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-01 15:53:30 +00:00
Jyotsna Verma
3cf2dba90f Disable Execution Engine tests not supported by Hexagon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177896 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25 20:02:14 +00:00
Renato Golin
4a4fb84d4b Corrections for XFAIL armv5 tests
Most of the tests that behave differently on llvm-arm-linux buildbot
did so becase the triple wasn't set correctly to armv5, so we can
revert most of the special behaviour added previously. Some tests
still need the special treatment, though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176243 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28 10:05:10 +00:00
Renato Golin
e57aaf038f Proper XFAILs for ARMv7 / v5
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176095 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-26 17:16:27 +00:00
Tim Northover
f13a7e2b21 AArch64: adjust tests which rely on a default JIT
Profiling tests *do* need a JIT. They'll pass if a cross-compiler targetting
AArch64 by default has been built, but fail if a native AArch64 compiler has
been build. Therefore XFAIL is inappropriate and we mark them unsupported.

ExecutionEngine tests are JIT by definition, they should also be unsupported.

Transforms/LICM only uses the interpreter to check the output is still sane
after optimisation. It can be switched to use an interpreter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175433 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 11:08:37 +00:00
Peter Collingbourne
fbb662f840 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
2013-01-16 17:27:22 +00:00
NAKAMURA Takumi
fecc368beb llvm/test/ExecutionEngine/MCJIT/lit.local.cfg: ppc32-elf is not ready.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168364 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-20 10:49:01 +00:00
Simon Atanasyan
01425d639e Marking remote mcjit tests as XFAIL for MIPS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168357 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-20 07:25:17 +00:00
Ulrich Weigand
948d9f743e Enable MCJIT tests on PowerPC.
Disable old JIT tests on PowerPC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168316 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-19 17:57:07 +00:00
NAKAMURA Takumi
fad9751d6e MCJIT: [cygming] Give noop to __main also in RecordingMemoryManger. It is emitted in @main().
XFAIL(s) can be removed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168282 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-18 06:16:32 +00:00
NAKAMURA Takumi
64b5015900 test/ExecutionEngine/MCJIT/stubs-remote.ll: Prune DOSish CRLF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168281 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-18 06:16:21 +00:00
Andrew Kaylor
784c5bb8b5 Marking remote mcjit tests as XFAIL for cygwin (hopefully only temporarily).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168226 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-17 00:02:50 +00:00
Andrew Kaylor
21414e953a Marking remote mcjit tests as XFAIL for mingw32 (hopefully only temporarily).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168221 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-16 23:38:16 +00:00
Andrew Kaylor
3bae2696ff Marking remote mcjit tests as XFAIL for ARM (hopefully only temporarily).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168210 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-16 22:21:04 +00:00
Andrew Kaylor
661dfdc9b7 Adding new tests to test lli's pseudo-remote feature (-remote-mcjit).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168180 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-16 18:51:59 +00:00
Amara Emerson
4372f00373 Add MCJIT test case for running global constructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168149 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-16 11:17:00 +00:00
Tim Northover
b210e6fea5 Align the data section correctly when loading an ELF file.
Patch by Amara Emerson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166920 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 10:47:07 +00:00
Tim Northover
f00677d74f Make use of common-symbol alignment info in ELF loader.
Patch by Amara Emerson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166919 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 10:47:04 +00:00
James Molloy
c1054710ca Some regression tests which are testing the old jit and are exercising functionality which is both known to be broken and not expected to be fixed in the old jit. To remove these from the regression test output, I've marked them XFAIL (for lit tests) and ifdef'd them out (unit tests). These modifications remove the last long-standing regression test failures from the buildbots (though updating the triple to reflect new ubuntu configuration has temporarily caused some new failures). Tested on x86-64 and ARM Linux.
Patch by David Tweed!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165390 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-08 13:06:30 +00:00
NAKAMURA Takumi
b894f96de4 Enable llvm/test/ExecutionEngine/MCJIT also for cygwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165313 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 14:10:29 +00:00
Tim Northover
565ebde5fe Implement .rel relocation for R_ARM_ABS32 in MCJIT.
Patch by Amara Emerson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165128 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03 16:29:42 +00:00
NAKAMURA Takumi
44a1fd4843 test/ExecutionEngine/MCJIT: MCJIT should work also on mingw.
FIXME: Also cygwin?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165081 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03 01:42:37 +00:00
Andrew Kaylor
7bbd6e366b Support for generating ELF objects on Windows.
This adds 'elf' as a recognized target triple environment value and overrides the default generated object format on Windows platforms if that value is present.  This patch also enables MCJIT tests on Windows using the new environment value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165030 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 18:38:34 +00:00
Jim Grosbach
ae6a2e2248 Revert "Enable MCJIT tests on Darwin."
This reverts commit 163278.

Works OK on x86_64, but not i386. Will re-enable when that's cleared up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163290 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-06 03:24:09 +00:00
Jim Grosbach
88a7e92fe1 Enable MCJIT tests on Darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163278 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-06 00:59:06 +00:00
Michael Liao
b6efbd2145 Should put test case under test/ExecutionEngine/MCJIT/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162885 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-30 00:43:57 +00:00
Akira Hatanaka
43d2ff1171 Add Mips to the list of target architectures for the MCJIT tests.
Patch by Reed Kotler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158933 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-21 20:23:32 +00:00
Danil Malyshev
6f55e3d57d Temporarily disabled the MCJIT tests for Darwin, because the RuntimeDyldMachO has a problems with relocations for 32bit x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157035 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-18 00:30:58 +00:00
Danil Malyshev
bb8cef51df - Added ExecutionEngine/MCJIT tests
- Added HOST_ARCH to Makefile.config.in
The HOST_ARCH will be used by MCJIT tests filter, because MCJIT supported only x86 and ARM architectures now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157015 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-17 21:07:47 +00:00
Preston Gurd
c68dda815e This patch improves the MCJIT runtime dynamic loader by adding new handling
of zero-initialized sections, virtual sections and common symbols
and preventing the loading of sections which are not required for
execution such as debug information.

Patch by Andy Kaylor!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154610 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 20:13:57 +00:00
Bill Wendling
288967dfac Revert r153694. It was causing failures in the buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153701 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-29 23:23:59 +00:00
Danil Malyshev
4b0b8ef1b0 Re-factored RuntimeDyld.
Added ExecutionEngine/MCJIT tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153694 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-29 21:46:18 +00:00
Chandler Carruth
3e29671cca Revert a series of commits to MCJIT to get the build working in CMake
(and hopefully on Windows). The bots have been down most of the day
because of this, and it's not clear to me what all will be required to
fix it.

The commits started with r153205, then r153207, r153208, and r153221.
The first commit seems to be the real culprit, but I couldn't revert
a smaller number of patches.

When resubmitting, r153207 and r153208 should be folded into r153205,
they were simple build fixes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153241 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-22 05:44:06 +00:00
Danil Malyshev
799184d8eb Re-factored RuntimeDyld.
Added ExecutionEngine/MCJIT tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153221 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-21 21:06:29 +00:00
Eli Bendersky
0f0c411079 Replace all instances of dg.exp file with lit.local.cfg, since all tests are run with LIT now and now Dejagnu. dg.exp is no longer needed.
Patch reviewed by Daniel Dunbar. It will be followed by additional cleanup patches.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150664 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 06:28:33 +00:00
Eli Bendersky
aa2bb63d97 Remove "XFAIL: arm" from test/ExecutionEngine/test-return.ll
The test passes on ARM bots



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148315 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 18:21:05 +00:00
Eli Bendersky
a7f99f28a7 Additional ExecutionEngine tests, as part of bringing up the MCJIT on ELF
implementation.
Currently lit still executes ExecutionEngine tests with JIT (not MCJIT) by
default. MCJIT tests can be executed manually by calling llvm-lit with
--param jit_impl=mcjit



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148299 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 09:14:54 +00:00
Eli Bendersky
a66a18505e Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches.
Patch developed by Andy Kaylor and Daniel Malea. Reviewed on llvm-commits.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148231 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-16 08:56:09 +00:00
Andrew Trick
0005cc7a0a Excluding ARM JIT tests until someone can fix this compilation path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138676 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-26 23:39:30 +00:00