xref: /llvm-project/lld/test/ELF/lto/archive-no-index.ll (revision d838bf2adc9cba1ef56e446fc2070dda233c1d05)
1; REQUIRES: x86
2; Tests that we accept an archive file without symbol table.
3
4; RUN: llvm-as -o %t1.o %s
5; RUN: llvm-as -o %t2.o %S/Inputs/archive.ll
6
7; RUN: rm -f %t1.a %t2.a
8; RUN: llvm-ar crS %t1.a %t2.o
9; RUN: llvm-ar crs %t2.a %t2.o
10
11; RUN: ld.lld -o %t -emain %t1.o %t1.a
12; RUN: ld.lld -o %t -emain %t1.o %t2.a
13
14target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
15target triple = "x86_64-unknown-linux-gnu"
16
17declare void @f()
18
19define i32 @main() {
20  call void @f()
21  ret i32 0
22}
23
24; RUN: echo 'f:' | llvm-mc -triple=x86_64-pc-linux -filetype=obj - -o %t3.o
25; RUN: rm -f %t3.a
26; RUN: llvm-ar crS %t3.a %t3.o
27; RUN: not ld.lld -o %t -emain %t1.o %t3.a 2>&1 | FileCheck --check-prefix=ERR2 %s
28
29; RUN: rm -f %t4.a
30; RUN: llvm-ar cr %t4.a
31; RUN: not ld.lld -o /dev/null -emain %t1.o %t4.a 2>&1 | FileCheck -check-prefix=ERR2 %s
32; ERR2: error: undefined symbol: f
33