Skip to content

Commit

Permalink
[clang][NewPM] Fix split debug test
Browse files Browse the repository at this point in the history
This contains the part of D62225 which fixes CodeGen/split-debug-single-file.c
by not placing .dwo sections when using -enable-split-dwarf=split.

Differential Revision: https://reviews.llvm.org/D63168

llvm-svn: 363281
  • Loading branch information
PiJoules committed Jun 13, 2019
1 parent a0781b6 commit 9f8ce3f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion clang/lib/CodeGen/BackendUtil.cpp
Expand Up @@ -1275,7 +1275,8 @@ void EmitAssemblyHelper::EmitAssemblyWithNewPassManager(
NeedCodeGen = true;
CodeGenPasses.add(
createTargetTransformInfoWrapperPass(getTargetIRAnalysis()));
if (!CodeGenOpts.SplitDwarfFile.empty()) {
if (!CodeGenOpts.SplitDwarfFile.empty() &&
CodeGenOpts.getSplitDwarfMode() == CodeGenOptions::SplitFileFission) {
DwoOS = openOutputFile(CodeGenOpts.SplitDwarfFile);
if (!DwoOS)
return;
Expand Down
10 changes: 8 additions & 2 deletions clang/test/CodeGen/split-debug-single-file.c
Expand Up @@ -2,13 +2,19 @@

// Testing to ensure -enable-split-dwarf=single allows to place .dwo sections into regular output object.
// RUN: %clang_cc1 -debug-info-kind=limited -triple x86_64-unknown-linux \
// RUN: -enable-split-dwarf=single -split-dwarf-file %t.o -emit-obj -o %t.o %s
// RUN: -enable-split-dwarf=single -split-dwarf-file %t.o -emit-obj -o %t.o %s -fno-experimental-new-pass-manager
// RUN: llvm-readobj -S %t.o | FileCheck --check-prefix=MODE-SINGLE %s
// RUN: %clang_cc1 -debug-info-kind=limited -triple x86_64-unknown-linux \
// RUN: -enable-split-dwarf=single -split-dwarf-file %t.o -emit-obj -o %t.o %s -fexperimental-new-pass-manager
// RUN: llvm-readobj -S %t.o | FileCheck --check-prefix=MODE-SINGLE %s
// MODE-SINGLE: .dwo

// Testing to ensure -enable-split-dwarf=split does not place .dwo sections into regular output object.
// RUN: %clang_cc1 -debug-info-kind=limited -triple x86_64-unknown-linux \
// RUN: -enable-split-dwarf=split -split-dwarf-file %t.o -emit-obj -o %t.o %s
// RUN: -enable-split-dwarf=split -split-dwarf-file %t.o -emit-obj -o %t.o %s -fno-experimental-new-pass-manager
// RUN: llvm-readobj -S %t.o | FileCheck --check-prefix=MODE-SPLIT %s
// RUN: %clang_cc1 -debug-info-kind=limited -triple x86_64-unknown-linux \
// RUN: -enable-split-dwarf=split -split-dwarf-file %t.o -emit-obj -o %t.o %s -fexperimental-new-pass-manager
// RUN: llvm-readobj -S %t.o | FileCheck --check-prefix=MODE-SPLIT %s
// MODE-SPLIT-NOT: .dwo

Expand Down

0 comments on commit 9f8ce3f

Please sign in to comment.