CRIS testsuite
PATCH 1/1 CRIS testsuite
This adds a test-suite for the CRIS port. I'm not sure it's suitable to keep this in the tree. It needs a crisv32-axis-linux-gnu compiler to build the test-cases.
This patch is large, let me know if you want me to split this further.
Signature · 107 lines
Edgar E. Iglesias Axis Communications AB tests/cris/.gdbinit | 12 ++ tests/cris/Makefile | 153 +++++++++++++++++++ tests/cris/README | 2 + tests/cris/check_abs.c | 39 +++++ tests/cris/check_addc.c | 57 +++++++ tests/cris/check_addcm.c | 83 +++++++++++ tests/cris/check_addi.s | 57 +++++++ tests/cris/check_addiv32.s | 62 ++++++++ tests/cris/check_addm.s | 96 ++++++++++++ tests/cris/check_addo.c | 125 ++++++++++++++++ tests/cris/check_addoq.c | 44 ++++++ tests/cris/check_addq.s | 47 ++++++ tests/cris/check_addr.s | 96 ++++++++++++ tests/cris/check_addxc.s | 91 ++++++++++++ tests/cris/check_addxm.s | 106 +++++++++++++ tests/cris/check_addxr.s | 96 ++++++++++++ tests/cris/check_andc.s | 80 ++++++++++ tests/cris/check_andm.s | 90 +++++++++++ tests/cris/check_andq.s | 46 ++++++ tests/cris/check_andr.s | 95 ++++++++++++ tests/cris/check_asr.s | 230 +++++++++++++++++++++++++++++ tests/cris/check_ba.s | 93 ++++++++++++ tests/cris/check_bas.s | 102 +++++++++++++ tests/cris/check_bcc.s | 197 +++++++++++++++++++++++++ tests/cris/check_bound.c | 139 +++++++++++++++++ tests/cris/check_boundc.s | 101 +++++++++++++ tests/cris/check_boundr.s | 125 ++++++++++++++++ tests/cris/check_btst.s | 87 +++++++++++ tests/cris/check_clearfv32.s | 17 ++ tests/cris/check_clrjmp1.s | 36 +++++ tests/cris/check_cmp-2.s | 15 ++ tests/cris/check_cmpc.s | 86 +++++++++++ tests/cris/check_cmpm.s | 96 ++++++++++++ tests/cris/check_cmpq.s | 75 ++++++++++ tests/cris/check_cmpr.s | 102 +++++++++++++ tests/cris/check_cmpxc.s | 92 ++++++++++++ tests/cris/check_cmpxm.s | 106 +++++++++++++ tests/cris/check_dstep.s | 42 ++++++ tests/cris/check_gcctorture_pr28634-1.c | 15 ++ tests/cris/check_gcctorture_pr28634.c | 15 ++ tests/cris/check_glibc_kernelversion.c | 116 +++++++++++++++ tests/cris/check_hello.c | 7 + tests/cris/check_int64.c | 45 ++++++ tests/cris/check_jsr.s | 85 +++++++++++ tests/cris/check_lapc.s | 78 ++++++++++ tests/cris/check_lsl.s | 217 +++++++++++++++++++++++++++ tests/cris/check_lsr.s | 218 +++++++++++++++++++++++++++ tests/cris/check_lz.c | 49 ++++++ tests/cris/check_mapbrk.c | 39 +++++ tests/cris/check_mcp.s | 49 ++++++ tests/cris/check_mmap1.c | 48 ++++++ tests/cris/check_mmap2.c | 48 ++++++ tests/cris/check_mmap3.c | 33 ++++ tests/cris/check_movdelsr1.s | 33 ++++ tests/cris/check_movecr.s | 37 +++++ tests/cris/check_movei.s | 47 ++++++ tests/cris/check_movemr.s | 79 ++++++++++ tests/cris/check_movemrv32.s | 97 ++++++++++++ tests/cris/check_moveq.c | 51 +++++++ tests/cris/check_mover.s | 29 ++++ tests/cris/check_moverm.s | 45 ++++++ tests/cris/check_movmp.s | 131 ++++++++++++++++ tests/cris/check_movpmv32.s | 35 +++++ tests/cris/check_movpr.s | 28 ++++ tests/cris/check_movprv32.s | 21 +++ tests/cris/check_movscr.s | 29 ++++ tests/cris/check_movsm.s | 44 ++++++ tests/cris/check_movsr.s | 46 ++++++ tests/cris/check_movucr.s | 33 ++++ tests/cris/check_movum.s | 40 +++++ tests/cris/check_movur.s | 45 ++++++ tests/cris/check_mulv32.s | 51 +++++++ tests/cris/check_mulx.s | 246 +++++++++++++++++++++++++++++++ tests/cris/check_neg.s | 104 +++++++++++++ tests/cris/check_not.s | 31 ++++ tests/cris/check_openpf1.c | 38 +++++ tests/cris/check_openpf2.c | 16 ++ tests/cris/check_openpf3.c | 49 ++++++ tests/cris/check_openpf4.c | 5 + tests/cris/check_openpf5.c | 56 +++++++ tests/cris/check_orc.s | 71 +++++++++ tests/cris/check_orm.s | 75 ++++++++++ tests/cris/check_orq.s | 41 +++++ tests/cris/check_orr.s | 84 +++++++++++ tests/cris/check_ret.s | 25 +++ tests/cris/check_scc.s | 95 ++++++++++++ tests/cris/check_stat1.c | 16 ++ tests/cris/check_stat2.c | 20 +++ tests/cris/check_stat3.c | 26 ++++ tests/cris/check_stat4.c | 28 ++++ tests/cris/check_subc.s | 87 +++++++++++ tests/cris/check_subm.s | 96 ++++++++++++ tests/cris/check_subq.s | 52 +++++++ tests/cris/check_subr.s | 102 +++++++++++++ tests/cris/check_swap.c | 75 ++++++++++ tests/cris/check_time1.c | 46 ++++++ tests/cris/check_time2.c | 18 +++ tests/cris/check_xarith.s | 46 ++++++ tests/cris/crisutils.h | 71 +++++++++ tests/cris/crt.s | 13 ++ tests/cris/sys.c | 48 ++++++ tests/cris/sys.h | 16 ++ tests/cris/testutils.inc | 117 +++++++++++++++ 103 files changed, 7014 insertions(+), 0 deletions(-)
tests/cris/.gdbinit new file +12 -0
@@ -0,0 +1,12 @@ +b main +b _fail +b exit +display /i $pc +display /x $srp +display /x $r0 +display /x $r1 +display /x $r2 +display /x $r3 +display /x $r4 +display /t $ccs +
tests/cris/Makefile new file +153 -0
153 lines not on this page · raw message
tests/cris/README new file +2 -0
@@ -0,0 +1,2 @@ +Test-suite for the cris port. Heavily based on the test-suite for the CRIS port of sim by Hans-Peter Nilsson. +
tests/cris/check_abs.c new file +39 -0
@@ -0,0 +1,39 @@ +#include <stdio.h> +#include <stdlib.h> +#include <stdint.h> +#include "sys.h" +#include "crisutils.h" + +extern inline int cris_abs (int n) { +int r; + asm ("abs\t%1, %0\n" :"=r" (r) :"r" (n)); +return r; +} + +extern inline void +verify_abs (int val,int res, +const int n,const int z,const int v,const int c) +{ +int r; + +cris_tst_cc_init (); + r =cris_abs (val); +cris_tst_cc (n, z, v, c); +if (r != res) +err (); +} + +int main (void ) +{ +verify_abs (-1 ,1 ,0 ,0 ,0 ,0 ); +verify_abs (0x80000000 ,0x80000000 ,1 ,0 ,0 ,0 ); +verify_abs (0x7fffffff ,0x7fffffff ,0 ,0 ,0 ,0 ); +verify_abs (42 ,42 ,0 ,0 ,0 ,0 ); +verify_abs (1 ,1 ,0 ,0 ,0 ,0 ); +verify_abs (0xffff ,0xffff ,0 ,0 ,0 ,0 ); +verify_abs (0xffff ,0xffff ,0 ,0 ,0 ,0 ); +verify_abs (-31 ,0x1f ,0 ,0 ,0 ,0 ); +verify_abs (0 ,0 ,0 ,1 ,0 ,0 ); +pass (); +return 0 ; +}
tests/cris/check_addc.c new file +57 -0
57 lines not on this page · raw message
tests/cris/check_addcm.c new file +83 -0
83 lines not on this page · raw message
tests/cris/check_addi.s new file +57 -0
57 lines not on this page · raw message
tests/cris/check_addiv32.s new file +62 -0
62 lines not on this page · raw message
tests/cris/check_addm.s new file +96 -0
96 lines not on this page · raw message
tests/cris/check_addo.c new file +125 -0
125 lines not on this page · raw message
tests/cris/check_addoq.c new file +44 -0
44 lines not on this page · raw message
tests/cris/check_addq.s new file +47 -0
47 lines not on this page · raw message
tests/cris/check_addr.s new file +96 -0
96 lines not on this page · raw message
tests/cris/check_addxc.s new file +91 -0
91 lines not on this page · raw message
tests/cris/check_addxm.s new file +106 -0
106 lines not on this page · raw message
tests/cris/check_addxr.s new file +96 -0
96 lines not on this page · raw message
tests/cris/check_andc.s new file +80 -0
80 lines not on this page · raw message
tests/cris/check_andm.s new file +90 -0
90 lines not on this page · raw message
tests/cris/check_andq.s new file +46 -0
46 lines not on this page · raw message
tests/cris/check_andr.s new file +95 -0
95 lines not on this page · raw message
tests/cris/check_asr.s new file +230 -0
230 lines not on this page · raw message
tests/cris/check_ba.s new file +93 -0
93 lines not on this page · raw message
tests/cris/check_bas.s new file +102 -0
102 lines not on this page · raw message
tests/cris/check_bcc.s new file +197 -0
197 lines not on this page · raw message
tests/cris/check_bound.c new file +139 -0
139 lines not on this page · raw message
tests/cris/check_boundc.s new file +101 -0
101 lines not on this page · raw message
tests/cris/check_boundr.s new file +125 -0
125 lines not on this page · raw message
tests/cris/check_btst.s new file +87 -0
87 lines not on this page · raw message
tests/cris/check_clearfv32.s new file +17 -0
@@ -0,0 +1,17 @@ +# mach: crisv32 +# output: ef\nef\n + +; Check that "clearf x" doesn't trivially fail. + + .include "testutils.inc" + start + setf puixnzvc + clearf x ; Actually, x would be cleared by almost-all other insns. + move ccs,r3 + checkr3 ef + + setf puixnzvc + moveq 0, $r3 ; moveq should only clear the xflag. + move ccs,r3 + checkr3 ef + quit
tests/cris/check_clrjmp1.s new file +36 -0
@@ -0,0 +1,36 @@ +# mach: crisv3 crisv8 crisv10 crisv32 +# output: ffffff00\n + +; A bug resulting in a non-effectual clear.b discovered running the GCC +; testsuite; jump actually wrote to p0. + + .include "testutils.inc" + + start + jump 1f + nop + .p2align 8 +1: + move.d y,r4 + + .if 0 ;0 == ..asm.arch.cris.v32 +; There was a bug causing this insn to set special register p0 +; (byte-clear) to 8 (low 8 bits of location after insn). + jump [r4+] + .endif + +1: + move.d 0f,r4 + +; The corresponding bug would cause this insn too, to set p0. + jump r4 + nop + quit +0: + moveq -1,r3 + clear.b r3 + checkr3 ffffff00 + quit + +y: + .dword 1b
tests/cris/check_cmp-2.s new file +15 -0
@@ -0,0 +1,15 @@ + + +.include "testutils.inc" + + start + + move.d 4294967283, $r0 + move.d $r0, $r10 + cmp.d $r0, $r10 + beq 1f + move.d $r10, $r3 + fail +1: + pass + quit
tests/cris/check_cmpc.s new file +86 -0
86 lines not on this page · raw message
tests/cris/check_cmpm.s new file +96 -0
96 lines not on this page · raw message
tests/cris/check_cmpq.s new file +75 -0
75 lines not on this page · raw message
tests/cris/check_cmpr.s new file +102 -0
102 lines not on this page · raw message
tests/cris/check_cmpxc.s new file +92 -0
21 lines not on this page · raw message
tests/cris/check_cmpxm.s new file +106 -0
106 lines not on this page · raw message
tests/cris/check_dstep.s new file +42 -0
42 lines not on this page · raw message
tests/cris/check_gcctorture_pr28634-1.c new file +15 -0
Lines of this file are not shown. View the raw message.
tests/cris/check_gcctorture_pr28634.c new file +15 -0
Lines of this file are not shown. View the raw message.
tests/cris/check_glibc_kernelversion.c new file +116 -0
116 lines not on this page · raw message
tests/cris/check_int64.c new file +45 -0
45 lines not on this page · raw message
tests/cris/check_jsr.s new file +85 -0
85 lines not on this page · raw message
tests/cris/check_lapc.s new file +78 -0
78 lines not on this page · raw message
tests/cris/check_lsl.s new file +217 -0
217 lines not on this page · raw message
tests/cris/check_lsr.s new file +218 -0
218 lines not on this page · raw message
tests/cris/check_lz.c new file +49 -0
49 lines not on this page · raw message
tests/cris/check_mcp.s new file +49 -0
49 lines not on this page · raw message
tests/cris/check_mmap1.c new file +48 -0
48 lines not on this page · raw message
tests/cris/check_mmap2.c new file +48 -0
48 lines not on this page · raw message
tests/cris/check_movei.s new file +47 -0
47 lines not on this page · raw message
tests/cris/check_movemr.s new file +79 -0
79 lines not on this page · raw message
tests/cris/check_movemrv32.s new file +97 -0
97 lines not on this page · raw message
tests/cris/check_moveq.c new file +51 -0
51 lines not on this page · raw message
tests/cris/check_moverm.s new file +45 -0
45 lines not on this page · raw message
tests/cris/check_movmp.s new file +131 -0
131 lines not on this page · raw message
tests/cris/check_movsm.s new file +44 -0
44 lines not on this page · raw message
tests/cris/check_movsr.s new file +46 -0
46 lines not on this page · raw message
tests/cris/check_movur.s new file +45 -0
45 lines not on this page · raw message
tests/cris/check_mulv32.s new file +51 -0
51 lines not on this page · raw message
tests/cris/check_mulx.s new file +246 -0
246 lines not on this page · raw message
tests/cris/check_neg.s new file +104 -0
104 lines not on this page · raw message
tests/cris/check_openpf3.c new file +49 -0
49 lines not on this page · raw message
tests/cris/check_openpf5.c new file +56 -0
56 lines not on this page · raw message
tests/cris/check_orc.s new file +71 -0
71 lines not on this page · raw message
tests/cris/check_orm.s new file +75 -0
75 lines not on this page · raw message
tests/cris/check_orq.s new file +41 -0
41 lines not on this page · raw message
tests/cris/check_orr.s new file +84 -0
84 lines not on this page · raw message
tests/cris/check_scc.s new file +95 -0
95 lines not on this page · raw message
tests/cris/check_subc.s new file +87 -0
87 lines not on this page · raw message
tests/cris/check_subm.s new file +96 -0
96 lines not on this page · raw message
tests/cris/check_subq.s new file +52 -0
52 lines not on this page · raw message
tests/cris/check_subr.s new file +102 -0
102 lines not on this page · raw message
tests/cris/check_swap.c new file +75 -0
75 lines not on this page · raw message
tests/cris/check_time1.c new file +46 -0
46 lines not on this page · raw message
tests/cris/check_xarith.s new file +46 -0
46 lines not on this page · raw message
tests/cris/crisutils.h new file +71 -0
71 lines not on this page · raw message
tests/cris/sys.c new file +48 -0
48 lines not on this page · raw message
tests/cris/testutils.inc new file +117 -0
117 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.