binutils-gdb/sim/testsuite/bfin/link.s
Mike Frysinger 1368b914e9 sim: testsuite: flatten tree
Now that all port tests live under testsuite/sim/*/, and none live
in testsuite/ directly, flatten the structure by moving all of the
dirs under testsuite/sim/ to testsuite/ directly.

We need to stop passing --tool to dejagnu so that it searches all
dirs and not just ones that start with "sim".  Since we have no
other dirs in this tree, and no plans to add any, should be fine.
2021-01-15 19:18:34 -05:00

68 lines
995 B
ArmAsm

# Blackfin testcase for link/unlink instructions
# mach: bfin
.include "testutils.inc"
start
/* give FP/RETS known/different values */
R7.H = 0xdead;
R7.L = 0x1234;
RETS = R7;
R6 = R7;
R6 += 0x23;
FP = R6;
/* SP should have moved by -8 bytes (to push FP/RETS) */
R0 = SP;
LINK 0;
R1 = SP;
R1 += 8;
CC = R0 == R1;
IF !CC JUMP 1f;
/* FP should now have the same value as SP */
R1 = SP;
R2 = FP;
CC = R1 == R2;
IF !CC JUMP 1f;
/* make sure FP/RETS on the stack have our known values */
R1 = [SP];
CC = R1 == R6;
IF !CC JUMP 1f;
R1 = [SP + 4];
CC = R1 == R7;
IF !CC JUMP 1f;
/* UNLINK should:
* assign SP to current FP
* adjust SP by -8 bytes
* restore RETS/FP from the stack
*/
R4 = 0;
RETS = R4;
R0 = SP;
UNLINK;
/* Check new SP */
R1 = SP;
R1 += -0x8;
CC = R1 == R0;
IF !CC JUMP 1f;
/* Check restored RETS */
R1 = RETS;
CC = R1 == R7;
IF !CC JUMP 1f;
/* Check restored FP */
R1 = FP;
CC = R1 == R6;
IF !CC JUMP 1f;
pass
1:
fail