1 # RUN: yaml2obj %s -o %t
3 # RUN: llvm-objcopy --set-section-alignment .foo=4 --set-section-alignment .bar=0x5 \
4 # RUN: --set-section-alignment .baz=0 %t %t.2
5 # RUN: llvm-readobj --sections %t.2 | FileCheck --check-prefix=CHECK %s
8 # CHECK: AddressAlignment:
11 # CHECK: AddressAlignment:
14 # CHECK: AddressAlignment:
17 ## If a section is specified multiple times, the last wins.
18 # RUN: llvm-objcopy --set-section-alignment .foo=4 --set-section-alignment=.foo=7 %t %t.3
19 # RUN: llvm-readobj --sections %t.3 | FileCheck --check-prefix=MULTI %s
22 # MULTI: AddressAlignment:
25 ## Ignore the option if the section does not exist.
26 # RUN: llvm-objcopy --set-section-alignment .not_exist=4 %t.3 %t.4
29 # RUN: not llvm-objcopy --set-section-alignment=.foo %t /dev/null 2>&1 | \
30 # RUN: FileCheck --check-prefix=MISSING-EQUAL %s
31 # MISSING-EQUAL: error: bad format for --set-section-alignment: missing '='
33 # RUN: not llvm-objcopy --set-section-alignment==4 %t /dev/null 2>&1 | \
34 # RUN: FileCheck --check-prefix=MISSING-SECTION %s
35 # MISSING-SECTION: error: bad format for --set-section-alignment: missing section name
37 # RUN: not llvm-objcopy --set-section-alignment=.foo=bar %t /dev/null 2>&1 | \
38 # RUN: FileCheck --check-prefix=INVALID-ALIGN %s
39 # INVALID-ALIGN: error: invalid alignment for --set-section-alignment: 'bar'