35 lines · yaml
1## Test how the Machine YAML field can be used to set the e_machine ELF header field.2 3## Test we can use an arbitrary value.4 5# RUN: yaml2obj -D MACHINE=0x1234 %s -o %t16# RUN: llvm-readelf %t1 --file-headers | FileCheck %s --check-prefix=UNKNOWN7 8# UNKNOWN: Machine: 12349 10--- !ELF11FileHeader:12 Class: ELFCLASS6413 Data: ELFDATA2MSB14 Type: ET_REL15 Machine: [[MACHINE]]16 17## Test we can't use a number that doesn't fit into 2 bytes.18 19# RUN: not yaml2obj -D MACHINE=0x12345 %s 2>&1 | FileCheck %s --check-prefix=ERR20 21# ERR: error: out of range hex16 number22 23## Test we can use a known named constant.24 25# RUN: yaml2obj -D MACHINE=EM_NONE %s -o %t326# RUN: llvm-readelf %t3 --file-headers | FileCheck %s --check-prefix=NONE27 28# NONE: Machine: None29 30## Test we can't use an unknown string constant.31 32# RUN: not yaml2obj -D MACHINE=EM_UNKNOWN_FOO %s 2>&1 | FileCheck %s --check-prefix=ERR233 34# ERR2: error: invalid hex16 number35