[RuntimeDyld] Add a framework for testing relocation logic in RuntimeDyld.
authorLang Hames <lhames@gmail.com>
Fri, 27 Jun 2014 20:20:57 +0000 (20:20 +0000)
committerLang Hames <lhames@gmail.com>
Fri, 27 Jun 2014 20:20:57 +0000 (20:20 +0000)
commite1c1138a387ee42cdf2dff93b22287339206af53
tree4f11c211bdc4fa743cbe16654d36a9181d921b5e
parenta94ef908d90524558b13c3a9fe44cf9875a0bb7b
[RuntimeDyld] Add a framework for testing relocation logic in RuntimeDyld.

This patch adds a "-verify" mode to the llvm-rtdyld utility. In verify mode,
llvm-rtdyld will test supplied expressions against the linked program images
that it creates in memory. This scheme can be used to verify the correctness
of the relocation logic applied by RuntimeDyld.

The expressions to test will be read out of files passed via the -check option
(there may be more than one of these). Expressions to check are extracted from
lines of the form:
# rtdyld-check: <expression>

This system is designed to fit the llvm-lit regression test workflow. It is
format and target agnostic, and supports verification of images linked for
remote targets. The expression language is defined in
llvm/include/llvm/RuntimeDyldChecker.h . Examples can be found in
test/ExecutionEngine/RuntimeDyld.

llvm-svn: 211956
llvm/include/llvm/ExecutionEngine/ObjectBuffer.h
llvm/include/llvm/ExecutionEngine/RuntimeDyld.h
llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h [new file with mode: 0644]
llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp [new file with mode: 0644]
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
llvm/test/ExecutionEngine/RuntimeDyld/MachO_x86-64_PIC_relocations.s [new file with mode: 0644]
llvm/tools/llvm-rtdyld/CMakeLists.txt
llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp