39 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t3# RUN: ld.lld %t --gc-sections --print-gc-sections -o %t2 2>&1 | FileCheck -check-prefix=PRINT %s4# RUN: ld.lld %t --gc-sections --print-gc-sections=- -o %t2 2>&1 | FileCheck -check-prefix=PRINT %s5# RUN: ld.lld %t --gc-sections --print-gc-sections=%t.txt -o %t26# RUN: FileCheck --check-prefix=PRINT %s --input-file=%t.txt7 8# PRINT: removing unused section {{.*}}:(.text.x)9# PRINT-NEXT: removing unused section {{.*}}:(.text.y)10 11# RUN: rm %t.txt12# RUN: ld.lld %t --gc-sections --print-gc-sections --print-gc-sections=%t.txt --no-print-gc-sections -o %t2 >& %t.log13# RUN: not ls %t.txt14# RUN: echo >> %t.log15# RUN: FileCheck -check-prefix=NOPRINT %s < %t.log16 17# NOPRINT-NOT: removing18 19# RUN: not ld.lld %t --gc-sections --print-gc-sections=/ -o %t2 2>&1 | FileCheck --check-prefix=ERR %s20 21# ERR: error: cannot open --print-gc-sections= file /: {{.*}}22 23.globl _start24.protected a, x, y25_start:26 call a27 28.section .text.a,"ax",@progbits29a:30 nop31 32.section .text.x,"ax",@progbits33x:34 nop35 36.section .text.y,"ax",@progbits37y:38 nop39