brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.2 KiB · 73a34a1 Raw
79 lines · plain
1## This test checks that a correct static library is created.2 3# RUN: yaml2obj %S/Inputs/input1.yaml -o %t-input1.o4# RUN: yaml2obj %S/Inputs/input2.yaml -o %t-input2.o5# RUN: llvm-as %S/Inputs/x86_64-osx.ll -o %t-x86_64.bc6 7# RUN: rm -rf %t.lib %t2.lib8# RUN: llvm-libtool-darwin -static -o %t.lib %t-input1.o %t-input2.o %t-x86_64.bc9# RUN: llvm-libtool-darwin -static -o %t2.lib -o %t.lib %t-input1.o %t-input2.o %t-x86_64.bc10# RUN: not ls %t2.lib11 12## Check that binaries are present:13# RUN: llvm-ar t %t.lib | \14# RUN:   FileCheck %s --check-prefix=CHECK-NAMES --implicit-check-not={{.}} -DPREFIX=%basename_t.tmp15 16# CHECK-NAMES:      [[PREFIX]]-input1.o17# CHECK-NAMES-NEXT: [[PREFIX]]-input2.o18# CHECK-NAMES-NEXT: [[PREFIX]]-x86_64.bc19 20## Check that symbols are present:21# RUN: llvm-nm --print-armap %t.lib | \22# RUN:   FileCheck %s --check-prefix=CHECK-SYMBOLS -DPREFIX=%basename_t.tmp --match-full-lines23 24# CHECK-SYMBOLS:      Archive map25# CHECK-SYMBOLS-NEXT: _symbol1 in [[PREFIX]]-input1.o26# CHECK-SYMBOLS-NEXT: _symbol2 in [[PREFIX]]-input2.o27# CHECK-SYMBOLS-NEXT: _x86_64 in [[PREFIX]]-x86_64.bc28# CHECK-SYMBOLS-EMPTY:29 30## Check that output archive is in Darwin format:31# RUN: llvm-objdump --macho --archive-headers %t.lib | \32# RUN:   FileCheck %s --check-prefix=FORMAT -DPREFIX=%basename_t.tmp -DARCHIVE=%t33 34# FORMAT:      Archive : [[ARCHIVE]]35# FORMAT-NEXT: __.SYMDEF36# FORMAT-NEXT: [[PREFIX]]-input1.o37# FORMAT-NEXT: [[PREFIX]]-input2.o38# FORMAT-NEXT: [[PREFIX]]-x86_64.bc39# FORMAT-NOT:  {{.}}40 41## Check that the output file is overwritten:42# RUN: llvm-libtool-darwin -static -o %t.lib %t-input2.o43# RUN: llvm-ar t %t.lib | \44# RUN:   FileCheck %s --check-prefix=OVERWRITE-NAMES --implicit-check-not={{.}} -DPREFIX=%basename_t.tmp45# RUN: llvm-nm --print-armap %t.lib | \46# RUN:   FileCheck %s --check-prefix=OVERWRITE-SYMBOLS -DPREFIX=%basename_t.tmp --match-full-lines47 48# OVERWRITE-NAMES: [[PREFIX]]-input2.o49 50# OVERWRITE-SYMBOLS:      Archive map51# OVERWRITE-SYMBOLS-NEXT: _symbol2 in [[PREFIX]]-input2.o52# OVERWRITE-SYMBOLS-EMPTY:53 54## Duplicate a binary:55# RUN: llvm-libtool-darwin -static -o %t.lib %t-input1.o %t-input2.o %t-input1.o 2>&1 | \56# RUN:   FileCheck %s --check-prefix=DUPLICATE-INPUT -DFILE=%basename_t.tmp-input1.o \57# RUN:     -DINPUTA=%t-input1.o -DINPUTB=%t-input1.o58 59# DUPLICATE-INPUT:     warning: file '[[FILE]]' was specified multiple times.60# DUPLICATE-INPUT-DAG: [[INPUTA]]61# DUPLICATE-INPUT-DAG: [[INPUTB]]62 63# RUN: not llvm-libtool-darwin -warnings_as_errors -static -o %t.lib %t-input1.o %t-input2.o %t-input1.o 2>&1 | \64# RUN:   FileCheck %s --check-prefix=ERROR-DUPLICATE-INPUT -DFILE=%basename_t.tmp-input1.o \65# RUN:     -DINPUTA=%t-input1.o -DINPUTB=%t-input1.o66 67# ERROR-DUPLICATE-INPUT:     error: file '[[FILE]]' was specified multiple times.68# ERROR-DUPLICATE-INPUT-DAG: [[INPUTA]]69# ERROR-DUPLICATE-INPUT-DAG: [[INPUTB]]70 71## Make sure we can combine object files with the same name if72## they are for different architectures.73# RUN: mkdir -p %t/arm64 %t/armv774# RUN: llvm-as %S/Inputs/arm64-ios.ll -o %t/arm64/out.bc75# RUN: llvm-as %S/Inputs/armv7-ios.ll -o %t/armv7/out.bc76## Command output should be empty.77# RUN: llvm-libtool-darwin -static %t/arm64/out.bc %t/armv7/out.bc -o %t.lib 2>&1 | \78# RUN:   FileCheck %s --implicit-check-not=warning: --allow-empty79