From: David Schleef Date: Thu, 9 Jul 2009 19:12:39 +0000 (-0700) Subject: tests: add orcc test X-Git-Tag: orc-0.4.2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=28b17cc3bf7fda81632fb0b2e45df5a41a732362;p=platform%2Fupstream%2Forc.git tests: add orcc test --- diff --git a/configure.ac b/configure.ac index a071866..cbfaa0a 100644 --- a/configure.ac +++ b/configure.ac @@ -123,6 +123,7 @@ orc-float/Makefile orc-pixel/Makefile orc-test/Makefile testsuite/Makefile +testsuite/orcc/Makefile examples/Makefile tools/Makefile orc-uninstalled.pc diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index 05aefe4..d8a4e68 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -1,4 +1,6 @@ +SUBDIRS = orcc + TESTS = \ compile_opcodes_sys_c \ compile_opcodes_float_c \ @@ -14,7 +16,8 @@ XFAIL_TESTS = \ exec_opcodes_float \ exec_opcodes_pixel -orcbin_PROGRAMS = $(TESTS) generate_xml_table generate_xml_table2 +orcbin_PROGRAMS = $(TESTS) generate_xml_table generate_xml_table2 \ + generate_opcodes_sys CLEANFILES = temp-orc-test-* diff --git a/testsuite/generate_opcodes_sys.c b/testsuite/generate_opcodes_sys.c new file mode 100644 index 0000000..a1ebd0f --- /dev/null +++ b/testsuite/generate_opcodes_sys.c @@ -0,0 +1,64 @@ + +#include "config.h" + +#include +#include + +#include +#include + + +int error = FALSE; + +void test_opcode (OrcStaticOpcode *opcode); +void test_opcode_const (OrcStaticOpcode *opcode); +void test_opcode_param (OrcStaticOpcode *opcode); + +int +main (int argc, char *argv[]) +{ + int i; + OrcOpcodeSet *opcode_set; + OrcStaticOpcode *opcode; + const char *d1; + + orc_init(); + orc_test_init(); + + opcode_set = orc_opcode_set_get ("sys"); + + for(i=0;in_opcodes;i++){ + opcode = opcode_set->opcodes + i; + + if (opcode->dest_size[0] == 0 || + opcode->src_size[0] == 0) { + printf("# skipping %s\n\n", opcode->name); + continue; + } + + printf(".function orc_%s\n", opcode->name); + if (opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { + printf(".accumulator %d a1\n", opcode->dest_size[0]); + d1 = "a1"; + } else { + printf(".dest %d d1\n", opcode->dest_size[0]); + d1 = "d1"; + } + printf(".source %d s1\n", opcode->src_size[0]); + if (opcode->src_size[1]) { + printf(".source %d s2\n", opcode->src_size[1]); + } + printf("\n"); + if (opcode->src_size[1]) { + printf("%s %s, s1, s2\n", opcode->name, d1); + } else { + printf("%s %s, s1\n", opcode->name, d1); + } + printf("\n"); + printf("\n"); + } + + if (error) return 1; + return 0; +} + diff --git a/testsuite/orcc/Makefile.am b/testsuite/orcc/Makefile.am new file mode 100644 index 0000000..5e96c82 --- /dev/null +++ b/testsuite/orcc/Makefile.am @@ -0,0 +1,19 @@ + + +TESTS = orc_test + +noinst_PROGRAMS = orc_test + + +AM_CFLAGS = $(ORC_CFLAGS) +LIBS = $(ORC_LIBS) $(top_builddir)/orc-test/liborc-test-@ORC_MAJORMINOR@.la + +CLEANFILES = testorc.c testorc.h orc_test.c + +orc: + ../../tools/orcc test.orc + cp out.c testorc.c + cp out.h testorc.h + cp test_out.c orc_test.c + +