[llvm-readelf] - Report a warning when .hash section contains a chain with a cycle.
[llvm-complete.git] / test / tools / llvm-cfi-verify / AArch64 / unprotected-lineinfo.s
blob3bec1d3dbffa7bac0ced0bb1f7d8d9b263d9717d
1 # RUN: llvm-mc %s -filetype obj -triple aarch64-- -o %t.o
2 # RUN: llvm-cfi-verify %t.o | FileCheck %s
4 # CHECK-LABEL: {{^Instruction: .* \(FAIL_BAD_CONDITIONAL_BRANCH\)}}
5 # CHECK-NEXT: tiny.cc:9
7 # CHECK: Expected Protected: 0 (0.00%)
8 # CHECK: Unexpected Protected: 0 (0.00%)
9 # CHECK: Expected Unprotected: 0 (0.00%)
10 # CHECK: Unexpected Unprotected (BAD): 1 (100.00%)
12 # Source (tiny.cc):
13 # int a() { return 42; }
14 # int b() { return 137; }
15 # int main(int argc, char** argv) {
16 # int(*ptr)();
17 # if (argc == 1)
18 # ptr = &a;
19 # else
20 # ptr = &b;
21 # return ptr();
22 # }
23 # Compile with:
24 # clang++ -target aarch64-- -gmlt tiny.cc -S -o tiny.s
25 .text
26 .file "tiny.cc"
27 .globl _Z1av
28 .p2align 2
29 .type _Z1av,@function
30 _Z1av: // @_Z1av
31 .Lfunc_begin0:
32 .file 1 "tiny.cc"
33 .loc 1 1 0 // tiny.cc:1:0
34 .cfi_startproc
35 // BB#0:
36 mov w0, #42
37 .Ltmp0:
38 .loc 1 1 11 prologue_end // tiny.cc:1:11
39 ret
40 .Ltmp1:
41 .Lfunc_end0:
42 .size _Z1av, .Lfunc_end0-_Z1av
43 .cfi_endproc
45 .globl _Z1bv
46 .p2align 2
47 .type _Z1bv,@function
48 _Z1bv: // @_Z1bv
49 .Lfunc_begin1:
50 .loc 1 2 0 // tiny.cc:2:0
51 .cfi_startproc
52 // BB#0:
53 mov w0, #137
54 .Ltmp2:
55 .loc 1 2 11 prologue_end // tiny.cc:2:11
56 ret
57 .Ltmp3:
58 .Lfunc_end1:
59 .size _Z1bv, .Lfunc_end1-_Z1bv
60 .cfi_endproc
62 .globl main
63 .p2align 2
64 .type main,@function
65 main: // @main
66 .Lfunc_begin2:
67 .loc 1 3 0 // tiny.cc:3:0
68 .cfi_startproc
69 // BB#0:
70 sub sp, sp, #48 // =48
71 stp x29, x30, [sp, #32] // 8-byte Folded Spill
72 add x29, sp, #32 // =32
73 .Lcfi0:
74 .cfi_def_cfa w29, 16
75 .Lcfi1:
76 .cfi_offset w30, -8
77 .Lcfi2:
78 .cfi_offset w29, -16
79 stur wzr, [x29, #-4]
80 stur w0, [x29, #-8]
81 str x1, [sp, #16]
82 .Ltmp4:
83 .loc 1 5 7 prologue_end // tiny.cc:5:7
84 ldur w0, [x29, #-8]
85 cmp w0, #1 // =1
86 b.ne .LBB2_2
87 // BB#1:
88 .loc 1 0 7 is_stmt 0 // tiny.cc:0:7
89 adrp x8, _Z1av
90 add x8, x8, :lo12:_Z1av
91 .loc 1 6 9 is_stmt 1 // tiny.cc:6:9
92 str x8, [sp, #8]
93 .loc 1 6 5 is_stmt 0 // tiny.cc:6:5
94 b .LBB2_3
95 .LBB2_2:
96 .loc 1 0 5 // tiny.cc:0:5
97 adrp x8, _Z1bv
98 add x8, x8, :lo12:_Z1bv
99 .loc 1 8 9 is_stmt 1 // tiny.cc:8:9
100 str x8, [sp, #8]
101 .LBB2_3:
102 .loc 1 9 10 // tiny.cc:9:10
103 ldr x8, [sp, #8]
104 blr x8
105 .loc 1 9 3 is_stmt 0 // tiny.cc:9:3
106 ldp x29, x30, [sp, #32] // 8-byte Folded Reload
107 add sp, sp, #48 // =48
109 .Ltmp5:
110 .Lfunc_end2:
111 .size main, .Lfunc_end2-main
112 .cfi_endproc
114 .section .debug_str,"MS",@progbits,1
115 .Linfo_string0:
116 .asciz "clang version 4.0.1-10 (tags/RELEASE_401/final)" // string offset=0
117 .Linfo_string1:
118 .asciz "tiny.cc" // string offset=48
119 .Linfo_string2:
120 .asciz "/tmp" // string offset=56
121 .section .debug_loc,"",@progbits
122 .section .debug_abbrev,"",@progbits
123 .Lsection_abbrev:
124 .byte 1 // Abbreviation Code
125 .byte 17 // DW_TAG_compile_unit
126 .byte 0 // DW_CHILDREN_no
127 .byte 37 // DW_AT_producer
128 .byte 14 // DW_FORM_strp
129 .byte 19 // DW_AT_language
130 .byte 5 // DW_FORM_data2
131 .byte 3 // DW_AT_name
132 .byte 14 // DW_FORM_strp
133 .byte 16 // DW_AT_stmt_list
134 .byte 23 // DW_FORM_sec_offset
135 .byte 27 // DW_AT_comp_dir
136 .byte 14 // DW_FORM_strp
137 .byte 17 // DW_AT_low_pc
138 .byte 1 // DW_FORM_addr
139 .byte 18 // DW_AT_high_pc
140 .byte 6 // DW_FORM_data4
141 .byte 0 // EOM(1)
142 .byte 0 // EOM(2)
143 .byte 0 // EOM(3)
144 .section .debug_info,"",@progbits
145 .Lsection_info:
146 .Lcu_begin0:
147 .word 38 // Length of Unit
148 .hword 4 // DWARF version number
149 .word .Lsection_abbrev // Offset Into Abbrev. Section
150 .byte 8 // Address Size (in bytes)
151 .byte 1 // Abbrev [1] 0xb:0x1f DW_TAG_compile_unit
152 .word .Linfo_string0 // DW_AT_producer
153 .hword 4 // DW_AT_language
154 .word .Linfo_string1 // DW_AT_name
155 .word .Lline_table_start0 // DW_AT_stmt_list
156 .word .Linfo_string2 // DW_AT_comp_dir
157 .xword .Lfunc_begin0 // DW_AT_low_pc
158 .word .Lfunc_end2-.Lfunc_begin0 // DW_AT_high_pc
159 .section .debug_ranges,"",@progbits
160 .Ldebug_range:
161 .section .debug_macinfo,"",@progbits
162 .Ldebug_macinfo:
163 .Lcu_macro_begin0:
164 .byte 0 // End Of Macro List Mark
166 .ident "clang version 4.0.1-10 (tags/RELEASE_401/final)"
167 .section ".note.GNU-stack","",@progbits
168 .section .debug_line,"",@progbits
169 .Lline_table_start0: