ld: Move the .note.build-id section to near the start of the memory map.
[binutils-gdb.git] / sim / testsuite / bfin / usp.S
blobe77ff5244869670c78af851028def20b0c64d835
1 # Blackfin testcase for USP handling
2 # mach: bfin
3 # sim: --environment operating
5 #include "test.h"
6         .include "testutils.inc"
8         start
10         imm32 R5, 0x44455566
11         imm32 R6, 0x12345678
12         imm32 R7, 0x9abcdef0
14         imm32 p0, EVT3;
15         loadsym r0, exception;
16         [p0] = r0;
18         loadsym r0, usermode;
19         reti = r0;
21         SP = R6;
22         USP = R7;
23         RTI;
25 usermode:
26         # SP should now be USP
27         R1 = SP;
28         CC = R1 == R7;
29         IF !CC JUMP fail;
31         # Now set SP to another value
32         SP = R5;
34         # Move up to exception space
35         EXCPT 0;
37 exception:
38         # SP should be the same as original, but USP should change
39         R1 = SP;
40         CC = R1 == R6;
41         IF !CC JUMP fail;
43         R1 = USP;
44         CC = R1 == R5;
45         IF !CC JUMP fail;
47         dbg_pass
49 fail:
50         dbg_fail