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
7 changes: 7 additions & 0 deletions clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4393,6 +4393,13 @@ renderDebugOptions(const ToolChain &TC, const Driver &D, const llvm::Triple &T,
// object file generation and no IR generation, -gN should not be needed. So
// allow -gsplit-dwarf with either -gN or IR input.
if (IRInput || Args.hasArg(options::OPT_g_Group)) {
// FIXME: -gsplit-dwarf on AIX is currently unimplemented.
if (TC.getTriple().isOSAIX() && Args.hasArg(options::OPT_gsplit_dwarf)) {
D.Diag(diag::err_drv_unsupported_opt_for_target)
<< Args.getLastArg(options::OPT_gsplit_dwarf)->getSpelling()
<< TC.getTriple().str();
return;
}
Arg *SplitDWARFArg;
DwarfFission = getDebugFissionKind(D, Args, SplitDWARFArg);
if (DwarfFission != DwarfFissionKind::None &&
Expand Down
12 changes: 12 additions & 0 deletions clang/test/Driver/aix-gsplit-dwarf.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Verify error message is emitted for `-gsplit-dwarf` on AIX
// as it's unsupported at the moment.

// RUN: not %clang -target powerpc-ibm-aix -gdwarf-4 -gsplit-dwarf %s 2>&1 \
// RUN: | FileCheck %s --check-prefix=UNSUP_OPT_AIX
// RUN: not %clang -target powerpc64-ibm-aix -gdwarf-4 -gsplit-dwarf %s 2>&1 \
// RUN: | FileCheck %s --check-prefix=UNSUP_OPT_AIX64

// UNSUP_OPT_AIX: error: unsupported option '-gsplit-dwarf' for target 'powerpc-ibm-aix'
// UNSUP_OPT_AIX64: error: unsupported option '-gsplit-dwarf' for target 'powerpc64-ibm-aix'

int main(){return 0;}
Loading