2020-08-21 06:00:25 +08:00
|
|
|
# RUN: yaml2obj %s -o %t.obj
|
2017-11-14 02:38:25 +08:00
|
|
|
# RUN: lld-link /opt:icf /entry:foo /out:%t.exe /subsystem:console /include:bar \
|
2015-09-17 00:41:38 +08:00
|
|
|
# RUN: /verbose %t.obj > %t.log 2>&1
|
2015-09-17 05:30:55 +08:00
|
|
|
# RUN: FileCheck -check-prefix=ICF %s < %t.log
|
2015-08-24 15:52:08 +08:00
|
|
|
|
2015-09-17 05:30:55 +08:00
|
|
|
# ICF: Selected foo
|
|
|
|
# ICF: Removed bar
|
|
|
|
|
|
|
|
# RUN: lld-link /entry:foo /out:%t.exe /subsystem:console /include:bar \
|
|
|
|
# RUN: /verbose /opt:noicf %t.obj > %t.log 2>&1
|
|
|
|
# RUN: FileCheck -check-prefix=NOICF %s < %t.log
|
2015-10-20 03:40:43 +08:00
|
|
|
# RUN: lld-link /entry:foo /out:%t.exe /subsystem:console /include:bar \
|
|
|
|
# RUN: /verbose /opt:noref,noicf %t.obj > %t.log 2>&1
|
|
|
|
# RUN: FileCheck -check-prefix=NOICF %s < %t.log
|
2015-09-17 05:30:55 +08:00
|
|
|
|
2017-11-14 02:38:25 +08:00
|
|
|
# ICF is on by default (no /opt: flags).
|
|
|
|
# RUN: lld-link /entry:foo /out:%t.exe /subsystem:console \
|
|
|
|
# RUN: /include:bar /verbose %t.obj > %t.log 2>&1
|
|
|
|
# RUN: FileCheck -check-prefix=ICF %s < %t.log
|
|
|
|
|
|
|
|
# /debug disables ICF.
|
|
|
|
# RUN: lld-link /debug /entry:foo /out:%t.exe /subsystem:console \
|
|
|
|
# RUN: /include:bar /verbose %t.obj > %t.log 2>&1
|
|
|
|
# RUN: FileCheck -check-prefix=NOICF %s < %t.log
|
|
|
|
|
2018-03-31 01:14:50 +08:00
|
|
|
# /profile disables ICF.
|
|
|
|
# RUN: lld-link /profile /entry:foo /out:%t.exe /subsystem:console \
|
|
|
|
# RUN: /include:bar /verbose %t.obj > %t.log 2>&1
|
|
|
|
# RUN: FileCheck -check-prefix=NOICF %s < %t.log
|
|
|
|
|
2017-11-14 02:38:25 +08:00
|
|
|
# /opt:noref disables ICF.
|
|
|
|
# RUN: lld-link /opt:noref /entry:foo /out:%t.exe /subsystem:console \
|
|
|
|
# RUN: /include:bar /verbose %t.obj > %t.log 2>&1
|
|
|
|
# RUN: FileCheck -check-prefix=NOICF %s < %t.log
|
|
|
|
|
|
|
|
# /debug /opt:ref enables ICF.
|
|
|
|
# RUN: lld-link /debug /opt:ref /entry:foo /out:%t.exe /subsystem:console \
|
|
|
|
# RUN: /include:bar /verbose %t.obj > %t.log 2>&1
|
|
|
|
# RUN: FileCheck -check-prefix=ICF %s < %t.log
|
|
|
|
|
|
|
|
# /debug /opt:noicf,ref disables ICF.
|
|
|
|
# RUN: lld-link /debug /opt:noicf,ref /entry:foo /out:%t.exe /subsystem:console \
|
|
|
|
# RUN: /include:bar /verbose %t.obj > %t.log 2>&1
|
|
|
|
# RUN: FileCheck -check-prefix=NOICF %s < %t.log
|
|
|
|
|
2015-09-17 05:30:55 +08:00
|
|
|
# NOICF-NOT: Removed foo
|
|
|
|
# NOICF-NOT: Removed bar
|
2015-08-24 15:52:08 +08:00
|
|
|
|
2016-06-28 04:17:08 +08:00
|
|
|
--- !COFF
|
2015-06-28 09:30:54 +08:00
|
|
|
header:
|
|
|
|
Machine: IMAGE_FILE_MACHINE_AMD64
|
|
|
|
Characteristics: []
|
|
|
|
sections:
|
2015-08-24 15:52:08 +08:00
|
|
|
- Name: '.text$mn'
|
2015-06-28 09:30:54 +08:00
|
|
|
Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
|
|
|
|
Alignment: 16
|
2015-08-24 15:52:08 +08:00
|
|
|
SectionData: 4883EC28E8000000004883C428C3
|
|
|
|
- Name: '.text$mn'
|
2015-06-28 09:30:54 +08:00
|
|
|
Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
|
|
|
|
Alignment: 16
|
2015-08-24 15:52:08 +08:00
|
|
|
SectionData: 4883EC28E8000000004883C428C3
|
2015-06-28 09:30:54 +08:00
|
|
|
symbols:
|
2015-08-24 15:52:08 +08:00
|
|
|
- Name: '.text$mn'
|
2015-06-28 09:30:54 +08:00
|
|
|
Value: 0
|
|
|
|
SectionNumber: 1
|
|
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
|
|
ComplexType: IMAGE_SYM_DTYPE_NULL
|
|
|
|
StorageClass: IMAGE_SYM_CLASS_STATIC
|
|
|
|
SectionDefinition:
|
2015-08-24 15:52:08 +08:00
|
|
|
Length: 14
|
2015-06-28 09:30:54 +08:00
|
|
|
NumberOfRelocations: 0
|
|
|
|
NumberOfLinenumbers: 0
|
2015-08-24 15:52:08 +08:00
|
|
|
CheckSum: 1682752513
|
2015-06-28 09:30:54 +08:00
|
|
|
Number: 0
|
2015-08-24 15:52:08 +08:00
|
|
|
Selection: IMAGE_COMDAT_SELECT_NODUPLICATES
|
|
|
|
- Name: '.text$mn'
|
2015-06-28 09:30:54 +08:00
|
|
|
Value: 0
|
|
|
|
SectionNumber: 2
|
|
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
|
|
ComplexType: IMAGE_SYM_DTYPE_NULL
|
|
|
|
StorageClass: IMAGE_SYM_CLASS_STATIC
|
|
|
|
SectionDefinition:
|
2015-08-24 15:52:08 +08:00
|
|
|
Length: 14
|
2015-06-28 09:30:54 +08:00
|
|
|
NumberOfRelocations: 0
|
|
|
|
NumberOfLinenumbers: 0
|
2015-08-24 15:52:08 +08:00
|
|
|
CheckSum: 1682752513
|
|
|
|
Number: 0
|
|
|
|
Selection: IMAGE_COMDAT_SELECT_NODUPLICATES
|
|
|
|
- Name: foo
|
|
|
|
Value: 0
|
|
|
|
SectionNumber: 1
|
|
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
|
|
ComplexType: IMAGE_SYM_DTYPE_FUNCTION
|
|
|
|
StorageClass: IMAGE_SYM_CLASS_EXTERNAL
|
|
|
|
- Name: bar
|
|
|
|
Value: 0
|
|
|
|
SectionNumber: 2
|
|
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
|
|
ComplexType: IMAGE_SYM_DTYPE_FUNCTION
|
|
|
|
StorageClass: IMAGE_SYM_CLASS_EXTERNAL
|
|
|
|
...
|