diff options
| author | Jake Ehrlich <jakehehrlich@google.com> | 2017-09-19 19:05:15 +0000 |
|---|---|---|
| committer | Jake Ehrlich <jakehehrlich@google.com> | 2017-09-19 19:05:15 +0000 |
| commit | 523560ef5799fcac88da0353b8b703779fa59d3c (patch) | |
| tree | 55157077398ecc371669e06a4cf08be257fd0bfb | |
| parent | affd201967f7d5cfeecf06b13347897087da42bf (diff) | |
| download | bcm5719-llvm-523560ef5799fcac88da0353b8b703779fa59d3c.tar.gz bcm5719-llvm-523560ef5799fcac88da0353b8b703779fa59d3c.zip | |
[llvm-objcopy] Add test to check that architecture specific values are not used on wrong architecture.
This change adds a test that checks the an error is produced when a hexagon
specific reserved section index is used but e_machine is not EM_HEXAGON.
Differential Revision: https://reviews.llvm.org/D38017
llvm-svn: 313661
| -rw-r--r-- | llvm/test/tools/llvm-objcopy/hexagon-unsupported-on-x86.test | 15 | ||||
| -rw-r--r-- | llvm/test/tools/llvm-objcopy/section-index-unsupported.test | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/llvm/test/tools/llvm-objcopy/hexagon-unsupported-on-x86.test b/llvm/test/tools/llvm-objcopy/hexagon-unsupported-on-x86.test new file mode 100644 index 00000000000..dab5eedf695 --- /dev/null +++ b/llvm/test/tools/llvm-objcopy/hexagon-unsupported-on-x86.test @@ -0,0 +1,15 @@ +# RUN: yaml2obj %s > %t +# RUN: not llvm-objcopy %t %t2 2>&1 >/dev/null | FileCheck %s + +!ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_X86_64 +Symbols: + Global: + - Name: test + Index: SHN_HEXAGON_SCOMMON + +# CHECK: Symbol 'test' has unsupported value greater than or equal to SHN_LORESERVE: 65280 diff --git a/llvm/test/tools/llvm-objcopy/section-index-unsupported.test b/llvm/test/tools/llvm-objcopy/section-index-unsupported.test index f2d32b6dd5e..1a69757b4e8 100644 --- a/llvm/test/tools/llvm-objcopy/section-index-unsupported.test +++ b/llvm/test/tools/llvm-objcopy/section-index-unsupported.test @@ -12,4 +12,4 @@ Symbols: - Name: test Index: 0xff05 -# CHECK: [[_:.*]] Symbol 'test' has unsupported value greater than or equal to SHN_LORESERVE: 65285 +# CHECK: Symbol 'test' has unsupported value greater than or equal to SHN_LORESERVE: 65285 |

