1# Blackfin testcase for unlink insn with any immediate value
2# mach: bfin
3# sim: --environment operating
4
5#include "test.h"
6	.include "testutils.inc"
7
8	start
9
10	/* Set up exception handler */
11	imm32 P4, EVT3;
12	loadsym R1, _evx;
13	[P4] = R1;
14
15	/* Lower to the code we want to single step through */
16	loadsym P1, _usr;
17	RETI = P1;
18
19	imm32 FP, 0x800000
20	imm32 R0, 0x12345678;
21	[FP] = R0;
22	imm32 R0, 0x87654321;
23	[FP + 4] = R0;
24
25	RTI;
26
27_usr:
28	imm32 FP, 0x800000
29
30	.byte 0x01, 0xe8
31.Linsn:
32	.byte 0, 0
33
34	imm32 R0, 0x12345678;
35	R1 = FP;
36	CC = R0 == R1;
37	IF !CC jump _fail;
38
39	imm32 R0, 0x87654321;
40	R1 = RETS;
41	CC = R0 == R1;
42	IF !CC jump _fail;
43
44	imm32 R0, 0x800008;
45	R1 = SP;
46	CC = R0 == R1;
47	IF !CC jump _fail;
48
49	loadsym P0, .Linsn;
50	R0 = W[P0];
51	R0 += 1;
52	W[P0] = R0;
53	SSYNC;
54
55	R0 = R0.L;
56	CC = R0 == 0;
57	IF CC jump _pass;
58	jump _usr;
59
60	.align 4;
61_evx:
62	dbg_fail;
63
64_pass:
65	dbg_pass;
66
67_fail:
68	dbg_fail;
69