diff options
author | David Schleef <ds@schleef.org> | 2010-08-24 13:22:24 -0700 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2010-08-24 13:22:24 -0700 |
commit | 9efe6267870dd10b7924aae8492954f190dd5273 (patch) | |
tree | e36270b5699bf7a7d99c41ad19a0f5d1baac54d8 /orc-test | |
parent | ca536c47aeaec7c2888862ef0ec2b84770b24cec (diff) |
Use OrcCode structure to handle all executable code
Diffstat (limited to 'orc-test')
-rw-r--r-- | orc-test/orctest.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/orc-test/orctest.c b/orc-test/orctest.c index 2c76d24..c9b873e 100644 --- a/orc-test/orctest.c +++ b/orc-test/orctest.c @@ -81,7 +81,7 @@ orc_test_gcc_compile (OrcProgram *p) fclose (file); file = fopen (dump_filename, "w"); - ret = fwrite(p->code, p->code_size, 1, file); + ret = fwrite(p->orccode->code, p->orccode->code_size, 1, file); fclose (file); #if defined(HAVE_POWERPC) @@ -190,7 +190,7 @@ orc_test_gcc_compile_neon (OrcProgram *p) fclose (file); file = fopen (dump_filename, "w"); - ret = fwrite(p->code, p->code_size, 1, file); + ret = fwrite(p->orccode->code, p->orccode->code_size, 1, file); fclose (file); sprintf (cmd, PREFIX "gcc -march=armv6t2 -mcpu=cortex-a8 -mfpu=neon -Wall " @@ -283,7 +283,7 @@ orc_test_gcc_compile_c64x (OrcProgram *p) fclose (file); file = fopen (dump_filename, "w"); - ret = fwrite(p->code, p->code_size, 1, file); + ret = fwrite(p->orccode->code, p->orccode->code_size, 1, file); fclose (file); sprintf (cmd, C64X_PREFIX "cl6x -mv=6400+ " @@ -521,10 +521,12 @@ orc_test_compare_output_full (OrcProgram *program, int flags) result = orc_program_compile_full (program, target, flags); if (ORC_COMPILE_RESULT_IS_FATAL(result)) { - return ORC_TEST_FAILED; + ret = ORC_TEST_FAILED; + goto out; } if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) { - return ORC_TEST_INDETERMINATE; + ret = ORC_TEST_INDETERMINATE; + goto out; } } @@ -716,6 +718,9 @@ orc_test_compare_output_full (OrcProgram *program, int flags) orc_executor_free (ex); +out: + orc_program_reset (program); + return ret; } @@ -907,6 +912,7 @@ orc_test_performance_full (OrcProgram *program, int flags, result = orc_program_compile_full (program, target, flags); if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) { //printf("compile failed\n"); + orc_program_reset (program); return 0; } } @@ -996,6 +1002,7 @@ orc_test_performance_full (OrcProgram *program, int flags, } orc_executor_free (ex); + orc_program_reset (program); return ave/(n*m); } |