1 # RUN: yaml2obj %s -o %t.obj
2 # RUN: lld-link /opt:icf /entry:foo /out:%t.exe /subsystem:console /include:bar \
3 # RUN: /verbose %t.obj > %t.log 2>&1
4 # RUN: FileCheck -check-prefix=ICF %s < %t.log
9 # RUN: lld-link /entry:foo /out:%t.exe /subsystem:console /include:bar \
10 # RUN: /verbose /opt:noicf %t.obj > %t.log 2>&1
11 # RUN: FileCheck -check-prefix=NOICF %s < %t.log
12 # RUN: lld-link /entry:foo /out:%t.exe /subsystem:console /include:bar \
13 # RUN: /verbose /opt:noref,noicf %t.obj > %t.log 2>&1
14 # RUN: FileCheck -check-prefix=NOICF %s < %t.log
16 # ICF is on by default (no /opt: flags).
17 # RUN: lld-link /entry:foo /out:%t.exe /subsystem:console \
18 # RUN: /include:bar /verbose %t.obj > %t.log 2>&1
19 # RUN: FileCheck -check-prefix=ICF %s < %t.log
21 # /debug disables ICF.
22 # RUN: lld-link /debug /entry:foo /out:%t.exe /subsystem:console \
23 # RUN: /include:bar /verbose %t.obj > %t.log 2>&1
24 # RUN: FileCheck -check-prefix=NOICF %s < %t.log
26 # /profile disables ICF.
27 # RUN: lld-link /profile /entry:foo /out:%t.exe /subsystem:console \
28 # RUN: /include:bar /verbose %t.obj > %t.log 2>&1
29 # RUN: FileCheck -check-prefix=NOICF %s < %t.log
31 # /opt:noref disables ICF.
32 # RUN: lld-link /opt:noref /entry:foo /out:%t.exe /subsystem:console \
33 # RUN: /include:bar /verbose %t.obj > %t.log 2>&1
34 # RUN: FileCheck -check-prefix=NOICF %s < %t.log
36 # /debug /opt:ref enables ICF.
37 # RUN: lld-link /debug /opt:ref /entry:foo /out:%t.exe /subsystem:console \
38 # RUN: /include:bar /verbose %t.obj > %t.log 2>&1
39 # RUN: FileCheck -check-prefix=ICF %s < %t.log
41 # /debug /opt:noicf,ref disables ICF.
42 # RUN: lld-link /debug /opt:noicf,ref /entry:foo /out:%t.exe /subsystem:console \
43 # RUN: /include:bar /verbose %t.obj > %t.log 2>&1
44 # RUN: FileCheck -check-prefix=NOICF %s < %t.log
46 # NOICF-NOT: Removed foo
47 # NOICF-NOT: Removed bar
51 Machine: IMAGE_FILE_MACHINE_AMD64
55 Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
57 SectionData: 4883EC28E8000000004883C428C3
59 Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
61 SectionData: 4883EC28E8000000004883C428C3
66 SimpleType: IMAGE_SYM_TYPE_NULL
67 ComplexType: IMAGE_SYM_DTYPE_NULL
68 StorageClass: IMAGE_SYM_CLASS_STATIC
71 NumberOfRelocations: 0
72 NumberOfLinenumbers: 0
75 Selection: IMAGE_COMDAT_SELECT_NODUPLICATES
79 SimpleType: IMAGE_SYM_TYPE_NULL
80 ComplexType: IMAGE_SYM_DTYPE_NULL
81 StorageClass: IMAGE_SYM_CLASS_STATIC
84 NumberOfRelocations: 0
85 NumberOfLinenumbers: 0
88 Selection: IMAGE_COMDAT_SELECT_NODUPLICATES
92 SimpleType: IMAGE_SYM_TYPE_NULL
93 ComplexType: IMAGE_SYM_DTYPE_FUNCTION
94 StorageClass: IMAGE_SYM_CLASS_EXTERNAL
98 SimpleType: IMAGE_SYM_TYPE_NULL
99 ComplexType: IMAGE_SYM_DTYPE_FUNCTION
100 StorageClass: IMAGE_SYM_CLASS_EXTERNAL