2 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-win32 %s -o %t1.obj
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-win32 %S/Inputs/icf-safe.s -o %t2.obj
4 # RUN: lld-link /dll /noentry /out:%t.dll /verbose /opt:noref,icf %t1.obj %t2.obj 2>&1 | FileCheck %s
5 # 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
6 # RUN: lld-link /dll /noentry /out:%t.dll /verbose /opt:noref,safeicf %t1.obj %t2.obj 2>&1 | FileCheck %s --check-prefix=SAFEICF
10 # CHECK-NEXT: Removed f2
11 # CHECK-NEXT: Removed f3
12 # CHECK-NEXT: Removed f4
13 # CHECK-NEXT: Selected g3
14 # CHECK-NEXT: Removed g4
17 # EXPORT-NOT: Selected g3
18 # EXPORT-NOT: Selected g4
20 # SAFEICF-NOT: Selected
21 # SAFEICF: Selected f3
22 # SAFEICF-NEXT: Removed f4
23 # SAFEICF-NEXT: Selected g3
24 # SAFEICF-NEXT: Removed g4
27 .section .rdata,"dr",one_only,g1
32 .section .rdata,"dr",one_only,g2
37 .section .rdata,"dr",one_only,g3
42 .section .rdata,"dr",one_only,g4
47 .section .text,"xr",one_only,f1
52 .section .text,"xr",one_only,f2
57 .section .text,"xr",one_only,f3
62 .section .text,"xr",one_only,f4