aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/hexagon/test_clobber.S
blob: 10046c30d2fd8c36fc7400e848d94eb47be56cf5 (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
/*
 * Purpose: demonstrate the successful operation of the register save mechanism,
 * in which the caller saves the registers that will be clobbered, and restores
 * them after the call.
 */

    .text
    .globl _start

_start:
    allocframe(#8)
    {
        r16 = #47
        r17 = #155
    }
    memd(sp+#0) = r17:16
    {
        r16 = #255
        r17 = #42
    }
    {
        deallocframe
        r17:16 = memd(sp+#0)
    }
    {
        p0 = cmp.eq(r16, #47)
        p0 = cmp.eq(r17, #155); if (p0.new) jump:t pass
        jump fail
    }