Index: test/ELF/gc-sections-undefined.s =================================================================== --- test/ELF/gc-sections-undefined.s +++ test/ELF/gc-sections-undefined.s @@ -0,0 +1,20 @@ +# REQUIRES: x86 +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t +# RUN: ld.lld %t -o %t1 --gc-sections --undefined=foo --undefined=bar +# RUN: llvm-readobj -t %t1 | FileCheck %s + +# CHECK: bar +# CHECK: foo + +.section .foo,"ax" +.global foo +foo: + +.section .bar,"ax" +.global bar +bar: + +.section .text,"ax" +.globl _start +_start: + .quad foo