]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - sim/testsuite/sim/aarch64/testutils.inc
Fix aarch64 sim bug with adds64, and add testcases for last 3 bug fixes.
[thirdparty/binutils-gdb.git] / sim / testsuite / sim / aarch64 / testutils.inc
1 # MACRO: exit
2 # Terminates execution.
3 .macro exit nr
4
5 stp x29, x30, [sp,#-32]!
6 mov x4, #0x26
7 mov x7, #\nr
8 mov x29, sp
9 movk x4, #0x2, lsl #16
10 add x1, x29, #0x10
11 str x4, [x29,#16]
12 str x7, [x29,#24]
13 mov w0, #0x18
14 hlt #0xf000
15
16 .endm
17
18 # MACRO: swiwrite
19 # Writes the string in X1 to stdout
20 .macro swiwrite len
21
22 stp x29, x30, [sp,#-48]!
23 mov x0, #1
24 mov x2, #\len
25 mov x29, sp
26 str x0, [x29,#24]
27 str x1, [x29,#32]
28 str x2, [x29,#40]
29 mov w0, #0x5
30 add x1, x29, #0x18
31 hlt #0xf000
32 ldp x29, x30, [sp],#48
33 ret
34
35 .endm
36
37 # MACRO: pass
38 # Write 'pass' to stdout and quit
39 .macro pass
40
41 adrp x1, .Lpass
42 add x1, x1, :lo12:.Lpass
43
44 swiwrite 5
45 exit 0
46 .endm
47
48 # MACRO: fail
49 # Write 'fail' to stdout and quit
50 .macro fail
51
52 adrp x1, .Lfail
53 add x1, x1, :lo12:.Lfail
54 swiwrite 5
55 exit 1
56 .endm
57
58 # MACRO: start
59 # All assembler tests should start with a call to "start"
60 .macro start
61 .data
62 .Lpass:
63 .asciz "pass\n"
64 .Lfail:
65 .asciz "fail\n"
66
67 .text
68 .global _start
69 _start:
70 .endm