212 lines · plain
1# RUN: llvm-mc %s -filetype obj -triple x86_64-linux-elf -o %t.o2# RUN: llvm-cfi-verify %t.o 2>&1 --summarize | FileCheck %s3 4# This is the same file as protected-lineinfo.s, however contains a hand-5# assembled function (fake_function) that has no line table information6# associated with it. Because there is no LT info, the indirect call made in the7# function should not be reported at all by llvm-cfi-verify.8 9# We can test that this indirect call is ignored from the final statistics10# reporting of the cfi-verify program. It should only find a single indirect CF11# instruction at `tiny.cc:11` (see protected-lineinfo.s for the source).12 13# CHECK-NOT: Begin Instruction14 15# CHECK: Expected Protected: 1 (100.00%)16# CHECK: Unexpected Protected: 0 (0.00%)17# CHECK: Expected Unprotected: 0 (0.00%)18# CHECK: Unexpected Unprotected (BAD): 0 (0.00%)19 20 .text21 .file "ld-temp.o"22 .p2align 4, 0x9023 .type fake_function,@function24fake_function:25 nop26 nop27 nop28 nop29 callq *%rax30 nop31 nop32 nop33 nop34 .type _Z1av.cfi,@function35_Z1av.cfi:36.Lfunc_begin0:37 .file 1 "tiny.cc"38 .loc 1 3 039 .cfi_startproc40 pushq %rbp41 .cfi_def_cfa_offset 1642 .cfi_offset %rbp, -1643 movq %rsp, %rbp44 .cfi_def_cfa_register %rbp45.Ltmp0:46 .loc 1 3 11 prologue_end47 popq %rbp48 retq49.Ltmp1:50.Lfunc_end0:51 .size _Z1av.cfi, .Lfunc_end0-_Z1av.cfi52 .cfi_endproc53 54 .p2align 4, 0x9055 .type _Z1bv.cfi,@function56_Z1bv.cfi:57.Lfunc_begin1:58 .loc 1 4 059 .cfi_startproc60 pushq %rbp61 .cfi_def_cfa_offset 1662 .cfi_offset %rbp, -1663 movq %rsp, %rbp64 .cfi_def_cfa_register %rbp65.Ltmp2:66 .loc 1 4 11 prologue_end67 popq %rbp68 retq69.Ltmp3:70.Lfunc_end1:71 .size _Z1bv.cfi, .Lfunc_end1-_Z1bv.cfi72 .cfi_endproc73 74 .hidden main75 .globl main76 .p2align 4, 0x9077 .type main,@function78main:79.Lfunc_begin2:80 .loc 1 6 081 .cfi_startproc82 pushq %rbp83 .cfi_def_cfa_offset 1684 .cfi_offset %rbp, -1685 movq %rsp, %rbp86 .cfi_def_cfa_register %rbp87 subq $32, %rsp88 movb $32, -1(%rbp)89 movl $0, -12(%rbp)90 movl %edi, -8(%rbp)91 movq %rsi, -32(%rbp)92.Ltmp4:93 .loc 1 8 12 prologue_end94 cmpl $1, -8(%rbp)95 .loc 1 8 7 is_stmt 096 jne .LBB2_297 .loc 1 0 798 leaq _Z1av(%rip), %rax99 .loc 1 9 9 is_stmt 1100 movq %rax, -24(%rbp)101 .loc 1 9 5 is_stmt 0102 jmp .LBB2_3103.LBB2_2:104 .loc 1 0 5105 leaq _Z1bv(%rip), %rax106 .loc 1 11 9 is_stmt 1107 movq %rax, -24(%rbp)108.LBB2_3:109 .loc 1 0 9 is_stmt 0110 leaq .L.cfi.jumptable(%rip), %rcx111 .loc 1 13 3 is_stmt 1112 movq -24(%rbp), %rax113 movq %rax, %rdx114 subq %rcx, %rdx115 movq %rdx, %rcx116 shrq $3, %rcx117 shlq $61, %rdx118 orq %rcx, %rdx119 cmpq $1, %rdx120 jbe .LBB2_5121 ud2122.LBB2_5:123 callq *%rax124 .loc 1 14 11125 movb $-1, -1(%rbp)126 .loc 1 15 1127 movl -12(%rbp), %eax128 addq $32, %rsp129 popq %rbp130 retq131.Ltmp5:132.Lfunc_end2:133 .size main, .Lfunc_end2-main134 .cfi_endproc135 136 .p2align 3, 0x90137 .type .L.cfi.jumptable,@function138.L.cfi.jumptable:139.Lfunc_begin3:140 .cfi_startproc141 #APP142 jmp _Z1av.cfi@PLT143 int3144 int3145 int3146 jmp _Z1bv.cfi@PLT147 int3148 int3149 int3150 151 #NO_APP152.Lfunc_end3:153 .size .L.cfi.jumptable, .Lfunc_end3-.L.cfi.jumptable154 .cfi_endproc155 156 .section .debug_str,"MS",@progbits,1157.Linfo_string0:158 .asciz "clang version 6.0.0 (trunk 316774)"159.Linfo_string1:160 .asciz "tiny.cc"161.Linfo_string2:162 .asciz "/tmp/a/b"163 .section .debug_abbrev,"",@progbits164 .byte 1165 .byte 17166 .byte 0167 .byte 37168 .byte 14169 .byte 19170 .byte 5171 .byte 3172 .byte 14173 .byte 16174 .byte 23175 .byte 27176 .byte 14177 .byte 17178 .byte 1179 .byte 18180 .byte 6181 .byte 0182 .byte 0183 .byte 0184 .section .debug_info,"",@progbits185.Lcu_begin0:186 .long 38187 .short 4188 .long .debug_abbrev189 .byte 8190 .byte 1191 .long .Linfo_string0192 .short 4193 .long .Linfo_string1194 .long .Lline_table_start0195 .long .Linfo_string2196 .quad .Lfunc_begin0197 .long .Lfunc_end2-.Lfunc_begin0198 .section .debug_ranges,"",@progbits199 .section .debug_macinfo,"",@progbits200.Lcu_macro_begin0:201 .byte 0202 203 .type _Z1av,@function204_Z1av = .L.cfi.jumptable205 .type _Z1bv,@function206_Z1bv = .L.cfi.jumptable+8207 .ident "clang version 6.0.0 (trunk 316774)"208 .section ".note.GNU-stack","",@progbits209 .section .debug_line,"",@progbits210.Lline_table_start0:211 212