File: universal-object.test

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,696 kB
  • sloc: cpp: 7,438,781; ansic: 1,393,871; asm: 1,012,926; python: 241,771; f90: 86,635; objc: 75,411; lisp: 42,144; pascal: 17,286; sh: 8,596; ml: 5,082; perl: 4,730; makefile: 3,591; awk: 3,523; javascript: 2,251; xml: 892; fortran: 672
file content (42 lines) | stat: -rw-r--r-- 2,511 bytes parent folder | download | duplicates (23)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# This test verifies that llvm-objcopy copies a univeral Mach-O object file properly.

# RUN: yaml2obj %p/Inputs/i386.yaml -o %t.i386
# RUN: yaml2obj %p/Inputs/x86_64.yaml -o %t.x86_64

## Case 1: copy a universal object containing regular Mach-O objects.
# RUN: llvm-lipo %t.i386 %t.x86_64 -create -output %t.universal
# RUN: llvm-objcopy %t.universal %t.universal.copy
# RUN: llvm-lipo %t.universal.copy -archs | FileCheck --check-prefix=VERIFY_ARCHS %s
# RUN: llvm-lipo %t.universal.copy -thin i386 -output %t.i386.copy
# RUN: llvm-lipo %t.universal.copy -thin x86_64 -output %t.x86_64.copy
# RUN: cmp %t.i386 %t.i386.copy
# RUN: cmp %t.x86_64 %t.x86_64.copy

## Case 2: copy a universal object file containing an archive with darwin specific timestamps.
# RUN: rm -f %t.archive.i386
# RUN: llvm-ar --format=darwin cr %t.archive.i386 %t.i386 %t.i386
# RUN: llvm-lipo %t.archive.i386 %t.x86_64 -create -output %t.universal.containing.archive
# RUN: llvm-objcopy %t.universal.containing.archive %t.universal.containing.archive.copy
# RUN: llvm-lipo %t.universal.containing.archive.copy -archs | FileCheck --check-prefix=VERIFY_ARCHS %s
# RUN: llvm-lipo %t.universal.containing.archive.copy -thin i386 -output %t.archive.i386.copy
# RUN: llvm-lipo %t.universal.containing.archive.copy -thin x86_64 -output %t.archive.x86_64.copy
# RUN: cmp %t.archive.i386 %t.archive.i386.copy
# RUN: cmp %t.x86_64 %t.archive.x86_64.copy

## Case 3: copy an archive containing a universal object.
# RUN: llvm-ar cr %t.archive.containing.universal %t.universal
# RUN: llvm-objcopy %t.archive.containing.universal %t.archive.containing.universal.copy

## Case 4: try to copy a universal object file contaning a bitcode slice.
# RUN: echo 'target triple = "arm64-apple-ios8.0.0"' | llvm-as -o %t.bitcode
# RUN: llvm-lipo %t.bitcode  %t.x86_64 -create -output %t.universal.containing.bitcode
# RUN: not llvm-objcopy %t.universal.containing.bitcode %t.universal.containing.bitcode.copy 2>&1 \
# RUN:  | FileCheck --check-prefix=UNSUPPORTED_UNIVERSAL_OBJECT %s

## Case 5: try to copy an archive containing an unsupported universal object.
# RUN: llvm-ar cr %t.archive.universal.bitcode %t.universal.containing.bitcode
# RUN: not llvm-objcopy %t.archive.universal.bitcode %t.archive.universal.bitcode.copy 2>&1 \
# RUN:  | FileCheck --check-prefix=UNSUPPORTED_UNIVERSAL_OBJECT %s

# VERIFY_ARCHS: i386 x86_64
# UNSUPPORTED_UNIVERSAL_OBJECT: slice for 'arm64' of the universal Mach-O binary {{.*}} is not a Mach-O object or an archive