87 lines · plain
1## This test checks that a universal bitcode file is flattened correctly.2 3# RUN: llvm-as %S/Inputs/arm64-ios.ll -o %t-arm64.bc4# RUN: llvm-as %S/Inputs/x86_64-osx.ll -o %t-x86_64.bc5# RUN: llvm-as %S/Inputs/x86_64-osx-2.ll -o %t-x86_64-2.bc6# RUN: llvm-lipo %t-arm64.bc %t-x86_64.bc -create -output %t-universal.o7 8# RUN: llvm-libtool-darwin -static -o %t.lib %t-universal.o -arch_only arm649 10## Check that the binary is present:11# RUN: llvm-ar t %t.lib | \12# RUN: FileCheck %s --check-prefix=CHECK-NAMES --implicit-check-not={{.}} -DPREFIX=%basename_t.tmp13 14# CHECK-NAMES: [[PREFIX]]-universal.o15 16## Check that symbols are present:17# RUN: llvm-nm --print-armap %t.lib | \18# RUN: FileCheck %s --check-prefix=CHECK-SYMBOLS -DPREFIX=%basename_t.tmp --match-full-lines19 20# CHECK-SYMBOLS: Archive map21# CHECK-SYMBOLS-NEXT: _arm64 in [[PREFIX]]-universal.o22# CHECK-SYMBOLS-EMPTY:23 24## Check that the output archive is in Darwin format:25# RUN: llvm-objdump --macho --archive-headers %t.lib | \26# RUN: FileCheck %s --check-prefix=FORMAT -DPREFIX=%basename_t.tmp -DARCHIVE=%t.lib27 28# FORMAT: Archive : [[ARCHIVE]]29# FORMAT-NEXT: __.SYMDEF30# FORMAT-NEXT: [[PREFIX]]-universal.o31# FORMAT-NOT: {{.}}32 33## Passing both a universal file and a bitcode file:34# RUN: llvm-libtool-darwin -static -o %t.lib %t-universal.o %t-x86_64-2.bc -arch_only x86_6435# RUN: llvm-ar t %t.lib | \36# RUN: FileCheck %s --check-prefix=BOTH-NAMES --implicit-check-not={{.}} -DPREFIX=%basename_t.tmp37# RUN: llvm-nm --print-armap %t.lib | \38# RUN: FileCheck %s --check-prefix=BOTH-SYMBOLS -DPREFIX=%basename_t.tmp --match-full-lines39 40# BOTH-NAMES: [[PREFIX]]-universal.o41# BOTH-NAMES-NEXT: [[PREFIX]]-x86_64-2.bc42 43# BOTH-SYMBOLS: Archive map44# BOTH-SYMBOLS-NEXT: _x86_64 in [[PREFIX]]-universal.o45# BOTH-SYMBOLS-NEXT: _x86_64_2 in [[PREFIX]]-x86_64-2.bc46# BOTH-SYMBOLS-EMPTY:47 48## Passing both a universal file and a bitcode file but filtering out the object file:49# RUN: llvm-libtool-darwin -static -o %t.lib %t-universal.o %t-x86_64.bc -arch_only arm6450# RUN: llvm-ar t %t.lib | \51# RUN: FileCheck %s --check-prefix=CHECK-NAMES --implicit-check-not={{.}} -DPREFIX=%basename_t.tmp52# RUN: llvm-nm --print-armap %t.lib | \53# RUN: FileCheck %s --check-prefix=CHECK-SYMBOLS -DPREFIX=%basename_t.tmp --match-full-lines54 55## Universal file containing an archive:56# RUN: rm -f %t.ar57# RUN: llvm-ar cr %t.ar %t-x86_64.bc %t-x86_64-2.bc58# RUN: llvm-lipo %t.ar -create -output %t-fat-with-archive.o59# RUN: llvm-libtool-darwin -static -o %t.lib %t-fat-with-archive.o60# RUN: llvm-ar t %t.lib | \61# RUN: FileCheck %s --check-prefix=ARCHIVE-NAMES --implicit-check-not={{.}} -DPREFIX=%basename_t.tmp62# RUN: llvm-nm --print-armap %t.lib | \63# RUN: FileCheck %s --check-prefix=ARCHIVE-SYMBOLS -DPREFIX=%basename_t.tmp --match-full-lines64 65# ARCHIVE-NAMES: [[PREFIX]]-x86_64.bc66# ARCHIVE-NAMES-NEXT: [[PREFIX]]-x86_64-2.bc67 68# ARCHIVE-SYMBOLS: Archive map69# ARCHIVE-SYMBOLS-NEXT: _x86_64 in [[PREFIX]]-x86_64.bc70# ARCHIVE-SYMBOLS-NEXT: _x86_64_2 in [[PREFIX]]-x86_64-2.bc71# ARCHIVE-SYMBOLS-EMPTY:72 73## Allow arch_only to be specified more than once (pick the last one):74# RUN: llvm-libtool-darwin -static -o %t.lib %t-universal.o -arch_only arm64 -arch_only x86_6475# RUN: llvm-ar t %t.lib | \76# RUN: FileCheck %s --check-prefix=DOUBLE-NAMES --implicit-check-not={{.}} -DPREFIX=%basename_t.tmp77# RUN: llvm-nm --print-armap %t.lib | \78# RUN: FileCheck %s --check-prefix=DOUBLE-SYMBOLS -DPREFIX=%basename_t.tmp --match-full-lines79 80# DOUBLE-NAMES: [[PREFIX]]-universal.o81 82# DOUBLE-SYMBOLS: Archive map83# DOUBLE-SYMBOLS-NEXT: _x86_64 in [[PREFIX]]-universal.o84# DOUBLE-SYMBOLS-EMPTY:85 86 87