OLD | NEW |
1 ; Test that functions are aligned to the NaCl bundle alignment. | 1 ; Test that functions are aligned to the NaCl bundle alignment. |
2 ; We could be smarter and only do this for indirect call targets | 2 ; We could be smarter and only do this for indirect call targets |
3 ; but typically you want to align functions anyway. | 3 ; but typically you want to align functions anyway. |
4 ; Also, we are currently using hlts for non-executable padding. | 4 ; Also, we are currently using hlts for non-executable padding. |
5 | 5 |
6 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 | FileCheck %s | 6 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 | FileCheck %s |
7 | 7 |
8 ; RUN: %if --need=target_ARM32 \ | 8 ; RUN: %if --need=target_ARM32 \ |
9 ; RUN: --command %p2i --filetype=obj \ | 9 ; RUN: --command %p2i --filetype=obj \ |
10 ; RUN: --disassemble --target arm32 -i %s --args -O2 \ | 10 ; RUN: --disassemble --target arm32 -i %s --args -O2 \ |
11 ; RUN: | %if --need=target_ARM32 \ | 11 ; RUN: | %if --need=target_ARM32 \ |
12 ; RUN: --command FileCheck --check-prefix ARM32 %s | 12 ; RUN: --command FileCheck --check-prefix ARM32 %s |
13 ; RUN: %if --need=target_MIPS32 --need=allow_dump \ | 13 ; RUN: %if --need=target_MIPS32 --need=allow_dump \ |
14 ; RUN: --command %p2i --filetype=asm --assemble \ | 14 ; RUN: --command %p2i --filetype=asm --assemble \ |
15 ; RUN: --disassemble --target mips32 -i %s --args -O2 --skip-unimplemented \ | 15 ; RUN: --disassemble --target mips32 -i %s --args -O2 \ |
16 ; RUN: | %if --need=target_MIPS32 --need=allow_dump \ | 16 ; RUN: | %if --need=target_MIPS32 --need=allow_dump \ |
17 ; RUN: --command FileCheck --check-prefix MIPS32 %s | 17 ; RUN: --command FileCheck --check-prefix MIPS32 %s |
18 | 18 |
19 define internal void @foo() { | 19 define internal void @foo() { |
20 ret void | 20 ret void |
21 } | 21 } |
22 ; CHECK-LABEL: foo | 22 ; CHECK-LABEL: foo |
23 ; CHECK-NEXT: 0: {{.*}} ret | 23 ; CHECK-NEXT: 0: {{.*}} ret |
24 ; CHECK-NEXT: 1: {{.*}} hlt | 24 ; CHECK-NEXT: 1: {{.*}} hlt |
25 ; ARM32-LABEL: foo | 25 ; ARM32-LABEL: foo |
26 ; ARM32-NEXT: 0: {{.*}} bx lr | 26 ; ARM32-NEXT: 0: {{.*}} bx lr |
27 ; ARM32-NEXT: 4: e7fedef0 udf | 27 ; ARM32-NEXT: 4: e7fedef0 udf |
28 ; ARM32-NEXT: 8: e7fedef0 udf | 28 ; ARM32-NEXT: 8: e7fedef0 udf |
29 ; ARM32-NEXT: c: e7fedef0 udf | 29 ; ARM32-NEXT: c: e7fedef0 udf |
30 ; MIPS32-LABEL: foo | 30 ; MIPS32-LABEL: foo |
31 ; MIPS32: 0: {{.*}} jr ra | 31 ; MIPS32: 0: {{.*}} jr ra |
32 ; MIPS32-NEXT: 4: {{.*}} nop | 32 ; MIPS32-NEXT: 4: {{.*}} nop |
33 | 33 |
34 define internal void @bar() { | 34 define internal void @bar() { |
35 ret void | 35 ret void |
36 } | 36 } |
37 ; CHECK-LABEL: bar | 37 ; CHECK-LABEL: bar |
38 ; CHECK-NEXT: 20: {{.*}} ret | 38 ; CHECK-NEXT: 20: {{.*}} ret |
39 ; ARM32-LABEL: bar | 39 ; ARM32-LABEL: bar |
40 ; ARM32-NEXT: 10: {{.*}} bx lr | 40 ; ARM32-NEXT: 10: {{.*}} bx lr |
41 ; MIPS32-LABEL: bar | 41 ; MIPS32-LABEL: bar |
42 ; MIPS32: 10: {{.*}} jr ra | 42 ; MIPS32: 10: {{.*}} jr ra |
43 ; MIPS32-NEXT: 14: {{.*}} nop | 43 ; MIPS32-NEXT: 14: {{.*}} nop |
OLD | NEW |