[tools] Introduce llvm-strip

llvm-strip is supposed to be a drop-in replacement for binutils strip.
To start the ball rolling this diff adds the initial bits for llvm-strip,
more features will be added incrementally over time.

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D46407

llvm-svn: 331663
diff --git a/llvm/test/tools/llvm-objcopy/strip-debug.test b/llvm/test/tools/llvm-objcopy/strip-debug.test
index d88e238..e24843d 100644
--- a/llvm/test/tools/llvm-objcopy/strip-debug.test
+++ b/llvm/test/tools/llvm-objcopy/strip-debug.test
@@ -2,6 +2,16 @@
 # RUN: llvm-objcopy -strip-debug %t %t2
 # RUN: llvm-readobj -file-headers -sections -symbols %t2 | FileCheck %s
 
+# We run yaml2obj again rather than copy %t to avoid interfering 
+# with llvm-objcopy's test (which potentially could have corrupted/updated the binary).
+
+# RUN: yaml2obj %s > %t3
+# RUN: llvm-strip -strip-debug %t3
+# RUN: llvm-readobj -file-headers -sections -symbols %t3 | FileCheck %s
+# RUN: cmp %t2 %t3
+
+# RUN: not llvm-strip -strip-debug 2>&1 | FileCheck %s --check-prefix=NO-INPUT-FILES
+
 !ELF
 FileHeader:
   Class:           ELFCLASS64
@@ -52,3 +62,5 @@
 # CHECK-NEXT:     Section: .text
 # CHECK-NEXT:   }
 # CHECK-NEXT: ]
+
+# NO-INPUT-FILES: No input file specified