1// REQUIRES: x86
2// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
3// RUN: mkdir -p %t.dir
4// RUN: rm -f %t.dir/liba.a
5// RUN: llvm-ar rcs %t.dir/liba.a %t.o
6// RUN: ld.lld -L%t.dir --whole-archive -la -o /dev/null -Map=- | FileCheck %s
7
8.globl _start
9_start:
10    nop
11
12// There was a use after free of an archive name.
13// Valgrind/asan would detect it.
14// CHECK:      liba.a(whole-archive-name.s.tmp.o):(.text)
15// CHECK-NEXT:     _start
16