1// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -S --sr --sd - | FileCheck %s 2// RUN: not llvm-mc -triple=x86_64 -o - -defsym=ERR=1 %s 2>&1 | FileCheck %s --check-prefix=ERR 3 4f1: 5 .cfi_startproc 6 .cfi_lsda 0x3, bar 7 nop 8 .cfi_endproc 9 10f2: 11 .cfi_startproc 12 .cfi_personality 0x00, foo 13 .cfi_lsda 0x3, bar 14 nop 15 .cfi_endproc 16 17f3: 18 .cfi_startproc 19 .cfi_lsda 0x3, bar 20 nop 21 .cfi_endproc 22 23f4: 24 .cfi_startproc 25 .cfi_personality 0x00, foo 26 .cfi_lsda 0x2, bar 27 nop 28 .cfi_endproc 29 30f5: 31 .cfi_startproc 32 .cfi_personality 0x02, foo 33 nop 34 .cfi_endproc 35 36f6: 37 .cfi_startproc 38 .cfi_personality 0x03, foo 39 nop 40 .cfi_endproc 41 42f7: 43 .cfi_startproc 44 .cfi_personality 0x04, foo 45 nop 46 .cfi_endproc 47 48f8: 49 .cfi_startproc 50 .cfi_personality 0x0a, foo 51 nop 52 .cfi_endproc 53 54f9: 55 .cfi_startproc 56 .cfi_personality 0x0b, foo 57 nop 58 .cfi_endproc 59 60f10: 61 .cfi_startproc 62 .cfi_personality 0x0c, foo 63 nop 64 .cfi_endproc 65 66f11: 67 .cfi_startproc 68 .cfi_personality 0x08, foo 69 nop 70 .cfi_endproc 71 72f12: 73 .cfi_startproc 74 .cfi_personality 0x10, foo 75 nop 76 .cfi_endproc 77 78f13: 79 .cfi_startproc 80 .cfi_personality 0x12, foo 81 nop 82 .cfi_endproc 83 84f14: 85 .cfi_startproc 86 .cfi_personality 0x13, foo 87 nop 88 .cfi_endproc 89 90f15: 91 .cfi_startproc 92 .cfi_personality 0x14, foo 93 nop 94 .cfi_endproc 95 96f16: 97 .cfi_startproc 98 .cfi_personality 0x1a, foo 99 nop 100 .cfi_endproc 101 102f17: 103 .cfi_startproc 104 .cfi_personality 0x1b, foo 105 nop 106 .cfi_endproc 107 108f18: 109 .cfi_startproc 110 .cfi_personality 0x1c, foo 111 nop 112 .cfi_endproc 113 114f19: 115 .cfi_startproc 116 .cfi_personality 0x18, foo 117 nop 118 .cfi_endproc 119 120f20: 121 .cfi_startproc 122 .cfi_personality 0x80, foo 123 nop 124 .cfi_endproc 125 126f21: 127 .cfi_startproc 128 .cfi_personality 0x82, foo 129 nop 130 .cfi_endproc 131 132f22: 133 .cfi_startproc 134 .cfi_personality 0x83, foo 135 nop 136 .cfi_endproc 137 138f23: 139 .cfi_startproc 140 .cfi_personality 0x84, foo 141 nop 142 .cfi_endproc 143 144f24: 145 .cfi_startproc 146 .cfi_personality 0x8a, foo 147 nop 148 .cfi_endproc 149 150f25: 151 .cfi_startproc 152 .cfi_personality 0x8b, foo 153 nop 154 .cfi_endproc 155 156f26: 157 .cfi_startproc 158 .cfi_personality 0x8c, foo 159 nop 160 .cfi_endproc 161 162f27: 163 .cfi_startproc 164 .cfi_personality 0x88, foo 165 nop 166 .cfi_endproc 167 168f28: 169 .cfi_startproc 170 .cfi_personality 0x90, foo 171 nop 172 .cfi_endproc 173 174f29: 175 .cfi_startproc 176 .cfi_personality 0x92, foo 177 nop 178 .cfi_endproc 179 180f30: 181 .cfi_startproc 182 .cfi_personality 0x93, foo 183 nop 184 .cfi_endproc 185 186f31: 187 .cfi_startproc 188 .cfi_personality 0x94, foo 189 nop 190 .cfi_endproc 191 192f32: 193 .cfi_startproc 194 .cfi_personality 0x9a, foo 195 nop 196 .cfi_endproc 197 198f33: 199 .cfi_startproc 200 .cfi_personality 0x9b, foo 201 nop 202 .cfi_endproc 203 204f34: 205 .cfi_startproc 206 .cfi_personality 0x9c, foo 207 nop 208 .cfi_endproc 209 210f36: 211 .cfi_startproc 212 .cfi_personality 0x98, foo 213 nop 214 .cfi_endproc 215 216f37: 217 .cfi_startproc simple 218 nop 219 .cfi_endproc 220 221// CHECK: Section { 222// CHECK: Index: 223// CHECK: Name: .eh_frame 224// CHECK-NEXT: Type: SHT_X86_64_UNWIND 225// CHECK-NEXT: Flags [ 226// CHECK-NEXT: SHF_ALLOC 227// CHECK-NEXT: ] 228// CHECK-NEXT: Address: 0x0 229// CHECK-NEXT: Offset: 0x68 230// CHECK-NEXT: Size: 1776 231// CHECK-NEXT: Link: 0 232// CHECK-NEXT: Info: 0 233// CHECK-NEXT: AddressAlignment: 8 234// CHECK-NEXT: EntrySize: 0 235// CHECK-NEXT: Relocations [ 236// CHECK-NEXT: ] 237// CHECK-NEXT: SectionData ( 238// CHECK-NEXT: 0000: 10000000 00000000 017A5200 01781001 |.........zR..x..| 239// CHECK-NEXT: 0010: 1B000000 10000000 18000000 00000000 |................| 240// CHECK-NEXT: 0020: 01000000 00000000 14000000 00000000 |................| 241// CHECK-NEXT: 0030: 017A4C52 00017810 02031B0C 07089001 |.zLR..x.........| 242// CHECK-NEXT: 0040: 14000000 1C000000 00000000 01000000 |................| 243// CHECK-NEXT: 0050: 04000000 00000000 14000000 34000000 |............4...| 244// CHECK-NEXT: 0060: 00000000 01000000 04000000 00000000 |................| 245// CHECK-NEXT: 0070: 20000000 00000000 017A504C 52000178 | ........zPLR..x| 246// CHECK-NEXT: 0080: 100B0000 00000000 00000002 1B0C0708 |................| 247// CHECK-NEXT: 0090: 90010000 10000000 28000000 00000000 |........(.......| 248// CHECK-NEXT: 00A0: 01000000 02000000 20000000 00000000 |........ .......| 249// CHECK-NEXT: 00B0: 017A504C 52000178 100B0000 00000000 |.zPLR..x........| 250// CHECK-NEXT: 00C0: 00000003 1B0C0708 90010000 14000000 |................| 251// CHECK-NEXT: 00D0: 28000000 00000000 01000000 04000000 |(...............| 252// CHECK-NEXT: 00E0: 00000000 18000000 00000000 017A5052 |.............zPR| 253// CHECK-NEXT: 00F0: 00017810 04020000 1B0C0708 90010000 |..x.............| 254// CHECK-NEXT: 0100: 10000000 20000000 00000000 01000000 |.... ...........| 255// CHECK-NEXT: 0110: 00000000 18000000 00000000 017A5052 |.............zPR| 256// CHECK-NEXT: 0120: 00017810 06030000 00001B0C 07089001 |..x.............| 257// CHECK-NEXT: 0130: 10000000 20000000 00000000 01000000 |.... ...........| 258// CHECK-NEXT: 0140: 00000000 1C000000 00000000 017A5052 |.............zPR| 259// CHECK-NEXT: 0150: 00017810 0A040000 00000000 00001B0C |..x.............| 260// CHECK-NEXT: 0160: 07089001 10000000 24000000 00000000 |........$.......| 261// CHECK-NEXT: 0170: 01000000 00000000 1C000000 00000000 |................| 262// CHECK-NEXT: 0180: 017A5052 00017810 0A080000 00000000 |.zPR..x.........| 263// CHECK-NEXT: 0190: 00001B0C 07089001 10000000 24000000 |............$...| 264// CHECK-NEXT: 01A0: 00000000 01000000 00000000 18000000 |................| 265// CHECK-NEXT: 01B0: 00000000 017A5052 00017810 040A0000 |.....zPR..x.....| 266// CHECK-NEXT: 01C0: 1B0C0708 90010000 10000000 20000000 |............ ...| 267// CHECK-NEXT: 01D0: 00000000 01000000 00000000 18000000 |................| 268// CHECK-NEXT: 01E0: 00000000 017A5052 00017810 060B0000 |.....zPR..x.....| 269// CHECK-NEXT: 01F0: 00001B0C 07089001 10000000 20000000 |............ ...| 270// CHECK-NEXT: 0200: 00000000 01000000 00000000 1C000000 |................| 271// CHECK-NEXT: 0210: 00000000 017A5052 00017810 0A0C0000 |.....zPR..x.....| 272// CHECK-NEXT: 0220: 00000000 00001B0C 07089001 10000000 |................| 273// CHECK-NEXT: 0230: 24000000 00000000 01000000 00000000 |$...............| 274// CHECK-NEXT: 0240: 1C000000 00000000 017A5052 00017810 |.........zPR..x.| 275// CHECK-NEXT: 0250: 0A100000 00000000 00001B0C 07089001 |................| 276// CHECK-NEXT: 0260: 10000000 24000000 00000000 01000000 |....$...........| 277// CHECK-NEXT: 0270: 00000000 18000000 00000000 017A5052 |.............zPR| 278// CHECK-NEXT: 0280: 00017810 04120000 1B0C0708 90010000 |..x.............| 279// CHECK-NEXT: 0290: 10000000 20000000 00000000 01000000 |.... ...........| 280// CHECK-NEXT: 02A0: 00000000 18000000 00000000 017A5052 |.............zPR| 281// CHECK-NEXT: 02B0: 00017810 06130000 00001B0C 07089001 |..x.............| 282// CHECK-NEXT: 02C0: 10000000 20000000 00000000 01000000 |.... ...........| 283// CHECK-NEXT: 02D0: 00000000 1C000000 00000000 017A5052 |.............zPR| 284// CHECK-NEXT: 02E0: 00017810 0A140000 00000000 00001B0C |..x.............| 285// CHECK-NEXT: 02F0: 07089001 10000000 24000000 00000000 |........$.......| 286// CHECK-NEXT: 0300: 01000000 00000000 1C000000 00000000 |................| 287// CHECK-NEXT: 0310: 017A5052 00017810 0A180000 00000000 |.zPR..x.........| 288// CHECK-NEXT: 0320: 00001B0C 07089001 10000000 24000000 |............$...| 289// CHECK-NEXT: 0330: 00000000 01000000 00000000 18000000 |................| 290// CHECK-NEXT: 0340: 00000000 017A5052 00017810 041A0000 |.....zPR..x.....| 291// CHECK-NEXT: 0350: 1B0C0708 90010000 10000000 20000000 |............ ...| 292// CHECK-NEXT: 0360: 00000000 01000000 00000000 18000000 |................| 293// CHECK-NEXT: 0370: 00000000 017A5052 00017810 061B0000 |.....zPR..x.....| 294// CHECK-NEXT: 0380: 00001B0C 07089001 10000000 20000000 |............ ...| 295// CHECK-NEXT: 0390: 00000000 01000000 00000000 1C000000 |................| 296// CHECK-NEXT: 03A0: 00000000 017A5052 00017810 0A1C0000 |.....zPR..x.....| 297// CHECK-NEXT: 03B0: 00000000 00001B0C 07089001 10000000 |................| 298// CHECK-NEXT: 03C0: 24000000 00000000 01000000 00000000 |$...............| 299// CHECK-NEXT: 03D0: 1C000000 00000000 017A5052 00017810 |.........zPR..x.| 300// CHECK-NEXT: 03E0: 0A800000 00000000 00001B0C 07089001 |................| 301// CHECK-NEXT: 03F0: 10000000 24000000 00000000 01000000 |....$...........| 302// CHECK-NEXT: 0400: 00000000 18000000 00000000 017A5052 |.............zPR| 303// CHECK-NEXT: 0410: 00017810 04820000 1B0C0708 90010000 |..x.............| 304// CHECK-NEXT: 0420: 10000000 20000000 00000000 01000000 |.... ...........| 305// CHECK-NEXT: 0430: 00000000 18000000 00000000 017A5052 |.............zPR| 306// CHECK-NEXT: 0440: 00017810 06830000 00001B0C 07089001 |..x.............| 307// CHECK-NEXT: 0450: 10000000 20000000 00000000 01000000 |.... ...........| 308// CHECK-NEXT: 0460: 00000000 1C000000 00000000 017A5052 |.............zPR| 309// CHECK-NEXT: 0470: 00017810 0A840000 00000000 00001B0C |..x.............| 310// CHECK-NEXT: 0480: 07089001 10000000 24000000 00000000 |........$.......| 311// CHECK-NEXT: 0490: 01000000 00000000 1C000000 00000000 |................| 312// CHECK-NEXT: 04A0: 017A5052 00017810 0A880000 00000000 |.zPR..x.........| 313// CHECK-NEXT: 04B0: 00001B0C 07089001 10000000 24000000 |............$...| 314// CHECK-NEXT: 04C0: 00000000 01000000 00000000 18000000 |................| 315// CHECK-NEXT: 04D0: 00000000 017A5052 00017810 048A0000 |.....zPR..x.....| 316// CHECK-NEXT: 04E0: 1B0C0708 90010000 10000000 20000000 |............ ...| 317// CHECK-NEXT: 04F0: 00000000 01000000 00000000 18000000 |................| 318// CHECK-NEXT: 0500: 00000000 017A5052 00017810 068B0000 |.....zPR..x.....| 319// CHECK-NEXT: 0510: 00001B0C 07089001 10000000 20000000 |............ ...| 320// CHECK-NEXT: 0520: 00000000 01000000 00000000 1C000000 |................| 321// CHECK-NEXT: 0530: 00000000 017A5052 00017810 0A8C0000 |.....zPR..x.....| 322// CHECK-NEXT: 0540: 00000000 00001B0C 07089001 10000000 |................| 323// CHECK-NEXT: 0550: 24000000 00000000 01000000 00000000 |$...............| 324// CHECK-NEXT: 0560: 1C000000 00000000 017A5052 00017810 |.........zPR..x.| 325// CHECK-NEXT: 0570: 0A900000 00000000 00001B0C 07089001 |................| 326// CHECK-NEXT: 0580: 10000000 24000000 00000000 01000000 |....$...........| 327// CHECK-NEXT: 0590: 00000000 18000000 00000000 017A5052 |.............zPR| 328// CHECK-NEXT: 05A0: 00017810 04920000 1B0C0708 90010000 |..x.............| 329// CHECK-NEXT: 05B0: 10000000 20000000 00000000 01000000 |.... ...........| 330// CHECK-NEXT: 05C0: 00000000 18000000 00000000 017A5052 |.............zPR| 331// CHECK-NEXT: 05D0: 00017810 06930000 00001B0C 07089001 |..x.............| 332// CHECK-NEXT: 05E0: 10000000 20000000 00000000 01000000 |.... ...........| 333// CHECK-NEXT: 05F0: 00000000 1C000000 00000000 017A5052 |.............zPR| 334// CHECK-NEXT: 0600: 00017810 0A940000 00000000 00001B0C |..x.............| 335// CHECK-NEXT: 0610: 07089001 10000000 24000000 00000000 |........$.......| 336// CHECK-NEXT: 0620: 01000000 00000000 1C000000 00000000 |................| 337// CHECK-NEXT: 0630: 017A5052 00017810 0A980000 00000000 |.zPR..x.........| 338// CHECK-NEXT: 0640: 00001B0C 07089001 10000000 24000000 |............$...| 339// CHECK-NEXT: 0650: 00000000 01000000 00000000 18000000 |................| 340// CHECK-NEXT: 0660: 00000000 017A5052 00017810 049A0000 |.....zPR..x.....| 341// CHECK-NEXT: 0670: 1B0C0708 90010000 10000000 20000000 |............ ...| 342// CHECK-NEXT: 0680: 00000000 01000000 00000000 18000000 |................| 343// CHECK-NEXT: 0690: 00000000 017A5052 00017810 069B0000 |.....zPR..x.....| 344// CHECK-NEXT: 06A0: 00001B0C 07089001 10000000 20000000 |............ ...| 345// CHECK-NEXT: 06B0: 00000000 01000000 00000000 1C000000 |................| 346// CHECK-NEXT: 06C0: 00000000 017A5052 00017810 0A9C0000 |.....zPR..x.....| 347// CHECK-NEXT: 06D0: 00000000 00001B0C 07089001 10000000 |................| 348// CHECK-NEXT: 06E0: 24000000 00000000 01000000 00000000 |$...............| 349 350// CHECK: Section { 351// CHECK: Index: 352// CHECK: Name: .rela.eh_frame 353// CHECK-NEXT: Type: SHT_RELA 354// CHECK-NEXT: Flags [ 355// CHECK-NEXT: ] 356// CHECK-NEXT: Address: 0x0 357// CHECK-NEXT: Offset: 358// CHECK-NEXT: Size: 1752 359// CHECK-NEXT: Link: 360// CHECK-NEXT: Info: 361// CHECK-NEXT: AddressAlignment: 8 362// CHECK-NEXT: EntrySize: 24 363// CHECK-NEXT: Relocations [ 364// CHECK-NEXT: 0x1C R_X86_64_PC32 .text 0x23 365// CHECK-NEXT: 0x48 R_X86_64_PC32 .text 0x0 366// CHECK-NEXT: 0x51 R_X86_64_32 bar 0x0 367// CHECK-NEXT: 0x60 R_X86_64_PC32 .text 0x2 368// CHECK-NEXT: 0x69 R_X86_64_32 bar 0x0 369// CHECK-NEXT: 0x83 R_X86_64_64 foo 0x0 370// CHECK-NEXT: 0x9C R_X86_64_PC32 .text 0x3 371// CHECK-NEXT: 0xA5 R_X86_64_16 bar 0x0 372// CHECK-NEXT: 0xBB R_X86_64_64 foo 0x0 373// CHECK-NEXT: 0xD4 R_X86_64_PC32 .text 0x1 374// CHECK-NEXT: 0xDD R_X86_64_32 bar 0x0 375// CHECK-NEXT: 0xF6 R_X86_64_16 foo 0x0 376// CHECK-NEXT: 0x108 R_X86_64_PC32 .text 0x4 377// CHECK-NEXT: 0x126 R_X86_64_32 foo 0x0 378// CHECK-NEXT: 0x138 R_X86_64_PC32 .text 0x5 379// CHECK-NEXT: 0x156 R_X86_64_64 foo 0x0 380// CHECK-NEXT: 0x16C R_X86_64_PC32 .text 0x6 381// CHECK-NEXT: 0x18A R_X86_64_64 foo 0x0 382// CHECK-NEXT: 0x1A0 R_X86_64_PC32 .text 0xA 383// CHECK-NEXT: 0x1BE R_X86_64_16 foo 0x0 384// CHECK-NEXT: 0x1D0 R_X86_64_PC32 .text 0x7 385// CHECK-NEXT: 0x1EE R_X86_64_32 foo 0x0 386// CHECK-NEXT: 0x200 R_X86_64_PC32 .text 0x8 387// CHECK-NEXT: 0x21E R_X86_64_64 foo 0x0 388// CHECK-NEXT: 0x234 R_X86_64_PC32 .text 0x9 389// CHECK-NEXT: 0x252 R_X86_64_PC64 foo 0x0 390// CHECK-NEXT: 0x268 R_X86_64_PC32 .text 0xB 391// CHECK-NEXT: 0x286 R_X86_64_PC16 foo 0x0 392// CHECK-NEXT: 0x298 R_X86_64_PC32 .text 0xC 393// CHECK-NEXT: 0x2B6 R_X86_64_PC32 foo 0x0 394// CHECK-NEXT: 0x2C8 R_X86_64_PC32 .text 0xD 395// CHECK-NEXT: 0x2E6 R_X86_64_PC64 foo 0x0 396// CHECK-NEXT: 0x2FC R_X86_64_PC32 .text 0xE 397// CHECK-NEXT: 0x31A R_X86_64_PC64 foo 0x0 398// CHECK-NEXT: 0x330 R_X86_64_PC32 .text 0x12 399// CHECK-NEXT: 0x34E R_X86_64_PC16 foo 0x0 400// CHECK-NEXT: 0x360 R_X86_64_PC32 .text 0xF 401// CHECK-NEXT: 0x37E R_X86_64_PC32 foo 0x0 402// CHECK-NEXT: 0x390 R_X86_64_PC32 .text 0x10 403// CHECK-NEXT: 0x3AE R_X86_64_PC64 foo 0x0 404// CHECK-NEXT: 0x3C4 R_X86_64_PC32 .text 0x11 405// CHECK-NEXT: 0x3E2 R_X86_64_64 foo 0x0 406// CHECK-NEXT: 0x3F8 R_X86_64_PC32 .text 0x13 407// CHECK-NEXT: 0x416 R_X86_64_16 foo 0x0 408// CHECK-NEXT: 0x428 R_X86_64_PC32 .text 0x14 409// CHECK-NEXT: 0x446 R_X86_64_32 foo 0x0 410// CHECK-NEXT: 0x458 R_X86_64_PC32 .text 0x15 411// CHECK-NEXT: 0x476 R_X86_64_64 foo 0x0 412// CHECK-NEXT: 0x48C R_X86_64_PC32 .text 0x16 413// CHECK-NEXT: 0x4AA R_X86_64_64 foo 0x0 414// CHECK-NEXT: 0x4C0 R_X86_64_PC32 .text 0x1A 415// CHECK-NEXT: 0x4DE R_X86_64_16 foo 0x0 416// CHECK-NEXT: 0x4F0 R_X86_64_PC32 .text 0x17 417// CHECK-NEXT: 0x50E R_X86_64_32 foo 0x0 418// CHECK-NEXT: 0x520 R_X86_64_PC32 .text 0x18 419// CHECK-NEXT: 0x53E R_X86_64_64 foo 0x0 420// CHECK-NEXT: 0x554 R_X86_64_PC32 .text 0x19 421// CHECK-NEXT: 0x572 R_X86_64_PC64 foo 0x0 422// CHECK-NEXT: 0x588 R_X86_64_PC32 .text 0x1B 423// CHECK-NEXT: 0x5A6 R_X86_64_PC16 foo 0x0 424// CHECK-NEXT: 0x5B8 R_X86_64_PC32 .text 0x1C 425// CHECK-NEXT: 0x5D6 R_X86_64_PC32 foo 0x0 426// CHECK-NEXT: 0x5E8 R_X86_64_PC32 .text 0x1D 427// CHECK-NEXT: 0x606 R_X86_64_PC64 foo 0x0 428// CHECK-NEXT: 0x61C R_X86_64_PC32 .text 0x1E 429// CHECK-NEXT: 0x63A R_X86_64_PC64 foo 0x0 430// CHECK-NEXT: 0x650 R_X86_64_PC32 .text 0x22 431// CHECK-NEXT: 0x66E R_X86_64_PC16 foo 0x0 432// CHECK-NEXT: 0x680 R_X86_64_PC32 .text 0x1F 433// CHECK-NEXT: 0x69E R_X86_64_PC32 foo 0x0 434// CHECK-NEXT: 0x6B0 R_X86_64_PC32 .text 0x20 435// CHECK-NEXT: 0x6CE R_X86_64_PC64 foo 0x0 436// CHECK-NEXT: 0x6E4 R_X86_64_PC32 .text 0x21 437// CHECK-NEXT: ] 438// CHECK: } 439 440.ifdef ERR 441// ERR: [[#@LINE+1]]:15: error: Expected an identifier 442.cfi_sections $ 443// ERR: [[#@LINE+1]]:28: error: unexpected token in '.cfi_sections' directive 444.cfi_sections .debug_frame $ 445// ERR: [[#@LINE+1]]:39: error: unexpected token in '.cfi_sections' directive 446.cfi_sections .debug_frame, .eh_frame $ 447 448// ERR: [[#@LINE+1]]:16: error: unexpected token in '.cfi_startproc' directive 449.cfi_startproc $ 450// ERR: [[#@LINE+1]]:23: error: unexpected token in '.cfi_startproc' directive 451.cfi_startproc simple $ 452 453// ERR: [[#@LINE+1]]:14: error: unexpected token in '.cfi_endproc' directive 454.cfi_endproc $ 455.endif 456