icf-safe.s
820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-win32 %s -o %t1.obj
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-win32 %S/Inputs/icf-safe.s -o %t2.obj
# RUN: lld-link /dll /noentry /out:%t.dll /verbose /opt:noref,icf %t1.obj %t2.obj 2>&1 | FileCheck %s
# RUN: lld-link /dll /noentry /out:%t.dll /verbose /opt:noref,icf /export:g3 /export:g4 %t1.obj %t2.obj 2>&1 | FileCheck --check-prefix=EXPORT %s
# CHECK-NOT: Selected
# CHECK: Selected g3
# CHECK-NEXT: Removed g4
# CHECK-NOT: Removed
# CHECK-NOT: Selected
# EXPORT-NOT: Selected
.section .rdata,"dr",one_only,g1
.globl g1
g1:
.byte 1
.section .rdata,"dr",one_only,g2
.globl g2
g2:
.byte 1
.section .rdata,"dr",one_only,g3
.globl g3
g3:
.byte 2
.section .rdata,"dr",one_only,g4
.globl g4
g4:
.byte 2
.addrsig
.addrsig_sym g1
.addrsig_sym g2