diff options
Diffstat (limited to 'testsuite/compile_parse_neon.c')
-rw-r--r-- | testsuite/compile_parse_neon.c | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/testsuite/compile_parse_neon.c b/testsuite/compile_parse_neon.c index 730a6e6..ed323e3 100644 --- a/testsuite/compile_parse_neon.c +++ b/testsuite/compile_parse_neon.c @@ -6,10 +6,10 @@ #include <stdio.h> #include <stdlib.h> -static char * read_file (const char *filename); -void output_code (OrcProgram *p, FILE *output); -void output_code_header (OrcProgram *p, FILE *output); -void output_code_test (OrcProgram *p, FILE *output); +static char *read_file (const char *filename); +void output_code (OrcProgram * p, FILE * output); +void output_code_header (OrcProgram * p, FILE * output); +void output_code_test (OrcProgram * p, FILE * output); int error = FALSE; @@ -36,23 +36,24 @@ main (int argc, char *argv[]) } code = read_file (filename); if (!code) { - printf("compile_parse_test <file.orc>\n"); - exit(1); + printf ("compile_parse_test <file.orc>\n"); + exit (1); } n = orc_parse (code, &programs); - for(i=0;i<n;i++){ + for (i = 0; i < n; i++) { OrcTestResult ret; - printf("%s:\n", programs[i]->name); + printf ("%s:\n", programs[i]->name); ret = orc_test_gcc_compile_neon (programs[i]); if (ret == ORC_TEST_FAILED) { error = TRUE; } } - if (error) return 1; + if (error) + return 1; return 0; } @@ -66,31 +67,38 @@ read_file (const char *filename) int ret; file = fopen (filename, "r"); - if (file == NULL) return NULL; + if (file == NULL) + return NULL; ret = fseek (file, 0, SEEK_END); - if (ret < 0) goto bail; + if (ret < 0) + goto bail; size = ftell (file); - if (size < 0) goto bail; + if (size < 0) + goto bail; ret = fseek (file, 0, SEEK_SET); - if (ret < 0) goto bail; + if (ret < 0) + goto bail; contents = malloc (size + 1); - if (contents == NULL) goto bail; + if (contents == NULL) + goto bail; ret = fread (contents, size, 1, file); - if (ret < 0) goto bail; + if (ret < 0) + goto bail; contents[size] = 0; return contents; bail: /* something failed */ - if (file) fclose (file); - if (contents) free (contents); + if (file) + fclose (file); + if (contents) + free (contents); return NULL; } - |