43 lines · plain
1# This test verifies that llvm-objcopy copies a univeral Mach-O object file properly.2 3# RUN: yaml2obj %p/Inputs/i386.yaml -o %t.i3864# RUN: yaml2obj %p/Inputs/x86_64.yaml -o %t.x86_645 6## Case 1: copy a universal object containing regular Mach-O objects.7# RUN: llvm-lipo %t.i386 %t.x86_64 -create -output %t.universal8# RUN: llvm-objcopy %t.universal %t.universal.copy9# RUN: llvm-lipo %t.universal.copy -archs | FileCheck --check-prefix=VERIFY_ARCHS %s10# RUN: llvm-lipo %t.universal.copy -thin i386 -output %t.i386.copy11# RUN: llvm-lipo %t.universal.copy -thin x86_64 -output %t.x86_64.copy12# RUN: cmp %t.i386 %t.i386.copy13# RUN: cmp %t.x86_64 %t.x86_64.copy14 15## Case 2: copy a universal object file containing an archive with darwin specific timestamps.16# RUN: rm -f %t.archive.i38617# RUN: llvm-ar --format=darwin cr %t.archive.i386 %t.i386 %t.i38618# RUN: llvm-lipo %t.archive.i386 %t.x86_64 -create -output %t.universal.containing.archive19# RUN: llvm-objcopy %t.universal.containing.archive %t.universal.containing.archive.copy20# RUN: llvm-lipo %t.universal.containing.archive.copy -archs | FileCheck --check-prefix=VERIFY_ARCHS %s21# RUN: llvm-lipo %t.universal.containing.archive.copy -thin i386 -output %t.archive.i386.copy22# RUN: llvm-lipo %t.universal.containing.archive.copy -thin x86_64 -output %t.archive.x86_64.copy23# RUN: cmp %t.archive.i386 %t.archive.i386.copy24# RUN: cmp %t.x86_64 %t.archive.x86_64.copy25 26## Case 3: copy an archive containing a universal object.27# RUN: llvm-ar cr %t.archive.containing.universal %t.universal28# RUN: llvm-objcopy %t.archive.containing.universal %t.archive.containing.universal.copy29 30## Case 4: try to copy a universal object file contaning a bitcode slice.31# RUN: echo 'target triple = "arm64-apple-ios8.0.0"' | llvm-as -o %t.bitcode32# RUN: llvm-lipo %t.bitcode %t.x86_64 -create -output %t.universal.containing.bitcode33# RUN: not llvm-objcopy %t.universal.containing.bitcode %t.universal.containing.bitcode.copy 2>&1 \34# RUN: | FileCheck --check-prefix=UNSUPPORTED_UNIVERSAL_OBJECT %s35 36## Case 5: try to copy an archive containing an unsupported universal object.37# RUN: llvm-ar cr %t.archive.universal.bitcode %t.universal.containing.bitcode38# RUN: not llvm-objcopy %t.archive.universal.bitcode %t.archive.universal.bitcode.copy 2>&1 \39# RUN: | FileCheck --check-prefix=UNSUPPORTED_UNIVERSAL_OBJECT %s40 41# VERIFY_ARCHS: i386 x86_6442# UNSUPPORTED_UNIVERSAL_OBJECT: slice for 'arm64' of the universal Mach-O binary {{.*}} is not a Mach-O object or an archive43