3 # RUN: llvm-mc -triple x86_64-pc-linux %s -o %t.o -filetype=obj
4 # RUN: ld.lld -o %t.so --gc-sections %t.o --print-gc-sections -shared 2>&1 | \
5 # RUN: FileCheck -check-prefix=CHECK %s
7 # RUN: echo "SECTIONS { /DISCARD/ : { *(.foo) } }" > %t.script
8 # RUN: ld.lld -o %t.so -T %t.script %t.o --print-gc-sections -shared 2>&1 | \
9 # RUN: FileCheck -check-prefix=QUIET --allow-empty %s
11 # RUN: echo "SECTIONS { .foo : { *(.foo) } }" > %t2.script
12 # RUN: ld.lld -o %t.so -T %t2.script --gc-sections %t.o --print-gc-sections -shared 2>&1 | \
13 # RUN: FileCheck -check-prefix=CHECK %s
18 # CHECK: removing unused section {{.*}}:(.foo)
19 # QUIET-NOT: removing unused section {{.*}}:(.foo)