OSDN Git Service

[llvm-objcopy] Add test to check that architecture specific values are not used on...
authorJake Ehrlich <jakehehrlich@google.com>
Tue, 19 Sep 2017 19:05:15 +0000 (19:05 +0000)
committerJake Ehrlich <jakehehrlich@google.com>
Tue, 19 Sep 2017 19:05:15 +0000 (19:05 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313661 91177308-0d34-0410-b5e6-96231b3b80d8

test/tools/llvm-objcopy/hexagon-unsupported-on-x86.test [new file with mode: 0644]
test/tools/llvm-objcopy/section-index-unsupported.test

diff --git a/test/tools/llvm-objcopy/hexagon-unsupported-on-x86.test b/test/tools/llvm-objcopy/hexagon-unsupported-on-x86.test
new file mode 100644 (file)
index 0000000..dab5eed
--- /dev/null
@@ -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
index f2d32b6..1a69757 100644 (file)
@@ -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