Implement -fmessage-length=N, which word-wraps diagnostics to N columns. 

Also, put a line of whitespace between the diagnostic and the source
code/caret line when the start of the actual source code text lines up
(or nearly lines up) with the most recent line of the diagnostic. For
example, here it's okay for the last line of the diagnostic to be
(vertically) next to the source line, because there is horizontal
whitespace to separate them:

decl-expr-ambiguity.cpp:12:16: error: function-style cast to a builtin
      type can only take one argument
  typeof(int)(a,5)<<a;

However, here is a case where we need the vertical separation (since
there is no horizontal separation):

message-length.c:10:46: warning: incompatible pointer types initializing 'void
      (int, float, char, float)', expected 'int (*)(int, float, short,
      float)'

      int (*fp1)(int, float, short, float) = f;

This is part one of <rdar://problem/6711348>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70578 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Misc/message-length.c b/test/Misc/message-length.c
new file mode 100644
index 0000000..a998892
--- /dev/null
+++ b/test/Misc/message-length.c
@@ -0,0 +1,13 @@
+// RUN: clang -fsyntax-only -fmessage-length=72 %s
+
+/* It's tough to verify the results of this test mechanically, since
+   the length of the filename (and, therefore, how the word-wrapping
+   behaves) changes depending on where the test-suite resides in the
+   file system. */
+void f(int, float, char, float);
+
+void g() {
+      int (*fp1)(int, float, short, float) = f;
+
+  int (*fp2)(int, float, short, float) = f;
+}