brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · e06479a Raw
63 lines · plain
1// RUN: llvm-mc -g -dwarf-version 2 -triple  i686-pc-linux-gnu %s -filetype=obj -o - | llvm-readobj -r - | FileCheck %s2// RUN: not llvm-mc -g -dwarf-version 1  -triple  i686-pc-linux-gnu %s -filetype=asm -o - 2>&1 | FileCheck --check-prefix=DWARF1 %s3// RUN: llvm-mc -g -dwarf-version 2 -triple  i686-pc-linux-gnu %s -filetype=asm -o - | FileCheck --check-prefix=ASM --check-prefix=DWARF2 %s4// RUN: llvm-mc -g -dwarf-version 3 -triple  i686-pc-linux-gnu %s -filetype=asm -o - | FileCheck --check-prefix=ASM --check-prefix=DWARF3 %s5// RUN: llvm-mc -g -triple  i686-pc-linux-gnu %s -filetype=asm -o - | FileCheck --check-prefix=ASM --check-prefix=DWARF4 %s6// RUN: llvm-mc -g -dwarf-version 5  -triple  i686-pc-linux-gnu %s -filetype=asm -o - 2>&1 | FileCheck --check-prefix=DWARF5 %s7// RUN: not llvm-mc -g -dwarf-version 6  -triple  i686-pc-linux-gnu %s -filetype=asm -o - 2>&1 | FileCheck --check-prefix=DWARF6 %s8 9 10// Test that on ELF:11// 1. the debug info has a relocation to debug_abbrev and one to debug_line.12// 2. the debug_aranges has relocations to text and debug_line.13 14 15    .text16    .globl foo17    .type foo, @function18    .align 419foo:20    ret21    .size foo, .-foo22 23// CHECK:      Relocations [24// CHECK:        Section ({{[^ ]+}}) .rel.debug_info {25// CHECK-NEXT:     0x6 R_386_32 .debug_abbrev26// CHECK-NEXT:     0xC R_386_32 .debug_line27// CHECK:        }28// CHECK-NEXT:   Section ({{[^ ]+}}) .rel.debug_aranges {29// CHECK-NEXT:     0x6 R_386_32 .debug_info30// CHECK-NEXT:     0x10 R_386_32 .text31// CHECK-NEXT:   }32// CHECK:      ]33 34// First instance of the section is just to give it a label for debug_aranges to refer to35// ASM: .section .debug_info36 37// ASM: .section .debug_abbrev38// ASM-NEXT: [[ABBREV_LABEL:.Ltmp[0-9]+]]39// DWARF5: .section .debug_abbrev40// DWARF5-NEXT: [[ABBREV_LABEL:.Ltmp[0-9]+]]41 42// Second instance of the section has the CU43// ASM: .section .debug_info44// Dwarf version45// DWARF2: .short 246// DWARF3: .short 347// DWARF4: .short 448// ASM-NEXT: .long [[ABBREV_LABEL]]49// DWARF5: .short 550// DWARF5-NEXT: .byte 151// DWARF5-NEXT: .byte 452// DWARF5-NEXT: .long [[ABBREV_LABEL]]53 54// First .byte 1 is the abbreviation number for the compile_unit abbrev55// ASM: .byte 156// ASM-NEXT: .long [[LINE_LABEL:.L[a-z0-9]+]]57 58// ASM: .section .debug_line59// ASM-NEXT: [[LINE_LABEL]]60 61// DWARF1: Dwarf version 1 is not supported.62// DWARF6: Dwarf version 6 is not supported.63