| 1 |
# RUN: llvm-mc %s -filetype obj -triple armv7a-- -o %t.o |
| 2 |
# RUN: not llvm-cfi-verify %t.o 2>&1 | FileCheck %s |
| 3 |
|
| 4 |
# CHECK: Could not initialise disassembler: Unsupported architecture. |
| 5 |
|
| 6 |
# Source (tiny.cc): |
| 7 |
# int a() { return 42; } |
| 8 |
# int b() { return 137; } |
| 9 |
# int main(int argc, char** argv) { |
| 10 |
# int(*ptr)(); |
| 11 |
# if (argc == 1) |
| 12 |
# ptr = &a; |
| 13 |
# else |
| 14 |
# ptr = &b; |
| 15 |
# return ptr(); |
| 16 |
# } |
| 17 |
.text |
| 18 |
.syntax unified |
| 19 |
.eabi_attribute 67, "2.09" |
| 20 |
.eabi_attribute 6, 2 |
| 21 |
.eabi_attribute 8, 1 |
| 22 |
.eabi_attribute 9, 1 |
| 23 |
.eabi_attribute 34, 1 |
| 24 |
.eabi_attribute 15, 1 |
| 25 |
.eabi_attribute 16, 1 |
| 26 |
.eabi_attribute 17, 2 |
| 27 |
.eabi_attribute 20, 1 |
| 28 |
.eabi_attribute 21, 1 |
| 29 |
.eabi_attribute 23, 3 |
| 30 |
.eabi_attribute 24, 1 |
| 31 |
.eabi_attribute 25, 1 |
| 32 |
.eabi_attribute 38, 1 |
| 33 |
.eabi_attribute 18, 4 |
| 34 |
.eabi_attribute 26, 2 |
| 35 |
.eabi_attribute 14, 0 |
| 36 |
.file "ld-temp.o" |
| 37 |
.p2align 2 |
| 38 |
.type _Z1av.cfi,%function |
| 39 |
.code 32 |
| 40 |
_Z1av.cfi: |
| 41 |
.Lfunc_begin0: |
| 42 |
.file 1 "tiny.cc" |
| 43 |
.loc 1 1 0 |
| 44 |
.fnstart |
| 45 |
.cfi_sections .debug_frame |
| 46 |
.cfi_startproc |
| 47 |
.loc 1 1 11 prologue_end |
| 48 |
mov r0, #42 |
| 49 |
bx lr |
| 50 |
.Ltmp0: |
| 51 |
.Lfunc_end0: |
| 52 |
.size _Z1av.cfi, .Lfunc_end0-_Z1av.cfi |
| 53 |
.cfi_endproc |
| 54 |
.cantunwind |
| 55 |
.fnend |
| 56 |
|
| 57 |
.p2align 2 |
| 58 |
.type _Z1bv.cfi,%function |
| 59 |
.code 32 |
| 60 |
_Z1bv.cfi: |
| 61 |
.Lfunc_begin1: |
| 62 |
.loc 1 2 0 |
| 63 |
.fnstart |
| 64 |
.cfi_startproc |
| 65 |
.loc 1 2 11 prologue_end |
| 66 |
mov r0, #137 |
| 67 |
bx lr |
| 68 |
.Ltmp1: |
| 69 |
.Lfunc_end1: |
| 70 |
.size _Z1bv.cfi, .Lfunc_end1-_Z1bv.cfi |
| 71 |
.cfi_endproc |
| 72 |
.cantunwind |
| 73 |
.fnend |
| 74 |
|
| 75 |
.p2align 2 |
| 76 |
.type main,%function |
| 77 |
.code 32 |
| 78 |
main: |
| 79 |
.Lfunc_begin2: |
| 80 |
.loc 1 3 0 |
| 81 |
.fnstart |
| 82 |
.cfi_startproc |
| 83 |
.save {r11, lr} |
| 84 |
push {r11, lr} |
| 85 |
.cfi_def_cfa_offset 8 |
| 86 |
.cfi_offset lr, -4 |
| 87 |
.cfi_offset r11, -8 |
| 88 |
.setfp r11, sp |
| 89 |
mov r11, sp |
| 90 |
.cfi_def_cfa_register r11 |
| 91 |
.pad #16 |
| 92 |
sub sp, sp, #16 |
| 93 |
mov r2, #0 |
| 94 |
str r2, [r11, #-4] |
| 95 |
str r0, [sp, #8] |
| 96 |
str r1, [sp, #4] |
| 97 |
.Ltmp2: |
| 98 |
.loc 1 5 7 prologue_end |
| 99 |
ldr r0, [sp, #8] |
| 100 |
cmp r0, #1 |
| 101 |
bne .LBB2_2 |
| 102 |
b .LBB2_1 |
| 103 |
.LBB2_1: |
| 104 |
.loc 1 6 9 |
| 105 |
ldr r0, .LCPI2_0 |
| 106 |
.LPC2_0: |
| 107 |
add r0, pc, r0 |
| 108 |
str r0, [sp] |
| 109 |
.loc 1 6 5 is_stmt 0 |
| 110 |
b .LBB2_3 |
| 111 |
.LBB2_2: |
| 112 |
.loc 1 8 9 is_stmt 1 |
| 113 |
ldr r0, .LCPI2_1 |
| 114 |
.LPC2_1: |
| 115 |
add r0, pc, r0 |
| 116 |
str r0, [sp] |
| 117 |
b .LBB2_3 |
| 118 |
.LBB2_3: |
| 119 |
.loc 1 9 10 |
| 120 |
ldr r1, [sp] |
| 121 |
ldr r0, .LCPI2_2 |
| 122 |
.LPC2_2: |
| 123 |
add r0, pc, r0 |
| 124 |
sub r0, r1, r0 |
| 125 |
ror r0, r0, #2 |
| 126 |
cmp r0, #2 |
| 127 |
blo .LBB2_5 |
| 128 |
b .LBB2_4 |
| 129 |
.LBB2_4: |
| 130 |
.inst 0xe7ffdefe |
| 131 |
.LBB2_5: |
| 132 |
mov lr, pc |
| 133 |
bx r1 |
| 134 |
.loc 1 9 3 is_stmt 0 |
| 135 |
mov sp, r11 |
| 136 |
pop {r11, lr} |
| 137 |
bx lr |
| 138 |
.Ltmp3: |
| 139 |
.p2align 2 |
| 140 |
.loc 1 0 3 |
| 141 |
.LCPI2_0: |
| 142 |
.long _Z1av-(.LPC2_0+8) |
| 143 |
.LCPI2_1: |
| 144 |
.long _Z1bv-(.LPC2_1+8) |
| 145 |
.LCPI2_2: |
| 146 |
.long .L.cfi.jumptable-(.LPC2_2+8) |
| 147 |
.Lfunc_end2: |
| 148 |
.size main, .Lfunc_end2-main |
| 149 |
.cfi_endproc |
| 150 |
.fnend |
| 151 |
|
| 152 |
.p2align 2 |
| 153 |
.type .L.cfi.jumptable,%function |
| 154 |
.code 32 |
| 155 |
.L.cfi.jumptable: |
| 156 |
.Lfunc_begin3: |
| 157 |
.fnstart |
| 158 |
.cfi_startproc |
| 159 |
@APP |
| 160 |
b _Z1av.cfi |
| 161 |
b _Z1bv.cfi |
| 162 |
|
| 163 |
@NO_APP |
| 164 |
.Lfunc_end3: |
| 165 |
.size .L.cfi.jumptable, .Lfunc_end3-.L.cfi.jumptable |
| 166 |
.cfi_endproc |
| 167 |
.cantunwind |
| 168 |
.fnend |
| 169 |
|
| 170 |
.type .L__unnamed_1,%object |
| 171 |
.section .rodata,"a",%progbits |
| 172 |
.L__unnamed_1: |
| 173 |
.size .L__unnamed_1, 0 |
| 174 |
|
| 175 |
.section .debug_str,"MS",%progbits,1 |
| 176 |
.Linfo_string0: |
| 177 |
.asciz "clang version 7.0.0 (trunk 336681) (llvm/trunk 336683)" |
| 178 |
.Linfo_string1: |
| 179 |
.asciz "tiny.cc" |
| 180 |
.Linfo_string2: |
| 181 |
.asciz "" |
| 182 |
.section .debug_abbrev,"",%progbits |
| 183 |
.byte 1 |
| 184 |
.byte 17 |
| 185 |
.byte 0 |
| 186 |
.byte 37 |
| 187 |
.byte 14 |
| 188 |
.byte 19 |
| 189 |
.byte 5 |
| 190 |
.byte 3 |
| 191 |
.byte 14 |
| 192 |
.byte 16 |
| 193 |
.byte 23 |
| 194 |
.byte 27 |
| 195 |
.byte 14 |
| 196 |
.byte 17 |
| 197 |
.byte 1 |
| 198 |
.byte 18 |
| 199 |
.byte 6 |
| 200 |
.byte 0 |
| 201 |
.byte 0 |
| 202 |
.byte 0 |
| 203 |
.section .debug_info,"",%progbits |
| 204 |
.Lcu_begin0: |
| 205 |
.long 34 |
| 206 |
.short 4 |
| 207 |
.long .debug_abbrev |
| 208 |
.byte 4 |
| 209 |
.byte 1 |
| 210 |
.long .Linfo_string0 |
| 211 |
.short 4 |
| 212 |
.long .Linfo_string1 |
| 213 |
.long .Lline_table_start0 |
| 214 |
.long .Linfo_string2 |
| 215 |
.long .Lfunc_begin0 |
| 216 |
.long .Lfunc_end2-.Lfunc_begin0 |
| 217 |
.section .debug_ranges,"",%progbits |
| 218 |
.section .debug_macinfo,"",%progbits |
| 219 |
.byte 0 |
| 220 |
|
| 221 |
.globl __typeid__ZTSFivE_global_addr |
| 222 |
.hidden __typeid__ZTSFivE_global_addr |
| 223 |
.set __typeid__ZTSFivE_global_addr, .L.cfi.jumptable |
| 224 |
.size __typeid__ZTSFivE_global_addr, 1 |
| 225 |
.type _Z1av,%function |
| 226 |
.set _Z1av, .L.cfi.jumptable |
| 227 |
.type _Z1bv,%function |
| 228 |
.set _Z1bv, .L.cfi.jumptable+4 |
| 229 |
.ident "clang version 7.0.0 (trunk 336681) (llvm/trunk 336683)" |
| 230 |
.section ".note.GNU-stack","",%progbits |
| 231 |
.section .debug_line,"",%progbits |
| 232 |
.Lline_table_start0: |