Automatic date update in version.in
[binutils-gdb.git] / sim / testsuite / bpf / mov.s
blob8fbd9819cb4f3b617642ec0c6205f9f1ddd3f034
1 # mach: bpf
2 # output: pass\nexit 0 (0x0)\n
3 /* mov.s
4 Tests for mov and mov32 instructions */
6 .include "testutils.inc"
8 .text
9 .global main
10 .type main, @function
11 main:
12 /* some basic sanity checks */
13 mov32 %r1, 5
14 fail_ne %r1, 5
16 mov32 %r2, %r1
17 fail_ne %r2, 5
19 mov %r2, %r1
20 fail_ne %r2, 5
22 mov %r1, -666
23 fail_ne %r1, -666
25 /* should NOT sign extend */
26 mov32 %r1, -1
27 fail_ne %r1, 0x00000000ffffffff
29 /* should sign extend */
30 mov %r2, -1
31 fail_ne %r2, 0xffffffffffffffff
33 mov %r3, -2147483648 /* 0x80000000 */
35 /* should NOT sign extend */
36 mov32 %r4, %r3
37 fail_ne %r4, 0x0000000080000000
39 /* should sign extend */
40 mov %r5, %r3
41 fail_ne %r5, 0xffffffff80000000
43 mov32 %r1, -2147483648
44 mov32 %r1, %r1
45 fail_ne32 %r1, -2147483648
47 /* casting shenanigans */
48 mov %r1, %r1
49 fail_ne %r1, +2147483648
50 mov32 %r2, -1
51 mov %r2, %r2
52 fail_ne %r2, +4294967295
54 pass