diff options
author | Amaury Sechet <deadalnix@gmail.com> | 2016-02-04 23:26:19 +0000 |
---|---|---|
committer | Amaury Sechet <deadalnix@gmail.com> | 2016-02-04 23:26:19 +0000 |
commit | e8ea7d8b1dff7bca3812da705437aac56ef6b105 (patch) | |
tree | ff65062afb586b60d16b024d45673ba9ff0999d6 /llvm/tools/llvm-c-test/main.c | |
parent | f9cec37880805bad4d54571f90688d1ab11688b2 (diff) | |
download | bcm5719-llvm-e8ea7d8b1dff7bca3812da705437aac56ef6b105.tar.gz bcm5719-llvm-e8ea7d8b1dff7bca3812da705437aac56ef6b105.zip |
Improve testing for the C API
Summary:
This basically add an echo test case in C. The support is limited right now, but full support would just be too much to review at once.
The echo test case simply get a module as input and try to output the same exact module. This allow to check the both reading and writing API are working as expected.
I want to improve this test over time to support more and more of the API, in order to improve coverage (coverage is quite poor right now).
Test Plan: Run the test.
Reviewers: chandlerc, bogner
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10725
llvm-svn: 259844
Diffstat (limited to 'llvm/tools/llvm-c-test/main.c')
-rw-r--r-- | llvm/tools/llvm-c-test/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/tools/llvm-c-test/main.c b/llvm/tools/llvm-c-test/main.c index e6b6e17098b..10d7d75f4ff 100644 --- a/llvm/tools/llvm-c-test/main.c +++ b/llvm/tools/llvm-c-test/main.c @@ -13,7 +13,6 @@ #include "llvm-c-test.h" #include "llvm-c/BitReader.h" -#include "llvm-c/Core.h" #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -47,6 +46,9 @@ static void print_usage(void) { fprintf(stderr, " Read lines of triple, hex ascii machine code from stdin " "- print disassembly\n\n"); fprintf(stderr, " * --calc\n"); + fprintf(stderr, " * --echo\n"); + fprintf(stderr, + " Read object file form stdin - and print it back out\n\n"); fprintf( stderr, " Read lines of name, rpn from stdin - print generated module\n\n"); @@ -83,6 +85,8 @@ int main(int argc, char **argv) { return add_named_metadata_operand(); } else if (argc == 2 && !strcmp(argv[1], "--set-metadata")) { return set_metadata(); + } else if (argc == 2 && !strcmp(argv[1], "--echo")) { + return echo(); } else { print_usage(); } |