Anders Waldenborg
2013-Sep-24 11:11 UTC
[LLVMdev] RFC: llvm-shlib-test (Was: [llvm] r191029 - llvm-c: Make LLVMGetFirstTarget a proper prototype)
On Mon, Sep 23, 2013 at 07:48:45PM -0400, Sean Silva wrote:> I like the idea, but I find the name confusing; I think it should have > `llvm-c` or `c-api` somewhere in the name. This could also serve as a > simple example of using the API.I had it as llvm-c-test first, then noticed that the shared library's directory was named "llvm-shlib". Yes, making sure it serves as a good example of using the API is a good idea. Not sure all tests would be that, but it is a good goal. The tests I have in mind are: * --dump-module basically just llvm-dis, tests memorybuffer/bitreader already implemented in patch, uncertain about protability as it does dup2 tricks to dump to stdout * --list-module-functions tests basic iteration over stuff in module implemented in patch, want to extend it to iterate over instructions too * --list-module-globals ditto * --disassemble Test llvm-c/Disassebler.h. Not sure about input format, lines of cpu name + hexdumped asm maybe is easiest for FileCheck * --objdump Test llvm-c/Object.h. List sections and symbols of an object file. * --list-targets LLVMGetFirstTarget/LLVMGetNextTarget and whatever can be extracted from them * --calc Test Core.h irbuilding and possibly executionengine. Create a module with a function evaluating the specified aritmetic expression. Possibly generating machinecode and executing. anders
Hans Wennborg
2013-Sep-24 18:39 UTC
[LLVMdev] RFC: llvm-shlib-test (Was: [llvm] r191029 - llvm-c: Make LLVMGetFirstTarget a proper prototype)
I think having this would be awesome! On Tue, Sep 24, 2013 at 4:11 AM, Anders Waldenborg <anders at 0x63.nu> wrote:> On Mon, Sep 23, 2013 at 07:48:45PM -0400, Sean Silva wrote: >> I like the idea, but I find the name confusing; I think it should have >> `llvm-c` or `c-api` somewhere in the name. This could also serve as a >> simple example of using the API. > > I had it as llvm-c-test first, then noticed that the shared library's > directory was named "llvm-shlib". > > Yes, making sure it serves as a good example of using the API is a > good idea. Not sure all tests would be that, but it is a good goal. > > The tests I have in mind are: > > * --dump-module > basically just llvm-dis, tests memorybuffer/bitreader > already implemented in patch, uncertain about protability as it > does dup2 tricks to dump to stdout > > * --list-module-functions > tests basic iteration over stuff in module > implemented in patch, want to extend it to iterate over > instructions too > > * --list-module-globals > ditto > > * --disassemble > Test llvm-c/Disassebler.h. Not sure about input format, > lines of cpu name + hexdumped asm maybe is easiest for FileCheck > > * --objdump > Test llvm-c/Object.h. List sections and symbols of an object file. > > * --list-targets > LLVMGetFirstTarget/LLVMGetNextTarget and whatever can be extracted > from them > > * --calc > Test Core.h irbuilding and possibly executionengine. Create a module > with a function evaluating the specified aritmetic expression. > Possibly generating machinecode and executing. > > anders > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Anders Waldenborg
2013-Sep-30 08:45 UTC
[LLVMdev] RFC: llvm-shlib-test (Was: [llvm] r191029 - llvm-c: Make LLVMGetFirstTarget a proper prototype)
Attached is what I got thus far. What I'm struggling with is proper integration in build system. What is in there is just wild guesses from my side, both on autoconf and cmake variants. It would be great if someone with proper knowledge of the buildsystems could have a look. Also I'm not sure how to properly handle compilation on msvc - clearly "-std=c11 -Wstrict-prototypes" is not the options I should use in that case. (also the dup2 use, will that work on windows?). Thanks -- -------------- next part -------------- A non-text attachment was scrubbed... Name: llvm-c-test-r2.patch Type: text/x-diff Size: 30807 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130930/847a4f00/attachment.patch>
Reasonably Related Threads
- [LLVMdev] RFC: llvm-shlib-test (Was: [llvm] r191029 - llvm-c: Make LLVMGetFirstTarget a proper prototype)
- [LLVMdev] RFC: llvm-shlib-test (Was: [llvm] r191029 - llvm-c: Make LLVMGetFirstTarget a proper prototype)
- [LLVMdev] RFC: llvm-shlib-test (Was: [llvm] r191029 - llvm-c: Make LLVMGetFirstTarget a proper prototype)
- [LLVMdev] RFC: llvm-shlib-test (Was: [llvm] r191029 - llvm-c: Make LLVMGetFirstTarget a proper prototype)
- [LLVMdev] [llvm-c]