2017-03-29 05:20:06 +08:00
|
|
|
; REQUIRES: x86
|
2019-03-15 02:21:32 +08:00
|
|
|
; Tests that we accept an archive file without symbol table
|
|
|
|
; if all the member files are bitcode files.
|
2017-03-29 05:20:06 +08:00
|
|
|
|
2017-05-04 05:03:08 +08:00
|
|
|
; RUN: llvm-as -o %t1.o %s
|
|
|
|
; RUN: llvm-as -o %t2.o %S/Inputs/archive.ll
|
2017-03-29 05:20:06 +08:00
|
|
|
|
2017-05-04 05:03:08 +08:00
|
|
|
; RUN: rm -f %t1.a %t2.a
|
|
|
|
; RUN: llvm-ar crS %t1.a %t2.o
|
|
|
|
; RUN: llvm-ar crs %t2.a %t2.o
|
2017-03-29 05:20:06 +08:00
|
|
|
|
2018-05-31 01:57:08 +08:00
|
|
|
; RUN: ld.lld -o %t -emain %t1.o %t1.a
|
|
|
|
; RUN: ld.lld -o %t -emain %t1.o %t2.a
|
2017-03-29 05:20:06 +08:00
|
|
|
|
2019-09-11 07:15:38 +08:00
|
|
|
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
2017-03-29 05:20:06 +08:00
|
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
|
|
|
|
declare void @f()
|
|
|
|
|
|
|
|
define i32 @main() {
|
|
|
|
call void @f()
|
|
|
|
ret i32 0
|
|
|
|
}
|
2019-03-15 02:21:32 +08:00
|
|
|
|
|
|
|
; RUN: echo 'f:' | llvm-mc -triple=x86_64-pc-linux -filetype=obj - -o %t3.o
|
|
|
|
; RUN: rm -f %t3.a
|
|
|
|
; RUN: llvm-ar crS %t3.a %t3.o
|
|
|
|
; RUN: not ld.lld -o /dev/null -emain %t1.o %t3.a 2>&1 | FileCheck -check-prefix=ERR1 %s
|
2019-07-03 10:29:02 +08:00
|
|
|
; ERR1: error: {{.*}}.a: archive has no index; run ranlib to add one
|
2019-03-15 02:21:32 +08:00
|
|
|
|
|
|
|
; RUN: rm -f %t4.a
|
|
|
|
; RUN: llvm-ar cr %t4.a
|
|
|
|
; RUN: not ld.lld -o /dev/null -emain %t1.o %t4.a 2>&1 | FileCheck -check-prefix=ERR2 %s
|
|
|
|
; ERR2: error: undefined symbol: f
|