From: David Schleef Date: Mon, 14 Jun 2010 23:20:41 +0000 (-0700) Subject: tests: Add ABI check for code_exec X-Git-Tag: orc-0.4.6~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=80b9a88663947addb6507a122a84c56e020bfdb6;p=platform%2Fupstream%2Forc.git tests: Add ABI check for code_exec --- diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index dc19a70..3bdaa5b 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -9,7 +9,8 @@ TESTS = \ exec_opcodes_sys \ exec_parse \ perf_opcodes_sys perf_parse \ - memcpy_speed + memcpy_speed \ + abi noinst_PROGRAMS = $(TESTS) generate_xml_table generate_xml_table2 \ generate_opcodes_sys compile_parse compile_parse_c memcpy_speed \ diff --git a/testsuite/abi.c b/testsuite/abi.c new file mode 100644 index 0000000..f03a7b3 --- /dev/null +++ b/testsuite/abi.c @@ -0,0 +1,33 @@ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include + + +int main (int argc, char *argv[]) +{ + int offset; + int expected_offset; + int error = 0; + + offset = ((int) ((unsigned char *) &((OrcProgram*) 0)->code_exec)); + + if (sizeof(void *) == 4) { + expected_offset = 8360; + } else { + expected_offset = 9688; + } + + if (offset != expected_offset) { + printf("ABI bug: OrcProgram->code_exec should be at offset %d instead of %d\n", + offset, expected_offset); + error = 1; + } + + return error; +} +