diff options
Diffstat (limited to 'Tests/RunCMake/pseudo_llvm-rc.c')
-rw-r--r-- | Tests/RunCMake/pseudo_llvm-rc.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Tests/RunCMake/pseudo_llvm-rc.c b/Tests/RunCMake/pseudo_llvm-rc.c new file mode 100644 index 0000000..7acb2a3 --- /dev/null +++ b/Tests/RunCMake/pseudo_llvm-rc.c @@ -0,0 +1,30 @@ +#include <stdio.h> +#include <string.h> + +int main(int argc, char* argv[]) +{ + FILE* source; + FILE* target; + int i; + for (i = 1; i < argc; ++i) { + if (strcmp(argv[i], "-bad") == 0) { + fprintf(stdout, "stdout from bad command line arg '-bad'\n"); + fprintf(stderr, "stderr from bad command line arg '-bad'\n"); + return 1; + } + } + source = fopen(argv[argc - 1], "rb"); + if (source == NULL) { + return 1; + } + target = fopen(argv[argc - 2], "wb"); + if (target != NULL) { + char buffer[500]; + size_t n = fread(buffer, 1, sizeof(buffer), source); + fwrite(buffer, 1, n, target); + fclose(source); + fclose(target); + return 0; + } + return 1; +} |