Add an option with a color type.
[binutils-gdb.git] / sim / testsuite / bpf / endbe.s
blob2b2de96f0baae6e39adc348c98035d924aeb2635
1 # mach: bpf
2 # as: --EB
3 # ld: --EB
4 # sim: -E big
5 # output: pass\nexit 0 (0x0)\n
6 /* endbe.s
7 Tests for BPF endianness-conversion instructions in simulator
8 running in BIG ENDIAN
10 Both 'be' and 'le' ISAs have both endbe and endle instructions. */
12 .include "testutils.inc"
14 .text
15 .global main
16 .type main, @function
17 main:
18 lddw %r1, 0x12345678deadbeef
19 endle %r1, 64
20 fail_ne %r1, 0xefbeadde78563412
21 endle %r1, 64
22 fail_ne %r1, 0x12345678deadbeef
24 /* `bitsize` < 64 will truncate */
25 endle %r1, 32
26 fail_ne %r1, 0xefbeadde
27 endle %r1, 32
28 fail_ne %r1, 0xdeadbeef
30 endle %r1, 16
31 fail_ne %r1, 0xefbe
32 endle %r1, 16
33 fail_ne %r1, 0xbeef
35 /* endbe on be should be noop (except truncate) */
36 lddw %r1, 0x12345678deadbeef
37 endbe %r1, 64
38 fail_ne %r1, 0x12345678deadbeef
40 endbe %r1, 32
41 fail_ne %r1, 0xdeadbeef
43 endbe %r1, 16
44 fail_ne %r1, 0xbeef
46 pass