[llvm-commits] [PATCH] unit tests for MCJIT

Malea, Daniel daniel.malea at intel.com
Wed Aug 29 12:22:11 PDT 2012


Hi all,

I noticed MCJIT does not have any unit tests, so I added a few. If someone has a moment, could you please review the attached patches?

Hopefully the unit tests can serve as an example of how to programatically use MCJIT for runtime code generation and execution.

Patch descriptions:

000-move-memory-manager.patch: move LLIMCJITMemoryManager (from lli.cpp) to SectionMemoryManager in public headers (so we can test it)
001-mcjit-tests-buildscripts.patch: CMake and Makefile changes required for this patchset
002-section-memory-manager-tests.patch: Tests for the section-based memory manager
003-mcjit-tests-impl.patch: Test cases for JITting empty modules, simple functions, function-calls, globals, and multiple-modules
004-memory-buffer-tests.patch: Tests for MemoryBuffer (not really related to other patches, but MemoryBuffer had no tests and is used inside MCJIT)

Not all test cases pass yet, due to either bugs or missing functionality (for example, multiple-module support) but I commented out such cases to keep "make check" happy.

Also, I posted the combined patches on the LLVM reviewboard instance (for easier reading/reviewing): http://llvm.org/reviews/r/11/

Thanks,
Dan


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 000-move-memory-manager.patch
Type: application/octet-stream
Size: 19734 bytes
Desc: 000-move-memory-manager.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120829/1277132c/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 001-mcjit-tests-buildscripts.patch
Type: application/octet-stream
Size: 2951 bytes
Desc: 001-mcjit-tests-buildscripts.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120829/1277132c/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 002-section-memory-manager-tests.patch
Type: application/octet-stream
Size: 5165 bytes
Desc: 002-section-memory-manager-tests.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120829/1277132c/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 003-mcjit-tests-impl.patch
Type: application/octet-stream
Size: 14185 bytes
Desc: 003-mcjit-tests-impl.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120829/1277132c/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 004-memory-buffer-tests.patch
Type: application/octet-stream
Size: 3532 bytes
Desc: 004-memory-buffer-tests.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120829/1277132c/attachment-0004.obj>


More information about the llvm-commits mailing list