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