| OLD | NEW |
| 1 ; TODO(kschimpf): Show that we can handle global variable loads/stores. | 1 ; TODO(kschimpf): Show that we can handle global variable loads/stores. |
| 2 | 2 |
| 3 ; REQUIRES: allow_dump | 3 ; REQUIRES: allow_dump |
| 4 | 4 |
| 5 ; Compile using standalone assembler. | 5 ; Compile using standalone assembler. |
| 6 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -O2 \ | 6 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -O2 \ |
| 7 ; RUN: | FileCheck %s --check-prefix=ASM | 7 ; RUN: | FileCheck %s --check-prefix=ASM |
| 8 | 8 |
| 9 ; Show bytes in assembled standalone code. | 9 ; Show bytes in assembled standalone code. |
| 10 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \ | 10 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \ |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 ; ASM-NEXT: ldr r0, [r0] | 45 ; ASM-NEXT: ldr r0, [r0] |
| 46 ; ASM-NEXT: bx lr | 46 ; ASM-NEXT: bx lr |
| 47 | 47 |
| 48 ; DIS-LABEL:00000000 <load>: | 48 ; DIS-LABEL:00000000 <load>: |
| 49 ; DIS-NEXT: 0: e3000000 | 49 ; DIS-NEXT: 0: e3000000 |
| 50 ; DIS-NEXT: 4: e3400000 | 50 ; DIS-NEXT: 4: e3400000 |
| 51 ; DIS-NEXT: 8: e5900000 | 51 ; DIS-NEXT: 8: e5900000 |
| 52 ; DIS-NEXT: c: e12fff1e | 52 ; DIS-NEXT: c: e12fff1e |
| 53 | 53 |
| 54 ; IASM-LABEL:load: | 54 ; IASM-LABEL:load: |
| 55 ; IASM-NEXT: .Lload$__0: |
| 55 ; IASM-NEXT: movw r0, #:lower16:global1 | 56 ; IASM-NEXT: movw r0, #:lower16:global1 |
| 56 ; IASM-NEXT: movt r0, #:upper16:global1 | 57 ; IASM-NEXT: movt r0, #:upper16:global1 |
| 57 ; IASM-NEXT: ldr r0, [r0] | 58 ; IASM-NEXT: ldr r0, [r0] |
| 58 ; IASM-NEXT: .byte 0x1e | 59 ; IASM-NEXT: .byte 0x1e |
| 59 ; IASM-NEXT: .byte 0xff | 60 ; IASM-NEXT: .byte 0xff |
| 60 ; IASM-NEXT: .byte 0x2f | 61 ; IASM-NEXT: .byte 0x2f |
| 61 ; IASM-NEXT: .byte 0xe1 | 62 ; IASM-NEXT: .byte 0xe1 |
| 62 | 63 |
| 63 define internal void @store(i32 %v) { | 64 define internal void @store(i32 %v) { |
| 64 %addr = bitcast [4 x i8]* @global1 to i32* | 65 %addr = bitcast [4 x i8]* @global1 to i32* |
| 65 store i32 %v, i32* %addr, align 1 | 66 store i32 %v, i32* %addr, align 1 |
| 66 ret void | 67 ret void |
| 67 } | 68 } |
| 68 | 69 |
| 69 ; ASM-LABEL:store: | 70 ; ASM-LABEL:store: |
| 70 ; ASM-NEXT: .Lstore$__0: | 71 ; ASM-NEXT: .Lstore$__0: |
| 71 ; ASM-NEXT: movw r1, #:lower16:global1 | 72 ; ASM-NEXT: movw r1, #:lower16:global1 |
| 72 ; ASM-NEXT: movt r1, #:upper16:global1 | 73 ; ASM-NEXT: movt r1, #:upper16:global1 |
| 73 ; ASM-NEXT: str r0, [r1] | 74 ; ASM-NEXT: str r0, [r1] |
| 74 ; ASM-NEXT: bx lr | 75 ; ASM-NEXT: bx lr |
| 75 | 76 |
| 76 ; DIS-LABEL:00000010 <store>: | 77 ; DIS-LABEL:00000010 <store>: |
| 77 ; DIS-NEXT: 10: e3001000 | 78 ; DIS-NEXT: 10: e3001000 |
| 78 ; DIS-NEXT: 14: e3401000 | 79 ; DIS-NEXT: 14: e3401000 |
| 79 ; DIS-NEXT: 18: e5810000 | 80 ; DIS-NEXT: 18: e5810000 |
| 80 ; DIS-NEXT: 1c: e12fff1e | 81 ; DIS-NEXT: 1c: e12fff1e |
| 81 | 82 |
| 82 ; IASM-LABEL:store: | 83 ; IASM-LABEL:store: |
| 84 ; IASM-NEXT: .Lstore$__0: |
| 83 ; IASM-NEXT: movw r1, #:lower16:global1 | 85 ; IASM-NEXT: movw r1, #:lower16:global1 |
| 84 ; IASM-NEXT: movt r1, #:upper16:global1 | 86 ; IASM-NEXT: movt r1, #:upper16:global1 |
| 85 ; IASM-NEXT: str r0, [r1] | 87 ; IASM-NEXT: str r0, [r1] |
| 86 ; IASM-NEXT: .byte 0x1e | 88 ; IASM-NEXT: .byte 0x1e |
| 87 ; IASM-NEXT: .byte 0xff | 89 ; IASM-NEXT: .byte 0xff |
| 88 ; IASM-NEXT: .byte 0x2f | 90 ; IASM-NEXT: .byte 0x2f |
| 89 ; IASM-NEXT: .byte 0xe1 | 91 ; IASM-NEXT: .byte 0xe1 |
| OLD | NEW |