[analyzer] Re-apply r283094 "Improve CloneChecker diagnostics"

The parent commit (r283092) was reverted before and now finally landed.

llvm-svn: 283661
diff --git a/clang/test/Analysis/copypaste/text-diagnostics.cpp b/clang/test/Analysis/copypaste/text-diagnostics.cpp
new file mode 100644
index 0000000..a80afdb
--- /dev/null
+++ b/clang/test/Analysis/copypaste/text-diagnostics.cpp
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -analyze -analyzer-output=text -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s
+
+void log();
+
+int max(int a, int b) { // expected-warning{{Duplicate code detected}} // expected-note{{Duplicate code detected}}
+  log();
+  if (a > b)
+    return a;
+  return b;
+}
+
+int maxClone(int a, int b) { // expected-note{{Similar code here}}
+  log();
+  if (a > b)
+    return a;
+  return b;
+}