summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-objcopy/strip-sections-only-keep.test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/tools/llvm-objcopy/strip-sections-only-keep.test')
-rw-r--r--llvm/test/tools/llvm-objcopy/strip-sections-only-keep.test20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-objcopy/strip-sections-only-keep.test b/llvm/test/tools/llvm-objcopy/strip-sections-only-keep.test
new file mode 100644
index 00000000000..2c9400cf34c
--- /dev/null
+++ b/llvm/test/tools/llvm-objcopy/strip-sections-only-keep.test
@@ -0,0 +1,20 @@
+# RUN: yaml2obj %s > %t
+# RUN: llvm-objcopy -strip-sections -only-keep=.test %t %t2
+# RUN: od -Ax -t x1 %t2 | FileCheck %s
+# RUN: od -Ax -t c %t2 | FileCheck %s -check-prefix=TEXT
+
+!ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_X86_64
+Sections:
+ - Name: .test
+ Type: SHT_PROGBITS
+ Flags: [ ]
+ Content: "DEADBEEF"
+
+# CHECK: de ad be ef
+
+# TEXT-NOT: t e s t
OpenPOWER on IntegriCloud