Automatic date update in version.in
[binutils-gdb.git] / sim / testsuite / bpf / endle.s
blob25d852d7172dd8a9d2ae038818d27abc37f7225f
1 # mach: bpf
2 # output: pass\nexit 0 (0x0)\n
3 /* endle.s
4 Tests for BPF endianness-conversion instructions in simulator
5 running in LITTLE ENDIAN
7 Both 'be' and 'le' ISAs have both endbe and endle instructions. */
9 .include "testutils.inc"
11 .text
12 .global main
13 .type main, @function
14 main:
15 lddw %r1, 0x12345678deadbeef
16 endbe %r1, 64
17 fail_ne %r1, 0xefbeadde78563412
18 endbe %r1, 64
19 fail_ne %r1, 0x12345678deadbeef
21 /* `bitsize` < 64 will truncate */
22 endbe %r1, 32
23 fail_ne %r1, 0xefbeadde
24 endbe %r1, 32
25 fail_ne %r1, 0xdeadbeef
27 endbe %r1, 16
28 fail_ne %r1, 0xefbe
29 endbe %r1, 16
30 fail_ne %r1, 0xbeef
32 /* endle on le should be noop (except truncate) */
33 lddw %r1, 0x12345678deadbeef
34 endle %r1, 64
35 fail_ne %r1, 0x12345678deadbeef
37 endle %r1, 32
38 fail_ne %r1, 0xdeadbeef
40 endle %r1, 16
41 fail_ne %r1, 0xbeef
43 pass