llvm-mc-fuzzer: A fuzzing tool for the MC layer.

Summary:
Only the disassembler is supported in this patch but it has already found a few
issues in the Mips disassembler (mostly invalid instructions being successfully
disassembled).

Reviewers: kcc

Subscribers: russell.gallop, silvas, kcc, llvm-commits

Differential Revision: http://reviews.llvm.org/D12723

llvm-svn: 247786
diff --git a/llvm/tools/llvm-mc-fuzzer/CMakeLists.txt b/llvm/tools/llvm-mc-fuzzer/CMakeLists.txt
new file mode 100644
index 0000000..0d6432b
--- /dev/null
+++ b/llvm/tools/llvm-mc-fuzzer/CMakeLists.txt
@@ -0,0 +1,18 @@
+if( LLVM_USE_SANITIZE_COVERAGE )
+  include_directories(BEFORE
+    ${CMAKE_CURRENT_SOURCE_DIR}/../../lib/Fuzzer)
+
+  set(LLVM_LINK_COMPONENTS
+      AllTargetsDescs
+      AllTargetsDisassemblers
+      AllTargetsInfos
+      MC
+      MCDisassembler
+      Support
+      )
+  add_llvm_tool(llvm-mc-fuzzer 
+                llvm-mc-fuzzer.cpp)
+  target_link_libraries(llvm-mc-fuzzer
+                        LLVMFuzzerNoMain
+                        )
+endif()