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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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: .Lload$__0: |
56 ; IASM-NEXT: movw r0, #:lower16:global1 | 56 ; IASM-NEXT: movw r0, #:lower16:global1 |
57 ; IASM-NEXT: movt r0, #:upper16:global1 | 57 ; IASM-NEXT: movt r0, #:upper16:global1 |
58 ; IASM-NEXT: ldr r0, [r0] | 58 ; IASM-NEXT: .byte 0x0 |
| 59 ; IASM-NEXT: .byte 0x0 |
| 60 ; IASM-NEXT: .byte 0x90 |
| 61 ; IASM-NEXT: .byte 0xe5 |
59 ; IASM-NEXT: .byte 0x1e | 62 ; IASM-NEXT: .byte 0x1e |
60 ; IASM-NEXT: .byte 0xff | 63 ; IASM-NEXT: .byte 0xff |
61 ; IASM-NEXT: .byte 0x2f | 64 ; IASM-NEXT: .byte 0x2f |
62 ; IASM-NEXT: .byte 0xe1 | 65 ; IASM-NEXT: .byte 0xe1 |
63 | 66 |
64 define internal void @store(i32 %v) { | 67 define internal void @store(i32 %v) { |
65 %addr = bitcast [4 x i8]* @global1 to i32* | 68 %addr = bitcast [4 x i8]* @global1 to i32* |
66 store i32 %v, i32* %addr, align 1 | 69 store i32 %v, i32* %addr, align 1 |
67 ret void | 70 ret void |
68 } | 71 } |
69 | 72 |
70 ; ASM-LABEL:store: | 73 ; ASM-LABEL:store: |
71 ; ASM-NEXT: .Lstore$__0: | 74 ; ASM-NEXT: .Lstore$__0: |
72 ; ASM-NEXT: movw r1, #:lower16:global1 | 75 ; ASM-NEXT: movw r1, #:lower16:global1 |
73 ; ASM-NEXT: movt r1, #:upper16:global1 | 76 ; ASM-NEXT: movt r1, #:upper16:global1 |
74 ; ASM-NEXT: str r0, [r1] | 77 ; ASM-NEXT: str r0, [r1] |
75 ; ASM-NEXT: bx lr | 78 ; ASM-NEXT: bx lr |
76 | 79 |
77 ; DIS-LABEL:00000010 <store>: | 80 ; DIS-LABEL:00000010 <store>: |
78 ; DIS-NEXT: 10: e3001000 | 81 ; DIS-NEXT: 10: e3001000 |
79 ; DIS-NEXT: 14: e3401000 | 82 ; DIS-NEXT: 14: e3401000 |
80 ; DIS-NEXT: 18: e5810000 | 83 ; DIS-NEXT: 18: e5810000 |
81 ; DIS-NEXT: 1c: e12fff1e | 84 ; DIS-NEXT: 1c: e12fff1e |
82 | 85 |
83 ; IASM-LABEL:store: | 86 ; IASM-LABEL:store: |
84 ; IASM-NEXT: .Lstore$__0: | 87 ; IASM-NEXT: .Lstore$__0: |
85 ; IASM-NEXT: movw r1, #:lower16:global1 | 88 ; IASM-NEXT: movw r1, #:lower16:global1 |
86 ; IASM-NEXT: movt r1, #:upper16:global1 | 89 ; IASM-NEXT: movt r1, #:upper16:global1 |
87 ; IASM-NEXT: str r0, [r1] | 90 ; IASM-NEXT: .byte 0x0 |
| 91 ; IASM-NEXT: .byte 0x0 |
| 92 ; IASM-NEXT: .byte 0x81 |
| 93 ; IASM-NEXT: .byte 0xe5 |
88 ; IASM-NEXT: .byte 0x1e | 94 ; IASM-NEXT: .byte 0x1e |
89 ; IASM-NEXT: .byte 0xff | 95 ; IASM-NEXT: .byte 0xff |
90 ; IASM-NEXT: .byte 0x2f | 96 ; IASM-NEXT: .byte 0x2f |
91 ; IASM-NEXT: .byte 0xe1 | 97 ; IASM-NEXT: .byte 0xe1 |
OLD | NEW |