aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite/bfin/unlink.S
blob: 978d39e9ff2d02b45cb1d42cf487324e92500759 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Blackfin testcase for unlink insn with any immediate value
# mach: bfin
# sim: --environment operating

#include "test.h"
	.include "testutils.inc"

	start

	/* Set up exception handler */
	imm32 P4, EVT3;
	loadsym R1, _evx;
	[P4] = R1;

	/* Lower to the code we want to single step through */
	loadsym P1, _usr;
	RETI = P1;

	imm32 FP, 0x800000
	imm32 R0, 0x12345678;
	[FP] = R0;
	imm32 R0, 0x87654321;
	[FP + 4] = R0;

	RTI;

_usr:
	imm32 FP, 0x800000

	.byte 0x01, 0xe8
.Linsn:
	.byte 0, 0

	imm32 R0, 0x12345678;
	R1 = FP;
	CC = R0 == R1;
	IF !CC jump _fail;

	imm32 R0, 0x87654321;
	R1 = RETS;
	CC = R0 == R1;
	IF !CC jump _fail;

	imm32 R0, 0x800008;
	R1 = SP;
	CC = R0 == R1;
	IF !CC jump _fail;

	loadsym P0, .Linsn;
	R0 = W[P0];
	R0 += 1;
	W[P0] = R0;
	SSYNC;

	R0 = R0.L;
	CC = R0 == 0;
	IF CC jump _pass;
	jump _usr;

	.align 4;
_evx:
	dbg_fail;

_pass:
	dbg_pass;

_fail:
	dbg_fail;