Fix jit.dg/test-alignment* (PR jit/82846)
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 25 Jan 2018 00:45:51 +0000 (00:45 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Thu, 25 Jan 2018 00:45:51 +0000 (00:45 +0000)
These testcases jit-compile functions that return char, but
were erroneously calling them as if they returned int.

This led to errors for certain target configurations (e.g.
reading from %eax (32-bit) in the harness when only %al (8-bit)
had been written to in the jit-compiled function).

gcc/testsuite/ChangeLog:
PR jit/82846
* jit.dg/test-alignment.c (create_aligned_code): Fix return type
of "fn_type" typedef.
* jit.dg/test-alignment.cc (verify_aligned_code): Likewise.

From-SVN: r257037

gcc/testsuite/ChangeLog
gcc/testsuite/jit.dg/test-alignment.c
gcc/testsuite/jit.dg/test-alignment.cc

index bdc01f7cfc1e0c3f3169fc164cb09fd18d3e1a5e..72efc3fbbbf80e71f6760504bf7e32bffaa26cd6 100644 (file)
@@ -1,3 +1,10 @@
+2018-01-24  David Malcolm  <dmalcolm@redhat.com>
+
+       PR jit/82846
+       * jit.dg/test-alignment.c (create_aligned_code): Fix return type
+       of "fn_type" typedef.
+       * jit.dg/test-alignment.cc (verify_aligned_code): Likewise.
+
 2018-01-24  Ian Lance Taylor  <iant@golang.org>
 
        * go.go-torture/execute/names-1.go: New test.
index 686d98181b72a13eed5e8abc6bb9db53ac650edc..82328d51558a696070008a5c089a98aea2f944dc 100644 (file)
@@ -166,7 +166,7 @@ create_aligned_code (gcc_jit_context *ctxt, const char *struct_name,
                                   gcc_jit_result *result,              \
                                   const char *writer_fn_name)          \
   {                                                                    \
-  typedef int (*fn_type) (struct TYPENAME *);                          \
+  typedef char (*fn_type) (struct TYPENAME *);                         \
   CHECK_NON_NULL (result);                                             \
                                                                        \
   struct TYPENAME tmp;                                                 \
index 3e99209b9b10aaa166c5e743b80fb23230a6dd68..9a09a411b666760772692b96555f2b56522f34a7 100644 (file)
@@ -126,7 +126,7 @@ verify_aligned_code (gcc_jit_context *ctxt,
                      gcc_jit_result *result,
                      const char *writer_fn_name)
 {
-  typedef int (*fn_type) (T *);
+  typedef char (*fn_type) (T *);
   CHECK_NON_NULL (result);
 
   T tmp;