3 ## Error if the linked-to section of an input section is discarded.
5 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
6 # RUN: not ld.lld --gc-sections --print-gc-sections %t.o -o /dev/null 2>&1 | FileCheck %s
8 # CHECK: removing unused section {{.*}}.o:(.foo0)
9 # CHECK-NEXT: error: {{.*}}.o:(.bar): sh_link points to discarded section {{.*}}.o:(.foo0)
10 # CHECK-NEXT: error: {{.*}}.o:(.baz): sh_link points to discarded section {{.*}}.o:(.foo0)
23 ## The linked-to section of the first input section is discarded.
24 .section .bar,"ao",@progbits,.foo0,unique,0
27 .section .bar,"ao",@progbits,.foo1,unique,1
31 ## Another case: the linked-to section of the second input section is discarded.
32 .section .baz,"ao",@progbits,.foo1,unique,0
35 .section .baz,"ao",@progbits,.foo0,unique,1