summaryrefslogtreecommitdiffstats
path: root/llvm/test/DebugInfo/X86/accel-tables.ll
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2018-07-20 12:59:05 +0000
committerPavel Labath <labath@google.com>2018-07-20 12:59:05 +0000
commitf9adc20aeff83ddb07b3b741099bf441425b787c (patch)
tree17bbb7728d246b26afd76b402f5277e056281eae /llvm/test/DebugInfo/X86/accel-tables.ll
parent35395a6773244a3462b839cf058e95a56f102063 (diff)
downloadbcm5719-llvm-f9adc20aeff83ddb07b3b741099bf441425b787c.tar.gz
bcm5719-llvm-f9adc20aeff83ddb07b3b741099bf441425b787c.zip
[DebugInfo] Generate .debug_names section when it makes sense
Summary: This patch makes us generate the debug_names section in response to some user-facing commands (previously it was only generated if explicitly selected via the -accel-tables option). My goal was to make this work for DWARF>=5 (as it's an official part of that standard), and also, as an extension, for DWARF<5 if one is explicitly tuning for lldb as a debugger (because it brings a large performance improvement there). This is slightly complicated by the fact that the debug_names tables are incompatible with the DWARF v4 type units (they assume that the type units are in the debug_info section), and unfortunately, right now we generate DWARF v4-style type units even for -gdwarf-5. For this reason, I disable all accelerator tables if the user requested type unit generation. I do this even for apple tables, as they have the same problem (in fact generating type units for apple targets makes us crash even before we get around to emitting the accelerator tables). Reviewers: JDevlieghere, aprantl, dblaikie, echristo, probinson Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D49420 llvm-svn: 337544
Diffstat (limited to 'llvm/test/DebugInfo/X86/accel-tables.ll')
-rw-r--r--llvm/test/DebugInfo/X86/accel-tables.ll36
1 files changed, 27 insertions, 9 deletions
diff --git a/llvm/test/DebugInfo/X86/accel-tables.ll b/llvm/test/DebugInfo/X86/accel-tables.ll
index c0b6a4c2fbf..e4f1508029e 100644
--- a/llvm/test/DebugInfo/X86/accel-tables.ll
+++ b/llvm/test/DebugInfo/X86/accel-tables.ll
@@ -1,16 +1,34 @@
-; Verify the emission of accelerator tables for various targets.
+; Verify the emission of accelerator tables for various targets for the DWARF<=4 case
-; Darwin has the tables unless we specifically tune for gdb
-; RUN: llc -mtriple=x86_64-apple-darwin12 -filetype=obj < %s | llvm-readobj -sections - | FileCheck --check-prefix=CHECK1 %s
-; RUN: llc -mtriple=x86_64-apple-darwin12 -filetype=obj -debugger-tune=gdb < %s | llvm-readobj -sections - | FileCheck --check-prefix=CHECK2 %s
+; Darwin has the apple tables unless we specifically tune for gdb
+; RUN: llc -mtriple=x86_64-apple-darwin12 -filetype=obj < %s \
+; RUN: | llvm-readobj -sections - | FileCheck --check-prefix=APPLE %s
+; RUN: llc -mtriple=x86_64-apple-darwin12 -filetype=obj -debugger-tune=gdb < %s \
+; RUN: | llvm-readobj -sections - | FileCheck --check-prefix=NONE %s
-; Linux does not have the tables even if we explicitly tune for lldb
-; RUN: llc -mtriple=x86_64-pc-linux -filetype=obj < %s | llvm-readobj -sections - | FileCheck --check-prefix=CHECK2 %s
-; RUN: llc -mtriple=x86_64-pc-linux -filetype=obj -debugger-tune=lldb < %s | llvm-readobj -sections - | FileCheck --check-prefix=CHECK2 %s
+; Linux does has debug_names tables only if we explicitly tune for lldb
+; RUN: llc -mtriple=x86_64-pc-linux -filetype=obj < %s \
+; RUN: | llvm-readobj -sections - | FileCheck --check-prefix=NONE %s
+; RUN: llc -mtriple=x86_64-pc-linux -filetype=obj -debugger-tune=lldb < %s \
+; RUN: | llvm-readobj -sections - | FileCheck --check-prefix=DEBUG_NAMES %s
-; CHECK1: apple_names
+; Neither target has accelerator tables if type units are enabled, as DWARF v4
+; type units are not compatible with accelerator tables.
+; RUN: llc -mtriple=x86_64-pc-linux -filetype=obj -generate-type-units -debugger-tune=lldb < %s \
+; RUN: | llvm-readobj -sections - | FileCheck --check-prefix=NONE %s
+; RUN: llc -mtriple=x86_64-apple-darwin12 -generate-type-units -filetype=obj < %s \
+; RUN: | llvm-readobj -sections - | FileCheck --check-prefix=NONE %s
-; CHECK2-NOT: apple_names
+; APPLE-NOT: debug_names
+; APPLE: apple_names
+; APPLE-NOT: debug_names
+
+; NONE-NOT: apple_names
+; NONE-NOT: debug_names
+
+; DEBUG_NAMES-NOT: apple_names
+; DEBUG_NAMES: debug_names
+; DEBUG_NAMES-NOT: apple_names
@var = thread_local global i32 0, align 4, !dbg !0
OpenPOWER on IntegriCloud