From fe30a79057bf5221305b1df10900a3758ec03b12 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 16 Jun 2010 08:00:12 +0200 Subject: [PATCH] orcc: Improve test program generation Output something if a check has passed instead of being completely silent --- tools/orcc.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tools/orcc.c b/tools/orcc.c index d0ab73a..8ef26cb 100644 --- a/tools/orcc.c +++ b/tools/orcc.c @@ -269,7 +269,6 @@ main (int argc, char *argv[]) fprintf(output, "main (int argc, char *argv[])\n"); fprintf(output, "{\n"); fprintf(output, " int error = FALSE;\n"); - fprintf(output, " int verbose = FALSE;\n"); fprintf(output, "\n"); fprintf(output, " orc_test_init ();\n"); fprintf(output, "\n"); @@ -716,7 +715,7 @@ output_code_test (OrcProgram *p, FILE *output) fprintf(output, " OrcProgram *p = NULL;\n"); fprintf(output, " int ret;\n"); fprintf(output, "\n"); - fprintf(output, " if (verbose) printf (\"%s:\\n\");\n", p->name); + fprintf(output, " printf (\"%s:\\n\");\n", p->name); fprintf(output, " p = orc_program_new ();\n"); if (p->constant_n != 0) { fprintf(output, " orc_program_set_constant_n (p, %d);\n", @@ -799,22 +798,22 @@ output_code_test (OrcProgram *p, FILE *output) } fprintf(output, "\n"); - fprintf(output, " if (verbose) printf (\" cycles (backup): \");\n"); - fprintf(output, " if (verbose) orc_test_performance (p, ORC_TEST_FLAGS_BACKUP);\n"); - fprintf(output, "\n"); fprintf(output, " ret = orc_test_compare_output_backup (p);\n"); fprintf(output, " if (!ret) {\n"); fprintf(output, " error = TRUE;\n"); + fprintf(output, " } else {\n"); + fprintf(output, " printf (\" backup function passed\\n\");\n"); fprintf(output, " }\n"); fprintf(output, "\n"); fprintf(output, " ret = orc_test_compare_output (p);\n"); - fprintf(output, " if (!ret) {\n"); + fprintf(output, " if (ret == ORC_TEST_INDETERMINATE) {\n"); + fprintf(output, " printf (\" compilation not possible for the target\\n\");\n"); + fprintf(output, " } else if (!ret) {\n"); fprintf(output, " error = TRUE;\n"); + fprintf(output, " } else {\n"); + fprintf(output, " printf (\" compiled function passed\\n\");\n"); fprintf(output, " }\n"); fprintf(output, "\n"); - fprintf(output, " if (verbose) printf (\" cycles (compiled): \");\n"); - fprintf(output, " if (verbose) orc_test_performance (p, 0);\n"); - fprintf(output, "\n"); fprintf(output, " orc_program_free (p);\n"); fprintf(output, " }\n"); fprintf(output, "\n"); -- 2.7.4