1# Blackfin testcase for circular buffers and BREV
2# mach: bfin
3
4	.include "testutils.inc"
5
6	start
7
8	I0 = 0 (X);
9	M0 = 0x8 (X);
10	P0 = 16;
11	loadsym R1, vals;
12
13aaa:
14	I0 += M0 (BREV);
15	P0 += -1;
16
17	R2 = I0;
18	R0 = R1 + R2
19	P1 = R0;
20	R0 = B[P1] (Z);
21
22	R3 = P0;
23
24	CC = R0 == R3;
25	if !CC JUMP _fail;
26
27	CC = P0 == 0;
28	IF !CC JUMP aaa (BP);
29	R0 = I0;
30
31	DBGA(R0.L, 0x0000);
32	DBGA(R0.H, 0x0000);
33
34	pass
35
36_fail:
37	fail
38
39	.data
40vals:
41.db 0x0		/* 0 */
42.db 0x8
43.db 0xc
44.db 0x4		/* 4 */
45.db 0xe
46.db 0x6
47.db 0xa
48.db 0x2		/* 8 */
49.db 0xf
50.db 0x7
51.db 0xB
52.db 0x3		/* c */
53.db 0xD
54.db 0x5
55.db 0x9		/* f */
56.db 0x1
57