aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/hexagon/test_call.S
blob: 338cd04e402bb76c72a510492afc47a445229266 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
 * Purpose: test function calls and duplex instructions.
 * The string "Hello there, I'm a test string!" with the first letter replaced
 * with a capital L should be printed out.
 */

#define SYS_write 64
#define FD_STDOUT 1

    .text
    .globl    test
test:
    {
        jumpr r31
        memb(r0+#0) = #76
    }
.Lfunc_end0:
.Ltmp0:
    .size    test, .Ltmp0-test

    .globl    _start
_start:
    {
        r0 = ##dummy_buffer
        allocframe(#0)
        call test
    }
    {
        call write
    }
    {
        deallocframe
        jump pass
    }
.Lfunc_end1:
.Ltmp1:
    .size    _start, .Ltmp1-_start

write:
    {
        r6 = #SYS_write
        r0 = #FD_STDOUT
        r1 = ##dummy_buffer
        r2 = #33
    }
    {
        trap0(#1)
    }
    {
        jumpr r31
    }

.Lfunc_end2:
.Ltmp2:
    .size    write, .Ltmp2-write

    .type    dummy_buffer,@object
    .data
    .globl    dummy_buffer
    .p2align    3
dummy_buffer:
    .string    "Hello there, I'm a test string!\n"
    .space 223
    .size    dummy_buffer, 256