xref: /llvm-project/llvm/test/tools/llvm-lipo/replace-invalid-input.test (revision dde23bf98ecb309dd36405cff7270c613834a534)
1# RUN: yaml2obj %p/Inputs/i386-slice.yaml -o %t-32.o
2# RUN: yaml2obj %p/Inputs/arm64-slice.yaml -o %t-arm64.o
3# RUN: yaml2obj %p/Inputs/i386-x86_64-universal.yaml -o %t-universal.o
4
5# RUN: not llvm-lipo %t-universal.o -replace %t-32.o 2>&1 | FileCheck --check-prefix=MISSING_ARG %s
6# MISSING_ARG: error: missing argument to -replace option
7
8# RUN: not llvm-lipo %t-universal.o -replace i386 %t-32.o 2>&1 | FileCheck --check-prefix=OUTPUT_FILE %s
9# OUTPUT_FILE: error: replace expects a single output file to be specified
10
11# RUN: not llvm-lipo %t-universal.o %t-universal.o -replace i386 %t-32.o -o %t.o 2>&1 | FileCheck --check-prefix=INPUT_ARGS %s
12# INPUT_ARGS: error: replace expects a single input file
13
14# RUN: not llvm-lipo %t-universal.o -replace i386 %t-33.o  -o %t.o 2>&1 | FileCheck -DMSG=%errc_ENOENT --check-prefix=INVALID_FILE %s
15# INVALID_FILE: [[MSG]]
16
17# RUN: not llvm-lipo %t-universal.o -replace i3866 %t-32.o -o %t.o 2>&1 | FileCheck --check-prefix=INVALID_ARCH %s
18# INVALID_ARCH: error: Invalid architecture: i3866
19
20# RUN: not llvm-lipo %t-universal.o -replace arm64 %t-32.o -o %t.o 2>&1 | FileCheck --check-prefix=ARCH_NOT_MATCHED %s
21# ARCH_NOT_MATCHED: error: specified architecture: arm64 for file: {{.*}} does not match the file's architecture (i386)
22
23# RUN: not llvm-lipo %t-universal.o -replace arm64 %t-arm64.o -o %t.o 2>&1 | FileCheck --check-prefix=ARCH_NOT_IN_INPUT %s
24# ARCH_NOT_IN_INPUT: error: -replace arm64 <file_name> specified but fat file: {{.*}} does not contain that architecture
25
26# RUN: not llvm-lipo %t-universal.o -replace i386 %t-32.o -replace arm64 %t-universal.o -o %t.o 2>&1 | FileCheck --check-prefix=REPLACE_UNIVERSAL %s
27# REPLACE_UNIVERSAL: replacement file: {{.*}} is a fat file (must be a thin file)
28
29# RUN: not llvm-lipo %t-universal.o -replace i386 %t-32.o -replace i386 %t-32.o -o %t.o 2>&1 | FileCheck --check-prefix=ARCH_DUPLICATE %s
30# ARCH_DUPLICATE: error: -replace i386 <file_name> specified multiple times:
31