Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4631,11 +4631,8 @@ renderDebugOptions(const ToolChain &TC, const Driver &D, const llvm::Triple &T,
}

if (Args.hasFlag(options::OPT_gkey_instructions,
options::OPT_gno_key_instructions, false)) {
options::OPT_gno_key_instructions, false))
CmdArgs.push_back("-gkey-instructions");
CmdArgs.push_back("-mllvm");
CmdArgs.push_back("-dwarf-use-key-instructions");
}

if (EmitCodeView) {
CmdArgs.push_back("-gcodeview");
Expand Down
20 changes: 13 additions & 7 deletions clang/test/DebugInfo/KeyInstructions/flag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
//// Default: Off.
// RUN: %clang -### -target x86_64 -c -gdwarf %s 2>&1 | FileCheck %s --check-prefixes=NO-KEY-INSTRUCTIONS

//// Help hidden.
// RUN %clang --help | FileCheck %s --check-prefix=HELP
// HELP-NOT: key-instructions

// KEY-INSTRUCTIONS: "-gkey-instructions"
// KEY-INSTRUCTIONS: "-mllvm" "-dwarf-use-key-instructions"

// NO-KEY-INSTRUCTIONS-NOT: key-instructions

//// TODO: Add smoke test once some functionality has been added.
//// Help hidden: flag should not be visible.
// RUN: %clang --help | FileCheck %s --check-prefix=HELP
// HELP-NOT: key-instructions

// Smoke test: check for Key Instructions keywords in the IR.
void f() {}
// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -debug-info-kind=line-tables-only -emit-llvm -o - | FileCheck %s --check-prefix=SMOKETEST-OFF
// SMOKETEST-OFF-NOT: keyInstructions:
// SMOKETEST-OFF-NOT: atomGroup

// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -gkey-instructions -debug-info-kind=line-tables-only -emit-llvm -o - | FileCheck %s --check-prefix=SMOKETEST-ON
// SMOKETEST-ON: keyInstructions: true
// SMOKETEST-ON: atomGroup: 1
Loading