repo.or.cz
/
binutils-gdb.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
gdb/testsuite: Reduce gdb.threads/threadcrash.exp reliance on libc symbols
[binutils-gdb.git]
/
sim
/
testsuite
/
cr16
/
testutils.inc
blob
1b82dc64c5efe27e89d7977b7060c6f699e71df3
1
# r0-r5 are used as tmps, consider them call clobbered by these macros.
2
3
.macro START
4
.data
5
failmsg:
6
.ascii "fail\n"
7
passmsg:
8
.ascii "pass\n"
9
.text
10
.global _START
11
_START:
12
.global _start
13
_start:
14
.endm
15
16
.macro exit rc
17
movw $\rc,r2
18
movw $0x410,r0
19
excp 8
20
.endm
21
22
.macro pass
23
movw $1, r2
24
movd $passmsg,(r4,r3)
25
movw $5, r5
26
movw $0x404, r0
27
excp 8
28
exit 0
29
.endm
30
31
.macro fail
32
movw $1, r2
33
movd $failmsg,(r4,r3)
34
movw $5, r5
35
movw $0x404, r0
36
excp 8
37
exit 1
38
.endm
39
40
# Other macros know this only clobbers r0.
41
.macro test_h_gr reg, val
42
movw $\val,r0
43
cmpw \reg, r0
44
beq test_gr
45
fail
46
test_gr:
47
.endm
48
49
.macro test_h_grp regp, val
50
movd $\val,(r1,r0)
51
cmpd \regp,(r1,r0)
52
beq test_grp
53
fail
54
test_grp:
55
.endm
56
57
58
.macro mvi_h_condbit val
59
movw $0, r0
60
movw $\val, r1
61
cmpw r0, r1
62
.endm
63
64
.macro test_h_condbit val
65
.if \val
66
br test_c1
67
fail
68
test_c1:
69
.else
70
br test_c0
71
fail
72
test_c0:
73
.endif
74
.endm