3 # RUN: llvm-mc -triple=x86_64-windows-msvc %s -filetype=obj -o %t.obj
4 # RUN: lld-link -lldmap:%t.map -out:%t.exe -opt:ref -entry:main %t.obj -verbose 2>&1 | FileCheck %s
5 # RUN: FileCheck %s --check-prefix=MAP --input-file=%t.map
7 # CHECK: Discarded unused1
8 # CHECK-NEXT: Discarded unused2
12 # MAP: gc-dwarf.s.tmp.obj:(.text)
14 # MAP: gc-dwarf.s.tmp.obj:(.text)
17 .def @feat.00; .scl 3; .type 0; .endef
21 .def main; .scl 2; .type 32; .endef
22 .section .text,"xr",one_only,main
29 .def used; .scl 2; .type 32; .endef
30 .section .text,"xr",one_only,used
36 .def unused1; .scl 2; .type 32; .endef
37 .section .text,"xr",one_only,unused1
42 .def unused2; .scl 2; .type 32; .endef
43 .section .text,"xr",one_only,unused2
48 # This isn't valid DWARF, but LLD doesn't care. Make up some data that
49 # references the functions above.
50 .section .debug_info,"r"
55 # Similarly, .eh_frame unwind info should not keep functions alive. Again, this
56 # is not valid unwind info, but it doesn't matter for testing purposes.
57 .section .eh_frame,"r"