ld: Move the .note.build-id section to near the start of the memory map.
[binutils-gdb.git] / sim / testsuite / bfin / stk4.s
blob797aa78a10273b06e639a56ca829c9c73d4ba0a6
1 // load up some registers.
2 // setup up a global pointer table and load some state.
3 // save the machine state and clear some of the values.
4 // then restore and assert some of the values to ensure that
5 // we maintain consitent machine state.
6 # mach: bfin
8 .include "testutils.inc"
9 start
11 R0 = 1;
12 R1 = 2;
13 R2 = 3;
14 R3 = -7;
15 R4 = 4;
16 R5 = 5;
17 R6 = 6;
18 R7 = 7;
20 loadsym P0, a;
21 P1.L = 0x1000;
22 _DBG P0;
23 _DBG P1;
24 SP = P0;
25 FP = P0;
27 CALL try;
29 P1 = [ P0 ++ ];
30 P2 = [ P0 ++ ];
31 P0 += 4;
32 P4 = [ P0 ++ ];
33 P5 = [ P0 ++ ];
34 [ -- SP ] = ( R7:0, P5:0 );
35 _DBG SP;
36 _DBG FP;
37 R0 = R0 ^ R0;
38 R1 = R1 ^ R1;
39 R2 = R2 ^ R2;
40 R4 = R4 ^ R4;
41 R5 = R5 ^ R5;
42 R6 = R6 ^ R6;
43 R7 = R7 ^ R7;
44 ( R7:0, P5:0 ) = [ SP ++ ];
45 DBGA ( R0.L , 1 );
46 DBGA ( R1.L , 2 );
47 DBGA ( R2.L , 3 );
48 DBGA ( R3.L , 0xfff9 );
49 DBGA ( R4.L , 4 );
50 DBGA ( R5.L , 5 );
51 DBGA ( R6.L , 6 );
52 DBGA ( R7.L , 7 );
53 R0 = SP;
54 loadsym R1, a;
55 CC = R0 == R1;
56 IF !CC JUMP abrt;
57 R0 = FP;
58 CC = R0 == R1;
59 CC = R0 == R1;
60 IF !CC JUMP abrt;
61 pass
62 abrt:
63 fail;
65 try:
66 LINK 0;
67 [ -- SP ] = ( R7:0, P5:0 );
68 R7 = 0x1234 (X);
69 [ -- SP ] = R7;
70 CALL bar;
71 R7 = [ SP ++ ];
72 ( R7:0, P5:0 ) = [ SP ++ ];
73 UNLINK;
74 RTS;
76 bar:
77 LINK 0;
78 [ -- SP ] = ( R7:0, P5:0 );
79 R0 = [ FP + 8 ];
80 DBGA ( R0.L , 0x1234 );
81 CALL foo;
82 ( R7:0, P5:0 ) = [ SP ++ ];
83 UNLINK;
84 RTS;
86 foo:
87 DBGA ( R0.L , 0x1234 );
88 RTS;
90 .data
91 _gptab:
92 .dw 0x200
93 .dw 0x000
94 .dw 0x300
95 .dw 0x400
96 .dw 0x500
97 .dw 0x600
99 .space (0x100)
101 .dw 1
102 .dw 2
103 .dw 3
104 .dw 4
105 .dw 5
106 .dw 6
107 .dw 7
108 .dw 8
109 .dw 9
110 .dw 0xa