227 changes: 89 additions & 138 deletions bolt/docs/CommandLineArgumentReference.md

Large diffs are not rendered by default.

149 changes: 149 additions & 0 deletions bolt/docs/generate_doc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
#!/usr/bin/env python3
# A tool to parse the output of `llvm-bolt --help-hidden` and update the
# documentation in CommandLineArgumentReference.md automatically.
# Run from the directory in which this file is located to update the docs.

import subprocess
from textwrap import wrap

LINE_LIMIT = 80


def wrap_text(text, indent, limit=LINE_LIMIT):
wrapped_lines = wrap(text, width=limit - len(indent))
wrapped_text = ("\n" + indent).join(wrapped_lines)
return wrapped_text


def add_info(sections, section, option, description):
indent = " "
wrapped_description = "\n".join(
[
wrap_text(line, indent) if len(line) > LINE_LIMIT else line
for line in description
]
)
sections[section].append((option, indent + wrapped_description))


def parse_bolt_options(output):
section_headers = [
"Generic options:",
"Output options:",
"BOLT generic options:",
"BOLT optimization options:",
"BOLT options in relocation mode:",
"BOLT instrumentation options:",
"BOLT printing options:",
]

sections = {key: [] for key in section_headers}
current_section, prev_section = None, None
option, description = None, []

for line in output.split("\n"):
cleaned_line = line.strip()

if cleaned_line.casefold() in map(str.casefold, section_headers):
if prev_section != None: # Save last option from prev section
add_info(sections, current_section, option, description)
option, description = None, []

cleaned_line = cleaned_line.split()
# Apply lowercase to all words except the first one
cleaned_line = [cleaned_line[0]] + [
word.lower() for word in cleaned_line[1:]
]
# Join the words back together into a string
cleaned_line = " ".join(cleaned_line)

current_section = cleaned_line
prev_section = current_section
continue

if cleaned_line.startswith("-"):
if option and description:
# Join description lines, adding an extra newline for
# sub-options that start with '='
add_info(sections, current_section, option, description)
option, description = None, []

parts = cleaned_line.split(" ", 1)
if len(parts) > 1:
option = parts[0].strip()
descr = parts[1].strip()
descr = descr[2].upper() + descr[3:]
description = [descr]
if option.startswith("--print") or option.startswith("--time"):
current_section = "BOLT printing options:"
elif prev_section != None:
current_section = prev_section
continue

if cleaned_line.startswith("="):
parts = cleaned_line.split(maxsplit=1)
# Split into two parts: sub-option and description
if len(parts) == 2:
# Rejoin with a single space
cleaned_line = parts[0] + " " + parts[1].rstrip()
description.append(cleaned_line)
elif cleaned_line: # Multiline description continuation
description.append(cleaned_line)

add_info(sections, current_section, option, description)
return sections


def generate_markdown(sections):
markdown_lines = [
"# BOLT - a post-link optimizer developed to speed up large applications\n",
"## SYNOPSIS\n",
"`llvm-bolt <executable> [-o outputfile] <executable>.bolt "
"[-data=perf.fdata] [options]`\n",
"## OPTIONS",
]

for section, options in sections.items():
markdown_lines.append(f"\n### {section}")
if section == "BOLT instrumentation options:":
markdown_lines.append(
f"\n`llvm-bolt <executable> -instrument"
" [-o outputfile] <instrumented-executable>`"
)
for option, desc in options:
markdown_lines.append(f"\n- `{option}`\n")
# Split description into lines to handle sub-options
desc_lines = desc.split("\n")
for line in desc_lines:
if line.startswith("="):
# Sub-option: correct formatting with bullet
sub_option, sub_desc = line[1:].split(" ", 1)
markdown_lines.append(f" - `{sub_option}`: {sub_desc[4:]}")
else:
# Regular line of description
if line[2:].startswith("<"):
line = line.replace("<", "").replace(">", "")
markdown_lines.append(f"{line}")

return "\n".join(markdown_lines)


def main():
try:
help_output = subprocess.run(
["llvm-bolt", "--help-hidden"], capture_output=True, text=True, check=True
).stdout
except subprocess.CalledProcessError as e:
print("Failed to execute llvm-bolt --help:")
print(e)
return

sections = parse_bolt_options(help_output)
markdown = generate_markdown(sections)

with open("CommandLineArgumentReference.md", "w") as md_file:
md_file.write(markdown)


if __name__ == "__main__":
main()
4 changes: 2 additions & 2 deletions bolt/include/bolt/Core/BinaryBasicBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class BinaryBasicBlock {
unsigned Index{InvalidIndex};

/// Index in the current layout.
mutable unsigned LayoutIndex{InvalidIndex};
unsigned LayoutIndex{InvalidIndex};

/// Number of pseudo instructions in this block.
uint32_t NumPseudos{0};
Expand Down Expand Up @@ -891,7 +891,7 @@ class BinaryBasicBlock {
}

/// Set layout index. To be used by BinaryFunction.
void setLayoutIndex(unsigned Index) const { LayoutIndex = Index; }
void setLayoutIndex(unsigned Index) { LayoutIndex = Index; }

/// Needed by graph traits.
BinaryFunction *getParent() const { return getFunction(); }
Expand Down
3 changes: 2 additions & 1 deletion bolt/include/bolt/Core/FunctionLayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ class FunctionLayout {
void eraseBasicBlocks(const DenseSet<const BinaryBasicBlock *> ToErase);

/// Make sure fragments' and basic blocks' indices match the current layout.
void updateLayoutIndices();
void updateLayoutIndices() const;
void updateLayoutIndices(ArrayRef<BinaryBasicBlock *> Order) const;

/// Replace the current layout with NewLayout. Uses the block's
/// self-identifying fragment number to assign blocks to infer function
Expand Down
4 changes: 4 additions & 0 deletions bolt/include/bolt/Rewrite/RewriteInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "llvm/Object/ELFObjectFile.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/Regex.h"
#include <map>
#include <set>
#include <unordered_map>
Expand Down Expand Up @@ -596,6 +597,9 @@ class RewriteInstance {

NameResolver NR;

// Regex object matching split function names.
const Regex FunctionFragmentTemplate{"(.*)\\.(cold|warm)(\\.[0-9]+)?"};

friend class RewriteInstanceDiff;
};

Expand Down
10 changes: 3 additions & 7 deletions bolt/lib/Core/BinaryFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3641,8 +3641,8 @@ bool BinaryFunction::forEachEntryPoint(EntryPointCallbackTy Callback) const {

BinaryFunction::BasicBlockListType BinaryFunction::dfs() const {
BasicBlockListType DFS;
unsigned Index = 0;
std::stack<BinaryBasicBlock *> Stack;
std::set<BinaryBasicBlock *> Visited;

// Push entry points to the stack in reverse order.
//
Expand All @@ -3659,17 +3659,13 @@ BinaryFunction::BasicBlockListType BinaryFunction::dfs() const {
for (BinaryBasicBlock *const BB : reverse(EntryPoints))
Stack.push(BB);

for (BinaryBasicBlock &BB : blocks())
BB.setLayoutIndex(BinaryBasicBlock::InvalidIndex);

while (!Stack.empty()) {
BinaryBasicBlock *BB = Stack.top();
Stack.pop();

if (BB->getLayoutIndex() != BinaryBasicBlock::InvalidIndex)
if (Visited.find(BB) != Visited.end())
continue;

BB->setLayoutIndex(Index++);
Visited.insert(BB);
DFS.push_back(BB);

for (BinaryBasicBlock *SuccBB : BB->landing_pads()) {
Expand Down
9 changes: 7 additions & 2 deletions bolt/lib/Core/FunctionLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,20 @@ void FunctionLayout::eraseBasicBlocks(
updateLayoutIndices();
}

void FunctionLayout::updateLayoutIndices() {
void FunctionLayout::updateLayoutIndices() const {
unsigned BlockIndex = 0;
for (FunctionFragment &FF : fragments()) {
for (const FunctionFragment &FF : fragments()) {
for (BinaryBasicBlock *const BB : FF) {
BB->setLayoutIndex(BlockIndex++);
BB->setFragmentNum(FF.getFragmentNum());
}
}
}
void FunctionLayout::updateLayoutIndices(
ArrayRef<BinaryBasicBlock *> Order) const {
for (auto [Index, BB] : llvm::enumerate(Order))
BB->setLayoutIndex(Index);
}

bool FunctionLayout::update(const ArrayRef<BinaryBasicBlock *> NewLayout) {
const bool EqualBlockOrder = llvm::equal(Blocks, NewLayout);
Expand Down
5 changes: 4 additions & 1 deletion bolt/lib/Passes/IdenticalCodeFolding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,10 @@ Error IdenticalCodeFolding::runOnFunctions(BinaryContext &BC) {
"ICF breakdown", opts::TimeICF);
ParallelUtilities::WorkFuncTy WorkFun = [&](BinaryFunction &BF) {
// Make sure indices are in-order.
BF.getLayout().updateLayoutIndices();
if (opts::ICFUseDFS)
BF.getLayout().updateLayoutIndices(BF.dfs());
else
BF.getLayout().updateLayoutIndices();

// Pre-compute hash before pushing into hashtable.
// Hash instruction operands to minimize hash collisions.
Expand Down
3 changes: 3 additions & 0 deletions bolt/lib/Profile/YAMLProfileWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ YAMLProfileWriter::convert(const BinaryFunction &BF, bool UseDFS,
llvm::copy(UseDFS ? BF.dfs() : BF.getLayout().blocks(),
std::back_inserter(Order));

const FunctionLayout Layout = BF.getLayout();
Layout.updateLayoutIndices(Order);

for (const BinaryBasicBlock *BB : Order) {
yaml::bolt::BinaryBasicBlockProfile YamlBB;
YamlBB.Index = BB->getLayoutIndex();
Expand Down
2 changes: 1 addition & 1 deletion bolt/lib/Rewrite/DWARFRewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ static cl::opt<bool> CreateDebugNames(

static cl::opt<bool>
DebugSkeletonCu("debug-skeleton-cu",
cl::desc("prints out offsetrs for abbrev and debu_info of "
cl::desc("prints out offsets for abbrev and debug_info of "
"Skeleton CUs that get patched."),
cl::ZeroOrMore, cl::Hidden, cl::init(false),
cl::cat(BoltCategory));
Expand Down
12 changes: 4 additions & 8 deletions bolt/lib/Rewrite/RewriteInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
#include "llvm/Support/Error.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Regex.h"
#include "llvm/Support/Timer.h"
#include "llvm/Support/ToolOutputFile.h"
#include "llvm/Support/raw_ostream.h"
Expand Down Expand Up @@ -945,9 +944,6 @@ void RewriteInstance::discoverFileObjects() {
BinaryFunction *PreviousFunction = nullptr;
unsigned AnonymousId = 0;

// Regex object for matching cold fragments.
const Regex ColdFragment(".*\\.cold(\\.[0-9]+)?");

const auto SortedSymbolsEnd =
LastSymbol == SortedSymbols.end() ? LastSymbol : std::next(LastSymbol);
for (auto Iter = SortedSymbols.begin(); Iter != SortedSymbolsEnd; ++Iter) {
Expand Down Expand Up @@ -1229,7 +1225,7 @@ void RewriteInstance::discoverFileObjects() {
}

// Check if it's a cold function fragment.
if (ColdFragment.match(SymName)) {
if (FunctionFragmentTemplate.match(SymName)) {
static bool PrintedWarning = false;
if (!PrintedWarning) {
PrintedWarning = true;
Expand Down Expand Up @@ -1460,10 +1456,10 @@ void RewriteInstance::registerFragments() {
for (StringRef Name : Function.getNames()) {
StringRef BaseName = NR.restore(Name);
const bool IsGlobal = BaseName == Name;
const size_t ColdSuffixPos = BaseName.find(".cold");
if (ColdSuffixPos == StringRef::npos)
SmallVector<StringRef> Matches;
if (!FunctionFragmentTemplate.match(BaseName, &Matches))
continue;
StringRef ParentName = BaseName.substr(0, ColdSuffixPos);
StringRef ParentName = Matches[1];
const BinaryData *BD = BC->getBinaryDataByName(ParentName);
const uint64_t NumPossibleLocalParents =
NR.getUniquifiedNameCount(ParentName);
Expand Down
3 changes: 3 additions & 0 deletions bolt/test/AArch64/Inputs/array_end.lld_script
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
SECTIONS {
.interp : { *(.interp) }

. = ALIGN(CONSTANT(MAXPAGESIZE));
.fini_array :
{
PROVIDE_HIDDEN (__fini_array_start = .);
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/AArch64/lit.local.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if "AArch64" not in config.root.targets:
config.unsupported = True

flags = "--target=aarch64-pc-linux -nostartfiles -nostdlib -ffreestanding"
flags = "--target=aarch64-unknown-linux-gnu -nostartfiles -nostdlib -ffreestanding"

config.substitutions.insert(0, ("%cflags", f"%cflags {flags}"))
config.substitutions.insert(0, ("%cxxflags", f"%cxxflags {flags}"))
3 changes: 3 additions & 0 deletions bolt/test/Inputs/lsda.ldscript
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
SECTIONS {
.interp : { *(.interp) }
. = ALIGN(CONSTANT(MAXPAGESIZE));
.text : { *(.text*) }
. = ALIGN(CONSTANT(MAXPAGESIZE));
.gcc_except_table.main : { *(.gcc_except_table*) }
. = 0x20000;
.eh_frame : { *(.eh_frame) }
Expand Down
335 changes: 335 additions & 0 deletions bolt/test/X86/Inputs/dwarf4-subprogram-multiple-ranges-other.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,335 @@
## clang++ -fbasic-block-sections=all -ffunction-sections -g2 -gdwarf-4
## int doStuffOther(int val) {
## if (val)
## ++val;
## return val;
## }
##
## int mainOther(int argc, const char** argv) {
## return doStuffOther(argc);
## }
.text
.file "mainOther.cpp"
.section .text._Z12doStuffOtheri,"ax",@progbits
.globl _Z12doStuffOtheri # -- Begin function _Z12doStuffOtheri
.p2align 4, 0x90
.type _Z12doStuffOtheri,@function
_Z12doStuffOtheri: # @_Z12doStuffOtheri
.Lfunc_begin0:
.file 1 "." "mainOther.cpp"
.loc 1 1 0 # mainOther.cpp:1:0
.cfi_startproc
# %bb.0: # %entry
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
movl %edi, -4(%rbp)
.Ltmp0:
.loc 1 2 8 prologue_end # mainOther.cpp:2:8
cmpl $0, -4(%rbp)
.Ltmp1:
.loc 1 2 8 is_stmt 0 # mainOther.cpp:2:8
je _Z12doStuffOtheri.__part.2
jmp _Z12doStuffOtheri.__part.1
.LBB_END0_0:
.cfi_endproc
.section .text._Z12doStuffOtheri,"ax",@progbits,unique,1
_Z12doStuffOtheri.__part.1: # %if.then
.cfi_startproc
.cfi_def_cfa %rbp, 16
.cfi_offset %rbp, -16
.loc 1 3 6 is_stmt 1 # mainOther.cpp:3:6
movl -4(%rbp), %eax
addl $1, %eax
movl %eax, -4(%rbp)
jmp _Z12doStuffOtheri.__part.2
.LBB_END0_1:
.size _Z12doStuffOtheri.__part.1, .LBB_END0_1-_Z12doStuffOtheri.__part.1
.cfi_endproc
.section .text._Z12doStuffOtheri,"ax",@progbits,unique,2
_Z12doStuffOtheri.__part.2: # %if.end
.cfi_startproc
.cfi_def_cfa %rbp, 16
.cfi_offset %rbp, -16
.loc 1 4 11 # mainOther.cpp:4:11
movl -4(%rbp), %eax
.loc 1 4 4 epilogue_begin is_stmt 0 # mainOther.cpp:4:4
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.LBB_END0_2:
.size _Z12doStuffOtheri.__part.2, .LBB_END0_2-_Z12doStuffOtheri.__part.2
.cfi_endproc
.section .text._Z12doStuffOtheri,"ax",@progbits
.Lfunc_end0:
.size _Z12doStuffOtheri, .Lfunc_end0-_Z12doStuffOtheri
# -- End function
.section .text._Z9mainOtheriPPKc,"ax",@progbits
.globl _Z9mainOtheriPPKc # -- Begin function _Z9mainOtheriPPKc
.p2align 4, 0x90
.type _Z9mainOtheriPPKc,@function
_Z9mainOtheriPPKc: # @_Z9mainOtheriPPKc
.Lfunc_begin1:
.loc 1 7 0 is_stmt 1 # mainOther.cpp:7:0
.cfi_startproc
# %bb.0: # %entry
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
.Ltmp2:
.loc 1 8 27 prologue_end # mainOther.cpp:8:27
movl -4(%rbp), %edi
.loc 1 8 14 is_stmt 0 # mainOther.cpp:8:14
callq _Z12doStuffOtheri
.loc 1 8 6 epilogue_begin # mainOther.cpp:8:6
addq $16, %rsp
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.LBB_END1_0:
.cfi_endproc
.Lfunc_end1:
.size _Z9mainOtheriPPKc, .Lfunc_end1-_Z9mainOtheriPPKc
# -- End function
.section .debug_abbrev,"",@progbits
.byte 1 # Abbreviation Code
.byte 17 # DW_TAG_compile_unit
.byte 1 # DW_CHILDREN_yes
.byte 37 # DW_AT_producer
.byte 14 # DW_FORM_strp
.byte 19 # DW_AT_language
.byte 5 # DW_FORM_data2
.byte 3 # DW_AT_name
.byte 14 # DW_FORM_strp
.byte 16 # DW_AT_stmt_list
.byte 23 # DW_FORM_sec_offset
.byte 27 # DW_AT_comp_dir
.byte 14 # DW_FORM_strp
.byte 17 # DW_AT_low_pc
.byte 1 # DW_FORM_addr
.byte 85 # DW_AT_ranges
.byte 23 # DW_FORM_sec_offset
.byte 0 # EOM(1)
.byte 0 # EOM(2)
.byte 2 # Abbreviation Code
.byte 46 # DW_TAG_subprogram
.byte 1 # DW_CHILDREN_yes
.byte 85 # DW_AT_ranges
.byte 23 # DW_FORM_sec_offset
.byte 64 # DW_AT_frame_base
.byte 24 # DW_FORM_exprloc
.byte 110 # DW_AT_linkage_name
.byte 14 # DW_FORM_strp
.byte 3 # DW_AT_name
.byte 14 # DW_FORM_strp
.byte 58 # DW_AT_decl_file
.byte 11 # DW_FORM_data1
.byte 59 # DW_AT_decl_line
.byte 11 # DW_FORM_data1
.byte 73 # DW_AT_type
.byte 19 # DW_FORM_ref4
.byte 63 # DW_AT_external
.byte 25 # DW_FORM_flag_present
.byte 0 # EOM(1)
.byte 0 # EOM(2)
.byte 3 # Abbreviation Code
.byte 5 # DW_TAG_formal_parameter
.byte 0 # DW_CHILDREN_no
.byte 2 # DW_AT_location
.byte 24 # DW_FORM_exprloc
.byte 3 # DW_AT_name
.byte 14 # DW_FORM_strp
.byte 58 # DW_AT_decl_file
.byte 11 # DW_FORM_data1
.byte 59 # DW_AT_decl_line
.byte 11 # DW_FORM_data1
.byte 73 # DW_AT_type
.byte 19 # DW_FORM_ref4
.byte 0 # EOM(1)
.byte 0 # EOM(2)
.byte 4 # Abbreviation Code
.byte 46 # DW_TAG_subprogram
.byte 1 # DW_CHILDREN_yes
.byte 17 # DW_AT_low_pc
.byte 1 # DW_FORM_addr
.byte 18 # DW_AT_high_pc
.byte 6 # DW_FORM_data4
.byte 64 # DW_AT_frame_base
.byte 24 # DW_FORM_exprloc
.byte 110 # DW_AT_linkage_name
.byte 14 # DW_FORM_strp
.byte 3 # DW_AT_name
.byte 14 # DW_FORM_strp
.byte 58 # DW_AT_decl_file
.byte 11 # DW_FORM_data1
.byte 59 # DW_AT_decl_line
.byte 11 # DW_FORM_data1
.byte 73 # DW_AT_type
.byte 19 # DW_FORM_ref4
.byte 63 # DW_AT_external
.byte 25 # DW_FORM_flag_present
.byte 0 # EOM(1)
.byte 0 # EOM(2)
.byte 5 # Abbreviation Code
.byte 36 # DW_TAG_base_type
.byte 0 # DW_CHILDREN_no
.byte 3 # DW_AT_name
.byte 14 # DW_FORM_strp
.byte 62 # DW_AT_encoding
.byte 11 # DW_FORM_data1
.byte 11 # DW_AT_byte_size
.byte 11 # DW_FORM_data1
.byte 0 # EOM(1)
.byte 0 # EOM(2)
.byte 6 # Abbreviation Code
.byte 15 # DW_TAG_pointer_type
.byte 0 # DW_CHILDREN_no
.byte 73 # DW_AT_type
.byte 19 # DW_FORM_ref4
.byte 0 # EOM(1)
.byte 0 # EOM(2)
.byte 7 # Abbreviation Code
.byte 38 # DW_TAG_const_type
.byte 0 # DW_CHILDREN_no
.byte 73 # DW_AT_type
.byte 19 # DW_FORM_ref4
.byte 0 # EOM(1)
.byte 0 # EOM(2)
.byte 0 # EOM(3)
.section .debug_info,"",@progbits
.Lcu_begin0:
.long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
.Ldebug_info_start0:
.short 4 # DWARF version number
.long .debug_abbrev # Offset Into Abbrev. Section
.byte 8 # Address Size (in bytes)
.byte 1 # Abbrev [1] 0xb:0x9b DW_TAG_compile_unit
.long .Linfo_string0 # DW_AT_producer
.short 33 # DW_AT_language
.long .Linfo_string1 # DW_AT_name
.long .Lline_table_start0 # DW_AT_stmt_list
.long .Linfo_string2 # DW_AT_comp_dir
.quad 0 # DW_AT_low_pc
.long .Ldebug_ranges1 # DW_AT_ranges
.byte 2 # Abbrev [2] 0x2a:0x24 DW_TAG_subprogram
.long .Ldebug_ranges0 # DW_AT_ranges
.byte 1 # DW_AT_frame_base
.byte 86
.long .Linfo_string3 # DW_AT_linkage_name
.long .Linfo_string4 # DW_AT_name
.byte 1 # DW_AT_decl_file
.byte 1 # DW_AT_decl_line
.long 136 # DW_AT_type
# DW_AT_external
.byte 3 # Abbrev [3] 0x3f:0xe DW_TAG_formal_parameter
.byte 2 # DW_AT_location
.byte 145
.byte 124
.long .Linfo_string8 # DW_AT_name
.byte 1 # DW_AT_decl_file
.byte 1 # DW_AT_decl_line
.long 136 # DW_AT_type
.byte 0 # End Of Children Mark
.byte 4 # Abbrev [4] 0x4e:0x3a DW_TAG_subprogram
.quad .Lfunc_begin1 # DW_AT_low_pc
.long .Lfunc_end1-.Lfunc_begin1 # DW_AT_high_pc
.byte 1 # DW_AT_frame_base
.byte 86
.long .Linfo_string6 # DW_AT_linkage_name
.long .Linfo_string7 # DW_AT_name
.byte 1 # DW_AT_decl_file
.byte 7 # DW_AT_decl_line
.long 136 # DW_AT_type
# DW_AT_external
.byte 3 # Abbrev [3] 0x6b:0xe DW_TAG_formal_parameter
.byte 2 # DW_AT_location
.byte 145
.byte 124
.long .Linfo_string9 # DW_AT_name
.byte 1 # DW_AT_decl_file
.byte 7 # DW_AT_decl_line
.long 136 # DW_AT_type
.byte 3 # Abbrev [3] 0x79:0xe DW_TAG_formal_parameter
.byte 2 # DW_AT_location
.byte 145
.byte 112
.long .Linfo_string10 # DW_AT_name
.byte 1 # DW_AT_decl_file
.byte 7 # DW_AT_decl_line
.long 143 # DW_AT_type
.byte 0 # End Of Children Mark
.byte 5 # Abbrev [5] 0x88:0x7 DW_TAG_base_type
.long .Linfo_string5 # DW_AT_name
.byte 5 # DW_AT_encoding
.byte 4 # DW_AT_byte_size
.byte 6 # Abbrev [6] 0x8f:0x5 DW_TAG_pointer_type
.long 148 # DW_AT_type
.byte 6 # Abbrev [6] 0x94:0x5 DW_TAG_pointer_type
.long 153 # DW_AT_type
.byte 7 # Abbrev [7] 0x99:0x5 DW_TAG_const_type
.long 158 # DW_AT_type
.byte 5 # Abbrev [5] 0x9e:0x7 DW_TAG_base_type
.long .Linfo_string11 # DW_AT_name
.byte 6 # DW_AT_encoding
.byte 1 # DW_AT_byte_size
.byte 0 # End Of Children Mark
.Ldebug_info_end0:
.section .debug_ranges,"",@progbits
.Ldebug_ranges0:
.quad _Z12doStuffOtheri.__part.1
.quad .LBB_END0_1
.quad _Z12doStuffOtheri.__part.2
.quad .LBB_END0_2
.quad .Lfunc_begin0
.quad .Lfunc_end0
.quad 0
.quad 0
.Ldebug_ranges1:
.quad _Z12doStuffOtheri.__part.1
.quad .LBB_END0_1
.quad _Z12doStuffOtheri.__part.2
.quad .LBB_END0_2
.quad .Lfunc_begin0
.quad .Lfunc_end0
.quad .Lfunc_begin1
.quad .Lfunc_end1
.quad 0
.quad 0
.section .debug_str,"MS",@progbits,1
.Linfo_string0:
.asciz "clang version 19.0.0git (git@github.com:llvm/llvm-project.git df542e1ed82bd4e5a9e345d3a3ae63a76893a0cf)" # string offset=0
.Linfo_string1:
.asciz "mainOther.cpp" # string offset=104
.Linfo_string2:
.asciz "." # string offset=118
.Linfo_string3:
.asciz "_Z12doStuffOtheri" # string offset=120
.Linfo_string4:
.asciz "doStuffOther" # string offset=138
.Linfo_string5:
.asciz "int" # string offset=151
.Linfo_string6:
.asciz "_Z9mainOtheriPPKc" # string offset=155
.Linfo_string7:
.asciz "mainOther" # string offset=173
.Linfo_string8:
.asciz "val" # string offset=183
.Linfo_string9:
.asciz "argc" # string offset=187
.Linfo_string10:
.asciz "argv" # string offset=192
.Linfo_string11:
.asciz "char" # string offset=197
.ident "clang version 19.0.0git (git@github.com:llvm/llvm-project.git df542e1ed82bd4e5a9e345d3a3ae63a76893a0cf)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym _Z12doStuffOtheri
.section .debug_line,"",@progbits
.Lline_table_start0:
390 changes: 390 additions & 0 deletions bolt/test/X86/Inputs/dwarf5-subprogram-multiple-ranges-other.s

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bolt/test/X86/addr32.s
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Check that we don't accidentally strip addr32 prefix
## Check that we don't accidentally strip addr32 prefix

# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
# RUN: ld.lld %t.o -o %t.exe -nostdlib
Expand Down
14 changes: 7 additions & 7 deletions bolt/test/X86/asm-func-debug.test
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Verify that we update DW_TAG_compile_unit' ranges and .debug_aranges
# for assembly function that doesn't have corresponding DIE.
#
# The input test case foo() contains nops that we remove.
## Verify that we update DW_TAG_compile_unit' ranges and .debug_aranges
## for assembly function that doesn't have corresponding DIE.
##
## The input test case foo() contains nops that we remove.

RUN: %clang %cflags -gdwarf-5 -no-pie %p/../Inputs/asm_foo.s %p/../Inputs/asm_main.c -o %t.exe
RUN: llvm-bolt %t.exe -o %t --update-debug-sections
RUN: llvm-dwarfdump -all %t | FileCheck %s

# Check ranges were created/updated for asm compile unit
## Check ranges were created/updated for asm compile unit
CHECK: 0x0000000c: DW_TAG_compile_unit
CHECK-NEXT: DW_AT_stmt_list (0x00000000)
CHECK-NEXT: DW_AT_low_pc (0x0000000000000000)
Expand All @@ -16,11 +16,11 @@ CHECK-NEXT: [0x0000000000[[#%x,ADDR:]],
CHECK-SAME: 0x0000000000[[#ADDR+1]]))
CHECK-NEXT: DW_AT_name ("{{.*}}asm_foo.s")

# Check .debug_aranges was updated for asm module
## Check .debug_aranges was updated for asm module
CHECK: .debug_aranges contents:
CHECK-NEXT: Address Range Header: length = 0x0000002c, format = DWARF32, version = 0x0002, cu_offset = 0x00000000, addr_size = 0x08, seg_size = 0x00
CHECK-NEXT: [0x0000000000[[#ADDR]], 0x0000000000[[#ADDR+1]])

# Check line number info was updated
## Check line number info was updated
CHECK: 0x0000000000[[#ADDR]] 13 0 0 0 0 0 is_stmt
CHECK-NEXT: 0x0000000000[[#ADDR+1]] 13 0 0 0 0 0 is_stmt end_sequence
10 changes: 5 additions & 5 deletions bolt/test/X86/avx512-trap.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Check that BOLT inserts trap instruction at entry to functions that use AVX-512.
# Check that AVX-512 instruction is updated correctly when -trap-avx512=0 is passed.
## Check that BOLT inserts trap instruction at entry to functions that use AVX-512.
## Check that AVX-512 instruction is updated correctly when -trap-avx512=0 is passed.

RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-unknown -o %t.o \
RUN: %S/Inputs/avx512.s
Expand All @@ -17,11 +17,11 @@ RUN: FileCheck %s --check-prefix=CHECK-DIS-NO-TRAP

CHECK: BOLT-WARNING: 1 function will trap on entry

# Check that we have two ud2 instructions - one per entry.
## Check that we have two ud2 instructions - one per entry.
CHECK-DIS: use_avx512
CHECK-DIS-NEXT: ud2
CHECK-DIS-NEXT: ud2

# Check that we generate correct AVX-512
## Check that we generate correct AVX-512
CHECK-DIS-NO-TRAP: use_avx512
CHECK-DIS-NO-TRAP: 62 e2 f5 70 2c da vscalefpd
CHECK-DIS-NO-TRAP: 62 e2 f5 70 2c da vscalefpd
6 changes: 3 additions & 3 deletions bolt/test/X86/bb-with-two-tail-calls.s
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This reproduces a bug with dynostats when trying to compute branch stats
# at a block with two tails calls (one conditional and one unconditional).
## This reproduces a bug with dynostats when trying to compute branch stats
## at a block with two tails calls (one conditional and one unconditional).

# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
# RUN: %s -o %t.o
Expand All @@ -17,7 +17,7 @@
# CHECK: {{.*}}: ja {{.*}} # TAILCALL # Offset: 7 # CTCTakenCount: 4
# CHECK-NEXT: {{.*}}: jmp {{.*}} # TAILCALL # Offset: 13

# Confirm that a deleted basic block is emitted at function end offset (0xe)
## Confirm that a deleted basic block is emitted at function end offset (0xe)
# CHECK-BAT: [[#%x,ADDR:]] g .text [[#%x,SIZE:]] _start
# CHECK-BAT: Function Address: 0x[[#%x,ADDR]]
# CHECK-BAT: 0x[[#%x,SIZE]]
Expand Down
5 changes: 2 additions & 3 deletions bolt/test/X86/block-reordering.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Tests whether llvm-bolt is able to reorder blocks and fix branches
# according to the new function layout.
## Tests whether llvm-bolt is able to reorder blocks and fix branches
## according to the new function layout.

RUN: yaml2obj %p/Inputs/blarge.yaml &> %t.exe
RUN: llvm-bolt %t.exe -o %t.null --data %p/Inputs/blarge.fdata \
Expand Down Expand Up @@ -46,4 +46,3 @@ CHECK: Exec Count : 0
CHECK: Predecessors: .Ltmp{{.*}}
CHECK: {{.*}}: movq %rax, (%rsi)
CHECK: {{.*}}: retq

10 changes: 5 additions & 5 deletions bolt/test/X86/bolt-address-translation-internal-call.test
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This checks for an issue with internal calls and BAT (BOLT address
# translation). BAT needs to map every output block back to an input
# block, but passes that introduce new blocks (such as validate
# internal calls) might create new blocks without a mapping to an
# input block.
## This checks for an issue with internal calls and BAT (BOLT address
## translation). BAT needs to map every output block back to an input
## block, but passes that introduce new blocks (such as validate
## internal calls) might create new blocks without a mapping to an
## input block.

# REQUIRES: x86_64-linux,bolt-runtime

Expand Down
12 changes: 6 additions & 6 deletions bolt/test/X86/bolt-address-translation-yaml.test
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Check new BAT format containing hashes for YAML profile.
## Check new BAT format containing hashes for YAML profile.

RUN: yaml2obj %p/Inputs/blarge_new.yaml &> %t.exe
RUN: llvm-bolt %t.exe -o %t.out --pa -p %p/Inputs/blarge_new.preagg.txt \
RUN: --reorder-blocks=ext-tsp --split-functions --split-strategy=cdsplit \
RUN: --reorder-functions=cdsort --enable-bat --dyno-stats --skip-funcs=main \
RUN: 2>&1 | FileCheck --check-prefix WRITE-BAT-CHECK %s
# Check that branch with entry in BAT is accounted for.
## Check that branch with entry in BAT is accounted for.
RUN: perf2bolt %t.out --pa -p %p/Inputs/blarge_new_bat_branchentry.preagg.txt \
RUN: -w %t.yaml -o %t.fdata
RUN: llvm-bolt %t.exe -data %t.fdata -w %t.yaml-fdata -o %t.null
Expand All @@ -15,7 +15,7 @@ BRANCHENTRY-YAML-CHECK: - name: SolveCubic
BRANCHENTRY-YAML-CHECK: bid: 0
BRANCHENTRY-YAML-CHECK: hash: 0x700F19D24600000
BRANCHENTRY-YAML-CHECK-NEXT: succ: [ { bid: 7, cnt: 1 }
# Check that the order is correct between BAT YAML and FDATA->YAML.
## Check that the order is correct between BAT YAML and FDATA->YAML.
RUN: perf2bolt %t.out --pa -p %p/Inputs/blarge_new_bat_order.preagg.txt \
RUN: -w %t.yaml -o %t.fdata
RUN: llvm-bolt %t.exe -data %t.fdata -w %t.yaml-fdata -o %t.null
Expand All @@ -26,16 +26,16 @@ ORDER-YAML-CHECK: bid: 3
ORDER-YAML-CHECK: hash: 0xDDA1DC5F69F900AC
ORDER-YAML-CHECK-NEXT: calls: [ { off: 0x26, fid: [[#]], cnt: 20 } ]
ORDER-YAML-CHECK-NEXT: succ: [ { bid: 5, cnt: 7 }
# Large profile test
## Large profile test
RUN: perf2bolt %t.out --pa -p %p/Inputs/blarge_new_bat.preagg.txt -w %t.yaml -o %t.fdata \
RUN: 2>&1 | FileCheck --check-prefix READ-BAT-CHECK %s
RUN: FileCheck --input-file %t.yaml --check-prefix YAML-BAT-CHECK %s
# Check that YAML converted from fdata matches YAML created directly with BAT.
## Check that YAML converted from fdata matches YAML created directly with BAT.
RUN: llvm-bolt %t.exe -data %t.fdata -w %t.yaml-fdata -o /dev/null \
RUN: 2>&1 | FileCheck --check-prefix READ-BAT-FDATA-CHECK %s
RUN: FileCheck --input-file %t.yaml-fdata --check-prefix YAML-BAT-CHECK %s

# Test resulting YAML profile with the original binary (no-stale mode)
## Test resulting YAML profile with the original binary (no-stale mode)
RUN: llvm-bolt %t.exe -data %t.yaml -o %t.null -dyno-stats 2>&1 \
RUN: | FileCheck --check-prefix CHECK-BOLT-YAML %s

Expand Down
54 changes: 27 additions & 27 deletions bolt/test/X86/bolt-address-translation.test
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# Check a common case for BOLT address translation tables. These tables are used
# to translate profile activity happening in a bolted binary back to the
# original binary, so you can run BOLT again, with updated profile collected
# in a production environment that only runs bolted binaries. As BOLT only
# takes no-bolt binaries as inputs, this translation is necessary to cover
# this scenario.
## Check a common case for BOLT address translation tables. These tables are used
## to translate profile activity happening in a bolted binary back to the
## original binary, so you can run BOLT again, with updated profile collected
## in a production environment that only runs bolted binaries. As BOLT only
## takes no-bolt binaries as inputs, this translation is necessary to cover
## this scenario.
#
# RUN: yaml2obj %p/Inputs/blarge.yaml &> %t.exe
# RUN: llvm-bolt %t.exe -o %t.out --data %p/Inputs/blarge.fdata \
# RUN: --reorder-blocks=normal --split-functions --enable-bat 2>&1 | FileCheck %s
# RUN: llvm-bat-dump %t.out --dump-all \
# RUN: --translate=0x401180 | FileCheck %s --check-prefix=CHECK-BAT-DUMP
#
# In this test we focus on function usqrt at address 0x401170. This is a
# non-reloc binary case, so we don't expect this address to change, that's
# why we hardcode its address here. This address also comes hardcoded in the
# blarge.yaml input file.
#
# This is the layout of the function before BOLT reorder blocks:
#
# BB Layout : .LBB02, .Ltmp39, .LFT1, .Ltmp38, .LFT2
#
# This is the layout of the function after BOLT reorder blocks:
#
# BB Layout : .LBB02, .Ltmp38, .Ltmp39, .LFT2, .LFT3
#
# .Ltmp38 is originally at offset 0x39 but gets moved to 0xc (see full dump
# below).
#
# We check that BAT is able to translate references happening in .Ltmp38 to
# its original offset.
#
## In this test we focus on function usqrt at address 0x401170. This is a
## non-reloc binary case, so we don't expect this address to change, that's
## why we hardcode its address here. This address also comes hardcoded in the
## blarge.yaml input file.
##
## This is the layout of the function before BOLT reorder blocks:
##
## BB Layout : .LBB02, .Ltmp39, .LFT1, .Ltmp38, .LFT2
##
## This is the layout of the function after BOLT reorder blocks:
##
## BB Layout : .LBB02, .Ltmp38, .Ltmp39, .LFT2, .LFT3
##
## .Ltmp38 is originally at offset 0x39 but gets moved to 0xc (see full dump
## below).
##
## We check that BAT is able to translate references happening in .Ltmp38 to
## its original offset.
##

# This binary has 3 functions with profile, all of them are split, so 6 maps.
# BAT creates one map per function fragment.
## This binary has 3 functions with profile, all of them are split, so 6 maps.
## BAT creates one map per function fragment.
#
# CHECK: BOLT: 3 out of 7 functions were overwritten.
# CHECK: BOLT-INFO: Wrote 6 BAT maps
Expand Down
6 changes: 3 additions & 3 deletions bolt/test/X86/branch-data.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Checks that llvm-bolt is able to read data generated by perf2bolt and update
# the CFG edges accordingly with absolute number of branches and mispredictions.
# Also checks that llvm-bolt disassembler and CFG builder is working properly.
## Checks that llvm-bolt is able to read data generated by perf2bolt and update
## the CFG edges accordingly with absolute number of branches and mispredictions.
## Also checks that llvm-bolt disassembler and CFG builder is working properly.

RUN: yaml2obj %p/Inputs/blarge.yaml &> %t.exe
RUN: llvm-bolt %t.exe -o %t.null --data %p/Inputs/blarge.fdata --print-cfg | FileCheck %s
Expand Down
6 changes: 3 additions & 3 deletions bolt/test/X86/broken_dynsym.test
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This test checks if BOLT can process stripped binaries, where symbol's section
# header index is corrupted due to strip tool.
## This test checks if BOLT can process stripped binaries, where symbol's section
## header index is corrupted due to strip tool.

# RUN: yaml2obj %p/Inputs/broken_dynsym.yaml -o %t
# RUN: llvm-strip -s %t
# RUN: llvm-bolt %t -o %t.bolt --allow-stripped | FileCheck %s

# CHECK-NOT: section index out of bounds
# CHECK-NOT: section index out of bounds
2 changes: 1 addition & 1 deletion bolt/test/X86/bug-function-layout-execount.s
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Verifies that llvm-bolt correctly sorts functions by their execution counts.
## Verifies that llvm-bolt correctly sorts functions by their execution counts.

# REQUIRES: x86_64-linux, asserts

Expand Down
16 changes: 8 additions & 8 deletions bolt/test/X86/bug-reorder-bb-jrcxz.s
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Test performs a BB reordering with unsupported
# instruction jrcxz. Reordering works correctly with the
# follow options: None, Normal or Reverse. Other strategies
# are completed with Assertion `isIntN(Size * 8 + 1, Value).
# The cause is the distance between BB where one contains
# jrcxz instruction.
# Example: OpenSSL
# https://github.com/openssl/openssl/blob/master/crypto/bn/asm/x86_64-mont5.pl#L3319
## Test performs a BB reordering with unsupported
## instruction jrcxz. Reordering works correctly with the
## follow options: None, Normal or Reverse. Other strategies
## are completed with Assertion `isIntN(Size * 8 + 1, Value).
## The cause is the distance between BB where one contains
## jrcxz instruction.
## Example: OpenSSL
## https://github.com/openssl/openssl/blob/master/crypto/bn/asm/x86_64-mont5.pl#L3319

# REQUIRES: system-linux

Expand Down
6 changes: 3 additions & 3 deletions bolt/test/X86/calculate-emitted-block-size.s
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Test BinaryContext::calculateEmittedSize's functionality to update
# BinaryBasicBlock::OutputAddressRange in place so that the emitted size
# of each basic block is given by BinaryBasicBlock::getOutputSize()
## Test BinaryContext::calculateEmittedSize's functionality to update
## BinaryBasicBlock::OutputAddressRange in place so that the emitted size
## of each basic block is given by BinaryBasicBlock::getOutputSize()

# RUN: llvm-mc --filetype=obj --triple x86_64-unknown-unknown %s -o %t.o
# RUN: link_fdata %s %t.o %t.fdata
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/call-zero.s
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Verifies that llvm-bolt ignores function calls to 0.
## Verifies that llvm-bolt ignores function calls to 0.

# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
# RUN: %clang %cflags %t.o -o %t.exe
Expand Down
14 changes: 7 additions & 7 deletions bolt/test/X86/cdsplit-call-scale.s
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Test the control of aggressiveness of 3-way splitting by -call-scale.
# When -call-scale=0.0, the tested function is 2-way splitted.
# When -call-scale=1.0, the tested function is 3-way splitted with 5 blocks
# in warm because of the increased benefit of shortening the call edges.
# When -call-scale=1000.0, the tested function is still 3-way splitted with
# 5 blocks in warm because cdsplit does not allow hot-warm splitting to break
# a fall through branch from a basic block to its most likely successor.
## Test the control of aggressiveness of 3-way splitting by -call-scale.
## When -call-scale=0.0, the tested function is 2-way splitted.
## When -call-scale=1.0, the tested function is 3-way splitted with 5 blocks
## in warm because of the increased benefit of shortening the call edges.
## When -call-scale=1000.0, the tested function is still 3-way splitted with
## 5 blocks in warm because cdsplit does not allow hot-warm splitting to break
## a fall through branch from a basic block to its most likely successor.

# RUN: llvm-mc --filetype=obj --triple x86_64-unknown-unknown %s -o %t.o
# RUN: link_fdata %s %t.o %t.fdata
Expand Down
6 changes: 3 additions & 3 deletions bolt/test/X86/cdsplit-symbol-names.s
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Test the correctness of section names and function symbol names post cdsplit.
# Warm section should have name .text.warm and warm function fragments should
# have symbol names ending in warm.
## Test the correctness of section names and function symbol names post cdsplit.
## Warm section should have name .text.warm and warm function fragments should
## have symbol names ending in warm.

# RUN: llvm-mc --filetype=obj --triple x86_64-unknown-unknown %s -o %t.o
# RUN: link_fdata %s %t.o %t.fdata
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/cfi-expr-rewrite.s
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Check that llvm-bolt is able to parse DWARF expressions in CFI instructions,
# store them in memory and correctly write them back to the output binary.
## Check that llvm-bolt is able to parse DWARF expressions in CFI instructions,
## store them in memory and correctly write them back to the output binary.

# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
# RUN: %clang %cflags %t.o -o %t.exe
Expand Down
22 changes: 11 additions & 11 deletions bolt/test/X86/cfi-instrs-count.s
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Check that llvm-bolt is able to read a file with DWARF Exception CFI
# information and annotate this into a disassembled function.
## Check that llvm-bolt is able to read a file with DWARF Exception CFI
## information and annotate this into a disassembled function.

# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
# RUN: %clang %cflags %t.o -o %t.exe
# RUN: llvm-bolt %t.exe -o %t.null --print-cfg 2>&1 | FileCheck %s
#
#
# CHECK: Binary Function "_Z7catchitv" after building cfg {
# CHECK: CFI Instrs : 6
# CHECK: }
Expand All @@ -23,7 +23,7 @@
main:
# FDATA: 0 [unknown] 0 1 main 0 0 0
.cfi_startproc
.LBB000:
.LBB000:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
Expand All @@ -49,7 +49,7 @@ main:
_Z7catchitv:
# FDATA: 0 [unknown] 0 1 _Z7catchitv 0 0 0
.cfi_startproc
.LBB00:
.LBB00:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
Expand All @@ -64,18 +64,18 @@ _Z7catchitv:
.LBB00_br: jmp .Ltmp0
# FDATA: 1 _Z7catchitv #.LBB00_br# 1 _Z7catchitv #.Ltmp0# 0 0

.LLP0:
.LLP0:
cmpq $0x1, %rdx
.LLP0_br: je .Ltmp1
# FDATA: 1 _Z7catchitv #.LLP0_br# 1 _Z7catchitv #.Ltmp1# 0 0
# FDATA: 1 _Z7catchitv #.LLP0_br# 1 _Z7catchitv #.LFT0# 0 0

.LFT0:
.LFT0:
movq %rax, %rdi
.LFT0_br: callq _Unwind_Resume@PLT
# FDATA: 1 _Z7catchitv #.LFT0_br# 1 _Z7catchitv #.Ltmp1# 0 0

.Ltmp1:
.Ltmp1:
movq %rax, %rdi
callq __cxa_begin_catch@PLT
movq %rax, -0x18(%rbp)
Expand All @@ -85,7 +85,7 @@ _Z7catchitv:
.Ltmp1_br: jmp .Ltmp2
# FDATA: 1 _Z7catchitv #.Ltmp1_br# 1 _Z7catchitv #.Ltmp2# 0 0

.LLP1:
.LLP1:
movl %edx, %ebx
movq %rax, %r12
callq __cxa_end_catch@PLT
Expand All @@ -95,11 +95,11 @@ _Z7catchitv:
.LLP1_br: callq _Unwind_Resume@PLT
# FDATA: 1 _Z7catchitv #.LLP1_br# 1 _Z7catchitv #.Ltmp2# 0 0

.Ltmp2:
.Ltmp2:
.Ltmp2_br: callq __cxa_end_catch@PLT
# FDATA: 1 _Z7catchitv #.Ltmp2_br# 1 _Z7catchitv #.Ltmp0# 0 0

.Ltmp0:
.Ltmp0:
addq $0x10, %rsp
popq %rbx
popq %r12
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/cfi-instrs-reordered.s
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Check that llvm-bolt is able to read a file with DWARF Exception CFI
# information and fix CFI information after reordering.
## Check that llvm-bolt is able to read a file with DWARF Exception CFI
## information and fix CFI information after reordering.

# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
# RUN: llvm-strip --strip-unneeded %t.o
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/checkvma-large-section.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This test reproduces the issue with a section which ends at >4G address
## This test reproduces the issue with a section which ends at >4G address
REQUIRES: asserts
RUN: split-file %s %t
RUN: yaml2obj %t/yaml -o %t.exe --max-size=0
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/ctc-and-unreachable.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Check that we don't fail processing a function with conditional tail call and
# a fall-through to a next function (result of builtin_unreachable()).
## Check that we don't fail processing a function with conditional tail call and
## a fall-through to a next function (result of builtin_unreachable()).

RUN: %clang %cflags %p/Inputs/ctc_and_unreachable.s -o %t.exe -Wl,-q
RUN: llvm-bolt %t.exe -o %t --print-after-lowering --print-only=foo 2>&1 | FileCheck %s
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/debug-fission-single-convert.s
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Checks debug fission support in BOLT
## Checks debug fission support in BOLT

# REQUIRES: system-linux

Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/debug-fission-single.s
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Checks debug fission support in BOLT
## Checks debug fission support in BOLT

# REQUIRES: system-linux

Expand Down
6 changes: 3 additions & 3 deletions bolt/test/X86/double-jump.test
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Test the double jump removal peephole.
## Test the double jump removal peephole.

# This test has commands that rely on shell capabilities that won't execute
# correctly on Windows e.g. subshell execution
## This test has commands that rely on shell capabilities that won't execute
## correctly on Windows e.g. subshell execution
REQUIRES: shell

RUN: %clang %cflags %p/Inputs/double_jump.cpp -o %t.exe
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf-handle-visit-loclist-error.s
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections &> file
# RUN: cat file | FileCheck --check-prefix=CHECK %s

# Making sure we handle error returned by visitLocationList correctly.
## Making sure we handle error returned by visitLocationList correctly.

# CHECK: BOLT-WARNING: empty location list detected at
# CHECK-NEXT: BOLT-WARNING: empty location list detected at
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf-test-df-logging.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Testing that we print out INFO message when binary has split dwarf.
;; Testing that we print out INFO message when binary has split dwarf.

; RUN: mkdir -p %t
; RUN: cd %t
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf3-lowpc-highpc-convert.s
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t.txt
# RUN: cat %t.txt | FileCheck --check-prefix=POSTCHECK %s

# This tests checks that DW_AT_high_pc[DW_FORM_ADDR] can be converted to DW_AT_ranges correctly in Dwarf3
## This tests checks that DW_AT_high_pc[DW_FORM_ADDR] can be converted to DW_AT_ranges correctly in Dwarf3

# PRECHECK: version = 0x0003
# PRECHECK: DW_AT_low_pc
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf4-cross-cu-backward-different-abbrev.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s

# This test checks that BOLT handles backward cross CU references for dwarf4
# when CUs are have different abbrev tables.
## This test checks that BOLT handles backward cross CU references for dwarf4
## when CUs are have different abbrev tables.

# PRECHECK: DW_TAG_compile_unit
# PRECHECK: DW_TAG_compile_unit
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf4-cross-cu-forward-different-abbrev.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s

# This test checks that BOLT handles forward cross CU references for dwarf4
# when CUs are have different abbrev tables.
## This test checks that BOLT handles forward cross CU references for dwarf4
## when CUs are have different abbrev tables.

# PRECHECK: DW_TAG_compile_unit
# PRECHECK: DW_AT_abstract_origin [DW_FORM_ref_addr]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s

# Tests that BOLT correctly handles location list with DWARF5/DWARF4 when order of CUs is not the same as in input.
## Tests that BOLT correctly handles location list with DWARF5/DWARF4 when order of CUs is not the same as in input.

# PRECHECK: version = 0x0005
# PRECHECK: version = 0x0004
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf4-df-basic.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections -v 1 &> log
; RUN: cat log | FileCheck %s -check-prefix=BOLT-LOG-CHECK

; Test check we don't print out a warning in -v 1 when Unit DIE doesn't have low_pc/high_pc
;; Test check we don't print out a warning in -v 1 when Unit DIE doesn't have low_pc/high_pc

; BOLT-LOG-CHECK-NOT: BOLT-ERROR: cannot update ranges for DIE in Unit offset
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf4-df-call-site-change-low-pc.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.dwo.dwo &> %t/maindwodwo.txt
; RUN: cat %t/maindwodwo.txt | FileCheck -check-prefix=BOLT-DWO-MAIN %s

; Tests that DW_AT_low_pc changes in DW_TAG_GNU_call_site.
;; Tests that DW_AT_low_pc changes in DW_TAG_GNU_call_site.

; PRE-BOLT-DWO-MAIN: version = 0x0004
; PRE-BOLT-DWO-MAIN: DW_TAG_GNU_call_site
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
; RUN: not llvm-dwarfdump --show-form --verbose --debug-info main.dwo.dwo &> %t/maindwodwo.txt
; RUN: cat %t/maindwodwo.txt | FileCheck -check-prefix=BOLT-DWO-MAIN %s

; Tests that new indices are assigned to DW_OP_GNU_addr_index.
;; Tests that new indices are assigned to DW_OP_GNU_addr_index.

; PRE-BOLT-DWO-MAIN: version = 0x0004
; PRE-BOLT-DWO-MAIN: DW_AT_location [DW_FORM_exprloc] (DW_OP_GNU_addr_index 0x0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.dwo | FileCheck --check-prefix=PRECHECK %s
; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.dwo.dwo | FileCheck --check-prefix=POSTCHECK %s

; This test checks that we do not convert low_pc/high_pc to ranges for DW_TAG_inlined_subroutine,
; when there is only one output range entry.
;; This test checks that we do not convert low_pc/high_pc to ranges for DW_TAG_inlined_subroutine,
;; when there is only one output range entry.

; PRECHECK: DW_TAG_inlined_subroutine
; PRECHECK: DW_AT_abstract_origin
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf4-df-dualcu-loclist.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
; RUN: llvm-dwarfdump --show-form --verbose --debug-info helper.dwo | FileCheck -check-prefix=PRE-BOLT-DWO-HELPER %s
; RUN: llvm-dwarfdump --show-form --verbose --debug-info helper.dwo.dwo | FileCheck -check-prefix=BOLT-DWO-HELPER %s

; Testing dwarf4 split dwarf for two CUs. Making sure DW_AT_location [DW_FORM_sec_offset] is updated correctly.
;; Testing dwarf4 split dwarf for two CUs. Making sure DW_AT_location [DW_FORM_sec_offset] is updated correctly.

; PRE-BOLT-DWO-MAIN: version = 0x0004
; PRE-BOLT-DWO-MAIN: DW_TAG_formal_parameter [10]
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf4-df-dualcu.test
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
; RUN: not llvm-dwarfdump --show-form --verbose --debug-info helper.dwo.dwo &> helperdwodwo.txt
; RUN: cat helperdwodwo.txt | FileCheck -check-prefix=BOLT-DWO-HELPER %s

; Testing dwarf5 split dwarf for two CUs. Making sure DW_AT_low_pc/DW_AT_high_pc are converted correctly in the binary and in dwo.
; Checking that DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx ##) are updated correctly.
;; Testing dwarf5 split dwarf for two CUs. Making sure DW_AT_low_pc/DW_AT_high_pc are converted correctly in the binary and in dwo.
;; Checking that DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx ##) are updated correctly.

; PRE-BOLT: version = 0x0004
; PRE-BOLT: DW_TAG_compile_unit
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf4-df-inlined-subroutine-lowpc-0.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
; RUN: llvm-dwarfdump --debug-info --verbose --show-form main.dwo.dwo >> log.txt
; RUN: cat log.txt | FileCheck -check-prefix=BOLT-MAIN %s

; Tests whether BOLT handles correctly DW_TAG_inlined_subroutine when DW_AT_low_pc is 0,
; and split dwarf is enabled.
;; Tests whether BOLT handles correctly DW_TAG_inlined_subroutine when DW_AT_low_pc is 0,
;; and split dwarf is enabled.

; BOLT-MAIN: 0x
; BOLT-MAIN: 0x
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf4-df-input-lowpc-ranges.test
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; RUN: rm -rf %t
; RUN: mkdir %t
; RUN: cd %t
;; RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-df-input-lowpc-ranges-main.s \
; RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-df-input-lowpc-ranges-main.s \
; RUN: -split-dwarf-file=main.dwo -o main.o
; RUN: %clang %cflags -gdwarf-4 -gsplit-dwarf=split main.o -o main.exe
; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections
Expand All @@ -11,7 +11,7 @@
; RUN: not llvm-dwarfdump --show-form --verbose --debug-info main.dwo.dwo &> %t/mainddwodwo.txt
; RUN: cat %t/mainddwodwo.txt | FileCheck -check-prefix=BOLT-DWO-MAIN %s

; Tests BOLT handles correctly Skeleton CU which has DW_AT_low_pc/DW_AT_ranges as input.
;; Tests that BOLT correctly handles Skeleton CU which has DW_AT_low_pc/DW_AT_ranges as input.

; BOLT: .debug_ranges
; BOLT-NEXT: 00000000 <End of list>
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf4-df-no-base.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
; RUN: llvm-dwarfdump --debug-info main.exe | FileCheck -check-prefix=PRE-BOLT-MAIN %s
; RUN: llvm-dwarfdump --debug-info main.exe.bolt | FileCheck -check-prefix=BOLT-MAIN %s

; Tests whether we add DW_AT_GNU_ranges_base, if it's not present when Skeleton CU has
; DW_AT_ranges.
;; Tests whether we add DW_AT_GNU_ranges_base, if it's not present when Skeleton CU has
;; DW_AT_ranges.

; PRE-BOLT-MAIN-NOT: DW_AT_GNU_ranges_base
; BOLT-MAIN: DW_AT_GNU_ranges_base
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s

# This test checks that we do not convert low_pc/high_pc to ranges for DW_TAG_inlined_subroutine,
# when there is only one output range entry.
## This test checks that we do not convert low_pc/high_pc to ranges for DW_TAG_inlined_subroutine,
## when there is only one output range entry.

# PRECHECK: DW_TAG_inlined_subroutine
# PRECHECK: DW_AT_abstract_origin
Expand Down
8 changes: 4 additions & 4 deletions bolt/test/X86/dwarf4-duplicate-types.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
# RUN: llvm-dwarfdump --debug-types %t.bolt | FileCheck --check-prefix=POSTCHECK %s

# LLD does not de-duplicate COMDAT sections for LTO.
# Clang can generate type units with the same hash.
# https://discourse.llvm.org/t/dwarf-different-tu-with-the-same-hash/70095
# Modified helper.s to have the same TU hash with a different COMDAT signature to test this.
## LLD does not de-duplicate COMDAT sections for LTO.
## Clang can generate type units with the same hash.
## https://discourse.llvm.org/t/dwarf-different-tu-with-the-same-hash/70095
## Modified helper.s to have the same TU hash with a different COMDAT signature to test this.

# POSTCHECK: Type Unit: length = 0x00000055, format = DWARF32, version = 0x0004,
# POSTCHECK-SAME: abbr_offset = 0x0000, addr_size = 0x08, name = 'Foo', type_signature = 0x675d23e4f33235f2, type_offset = 0x001e (next unit at 0x00000059)
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf4-ftypes-dwo-input-dwp-output.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
; RUN: llvm-dwarfdump --show-form --verbose --debug-types main.exe.bolt.dwp | FileCheck -check-prefix=BOLT %s
; RUN: llvm-dwarfdump --show-form --verbose --debug-tu-index main.exe.bolt.dwp | FileCheck -check-prefix=BOLT-DWP-TU-INDEX %s

; Test input into bolt a .dwo file with TU Index.
; Make sure the output .dwp file has a type information.
;; Test input into bolt a .dwo file with TU Index.
;; Make sure the output .dwp file has a type information.

; PRE-BOLT: DW_TAG_type_unit
; PRE-BOLT: DW_TAG_type_unit
Expand Down
6 changes: 3 additions & 3 deletions bolt/test/X86/dwarf4-ftypes-dwo-mono-input-dwp-output.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
; RUN: llvm-dwarfdump --show-form --verbose --debug-types main.exe.bolt.dwp | FileCheck -check-prefix=BOLT %s
; RUN: llvm-dwarfdump --show-form --verbose --debug-tu-index main.exe.bolt.dwp | FileCheck -check-prefix=BOLT-DWP-TU-INDEX %s

; Test input into bolt a .dwo file with TU Index.
; Test split-dwarf and monolithic TUs.
; Make sure the output .dwp file has a type information.
;; Test input into bolt a .dwo file with TU Index.
;; Test split-dwarf and monolithic TUs.
;; Make sure the output .dwp file has a type information.

; PRE-BOLT: 0x675d23e4f33235f2
; PRE-BOLT: DW_TAG_type_unit
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf4-ftypes-dwp-input-dwo-output.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections
; RUN: llvm-dwarfdump --show-form --verbose --debug-types main.dwo.dwo | FileCheck -check-prefix=BOLT %s

; Test input into bolt a DWP file with TU Index.
; Make sure output in the .dwo files has type information.
;; Test input into bolt a DWP file with TU Index.
;; Make sure output in the .dwo files has type information.

; PRE-BOLT: DW_TAG_type_unit
; PRE-BOLT: DW_TAG_type_unit
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf4-ftypes-dwp-input-dwp-output.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
; RUN: llvm-dwarfdump --show-form --verbose --debug-types main.exe.bolt.dwp | FileCheck -check-prefix=BOLT %s
; RUN: llvm-dwarfdump --show-form --verbose --debug-tu-index main.exe.bolt.dwp | FileCheck -check-prefix=BOLT-DWP-TU-INDEX %s

; Test input into bolt a DWP file with TU Index.
; Make sure the output .dwp file has a type information.
;; Test input into bolt a DWP file with TU Index.
;; Make sure the output .dwp file has a type information.

; PRE-BOLT: DW_TAG_type_unit
; PRE-BOLT: DW_TAG_type_unit
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf4-gdb-index-types-gdb-generated.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# RUN: llvm-bolt %tgdb.exe -o %tgdb.bolt --update-debug-sections
# RUN: llvm-dwarfdump --gdb-index %tgdb.bolt | FileCheck --check-prefix=POSTCHECK %s

# Tests that BOLT correctly handles gdb-index generated by GDB.
## Tests that BOLT correctly handles gdb-index generated by GDB.

# POSTCHECK: Version = 8
# POSTCHECK: CU list offset = 0x18, has 2 entries
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf4-gdb-index-types-lld-generated.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
# RUN: llvm-dwarfdump --gdb-index %t.bolt | FileCheck --check-prefix=POSTCHECK %s

# Tests that BOLT correctly handles gdb-index generated by LLD.
## Tests that BOLT correctly handles gdb-index generated by LLD.

# POSTCHECK: Version = 7
# POSTCHECK: CU list offset = 0x18, has 2 entries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# RUN: cat %tlog.txt | FileCheck --check-prefix=CHECKBOLT %s
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=CHECK %s

# Tests BOLT does not assert when DIE reference is invalid.
## Tests BOLT does not assert when DIE reference is invalid.

# CHECKBOLT: Referenced DIE offsets not in .debug_info
# CHECKBOLT-NEXT: 91
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# RUN: cat %tlog.txt | FileCheck --check-prefix=CHECKBOLT %s
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=CHECK %s

# Tests BOLT does not assert when DIE reference is invalid.
## Tests BOLT does not assert when DIE reference is invalid.

# CHECKBOLT: BOLT-WARNING: [internal-dwarf-error]: could not parse referenced DIE at offset:
# CHECKBOLT-NOT: Referenced DIE offsets not in .debug_info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# RUN: cat %tlog.txt | FileCheck --check-prefix=CHECKBOLT %s
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=CHECK %s

# Tests BOLT does not assert when DIE reference is invalid.
## Tests BOLT does not assert when DIE reference is invalid.

# CHECKBOLT: BOLT-WARNING: [internal-dwarf-error]: invalid referenced DIE at offset:
# CHECKBOLT-NOT: Referenced DIE offsets not in .debug_info
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf4-sibling.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s

# This test checks that BOLT handles DW_AT_sibling.
## This test checks that BOLT handles DW_AT_sibling.

# The assembly was manually modified to do cross CU reference.
## The assembly was manually modified to do cross CU reference.

# POSTCHECK: version = 0x0004
# POSTCHECK: DW_TAG_structure_type [5]
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf4-size-0-inlined_subroutine.s
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000000)


# Testing BOLT handles correctly when size of DW_AT_inlined_subroutine is 0.
# In other words DW_AT_high_pc is 0 or DW_AT_low_pc == DW_AT_high_pc.
## Testing BOLT handles correctly when size of DW_AT_inlined_subroutine is 0.
## In other words DW_AT_high_pc is 0 or DW_AT_low_pc == DW_AT_high_pc.

# Modified assembly manually to set DW_AT_high_pc to 0.
# clang++ -g2 -gdwarf-4 main.cpp -O1 -S -o main4.s
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf4-split-dwarf-no-address.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections
; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.exe.bolt | FileCheck -check-prefix=BOLT %s

; Testing that there are no asserts/crashes when one of the DWARF4 CUs does not modify .debug_addr
;; Testing that there are no asserts/crashes when one of the DWARF4 CUs does not modify .debug_addr

; BOLT: DW_TAG_compile_unit
; BOLT: DW_TAG_compile_unit
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# RUN: llvm-bolt maingdb.exe -o maingdb.exe.bolt --update-debug-sections
# RUN: llvm-dwarfdump --gdb-index maingdb.exe.bolt | FileCheck --check-prefix=POSTCHECK %s

# Tests that BOLT correctly handles gdb-index generated by GDB with split-dwarf DWARF4.
## Tests that BOLT correctly handles gdb-index generated by GDB with split-dwarf DWARF4.

# POSTCHECK: Version = 8
# POSTCHECK: CU list offset = 0x18, has 2 entries
Expand Down
38 changes: 38 additions & 0 deletions bolt/test/X86/dwarf4-subprogram-multiple-ranges-cus.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# REQUIRES: system-linux

# RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-subprogram-multiple-ranges-main.s -o %t1.o
# RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-subprogram-multiple-ranges-other.s -o %t2.o
# RUN: %clang %cflags %t1.o %t2.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
# RUN: llvm-objdump %t.bolt --disassemble > %t1.txt
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t1.txt
# RUN: cat %t1.txt | FileCheck --check-prefix=POSTCHECK %s

## This test checks that BOLT correctly handles DW_TAG_subprogram with Ranges with multiple entries and handles multiple CUs with ranges.

# POSTCHECK: _Z7doStuffi>:
# POSTCHECK: [[#%.6x,ADDR:]]
# POSTCHECK: _Z7doStuffi.__part.1>:
# POSTCHECK-NEXT: [[#%.6x,ADDR1:]]
# POSTCHECK: _Z7doStuffi.__part.2>:
# POSTCHECK-NEXT: [[#%.6x,ADDR2:]]

# POSTCHECK: _Z12doStuffOtheri>:
# POSTCHECK: [[#%.6x,ADDR3:]]
# POSTCHECK: _Z12doStuffOtheri.__part.1>:
# POSTCHECK-NEXT: [[#%.6x,ADDR4:]]
# POSTCHECK: _Z12doStuffOtheri.__part.2>:
# POSTCHECK-NEXT: [[#%.6x,ADDR5:]]

# POSTCHECK: DW_TAG_subprogram
# POSTCHECK-NEXT: DW_AT_ranges
# POSTCHECK-NEXT: [0x0000000000[[#ADDR1]], 0x0000000000[[#ADDR1 + 0xb]])
# POSTCHECK-NEXT: [0x0000000000[[#ADDR2]], 0x0000000000[[#ADDR2 + 0x5]])
# POSTCHECK-NEXT: [0x0000000000[[#ADDR]], 0x0000000000[[#ADDR + 0xf]]))

# POSTCHECK: DW_TAG_subprogram
# POSTCHECK: DW_TAG_subprogram
# POSTCHECK-NEXT: DW_AT_ranges
# POSTCHECK-NEXT: [0x0000000000[[#ADDR4]], 0x0000000000[[#ADDR4 + 0xb]])
# POSTCHECK-NEXT: [0x0000000000[[#ADDR5]], 0x0000000000[[#ADDR5 + 0x5]])
# POSTCHECK-NEXT: [0x0000000000[[#ADDR3]], 0x0000000000[[#ADDR3 + 0xf]]))
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf4-subprogram-multiple-ranges.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t1.txt
# RUN: cat %t1.txt | FileCheck --check-prefix=POSTCHECK %s

# This test checks BOLT correctly handles DW_TAG_subprogram with Ranges with multiple entries.
## This test checks BOLT correctly handles DW_TAG_subprogram with Ranges with multiple entries.

# POSTCHECK: _Z7doStuffi>:
# POSTCHECK: [[#%.6x,ADDR:]]
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf4-subprogram-single-gc-ranges.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt > %t1.txt
# RUN: cat %t1.txt | FileCheck --check-prefix=POSTCHECK %s

# This test checks BOLT correctly handles DW_TAG_subprogram with Ranges with single entry, when function was GCed.
## This test checks BOLT correctly handles DW_TAG_subprogram with Ranges with single entry, when function was GCed.

# POSTCHECK: DW_TAG_subprogram
# POSTCHECK-NEXT: DW_AT_frame_base
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf4-subprogram-single-ranges.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t1.txt
# RUN: cat %t1.txt | FileCheck --check-prefix=POSTCHECK %s

# This test checks BOLT correctly handles DW_TAG_subprogram with Ranges with single entry.
## This test checks BOLT correctly handles DW_TAG_subprogram with Ranges with single entry.

# POSTCHECK: _Z7doStuffi>:
# POSTCHECK: [[#%.6x,ADDR:]]
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf4-types-dwarf5-types.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s
# RUN: llvm-dwarfdump --show-form --verbose --debug-types %t.bolt | FileCheck --check-prefix=POSTCHECKTU %s

# Check BOLT handles DWARF4/5 with fdebug-types.
## Check BOLT handles DWARF4/5 with fdebug-types.

# POSTCHECK: version = 0x0005
# POSTCHECK: DW_TAG_type_unit
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf4-types-dwarf5.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s
# RUN: llvm-dwarfdump --show-form --verbose --debug-types %t.bolt | FileCheck --check-prefix=POSTCHECKTU %s

# Check BOLT handles DWARF4 with fdebug-types, and DWARF5 without.
## Check BOLT handles DWARF4 with fdebug-types, and DWARF5 without.

# POSTCHECK: version = 0x0004
# POSTCHECK: DW_TAG_compile_unit
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf4-types-forward-backward-cross-reference.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s

# This test checks that BOLT handles correctly backward and forward cross CU references
# for DWARF4 with -fdebug-types-section
## This test checks that BOLT handles correctly backward and forward cross CU references
## for DWARF4 with -fdebug-types-section

# POSTCHECK: version = 0x0004
# POSTCHECK: DW_TAG_variable [10]
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf4-types.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s
# RUN: llvm-dwarfdump --show-form --verbose --debug-types %t.bolt | FileCheck --check-prefix=POSTCHECKTU %s

# Check BOLT handles DWARF4/5 with fdebug-types.
## Check BOLT handles DWARF4/5 with fdebug-types.

# POSTCHECK: version = 0x0004
# POSTCHECK: DW_TAG_compile_unit [6]
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf5-addr-section-reuse.s
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# RUN: llvm-bolt %t.exe -o %t.exe.bolt --update-debug-sections
# RUN: llvm-dwarfdump --debug-info %t.exe.bolt | FileCheck --check-prefix=POSTCHECK %s

# This test checks that when a binary is bolted if CU is not modified and has DW_AT_addr_base that is shared
# after being bolted CUs still share same entry in .debug_addr.
## This test checks that when a binary is bolted if CU is not modified and has DW_AT_addr_base that is shared
## after being bolted CUs still share same entry in .debug_addr.

# PRECHECK: DW_AT_addr_base (0x00000008)
# PRECHECK: DW_AT_addr_base (0x00000008)
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf5-call-pc-function-null-check.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe.bolt >> %t.txt
# RUN: cat %t.txt | FileCheck --check-prefix=CHECK %s

# Test checks we correctly handle nullptr returned by getBinaryFunctionContainingAddress for DW_AT_call_pc.
# This happens when address is not contained in any function.
## Test checks we correctly handle nullptr returned by getBinaryFunctionContainingAddress for DW_AT_call_pc.
## This happens when address is not contained in any function.

# CHECK: DW_AT_call_pc [DW_FORM_addrx]
# CHECK-SAME: address = 0x[[#%.16x,ADDR:]]
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-call-pc.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# RUN: cat %tmain.txt | FileCheck --check-prefix=PRECHECK %s
# RUN: cat %tmainbolt.txt | FileCheck --check-prefix=POSTCHECK %s

# Test checks that DW_AT_call_pc address points to a correct address for jmp instruction.
## Test checks that DW_AT_call_pc address points to a correct address for jmp instruction.

# PRECHECK: DW_TAG_call_site [6]
# PRECHECK-NEXT: DW_AT_call_origin [DW_FORM_ref4]
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-cu-no-debug-addr.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s

# This tests checks that we handle correctly, don't crash, DWARF5 CUs that does not access .debug_addr.
## This tests checks that we handle correctly, don't crash, DWARF5 CUs that does not access .debug_addr.

# PRECHECK: DW_TAG_compile_unit
# PRECHECK: DW_AT_addr_base
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-debug-info-dwarf4-debug-line.s
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-line %t.exe | FileCheck --check-prefix=PRECHECK %s
# RUN: llvm-dwarfdump --show-form --verbose --debug-line %t.bolt | FileCheck --check-prefix=POSTCHECK %s

# This test checks that .debug_line gets generated correctly when .debug_info is DWARF5, and .debug_line is DWARF4.
## This test checks that .debug_line gets generated correctly when .debug_info is DWARF5, and .debug_line is DWARF4.

# PRECHECK: version: 4
# PRECHECK: file_names[ 1]:
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-debug-line-not-modified.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
# RUN: llvm-dwarfdump --show-form --verbose --debug-line %t.bolt | FileCheck --check-prefix=POSTCHECK %s

# This test checks that BOLT generates correct debug_line_str when one of CU contributions is not modified.
## This test checks that BOLT generates correct debug_line_str when one of CU contributions is not modified.

# POSTCHECK: version: 5
# POSTCHECK: include_directories[ 0] = .debug_line_str[{{.*}}] = "/test"
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-debug-line.s
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-line %t.exe | FileCheck --check-prefix=PRECHECK %s
# RUN: llvm-dwarfdump --show-form --verbose --debug-line %t.bolt | FileCheck --check-prefix=POSTCHECK %s

# This test checks that DWARF5 .debug_line is handled correctly.
## This test checks that DWARF5 .debug_line is handled correctly.

# PRECHECK: version: 5
# PRECHECK: include_directories[ 0] = .debug_line_str
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-debug-loclists.s
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t.txt
# RUN: cat %t.txt | FileCheck --check-prefix=POSTCHECK %s

# This tests checks that re-writing of .debug_loclists is handled correctly.
## This tests checks that re-writing of .debug_loclists is handled correctly.

# PRECHECK: version = 0x0005
# PRECHECK: DW_AT_loclists_base [DW_FORM_sec_offset] (0x0000000c)
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-df-call-site-change-low-pc.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.dwo.dwo &> %t/maindwodwo.txt
; RUN: cat %t/maindwodwo.txt | FileCheck -check-prefix=BOLT-DWO-MAIN %s

; Tests that DW_AT_low_pc changes in DW_TAG_call_site.
;; Tests that DW_AT_low_pc changes in DW_TAG_call_site.

; PRE-BOLT-DWO-MAIN: version = 0x0005
; PRE-BOLT-DWO-MAIN: DW_TAG_call_site
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.dwo.dwo &> %t/maindwodwo.txt
; RUN: cat %t/maindwodwo.txt | FileCheck -check-prefix=BOLT-DWO-MAIN %s

; Tests that new indices are assigned to DW_OP_GNU_addr_index.
;; Tests that new indices are assigned to DW_OP_GNU_addr_index.

; PRE-BOLT-DWO-MAIN: version = 0x0005
; PRE-BOLT-DWO-MAIN: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x0)
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-df-cu-function-gc.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.exe.bolt >> addr.txt
; RUN: cat addr.txt | FileCheck -check-prefix=BOLT %s

; Tests we generate range when linker GCs only function used in CU
;; Tests we generate range when linker GCs only function used in CU

; BOLT: Addrs:
; BOLT-NEXT: 0x[[#%.16x,ADDR:]]
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-df-dualcu-loclist.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
; RUN: llvm-dwarfdump --show-form --verbose --debug-info helper.dwo | FileCheck -check-prefix=PRE-BOLT-DWO-HELPER %s
; RUN: llvm-dwarfdump --show-form --verbose --debug-info helper.dwo.dwo | FileCheck -check-prefix=BOLT-DWO-HELPER %s

; Testing dwarf5 split dwarf for two CUs. Making sure DW_AT_location [DW_FORM_loclistx] is updated correctly.
;; Testing dwarf5 split dwarf for two CUs. Making sure DW_AT_location [DW_FORM_loclistx] is updated correctly.

; PRE-BOLT-DWO-MAIN: version = 0x0005
; PRE-BOLT-DWO-MAIN: DW_TAG_formal_parameter [10]
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf5-df-dualcu.test
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
; RUN: llvm-dwarfdump --show-form --verbose --debug-info helper.dwo | FileCheck -check-prefix=PRE-BOLT-DWO-HELPER %s
; RUN: llvm-dwarfdump --show-form --verbose --debug-info helper.dwo.dwo | FileCheck -check-prefix=BOLT-DWO-HELPER %s

; Testing dwarf5 split dwarf for two CUs. Making sure DW_AT_low_pc/DW_AT_high_pc are converted correctly in the binary and in dwo.
; Checking that DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx ##) are updated correctly.
;; Testing dwarf5 split dwarf for two CUs. Making sure DW_AT_low_pc/DW_AT_high_pc are converted correctly in the binary and in dwo.
;; Checking that DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx ##) are updated correctly.

; PRE-BOLT: version = 0x0005
; PRE-BOLT: DW_TAG_skeleton_unit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
; RUN: cat log.txt | FileCheck -check-prefix=BOLT-PRE %s
; RUN: cat logBolt.txt | FileCheck -check-prefix=BOLT-MAIN %s

; Tests whether BOLT handles correctly DW_TAG_inlined_subroutine when DW_AT_ranges is 0,
; and split dwarf is enabled.
;; Tests whether BOLT handles correctly DW_TAG_inlined_subroutine when DW_AT_ranges is 0,
;; and split dwarf is enabled.

; BOLT-PRE: Addrs:
; BOLT-PRE: 0x0000000000000000
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf5-df-inlined-subroutine-range-0.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
; RUN: llvm-dwarfdump --debug-info --verbose --show-form main.dwo.dwo >> log.txt
; RUN: cat log.txt | FileCheck -check-prefix=BOLT-MAIN %s

; Tests whether BOLT handles correctly DW_TAG_inlined_subroutine when DW_AT_ranges is 0,
; and split dwarf is enabled.
;; Tests whether BOLT handles correctly DW_TAG_inlined_subroutine when DW_AT_ranges is 0,
;; and split dwarf is enabled.

; BOLT-MAIN: 0x
; BOLT-MAIN: 0x
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf5-df-input-lowpc-ranges.test
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; RUN: rm -rf %t
; RUN: mkdir %t
; RUN: cd %t
;; RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-df-input-lowpc-ranges-main.s \
; RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-df-input-lowpc-ranges-main.s \
; RUN: -split-dwarf-file=main.dwo -o main.o
; RUN: %clang %cflags -gdwarf-4 -gsplit-dwarf=split main.o -o main.exe
; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections
Expand All @@ -12,7 +12,7 @@
; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.dwo.dwo &> %t/mainddwodwo.txt
; RUN: cat %t/mainddwodwo.txt | FileCheck -check-prefix=BOLT-DWO-MAIN %s

; Tests BOLT handles correctly Skeleton CU which has DW_AT_low_pc/DW_AT_ranges as input.
;; Tests that BOLT correctly handles Skeleton CU which has DW_AT_low_pc/DW_AT_ranges as input.

; BOLT: Addrs: [
; BOLT-NEXT: 0x[[#%.16x,ADDR1:]]
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-df-mono-dualcu.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.dwo | FileCheck -check-prefix=PRE-BOLT-DWO-MAIN %s
; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.dwo.dwo | FileCheck -check-prefix=BOLT-DWO-MAIN %s

; Testing dwarf5 mix of split dwarf and monolithic CUs.
;; Testing dwarf5 mix of split dwarf and monolithic CUs.

; PRE-BOLT: version = 0x0005
; PRE-BOLT: DW_TAG_skeleton_unit
Expand Down
10 changes: 5 additions & 5 deletions bolt/test/X86/dwarf5-df-output-dir-same-name.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@
; RUN: llvm-dwarfdump --debug-info main.exe.bolt >> log
; RUN: cat log | FileCheck -check-prefix=BOLT %s

; Tests that BOLT handles correctly writing out .dwo files to the same directory when input has input where part of path
; is in DW_AT_dwo_name and the .dwo file names are the same.
;; Tests that BOLT handles correctly writing out .dwo files to the same directory when input has input where part of path
;; is in DW_AT_dwo_name and the .dwo file names are the same.

; BOLT: split.dwo0.dwo
; BOLT: split.dwo1.dwo
; BOLT: DW_AT_dwo_name ("split.dwo0.dwo")
; BOLT: DW_AT_dwo_name ("split.dwo1.dwo")

; Tests that when --dwarf-output-path is specified, but path do not exist BOLT creates it.
;; Tests that when --dwarf-output-path is specified, but path do not exist BOLT creates it.

; RUN: rm -rf dwo
; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections --dwarf-output-path=%t/dwo
; RUN: ls -l %t/dwo > log
; RUN: llvm-dwarfdump --debug-info main.exe.bolt >> log
; RUN: cat log | FileCheck -check-prefix=BOLT1 %s

; Tests that BOLT handles correctly writing out .dwo files to the same directory when input has input where part of path
; is in DW_AT_dwo_name and the .dwo file names are the same.
;; Tests that BOLT handles correctly writing out .dwo files to the same directory when input has input where part of path
;; is in DW_AT_dwo_name and the .dwo file names are the same.

; BOLT1: split.dwo0.dwo
; BOLT1: split.dwo1.dwo
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-df-types-dup-dwp-input.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
; RUN: llvm-dwarfdump --debug-info -r 0 main.dwo.dwo | FileCheck -check-prefix=BOLT-DWO-DWO-MAIN %s
; RUN: llvm-dwarfdump --debug-info -r 0 helper.dwo.dwo | FileCheck -check-prefix=BOLT-DWO-DWO-HELPER %s

; Tests that BOLT correctly handles DWARF5 DWP file as input. Output has correct CU, and all the type units are written out.
;; Tests that BOLT correctly handles DWARF5 DWP file as input. Output has correct CU, and all the type units are written out.

; BOLT-DWO-DWO-MAIN: debug_info.dwo
; BOLT-DWO-DWO-MAIN-NEXT: type_signature = 0x49dc260088be7e56
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s

# This test checks that we do not convert low_pc/high_pc to ranges for DW_TAG_inlined_subroutine,
# when there is only one output range entry.
## This test checks that we do not convert low_pc/high_pc to ranges for DW_TAG_inlined_subroutine,
## when there is only one output range entry.

# PRECHECK: DW_TAG_inlined_subroutine
# PRECHECK: DW_AT_abstract_origin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# RUN: llvm-bolt %tgdb.exe -o %tgdb.bolt --update-debug-sections
# RUN: llvm-dwarfdump --gdb-index %tgdb.bolt | FileCheck --check-prefix=POSTCHECK %s

# Tests that BOLT correctly handles gdb-index generated by GDB.
## Tests that BOLT correctly handles gdb-index generated by GDB.

# POSTCHECK: Version = 8
# POSTCHECK: CU list offset = 0x18, has 2 entries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# RUN: llvm-bolt %tgdb.exe -o %tgdb.bolt --update-debug-sections
# RUN: llvm-dwarfdump --gdb-index %tgdb.bolt | FileCheck --check-prefix=POSTCHECK %s

# Tests that BOLT correctly handles gdb-index generated by GDB.
## Tests that BOLT correctly handles gdb-index generated by GDB.

# POSTCHECK: Version = 8
# POSTCHECK: CU list offset = 0x18, has 3 entries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
# RUN: llvm-dwarfdump --gdb-index %t.bolt | FileCheck --check-prefix=POSTCHECK %s

# Tests that BOLT correctly handles gdb-index generated by LLD.
## Tests that BOLT correctly handles gdb-index generated by LLD.

# POSTCHECK: Version = 7
# POSTCHECK: CU list offset = 0x18, has 2 entries
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-dwarf4-monolithic.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# RUN: FileCheck --check-prefix=CHECK-LINE %s --input-file %t_line.txt


# Check BOLT handles monolithic mix of DWARF4 and DWARF5.
## Check BOLT handles monolithic mix of DWARF4 and DWARF5.

# main.cpp
# PRECHECK: version = 0x0005
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s
# RUN: llvm-dwarfdump --show-form --verbose --debug-types %t.bolt | FileCheck --check-prefix=POSTCHECKTU %s

# This test checks that BOLT handles correctly backward and forward cross CU references
# for DWARF5 and DWARF4 with -fdebug-types-section
## This test checks that BOLT handles correctly backward and forward cross CU references
## for DWARF5 and DWARF4 with -fdebug-types-section

# POSTCHECK: version = 0x0005
# POSTCHECK: DW_TAG_type_unit
Expand Down
6 changes: 3 additions & 3 deletions bolt/test/X86/dwarf5-ftypes-dwo-mono-input-dwp-output.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
; RUN: llvm-dwarfdump --show-form --verbose --debug-tu-index main.exe.bolt.dwp | FileCheck -check-prefix=BOLT-DWP-TU-INDEX %s
; RUN: llvm-dwarfdump --show-form --verbose --debug-cu-index main.exe.bolt.dwp | FileCheck -check-prefix=BOLT-DWP-CU-INDEX %s

; Test input into bolt a .dwo file with TU Index.
; Test split-dwarf and monolithic TUs.
; Make sure the output .dwp file has a type and cu information.
;; Test input into bolt a .dwo file with TU Index.
;; Test split-dwarf and monolithic TUs.
;; Make sure the output .dwp file has a type and cu information.

; PRE-BOLT: Type Unit
; PRE-BOLT-SAME: 0x675d23e4f33235f2
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf5-ftypes-dwp-input-dwo-output.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections
; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.dwo.dwo | FileCheck -check-prefix=BOLT %s

; Test input into bolt a DWP file with TU Index.
; Make sure output in the .dwo files has type information.
;; Test input into bolt a DWP file with TU Index.
;; Make sure output in the .dwo files has type information.

; PRE-BOLT: DW_TAG_type_unit
; PRE-BOLT: DW_TAG_type_unit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# RUN: llvm-bolt %tgdb.exe -o %tgdb.bolt --update-debug-sections
# RUN: llvm-dwarfdump --gdb-index %tgdb.bolt | FileCheck --check-prefix=POSTCHECK %s

# Tests that BOLT correctly handles gdb-index generated by GDB.
## Tests that BOLT correctly handles gdb-index generated by GDB.

# POSTCHECK: Version = 8
# POSTCHECK: CU list offset = 0x18, has 2 entries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# RUN: llvm-bolt %tgdb.exe -o %tgdb.bolt --update-debug-sections
# RUN: llvm-dwarfdump --gdb-index %tgdb.bolt | FileCheck --check-prefix=POSTCHECK %s

# Tests that BOLT correctly handles gdb-index generated by GDB.
## Tests that BOLT correctly handles gdb-index generated by GDB.

# POSTCHECK: Version = 8
# POSTCHECK: CU list offset = 0x18, has 4 entries
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-gdb-index-types-lld-generated.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
# RUN: llvm-dwarfdump --gdb-index %t.bolt | FileCheck --check-prefix=POSTCHECK %s

# Tests that BOLT correctly handles gdb-index generated by LLD.
## Tests that BOLT correctly handles gdb-index generated by LLD.

# POSTCHECK: Version = 7
# POSTCHECK: CU list offset = 0x18, has 2 entries
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf5-locaddrx.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
; RUN: llvm-dwarfdump --show-form --verbose --debug-info mainlocadddrx.dwo | FileCheck -check-prefix=PRE-BOLT-DWO %s
; RUN: llvm-dwarfdump --show-form --verbose --debug-info mainlocadddrx.dwo.dwo | FileCheck -check-prefix=BOLT-DWO %s

; Testing dwarf5 split dwarf. Making sure DW_AT_low_pc/DW_AT_high_pc are converted correctly in the binary and in dwo.
; Checking that DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x0) is updated correctly.
;; Testing dwarf5 split dwarf. Making sure DW_AT_low_pc/DW_AT_high_pc are converted correctly in the binary and in dwo.
;; Checking that DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x0) is updated correctly.

; PRE-BOLT: version = 0x0005
; PRE-BOLT: DW_TAG_skeleton_unit
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf5-locexpr-addrx.s
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s

# This test checks that we correctly encode new index into .debug_addr section
# from DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x#)
## This test checks that we correctly encode new index into .debug_addr section
## from DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x#)

# PRECHECK: version = 0x0005
# PRECHECK: DW_TAG_variable
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-locexpr-referrence.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=CHECK %s

# This test checks that we update relative DIE references with DW_OP_convert that are in locexpr.
## This test checks that we update relative DIE references with DW_OP_convert that are in locexpr.

# CHECK: version = 0x0005
# CHECK: DW_TAG_variable
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-loclist-offset-form.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t.txt
# RUN: cat %t.txt | FileCheck --check-prefix=POSTCHECK %s

# Checks we can handle DWARF5 CU with DWARF4 DW_AT_location access pattern.
## Checks we can handle DWARF5 CU with DWARF4 DW_AT_location access pattern.

# PRECHECK: DW_TAG_compile_unit
# PRECHECK: DW_TAG_variable [5]
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf5-lowpc-highpc-convert.s
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t.txt
# RUN: cat %t.txt | FileCheck --check-prefix=POSTCHECK %s

# This tests checks that DW_AT_low_pc/DW_AT_high_pc is converted to DW_AT_low_pc/DW_AT_ranges.
# Checks that DW_AT_rnglists_base is inserted, and that correct address is used.
## This tests checks that DW_AT_low_pc/DW_AT_high_pc is converted to DW_AT_low_pc/DW_AT_ranges.
## Checks that DW_AT_rnglists_base is inserted, and that correct address is used.

# PRECHECK: version = 0x0005
# PRECHECK: DW_AT_low_pc
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-multiple-dw-op-addrx-locexpr.s
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# CHECK: DW_AT_decl_line [DW_FORM_data1]
# CHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x2, DW_OP_piece 0x4, DW_OP_addrx 0x3, DW_OP_piece 0x4)

# This test checks that we update DW_AT_location [DW_FORM_exprloc] with multiple DW_OP_addrx.
## This test checks that we update DW_AT_location [DW_FORM_exprloc] with multiple DW_OP_addrx.

# struct pair {int i; int j; };
# static pair p;
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf5-one-loclists-two-bases.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t.txt
# RUN: cat %t.txt | FileCheck --check-prefix=POSTCHECK %s

# This tests checks that re-writing of .debug_loclists is handled correctly when one of the CUs
# doesn't have any DW_AT_location accesses.
## This tests checks that re-writing of .debug_loclists is handled correctly when one of the CUs
## doesn't have any DW_AT_location accesses.

# PRECHECK: version = 0x0005
# PRECHECK: DW_AT_loclists_base [DW_FORM_sec_offset] (0x0000000c)
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-rangeoffset-to-rangeindex.s
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t.txt
# RUN: cat %t.txt | FileCheck --check-prefix=POSTCHECK %s

# This tests conversion for DWARF5 ranges DW_AT_ranges [DW_FORM_sec_offset] to DW_AT_ranges [DW_FORM_rnglistx]
## This tests conversion for DWARF5 ranges DW_AT_ranges [DW_FORM_sec_offset] to DW_AT_ranges [DW_FORM_rnglistx]

# PRECHECK: version = 0x0005
# PRECHECK: DW_AT_ranges [DW_FORM_sec_offset]
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-return-pc-form-addr.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# RUN: cat %tmain.txt | FileCheck --check-prefix=PRECHECK %s
# RUN: cat %tmainbolt.txt | FileCheck --check-prefix=POSTCHECK %s

# Test checks that DW_AT_call_return_pc points to an address after the callq instruction.
## Test checks that DW_AT_call_return_pc points to an address after the callq instruction.

# PRECHECK: DW_TAG_call_site [11]
# PRECHECK-NEXT: DW_AT_call_origin [DW_FORM_ref4]
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-return-pc.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# RUN: cat %tmain.txt | FileCheck --check-prefix=PRECHECK %s
# RUN: cat %tmainbolt.txt | FileCheck --check-prefix=POSTCHECK %s

# Test checks that DW_AT_call_return_pc points to an address after the callq instruction.
## Test checks that DW_AT_call_return_pc points to an address after the callq instruction.

# PRECHECK: DW_TAG_call_site [11]
# PRECHECK-NEXT: DW_AT_call_origin [DW_FORM_ref4]
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf5-shared-str-offset-base.s
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
# RUN: llvm-dwarfdump --show-section-sizes %tmain.exe.bolt >> %tout.text
# RUN: cat %tout.text | FileCheck %s

# This test checks that with DWARF5 when two CUs share the same .debug_str_offsets
# entry BOLT does not create a duplicate.
## This test checks that with DWARF5 when two CUs share the same .debug_str_offsets
## entry BOLT does not create a duplicate.

# CHECK: DW_AT_str_offsets_base (0x[[#%.8x,ADDR:]]
# CHECK: DW_AT_str_offsets_base (0x[[#ADDR]]
Expand Down
6 changes: 3 additions & 3 deletions bolt/test/X86/dwarf5-split-dwarf4-monolithic.test
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-line main.bolt | FileCheck --check-prefix=POSTCHECK-LINE %s


# Check BOLT handles monolithic mix of DWARF4 and DWARF5.
## Check BOLT handles monolithic mix of DWARF4 and DWARF5.

# main.cpp
# PRECHECK: version = 0x0005
Expand Down Expand Up @@ -89,7 +89,7 @@
# PRECHECK-NEXT: DW_AT_low_pc [DW_FORM_addr]
# PRECHECK-NEXT: DW_AT_high_pc

# Checking debug line.
## Checking debug line.

# PRECHECK-LINE: debug_line[
# PRECHECK-LINE: version: 5
Expand Down Expand Up @@ -262,7 +262,7 @@
# POSTCHECK-DWO-HELPER1-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x1) rangelist = 0x00000018
# POSTCHECK-DWO-HELPER1-NEXT: [0x0000000000000000, 0x0000000000000003))

# Checking debug line.
## Checking debug line.

# POSTCHECK-LINE: debug_line[
# POSTCHECK-LINE: version: 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# RUN: llvm-bolt maingdb.exe -o maingdb.exe.bolt --update-debug-sections
# RUN: llvm-dwarfdump --gdb-index maingdb.exe.bolt | FileCheck --check-prefix=POSTCHECK %s

# Tests that BOLT correctly handles gdb-index generated by GDB with split-dwarf DWARF4.
## Tests that BOLT correctly handles gdb-index generated by GDB with split-dwarf DWARF4.

# POSTCHECK: Version = 8
# POSTCHECK: CU list offset = 0x18, has 2 entries
Expand Down
38 changes: 38 additions & 0 deletions bolt/test/X86/dwarf5-subprogram-multiple-ranges-cus.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# REQUIRES: system-linux

# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-subprogram-multiple-ranges-main.s -o %t1.o
# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-subprogram-multiple-ranges-other.s -o %t2.o
# RUN: %clang %cflags %t1.o %t2.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
# RUN: llvm-objdump %t.bolt --disassemble > %t1.txt
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t1.txt
# RUN: cat %t1.txt | FileCheck --check-prefix=POSTCHECK %s

## This test checks that BOLT correctly handles DW_TAG_subprogram with Ranges with multiple entries and handles multiple CUs with ranges.

# POSTCHECK: _Z7doStuffi>:
# POSTCHECK: [[#%.6x,ADDR:]]
# POSTCHECK: _Z7doStuffi.__part.1>:
# POSTCHECK-NEXT: [[#%.6x,ADDR1:]]
# POSTCHECK: _Z7doStuffi.__part.2>:
# POSTCHECK-NEXT: [[#%.6x,ADDR2:]]

# POSTCHECK: _Z12doStuffOtheri>:
# POSTCHECK: [[#%.6x,ADDR3:]]
# POSTCHECK: _Z12doStuffOtheri.__part.1>:
# POSTCHECK-NEXT: [[#%.6x,ADDR4:]]
# POSTCHECK: _Z12doStuffOtheri.__part.2>:
# POSTCHECK-NEXT: [[#%.6x,ADDR5:]]

# POSTCHECK: DW_TAG_subprogram
# POSTCHECK-NEXT: DW_AT_ranges
# POSTCHECK-NEXT: [0x0000000000[[#ADDR]], 0x0000000000[[#ADDR + 0xf]])
# POSTCHECK-NEXT: [0x0000000000[[#ADDR1]], 0x0000000000[[#ADDR1 + 0xb]])
# POSTCHECK-NEXT: [0x0000000000[[#ADDR2]], 0x0000000000[[#ADDR2 + 0x5]]))

# POSTCHECK: DW_TAG_subprogram
# POSTCHECK: DW_TAG_subprogram
# POSTCHECK-NEXT: DW_AT_ranges
# POSTCHECK-NEXT: [0x0000000000[[#ADDR3]], 0x0000000000[[#ADDR3 + 0xf]])
# POSTCHECK-NEXT: [0x0000000000[[#ADDR4]], 0x0000000000[[#ADDR4 + 0xb]])
# POSTCHECK-NEXT: [0x0000000000[[#ADDR5]], 0x0000000000[[#ADDR5 + 0x5]]))
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-subprogram-multiple-ranges.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t1.txt
# RUN: cat %t1.txt | FileCheck --check-prefix=POSTCHECK %s

# This test checks BOLT correctly handles DW_TAG_subprogram with Ranges with multiple entries.
## This test checks BOLT correctly handles DW_TAG_subprogram with Ranges with multiple entries.

# POSTCHECK: _Z7doStuffi>:
# POSTCHECK: [[#%.6x,ADDR:]]
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-subprogram-single-gc-ranges.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt > %t1.txt
# RUN: cat %t1.txt | FileCheck --check-prefix=POSTCHECK %s

# This test checks BOLT correctly handles DW_TAG_subprogram with Ranges with single entry, when function was GCed.
## This test checks BOLT correctly handles DW_TAG_subprogram with Ranges with single entry, when function was GCed.

# POSTCHECK: DW_TAG_subprogram
# POSTCHECK-NEXT: DW_AT_frame_base
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/dwarf5-subprogram-single-ranges.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t1.txt
# RUN: cat %t1.txt | FileCheck --check-prefix=POSTCHECK %s

# This test checks BOLT correctly handles DW_TAG_subprogram with Ranges with single entry.
## This test checks BOLT correctly handles DW_TAG_subprogram with Ranges with single entry.

# POSTCHECK: _Z7doStuffi>:
# POSTCHECK: [[#%.6x,ADDR:]]
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf5-two-loclists.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t.txt
# RUN: cat %t.txt | FileCheck --check-prefix=POSTCHECK %s

# This tests checks that re-writing of .debug_loclists is handled correctly for two CUs,
# and two loclist entries.
## This tests checks that re-writing of .debug_loclists is handled correctly for two CUs,
## and two loclist entries.

# PRECHECK: version = 0x0005
# PRECHECK: DW_AT_loclists_base [DW_FORM_sec_offset] (0x0000000c)
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf5-two-rnglists.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t.txt
# RUN: cat %t.txt | FileCheck --check-prefix=POSTCHECK %s

# This tests checks that re-writing of .debug_rnglists is handled correctly for two CUs,
# and DW_AT_low_pc/DW_AT_high_pc conversion is handled correctly.
## This tests checks that re-writing of .debug_rnglists is handled correctly for two CUs,
## and DW_AT_low_pc/DW_AT_high_pc conversion is handled correctly.

# PRECHECK: version = 0x0005
# PRECHECK: DW_AT_low_pc [DW_FORM_addrx]
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/dwarf5-types-backward-cross-reference.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s

# This test checks that BOLT handles backward cross CU references for dwarf5
# when -fdebug-types-sections is specified.
## This test checks that BOLT handles backward cross CU references for dwarf5
## when -fdebug-types-sections is specified.

# The assembly was manually modified to do cross CU reference.

Expand Down
6 changes: 3 additions & 3 deletions bolt/test/X86/dwarf5-types-forward-cross-reference.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s

# This test checks that BOLT handles forward cross CU references for dwarf5
# when -fdebug-types-sections is specified.
## This test checks that BOLT handles forward cross CU references for dwarf5
## when -fdebug-types-sections is specified.

# The assembly was manually modified to do cross CU reference.
## The assembly was manually modified to do cross CU reference.

# POSTCHECK: Type Unit
# POSTCHECK-SAME: version = 0x0005
Expand Down
46 changes: 23 additions & 23 deletions bolt/test/X86/dynrelocs.s
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# This reproduces a bug when rewriting dynamic relocations in X86 as
# BOLT incorrectly attributes R_X86_64_64 dynamic relocations
# to the wrong section when the -jump-tables=move flag is used. We
# expect the relocations to belong to the .bolt.org.rodata section but
# it is attributed to a new .rodata section that only contains jump
# table entries, created by BOLT. BOLT will only create this new .rodata
# section if both -jump-tables=move is used and a hot function with
# jt is present in the input binary, triggering a scenario where the
# dynamic relocs rewriting gets confused on where to put .rodata relocs.
## This reproduces a bug when rewriting dynamic relocations in X86 as
## BOLT incorrectly attributes R_X86_64_64 dynamic relocations
## to the wrong section when the -jump-tables=move flag is used. We
## expect the relocations to belong to the .bolt.org.rodata section but
## it is attributed to a new .rodata section that only contains jump
## table entries, created by BOLT. BOLT will only create this new .rodata
## section if both -jump-tables=move is used and a hot function with
## jt is present in the input binary, triggering a scenario where the
## dynamic relocs rewriting gets confused on where to put .rodata relocs.

# It is uncommon to end up with dynamic relocations against .rodata,
# but it can happen. In these cases we cannot corrupt the
# output binary by writing out dynamic relocs incorrectly. The linker
# avoids emitting relocs against read-only sections but we override
# this behavior with the -z notext flag. During runtime, these pages
# are mapped with write permission and then changed to read-only after
# the dynamic linker finishes processing the dynamic relocs.
## It is uncommon to end up with dynamic relocations against .rodata,
## but it can happen. In these cases we cannot corrupt the
## output binary by writing out dynamic relocs incorrectly. The linker
## avoids emitting relocs against read-only sections but we override
## this behavior with the -z notext flag. During runtime, these pages
## are mapped with write permission and then changed to read-only after
## the dynamic linker finishes processing the dynamic relocs.

# In this test, we create a reference to a dynamic object that will
# imply in R_X86_64_64 being used for .rodata. Now BOLT, when creating
# a new .rodata to hold jump table entries, needs to remember to emit
# these dynamic relocs against the original .rodata, and not the new
# one it just created.
## In this test, we create a reference to a dynamic object that will
## imply in R_X86_64_64 being used for .rodata. Now BOLT, when creating
## a new .rodata to hold jump table entries, needs to remember to emit
## these dynamic relocs against the original .rodata, and not the new
## one it just created.

# REQUIRES: system-linux

Expand All @@ -36,8 +36,8 @@
# RUN: -jump-tables=move
# RUN: llvm-readobj -rs %t.out | FileCheck --check-prefix=READOBJ %s

# Verify that BOLT outputs the dynamic reloc at the correct address,
# which is the start of the .bolt.org.rodata section.
## Verify that BOLT outputs the dynamic reloc at the correct address,
## which is the start of the .bolt.org.rodata section.
# READOBJ: Relocations [
# READOBJ: Section ([[#]]) .rela.dyn {
# READOBJ-NEXT: 0x[[#%X,ADDR:]] R_X86_64_64 bar 0x10
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/exceptions-args.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Check that we handle GNU_args_size correctly.
# It is generated for throwing functions with LP that have parameters on stack.
## Check that we handle GNU_args_size correctly.
## It is generated for throwing functions with LP that have parameters on stack.

RUN: %clang %cflags %p/../Inputs/stub.c -fPIC -pie -shared -o %t.so
RUN: %clangxx %cxxflags -no-pie %p/Inputs/exc_args.s -o %t %t.so -Wl,-z,notext
Expand Down
14 changes: 7 additions & 7 deletions bolt/test/X86/fallthrough-to-noop.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Check that profile data for the fall-through jump is not ignored when there is
# a conditional jump followed by a no-op.
## Check that profile data for the fall-through jump is not ignored when there is
## a conditional jump followed by a no-op.

RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
RUN: %S/Inputs/ft_to_noop.s -o %t.o
Expand All @@ -13,11 +13,11 @@ CHECK: Binary Function "foo" after building cfg
CHECK: Exec Count : 20
CHECK: Profile Acc : 100.0%

# This block is terminated with a conditional jump to .Ltmp0 followed by a
# no-op. The profile data contains a count for the fall-through (3) which
# is different from what would be inferred (2). However the destination
# offset of this fall-through jump in the profile data points to the no-op
# following the jump and not the start of the fall-through block .LFT0.
## This block is terminated with a conditional jump to .Ltmp0 followed by a
## no-op. The profile data contains a count for the fall-through (3) which
## is different from what would be inferred (2). However the destination
## offset of this fall-through jump in the profile data points to the no-op
## following the jump and not the start of the fall-through block .LFT0.
CHECK: Entry Point
CHECK-NEXT: Exec Count : 20
CHECK: Successors: .Ltmp[[#BB1:]] (mispreds: 0, count: 18), .LFT[[#BB2:]] (mispreds: 0, count: 3)
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/false-jump-table.s
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Check that jump table detection does not fail on a false
# reference to a jump table.
## Check that jump table detection does not fail on a false
## reference to a jump table.

# REQUIRES: system-linux

Expand Down
6 changes: 3 additions & 3 deletions bolt/test/X86/fatal-error.s
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tests whether llvm-bolt will correctly exit with error code and printing
# fatal error message in case one occurs. Here we test opening a function
# reordering file that does not exist.
## Tests whether llvm-bolt will correctly exit with error code and printing
## fatal error message in case one occurs. Here we test opening a function
## reordering file that does not exist.

# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/fragment-lite-reverse.s
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Check that BOLT in lite mode processes fragments as expected.
## Check that BOLT in lite mode processes fragments as expected.

# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
# RUN: link_fdata %s %t.o %t.fdata
Expand Down
2 changes: 1 addition & 1 deletion bolt/test/X86/fragment-lite.s
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Check that BOLT in lite mode processes fragments as expected.
## Check that BOLT in lite mode processes fragments as expected.

# RUN: split-file %s %t
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %t/main.s -o %t.o
Expand Down
4 changes: 2 additions & 2 deletions bolt/test/X86/fragmented-symbols.s
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Checks that symbols are allocated in correct sections, and that empty
# fragments are not allocated at all.
## Checks that symbols are allocated in correct sections, and that empty
## fragments are not allocated at all.

# REQUIRES: x86_64-linux

Expand Down
Loading