xref: /llvm-project/llvm/test/tools/llvm-lipo/segalign-invalid-input.test (revision dde23bf98ecb309dd36405cff7270c613834a534)
1# RUN: yaml2obj %p/Inputs/arm64-slice.yaml -o %t-arm64.o
2# RUN: yaml2obj %p/Inputs/armv7-slice.yaml -o %t-armv7.o
3
4# RUN: not llvm-lipo %t-armv7.o %t-arm64.o -create -o %t.o -segalign a 2>&1 | FileCheck --check-prefix=MISSING_ARG %s
5# MISSING_ARG: error: missing argument to -segalign option
6
7# RUN: not llvm-lipo %t-armv7.o %t-arm64.o -o %t.o -segalign arm64 10 2>&1 | FileCheck --check-prefix=MISSING_ACTION %s
8# MISSING_ACTION: error: at least one action should be specified
9
10# RUN: not llvm-lipo %t-armv7.o %t-arm64.o -create -o %t.o -segalign arm6 10 2>&1 | FileCheck --check-prefix=INVALID_ARCH %s
11# INVALID_ARCH: error: Invalid architecture: arm6
12
13# RUN: not llvm-lipo %t-armv7.o %t-arm64.o -create -o %t.o -segalign arm64 15.7 2>&1 | FileCheck --check-prefix=INVALID_ALIGN_NOT_HEX %s
14# INVALID_ALIGN_NOT_HEX: error: argument to -segalign <arch_type> 15.7 (hex) is not a proper hexadecimal number
15
16# RUN: not llvm-lipo %t-armv7.o %t-arm64.o -create -o %t.o -segalign arm64 15 2>&1 | FileCheck --check-prefix=INVALID_ALIGN_HEX %s
17# INVALID_ALIGN_HEX: error: argument to -segalign <arch_type> 15 (hex) must be a non-zero power of two
18
19# RUN: not llvm-lipo %t-armv7.o %t-arm64.o -create -o %t.o -segalign arm64 0 2>&1 | FileCheck --check-prefix=INVALID_ALIGN_ZERO %s
20# INVALID_ALIGN_ZERO: error: argument to -segalign <arch_type> 0 (hex) must be a non-zero power of two
21
22# RUN: not llvm-lipo %t-armv7.o %t-arm64.o -create -o %t.o -segalign arm64 10000 2>&1 | FileCheck --check-prefix=INVALID_ALIGN_BIG %s
23# INVALID_ALIGN_BIG: error: argument to -segalign <arch_type> 10000 (hex) must be less than or equal to the maximum section align 2^15
24
25# RUN: not llvm-lipo %t-armv7.o %t-arm64.o -create -o %t.o -segalign arm64 100 -segalign arm64 200 2>&1 | FileCheck --check-prefix=DUPLICATE_ALIGN %s
26# DUPLICATE_ALIGN: error: -segalign arm64 <alignment_value> specified multiple times: 256, 512
27
28# RUN: not llvm-lipo %t-armv7.o %t-arm64.o -create -o %t.o -segalign i386 100 2>&1 | FileCheck --check-prefix=EXCLUDED_ALIGN %s
29# EXCLUDED_ALIGN: error: -segalign i386 <value> specified but resulting fat file does not contain that architecture
30