mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-30 09:01:19 +00:00
f97b61ed27
D154070 has added /dwodir to lld/COFF to tells LTO backend to create dwo directory and files. This patch makes clang to emit /dwodir to lld when user specify -gsplit-dwarf with LTO. This behavior is simiar to DWARF fission with LTO for ELF. A simple use case: $clang-cl -c -flto -gdwarf main.c -o main.o $clang-cl -c -flto -gdwarf a.c -o a.o $clang-cl -flto -fuse-ld=lld -gdwarf -gsplit-dwarf main.o a.o This'll generate a dwo file: main.exe_dwo/0.dwo Reviewed By: mstorsjo, MaskRay, hans Differential Revision: https://reviews.llvm.org/D154295
10 lines
532 B
C
10 lines
532 B
C
// Confirm that -gsplit-dwarf=DIR is passed to linker
|
|
|
|
// RUN: %clang --target=x86_64-unknown-linux -### %s -flto=thin -gsplit-dwarf -o a.out 2> %t
|
|
// RUN: FileCheck -check-prefix=CHECK-LINK-ELF-DWO-DIR-DEFAULT < %t %s
|
|
// RUN: %clang_cl --target=x86_64-unknown-windows-msvc -### -fuse-ld=lld -flto -gsplit-dwarf -o a.out -- %s 2> %t
|
|
// RUN: FileCheck -check-prefix=CHECK-LINK-COFF-DWO-DIR-DEFAULT < %t %s
|
|
//
|
|
// CHECK-LINK-ELF-DWO-DIR-DEFAULT: "-plugin-opt=dwo_dir=a.out_dwo"
|
|
// CHECK-LINK-COFF-DWO-DIR-DEFAULT: "/dwodir:a.out_dwo"
|