blob: 23d2ca75ea465335aa5929f6cb9f83a8a1a14caf [file] [log] [blame]
Jan Voungb17f61d2014-08-28 16:00:53 -07001; 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
Jim Stichnoth729dbd02015-02-25 14:48:43 -08006; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 | FileCheck %s
Jan Voung29719972015-05-19 11:24:51 -07007
Jan Voungb2d50842015-05-12 09:53:50 -07008; TODO(jvoung): Stop skipping unimplemented parts (via --skip-unimplemented)
9; once enough infrastructure is in. Also, switch to --filetype=obj
10; when possible.
Jim Stichnothc8799682015-06-22 13:04:10 -070011; RUN: %if --need=target_ARM32 --need=allow_dump \
12; RUN: --command %p2i --filetype=asm --assemble \
Jan Voungb2d50842015-05-12 09:53:50 -070013; RUN: --disassemble --target arm32 -i %s --args -O2 --skip-unimplemented \
Jim Stichnothc8799682015-06-22 13:04:10 -070014; RUN: | %if --need=target_ARM32 --need=allow_dump \
15; RUN: --command FileCheck --check-prefix ARM32 %s
Jan Voungb17f61d2014-08-28 16:00:53 -070016
17define void @foo() {
18 ret void
19}
20; CHECK-LABEL: foo
21; CHECK-NEXT: 0: {{.*}} ret
22; CHECK-NEXT: 1: {{.*}} hlt
Jan Voungb2d50842015-05-12 09:53:50 -070023; ARM32-LABEL: foo
24; ARM32-NEXT: 0: {{.*}} bx lr
25; ARM32-NEXT: 4: e7fedef0 udf
26; ARM32-NEXT: 8: e7fedef0 udf
27; ARM32-NEXT: c: e7fedef0 udf
Jan Voungb17f61d2014-08-28 16:00:53 -070028
29define void @bar() {
30 ret void
31}
32; CHECK-LABEL: bar
33; CHECK-NEXT: 20: {{.*}} ret
Jan Voungb2d50842015-05-12 09:53:50 -070034; ARM32-LABEL: bar
35; ARM32-NEXT: 10: {{.*}} bx lr