OLD | NEW |
(Empty) | |
| 1 ; Show that we know how to translate add. |
| 2 |
| 3 ; NOTE: We use -O2 to get rid of memory stores. |
| 4 |
| 5 ; REQUIRES: allow_dump |
| 6 |
| 7 ; Compile using standalone assembler. |
| 8 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -O2 \ |
| 9 ; RUN: | FileCheck %s --check-prefix=ASM |
| 10 |
| 11 ; Show bytes in assembled standalone code. |
| 12 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \ |
| 13 ; RUN: --args -O2 | FileCheck %s --check-prefix=DIS |
| 14 |
| 15 ; Compile using integrated assembler. |
| 16 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 \ |
| 17 ; RUN: | FileCheck %s --check-prefix=IASM |
| 18 |
| 19 ; Show bytes in assembled integrated code. |
| 20 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \ |
| 21 ; RUN: --args -O2 | FileCheck %s --check-prefix=DIS |
| 22 |
| 23 define internal void @callIndirect(i32 %addr) { |
| 24 ; ASM-LABEL:callIndirect: |
| 25 ; DIS-LABEL:00000000 <callIndirect>: |
| 26 ; IASM-LABEL:callIndirect: |
| 27 |
| 28 entry: |
| 29 ; ASM-NEXT:.LcallIndirect$entry: |
| 30 ; IASM-NEXT:.LcallIndirect$entry: |
| 31 ; ASM-NEXT: push {lr} |
| 32 ; DIS-NEXT: 0: e52de004 |
| 33 ; IASM-NEXT: .byte 0x4 |
| 34 ; IASM-NEXT: .byte 0xe0 |
| 35 ; IASM-NEXT: .byte 0x2d |
| 36 ; IASM-NEXT: .byte 0xe5 |
| 37 |
| 38 ; ASM-NEXT: sub sp, sp, #12 |
| 39 ; DIS-NEXT: 4: e24dd00c |
| 40 ; IASM-NEXT: .byte 0xc |
| 41 ; IASM-NEXT: .byte 0xd0 |
| 42 ; IASM-NEXT: .byte 0x4d |
| 43 ; IASM-NEXT: .byte 0xe2 |
| 44 |
| 45 %calladdr = inttoptr i32 %addr to void (i32)* |
| 46 |
| 47 ; ASM-NEXT: mov r1, r0 |
| 48 ; DIS-NEXT: 8: e1a01000 |
| 49 ; IASM-NEXT: .byte 0x0 |
| 50 ; IASM-NEXT: .byte 0x10 |
| 51 ; IASM-NEXT: .byte 0xa0 |
| 52 ; IASM-NEXT: .byte 0xe1 |
| 53 |
| 54 call void %calladdr(i32 %addr) |
| 55 |
| 56 ; ASM-NEXT: blx r1 |
| 57 ; DIS-NEXT: c: e12fff31 |
| 58 ; IASM-NEXT: .byte 0x31 |
| 59 ; IASM-NEXT: .byte 0xff |
| 60 ; IASM-NEXT: .byte 0x2f |
| 61 ; IASM-NEXT: .byte 0xe1 |
| 62 |
| 63 ret void |
| 64 } |
OLD | NEW |