[WebAssembly] Check function signatures by default

But only produce a warning (for now) unless --fatal-warnings
is passed.

Differential Revision: https://reviews.llvm.org/D46484

llvm-svn: 331574
diff --git a/lld/test/wasm/fatal-warnings.ll b/lld/test/wasm/fatal-warnings.ll
new file mode 100644
index 0000000..f3f1d3b
--- /dev/null
+++ b/lld/test/wasm/fatal-warnings.ll
@@ -0,0 +1,14 @@
+; RUN: llc -filetype=obj %s -o %t.main.o
+; RUN: lld -flavor wasm -o %t.wasm %t.main.o 2>&1 | FileCheck %s -check-prefix=CHECK-WARN
+; RUN: not lld -flavor wasm --fatal-warnings -o %t.wasm %t.main.o 2>&1 | FileCheck %s -check-prefix=CHECK-FATAL
+
+; CHECK-WARN: warning: Function type mismatch: _start
+; CHECK-FATAL: error: Function type mismatch: _start
+
+target triple = "wasm32-unknown-unknown-wasm"
+
+define hidden i32 @_start(i32 %arg) local_unnamed_addr {
+entry:
+  ret i32 %arg
+}
+