InstrProf: Actually detect bad headers

<rdar://problem/15950346>

llvm-svn: 204510
diff --git a/llvm/test/tools/llvm-profdata/raw-magic-but-no-header.test b/llvm/test/tools/llvm-profdata/raw-magic-but-no-header.test
new file mode 100644
index 0000000..e899ece
--- /dev/null
+++ b/llvm/test/tools/llvm-profdata/raw-magic-but-no-header.test
@@ -0,0 +1,6 @@
+RUN: printf "warforpl" > %t
+RUN: not llvm-profdata show %t 2>&1 | FileCheck %s
+RUN: printf "lprofraw" > %t
+RUN: not llvm-profdata show %t 2>&1 | FileCheck %s
+
+CHECK: error: {{.+}}: Invalid header