diff options
| author | Ekaterina Romanova <katya_romanova@playstation.sony.com> | 2016-10-27 22:37:25 +0000 |
|---|---|---|
| committer | Ekaterina Romanova <katya_romanova@playstation.sony.com> | 2016-10-27 22:37:25 +0000 |
| commit | 0b82459c6cf22a17d116f836c0e47749b9ad5f4b (patch) | |
| tree | 25298314b7b0e0a6222279d418f6a7822ef42031 /llvm/test/DebugInfo/X86 | |
| parent | 414b0155c446afef1d5d0b8cc6677970f043d7cc (diff) | |
| download | bcm5719-llvm-0b82459c6cf22a17d116f836c0e47749b9ad5f4b.tar.gz bcm5719-llvm-0b82459c6cf22a17d116f836c0e47749b9ad5f4b.zip | |
Update .debug_line section version information to match DWARF version.
In the past the compiler always emitted .debug_line version 2, though some opcodes from DWARF 3 (e.g. DW_LNS_set_prologue_end, DW_LNS_set_epilogue_begin or DW_LNS_set_isa) and from DWARF 4 could be emitted by the compiler.
This patch changes version information of .debug_line to exactly match the DWARF version. For .debug_line version 4, a new field maximum_operations_per_instruction is emitted.
Differential Revision: https://reviews.llvm.org/D16697
llvm-svn: 285355
Diffstat (limited to 'llvm/test/DebugInfo/X86')
| -rw-r--r-- | llvm/test/DebugInfo/X86/debug-line-version.s | 39 | ||||
| -rw-r--r-- | llvm/test/DebugInfo/X86/empty.ll | 2 | ||||
| -rw-r--r-- | llvm/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll | 6 |
3 files changed, 43 insertions, 4 deletions
diff --git a/llvm/test/DebugInfo/X86/debug-line-version.s b/llvm/test/DebugInfo/X86/debug-line-version.s new file mode 100644 index 00000000000..46041097047 --- /dev/null +++ b/llvm/test/DebugInfo/X86/debug-line-version.s @@ -0,0 +1,39 @@ +// RUN: llvm-mc -g -dwarf-version 2 -triple i686-pc-linux-gnu %s -filetype=obj -o - | llvm-dwarfdump - | FileCheck --check-prefix=DWARF2 %s +// RUN: llvm-mc -g -dwarf-version 3 -triple i686-pc-linux-gnu %s -filetype=obj -o - |llvm-dwarfdump - | FileCheck --check-prefix=DWARF3 %s +// RUN: llvm-mc -g -dwarf-version 4 -triple i686-pc-linux-gnu %s -filetype=obj -o - | llvm-dwarfdump - | FileCheck --check-prefix=DWARF4 %s + + +// Check that we generate debug_line version that matches the dwarf version. +// For DWARF-4, additionally check that maximum_operations_per_instruction +// field is emitted. + + .text + .globl foo + .type foo, @function + .align 4 +foo: + ret + .size foo, .-foo + +// DWARF2: Compile Unit: length = {{.*}} version = 0x0002 +// DWARF2: Line table prologue: +// DWARF2-NEXT: total_length: 0x00000077 +// DWARF2-NEXT: version: 2 +// DWARF2-NEXT: prologue_length: 0x00000062 +// DWARF2-NOT: max_ops_per_inst: 1 + +// DWARF3: Compile Unit: length = {{.*}} version = 0x0003 +// DWARF3: Line table prologue: +// DWARF3-NEXT: total_length: 0x00000077 +// DWARF3-NEXT: version: 3 +// DWARF3-NEXT: prologue_length: 0x00000062 +// DWARF3-NOT: max_ops_per_inst: 1 + + +// DWARF4: Compile Unit: length = {{.*}} version = 0x0004 +// DWARF4: Line table prologue: +// DWARF4-NEXT: total_length: 0x00000078 +// DWARF4-NEXT: version: 4 +// DWARF4-NEXT: prologue_length: 0x00000063 +// DWARF4: max_ops_per_inst: 1 + diff --git a/llvm/test/DebugInfo/X86/empty.ll b/llvm/test/DebugInfo/X86/empty.ll index e156e3bbe5e..6506f5567ad 100644 --- a/llvm/test/DebugInfo/X86/empty.ll +++ b/llvm/test/DebugInfo/X86/empty.ll @@ -4,7 +4,7 @@ ; Expect no line table entry since there are no functions and file references in this compile unit ; CHECK: .debug_line contents: ; CHECK: Line table prologue: -; CHECK: total_length: 0x00000019 +; CHECK: total_length: 0x0000001a ; CHECK-NOT: file_names[ ; CHECK: .debug_pubnames contents: diff --git a/llvm/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll b/llvm/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll index 527f577134c..a60725fe685 100644 --- a/llvm/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll +++ b/llvm/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll @@ -15,7 +15,7 @@ ; CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000010) ; CHECK: DW_TAG_compile_unit -; CHECK: DW_AT_stmt_list [DW_FORM_sec_offset] (0x0000003c) +; CHECK: DW_AT_stmt_list [DW_FORM_sec_offset] (0x0000003d) ; CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000010) ; CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000009) ; CHECK: DW_TAG_subprogram @@ -25,10 +25,10 @@ ; CHECK: .debug_line contents: ; CHECK-NEXT: Line table prologue: -; CHECK-NEXT: total_length: 0x00000038 +; CHECK-NEXT: total_length: 0x00000039 ; CHECK: file_names[ 1] 0 0x00000000 0x00000000 simple.c ; CHECK: Line table prologue: -; CHECK-NEXT: total_length: 0x00000039 +; CHECK-NEXT: total_length: 0x0000003a ; CHECK: file_names[ 1] 0 0x00000000 0x00000000 simple2.c ; CHECK-NOT: file_names |

