summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/tools/llvm-objcopy/COFF/only-keep-debug.test4
-rw-r--r--llvm/test/tools/llvm-objcopy/ELF/basic-only-keep-debug.test4
2 files changed, 8 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-objcopy/COFF/only-keep-debug.test b/llvm/test/tools/llvm-objcopy/COFF/only-keep-debug.test
index 5518d4000fc..c2a6afef7ce 100644
--- a/llvm/test/tools/llvm-objcopy/COFF/only-keep-debug.test
+++ b/llvm/test/tools/llvm-objcopy/COFF/only-keep-debug.test
@@ -3,6 +3,10 @@ RUN: yaml2obj %p/Inputs/only-keep-sections.yaml > %t.in.exe
RUN: llvm-objcopy --only-keep-debug %t.in.exe %t.out.exe
RUN: llvm-readobj --sections %t.out.exe | FileCheck %s --check-prefix=SECTIONS
RUN: llvm-objdump -t %t.out.exe | FileCheck %s --check-prefix=SYMBOLS
+# Run llvm-strip with --strip-symbol on a non-existent symbol to prevent
+# defaulting to --strip-all.
+RUN: llvm-strip --only-keep-debug --strip-symbol foo %t.in.exe -o %t-strip.out.exe
+RUN: cmp %t.out.exe %t-strip.out.exe
Check that all non-debug/buildid sections with IMAGE_SCN_CNT_CODE
or IMAGE_SCN_CNT_INITIALIZED_DATA are truncated, and no others.
diff --git a/llvm/test/tools/llvm-objcopy/ELF/basic-only-keep-debug.test b/llvm/test/tools/llvm-objcopy/ELF/basic-only-keep-debug.test
index c35c4a5c60a..c5a794a0858 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/basic-only-keep-debug.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/basic-only-keep-debug.test
@@ -6,6 +6,10 @@
# RUN: llvm-objcopy %t %t2
# RUN: llvm-objcopy --only-keep-debug %t %t3
# RUN: cmp %t2 %t3
+# Run llvm-strip with --strip-symbol on a non-existent symbol to prevent
+# defaulting to --strip-all.
+# RUN: llvm-strip --only-keep-debug --strip-symbol foo %t -o %t4
+# RUN: cmp %t2 %t4
!ELF
FileHeader:
OpenPOWER on IntegriCloud