xref: /netbsd-src/external/gpl3/gdb/dist/sim/testsuite/bfin/cec-ifetch.S (revision 4b169a6ba595ae283ca507b26b15fdff40495b1c)
1# Blackfin testcase for making sure RETX is the excepting insn
2# and not the target of the insn (like indirect jumps)
3# mach: bfin
4# sim: --environment operating
5
6#include "test.h"
7	.include "testutils.inc"
8
9	start
10
11	# Set our handler
12	imm32 P5, EVT3;
13	loadsym R1, _evtx;
14	[P5] = R1;
15
16	# Lower ourselves below EVT3
17	loadsym R4, _i_rts;
18	RETI = R4;
19	RAISE 12;
20	RTI;
21
22_i_rts:
23	# Check unaligned RETS
24	loadsym R6, 1f;
25	loadsym R5, 2f;
26	R0 = 1;
27	RETS = R0;
281:	RTS;
292:
30
31_i_jump:
32	# Check unaligned indirect jump
33	loadsym R6, 1f;
34	loadsym R5, 2f;
35	P0 = 1;
361:	JUMP (P0);
372:
38
39_i_jump_off:
40	# Check unaligned indirect jump (pc-relative)
41	loadsym R6, 1f;
42	loadsym R5, 2f;
43	P0 = 1;
441:	JUMP (PC + P0);
452:
46
47_i_call:
48	# Check unaligned indirect call
49	loadsym R6, 1f;
50	loadsym R5, 2f;
51	P0 = 1;
521:	CALL (P0);
532:
54
55_pass_lvl:
56	dbg_pass
57
58_evtx:
59	# Make sure R6 matches RETX
60	R7 = RETX;
61	CC = R6 == R7;
62	if !CC jump _fail_lvl;
63
64	# Move on to next test
65	RETX = R5;
66	RTX;
67
68_fail_lvl:
69	dbg_fail
70