76 lines · plain
1## This test checks that a correct universal binary is produced when2## llvm-libtool-darwin is given bitcode for multiple architectures.3 4## Check that the subtypes of cputype CPU_TYPE_ARM are stored in a fat file:5# RUN: llvm-as %p/Inputs/arm64-ios.ll -o %t-arm64.bc6# RUN: llvm-as %p/Inputs/armv7-ios.ll -o %t-armv7.bc7 8# RUN: llvm-libtool-darwin -static -o %t.lib %t-arm64.bc %t-armv7.bc9 10## Check that architectures are present in the universal output:11# RUN: llvm-lipo -info %t.lib | \12# RUN: FileCheck %s --check-prefix=ARCHS -DFILE=%t.lib13 14# ARCHS: Architectures in the fat file: [[FILE]] are: armv7 arm64 15 16## Check that the files with the same architecture are combined in an archive:17# RUN: llvm-libtool-darwin -static -o %t.lib %t-arm64.bc %t-arm64.bc %t-armv7.bc18# RUN: llvm-lipo -info %t.lib | \19# RUN: FileCheck %s --check-prefix=ARCHS -DFILE=%t.lib20# RUN: llvm-objdump --macho --arch all --all-headers %t.lib | \21# RUN: FileCheck %s --check-prefix=UNIVERSAL-MEMBERS -DFILE=%t.lib -DPREFIX=%basename_t.tmp --implicit-check-not=Archive22 23# UNIVERSAL-MEMBERS: Archive : [[FILE]] (architecture armv7)24# UNIVERSAL-MEMBERS-NEXT: __.SYMDEF25# UNIVERSAL-MEMBERS-NEXT: [[PREFIX]]-armv7.bc26# UNIVERSAL-MEMBERS: Archive : [[FILE]] (architecture arm64)27# UNIVERSAL-MEMBERS-NEXT: __.SYMDEF28# UNIVERSAL-MEMBERS-NEXT: [[PREFIX]]-arm64.bc29# UNIVERSAL-MEMBERS-NEXT: [[PREFIX]]-arm64.bc30 31## Check that the files extracted from a universal output are archives:32# RUN: llvm-libtool-darwin -static -o %t.lib %t-arm64.bc %t-armv7.bc33# RUN: llvm-lipo %t.lib -thin armv7 -output %t-extracted-v7.a34# RUN: llvm-ar t %t-extracted-v7.a | \35# RUN: FileCheck %s --check-prefix=EXTRACT --implicit-check-not={{.}} -DPREFIX=%basename_t.tmp36# RUN: llvm-nm --print-armap %t-extracted-v7.a | \37# RUN: FileCheck %s --check-prefix=EXTRACT-SYMBOLS -DPREFIX=%basename_t.tmp --match-full-lines38 39# EXTRACT: [[PREFIX]]-armv7.bc40 41# EXTRACT-SYMBOLS: Archive map42# EXTRACT-SYMBOLS-NEXT: _armv7 in [[PREFIX]]-armv7.bc43# EXTRACT-SYMBOLS-EMPTY:44 45## Check that the subtypes of cputype CPU_TYPE_X86_64 are stored in a fat file:46# RUN: llvm-as %p/Inputs/x86_64-osx.ll -o %t-x86_64.bc47# RUN: llvm-as %p/Inputs/x86_64h-osx.ll -o %t-x86_64_h.bc48# RUN: llvm-libtool-darwin -static -o %t.lib %t-x86_64.bc %t-x86_64_h.bc49# RUN: llvm-lipo -info %t.lib | \50# RUN: FileCheck %s --check-prefix=ARCHS-X86 -DFILE=%t.lib51 52# ARCHS-X86: Architectures in the fat file: [[FILE]] are: x86_64 x86_64h53 54## Check that the subtypes of cputype CPU_TYPE_ARM64 are stored in a fat file:55## Testing it using llvm-objdump as, currently, there is no support for arm64e56## under llvm/lib/Object/MachOObjectFile.cpp.57# RUN: llvm-as %p/Inputs/arm64e-ios.ll -o %t-arm64e.bc58# RUN: llvm-libtool-darwin -static -o %t.lib %t-arm64.bc %t-arm64e.bc59# RUN: llvm-objdump --macho --arch all --all-headers %t.lib | \60# RUN: FileCheck %s --check-prefix=UNIVERSAL-MEMBERS-ARM64 -DFILE=%t.lib -DPREFIX=%basename_t.tmp --implicit-check-not=Archive61 62# UNIVERSAL-MEMBERS-ARM64: Archive : [[FILE]] (architecture arm64)63# UNIVERSAL-MEMBERS-ARM64-NEXT: __.SYMDEF64# UNIVERSAL-MEMBERS-ARM64-NEXT: [[PREFIX]]-arm64.bc65# UNIVERSAL-MEMBERS-ARM64: Archive : [[FILE]]66# UNIVERSAL-MEMBERS-ARM64-NEXT: __.SYMDEF67# UNIVERSAL-MEMBERS-ARM64-NEXT: [[PREFIX]]-arm64e.bc68 69## Check that different cputypes are stored together in a fat file:70# RUN: llvm-libtool-darwin -static -o %t.lib %t-armv7.bc %t-x86_64.bc71# RUN: llvm-lipo -info %t.lib | \72# RUN: FileCheck %s --check-prefix=ARCHS-CPU -DFILE=%t.lib73 74# ARCHS-CPU: Architectures in the fat file: [[FILE]] are: armv7 x86_6475 76