File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -1669,9 +1669,18 @@ static int getSelectionForCOFF(const GlobalValue *GV) {
1669
1669
1670
1670
MCSection *TargetLoweringObjectFileCOFF::getExplicitSectionGlobal (
1671
1671
const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
1672
+ StringRef Name = GO->getSection ();
1673
+ if (Name == getInstrProfSectionName (IPSK_covmap, Triple::COFF,
1674
+ /* AddSegmentInfo=*/ false ) ||
1675
+ Name == getInstrProfSectionName (IPSK_covfun, Triple::COFF,
1676
+ /* AddSegmentInfo=*/ false ) ||
1677
+ Name == getInstrProfSectionName (IPSK_covdata, Triple::COFF,
1678
+ /* AddSegmentInfo=*/ false ) ||
1679
+ Name == getInstrProfSectionName (IPSK_covname, Triple::COFF,
1680
+ /* AddSegmentInfo=*/ false ))
1681
+ Kind = SectionKind::getMetadata ();
1672
1682
int Selection = 0 ;
1673
1683
unsigned Characteristics = getCOFFSectionFlags (Kind, TM);
1674
- StringRef Name = GO->getSection ();
1675
1684
StringRef COMDATSymName = " " ;
1676
1685
if (GO->hasComdat ()) {
1677
1686
Selection = getSelectionForCOFF (GO);
Original file line number Diff line number Diff line change
1
+ ; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -filetype=obj -o - | llvm-readobj -S - | FileCheck %s
2
+
3
+ @covmap = private global i32 0 , section ".lcovmap$M"
4
+ @covfun = private global i32 0 , section ".lcovfun$M"
5
+ @covname = private global i32 0 , section ".lcovd"
6
+ @covdata = private global i32 0 , section ".lcovn"
7
+
8
+ ; CHECK: Name: .lcovmap$M
9
+ ; CHECK: IMAGE_SCN_MEM_DISCARDABLE (0x2000000)
10
+ ; CHECK: Name: .lcovfun$M
11
+ ; CHECK: IMAGE_SCN_MEM_DISCARDABLE (0x2000000)
12
+ ; CHECK: Name: .lcovd
13
+ ; CHECK: IMAGE_SCN_MEM_DISCARDABLE (0x2000000)
14
+ ; CHECK: Name: .lcovn
15
+ ; CHECK: IMAGE_SCN_MEM_DISCARDABLE (0x2000000)
You can’t perform that action at this time.
0 commit comments