| 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 ; TODO(jvoung): Stop skipping unimplemented parts (via --skip-unimplemented) | 8 ; TODO(jvoung): Stop skipping unimplemented parts (via --skip-unimplemented) |
| 9 ; once enough infrastructure is in. Also, switch to --filetype=obj | 9 ; once enough infrastructure is in. Also, switch to --filetype=obj |
| 10 ; when possible. | 10 ; when possible. |
| 11 ; RUN: %if --need=target_ARM32 --need=allow_dump \ | 11 ; RUN: %if --need=target_ARM32 --need=allow_dump \ |
| 12 ; RUN: --command %p2i --filetype=asm --assemble \ | 12 ; RUN: --command %p2i --filetype=asm --assemble \ |
| 13 ; RUN: --disassemble --target arm32 -i %s --args -O2 --skip-unimplemented \ | 13 ; RUN: --disassemble --target arm32 -i %s --args -O2 --skip-unimplemented \ |
| 14 ; RUN: | %if --need=target_ARM32 --need=allow_dump \ | 14 ; RUN: | %if --need=target_ARM32 --need=allow_dump \ |
| 15 ; RUN: --command FileCheck --check-prefix ARM32 %s | 15 ; RUN: --command FileCheck --check-prefix ARM32 %s |
| 16 ; RUN: %if --need=target_MIPS32 --need=allow_dump \ | 16 ; RUN: %if --need=target_MIPS32 --need=allow_dump \ |
| 17 ; RUN: --command %p2i --filetype=asm --assemble \ | 17 ; RUN: --command %p2i --filetype=asm --assemble \ |
| 18 ; RUN: --disassemble --target mips32 -i %s --args -O2 --skip-unimplemented \ | 18 ; RUN: --disassemble --target mips32 -i %s --args -O2 --skip-unimplemented \ |
| 19 ; RUN: | %if --need=target_MIPS32 --need=allow_dump \ | 19 ; RUN: | %if --need=target_MIPS32 --need=allow_dump \ |
| 20 ; RUN: --command FileCheck --check-prefix MIPS32 %s | 20 ; RUN: --command FileCheck --check-prefix MIPS32 %s |
| 21 | 21 |
| 22 define void @foo() { | 22 define internal void @foo() { |
| 23 ret void | 23 ret void |
| 24 } | 24 } |
| 25 ; CHECK-LABEL: foo | 25 ; CHECK-LABEL: foo |
| 26 ; CHECK-NEXT: 0: {{.*}} ret | 26 ; CHECK-NEXT: 0: {{.*}} ret |
| 27 ; CHECK-NEXT: 1: {{.*}} hlt | 27 ; CHECK-NEXT: 1: {{.*}} hlt |
| 28 ; ARM32-LABEL: foo | 28 ; ARM32-LABEL: foo |
| 29 ; ARM32-NEXT: 0: {{.*}} bx lr | 29 ; ARM32-NEXT: 0: {{.*}} bx lr |
| 30 ; ARM32-NEXT: 4: e7fedef0 udf | 30 ; ARM32-NEXT: 4: e7fedef0 udf |
| 31 ; ARM32-NEXT: 8: e7fedef0 udf | 31 ; ARM32-NEXT: 8: e7fedef0 udf |
| 32 ; ARM32-NEXT: c: e7fedef0 udf | 32 ; ARM32-NEXT: c: e7fedef0 udf |
| 33 ; MIPS32-LABEL: foo | 33 ; MIPS32-LABEL: foo |
| 34 ; MIPS32: 0: {{.*}} jr ra | 34 ; MIPS32: 0: {{.*}} jr ra |
| 35 ; MIPS32-NEXT: 4: {{.*}} nop | 35 ; MIPS32-NEXT: 4: {{.*}} nop |
| 36 | 36 |
| 37 define void @bar() { | 37 define internal void @bar() { |
| 38 ret void | 38 ret void |
| 39 } | 39 } |
| 40 ; CHECK-LABEL: bar | 40 ; CHECK-LABEL: bar |
| 41 ; CHECK-NEXT: 20: {{.*}} ret | 41 ; CHECK-NEXT: 20: {{.*}} ret |
| 42 ; ARM32-LABEL: bar | 42 ; ARM32-LABEL: bar |
| 43 ; ARM32-NEXT: 10: {{.*}} bx lr | 43 ; ARM32-NEXT: 10: {{.*}} bx lr |
| 44 ; MIPS32-LABEL: bar | 44 ; MIPS32-LABEL: bar |
| 45 ; MIPS32: 10: {{.*}} jr ra | 45 ; MIPS32: 10: {{.*}} jr ra |
| 46 ; MIPS32-NEXT: 14: {{.*}} nop | 46 ; MIPS32-NEXT: 14: {{.*}} nop |
| OLD | NEW |