xref: /openbmc/qemu/tests/tcg/hexagon/test_clobber.S (revision 7d87775f)
1/*
2 * Purpose: demonstrate the successful operation of the register save mechanism,
3 * in which the caller saves the registers that will be clobbered, and restores
4 * them after the call.
5 */
6
7    .text
8    .globl _start
9
10_start:
11    allocframe(#8)
12    {
13        r16 = #47
14        r17 = #155
15    }
16    memd(sp+#0) = r17:16
17    {
18        r16 = #255
19        r17 = #42
20    }
21    {
22        deallocframe
23        r17:16 = memd(sp+#0)
24    }
25    {
26        p0 = cmp.eq(r16, #47)
27        p0 = cmp.eq(r17, #155); if (p0.new) jump:t pass
28        jump fail
29    }
30