xref: /qemu/tests/tcg/hexagon/test_call.S (revision 0ec8384f)
1/*
2 * Purpose: test function calls and duplex instructions.
3 * The string "Hello there, I'm a test string!" with the first letter replaced
4 * with a capital L should be printed out.
5 */
6
7#define SYS_write 64
8#define FD_STDOUT 1
9
10    .text
11    .globl    test
12test:
13    {
14        jumpr r31
15        memb(r0+#0) = #76
16    }
17.Lfunc_end0:
18.Ltmp0:
19    .size    test, .Ltmp0-test
20
21    .globl    _start
22_start:
23    {
24        r0 = ##dummy_buffer
25        allocframe(#0)
26        call test
27    }
28    {
29        call write
30    }
31    {
32        deallocframe
33        jump pass
34    }
35.Lfunc_end1:
36.Ltmp1:
37    .size    _start, .Ltmp1-_start
38
39write:
40    {
41        r6 = #SYS_write
42        r0 = #FD_STDOUT
43        r1 = ##dummy_buffer
44        r2 = #33
45    }
46    {
47        trap0(#1)
48    }
49    {
50        jumpr r31
51    }
52
53.Lfunc_end2:
54.Ltmp2:
55    .size    write, .Ltmp2-write
56
57    .type    dummy_buffer,@object
58    .data
59    .globl    dummy_buffer
60    .p2align    3
61dummy_buffer:
62    .string    "Hello there, I'm a test string!\n"
63    .space 223
64    .size    dummy_buffer, 256
65