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 ## Also incidentally show that unmentioned sections are not impacted.
19 # RUN: llvm-objcopy --set-section-alignment .foo=4 --set-section-alignment=.foo=7 %t %t.3
20 # RUN: llvm-readobj --sections %t.3 | FileCheck --check-prefix=MULTI %s
23 # MULTI: AddressAlignment:
26 # MULTI: AddressAlignment:
29 # MULTI: AddressAlignment:
32 ## Ignore the option if the section does not exist.
33 # RUN: llvm-objcopy --set-section-alignment .not_exist=4 %t.3 %t.4
36 # RUN: not llvm-objcopy --set-section-alignment=.foo %t /dev/null 2>&1 | \
37 # RUN: FileCheck --check-prefix=MISSING-EQUAL %s
38 # MISSING-EQUAL: error: bad format for --set-section-alignment: missing '='
40 # RUN: not llvm-objcopy --set-section-alignment==4 %t /dev/null 2>&1 | \
41 # RUN: FileCheck --check-prefix=MISSING-SECTION %s
42 # MISSING-SECTION: error: bad format for --set-section-alignment: missing section name
44 # RUN: not llvm-objcopy --set-section-alignment=.foo=bar %t /dev/null 2>&1 | \
45 # RUN: FileCheck --check-prefix=INVALID-ALIGN %s
46 # INVALID-ALIGN: error: invalid value for --set-section-alignment: 'bar'