aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite/bfin/stk.s
blob: 451a11e280d947a557d49e6416cf653f1a44447b (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
69
70
71
72
73
74
75
76
77
78
# mach: bfin

.include "testutils.inc"
	start


// load up some registers.
// setup up a global pointer table and load some state.
// save the machine state and clear some of the values.
// then restore and assert some of the values to ensure that
// we maintain consitent machine state.

	R0 = 1;
	R1 = 2;
	R2 = 3;
	R3 = -7;
	R4 = 4;
	R5 = 5;
	R6 = 6;
	R7 = 7;

	loadsym P0, a;
	_DBG P0;
	SP = P0;
	FP = P0;
	P1 = [ P0 ++ ];
	P2 = [ P0 ++ ];
	P0 += 4;
	P4 = [ P0 ++ ];
	P5 = [ P0 ++ ];
	[ -- SP ] = ( R7:0, P5:0 );
	_DBG SP;
	_DBG FP;
	R0 = R0 ^ R0;
	R1 = R1 ^ R1;
	R2 = R2 ^ R2;
	R4 = R4 ^ R4;
	R5 = R5 ^ R5;
	R6 = R6 ^ R6;
	R7 = R7 ^ R7;
	( R7:0, P5:0 ) = [ SP ++ ];
	DBGA ( R0.L , 1 );
	DBGA ( R2.L , 3 );
	DBGA ( R7.L , 7 );
	R0 = SP;
	loadsym R1, a;
	CC = R0 == R1;
	IF !CC JUMP abrt;
	R0 = FP;
	CC = R0 == R1;
	CC = R0 == R1;
	IF !CC JUMP abrt;

	pass
abrt:
	fail

	.data
_gptab:
	.dw 0x200
	.dw 0x000
	.dw 0x300
	.dw 0x400
	.dw 0x500
	.dw 0x600

	.space (0x100)
a:
	.dw 1
	.dw 2
	.dw 3
	.dw 4
	.dw 5
	.dw 6
	.dw 7
	.dw 8
	.dw 9
	.dw 0xa