Make one expected-diag directive match exactly one actual diagnostic.
This uncovers some bugs, so several test cases now fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64025 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/array-constraint.c b/test/Sema/array-constraint.c
index 69475b7..d35b0ac 100644
--- a/test/Sema/array-constraint.c
+++ b/test/Sema/array-constraint.c
@@ -1,6 +1,6 @@
 // RUN: clang -fsyntax-only -verify -pedantic %s
 
-struct s;  // expected-note {{forward declaration of 'struct s'}}
+struct s;  // expected-note 2 {{forward declaration of 'struct s'}}
 struct s* t (struct s z[]) {   // expected-error {{array has incomplete element type}}
   return z;
 }
diff --git a/test/Sema/flexible-array-init.c b/test/Sema/flexible-array-init.c
index 9ef6eb3..99ef66a 100644
--- a/test/Sema/flexible-array-init.c
+++ b/test/Sema/flexible-array-init.c
@@ -12,7 +12,7 @@
 
 struct foo { 
   int x; 
-  int y[]; // expected-note{{initialized flexible array member 'y' is here}}
+  int y[]; // expected-note 3 {{initialized flexible array member 'y' is here}}
 }; 
 struct bar { struct foo z; };
      
diff --git a/test/Sema/incomplete-decl.c b/test/Sema/incomplete-decl.c
index bd60368..be52cfd 100644
--- a/test/Sema/incomplete-decl.c
+++ b/test/Sema/incomplete-decl.c
@@ -1,6 +1,6 @@
 // RUN: clang -fsyntax-only -verify %s
 
-struct foo; // expected-note {{forward declaration of 'struct foo'}}
+struct foo; // expected-note 4 {{forward declaration of 'struct foo'}}
 
 void b;  // expected-error {{variable has incomplete type 'void'}}
 struct foo f; // expected-error {{variable has incomplete type 'struct foo'}}
diff --git a/test/Sema/pointer-addition.c b/test/Sema/pointer-addition.c
index 81a1dc0..3a924b0 100644
--- a/test/Sema/pointer-addition.c
+++ b/test/Sema/pointer-addition.c
@@ -1,6 +1,6 @@
 // RUN: clang %s -fsyntax-only -verify -pedantic
 
-typedef struct S S; // expected-note{{forward declaration of 'struct S'}}
+typedef struct S S; // expected-note 3 {{forward declaration of 'struct S'}}
 void a(S* b, void* c) {
   void (*fp)(int) = 0;
   b++;       // expected-error {{arithmetic on pointer to incomplete type}}
diff --git a/test/SemaCXX/condition.cpp b/test/SemaCXX/condition.cpp
index eb1e095..babb827 100644
--- a/test/SemaCXX/condition.cpp
+++ b/test/SemaCXX/condition.cpp
@@ -20,7 +20,7 @@
   while (struct {} x=0) ; // expected-error {{types may not be defined in conditions}} expected-error {{cannot initialize 'x' with an rvalue of type 'int'}} expected-error {{value of type 'struct <anonymous>' is not contextually convertible to 'bool'}}
   switch (enum {E} x=0) ; // expected-error {{types may not be defined in conditions}} expected-error {{incompatible type}}
 
-  if (int x=0) { // expected-note {{previous definition is here}}
+  if (int x=0) { // expected-note 2 {{previous definition is here}}
     int x;  // expected-error {{redefinition of 'x'}}
   }
   else
diff --git a/test/SemaCXX/dcl_init_aggr.cpp b/test/SemaCXX/dcl_init_aggr.cpp
index fbe7de1..bed526d 100644
--- a/test/SemaCXX/dcl_init_aggr.cpp
+++ b/test/SemaCXX/dcl_init_aggr.cpp
@@ -15,7 +15,7 @@
 };
 NonAggregate non_aggregate_test = { 1, 2 }; // expected-error{{initialization of non-aggregate type 'struct NonAggregate' with an initializer list}}
 
-NonAggregate non_aggregate_test2[2] = { { 1, 2 }, { 3, 4 } }; // expected-error{{initialization of non-aggregate type 'struct NonAggregate' with an initializer list}}
+NonAggregate non_aggregate_test2[2] = { { 1, 2 }, { 3, 4 } }; // expected-error 2 {{initialization of non-aggregate type 'struct NonAggregate' with an initializer list}}
 
 
 // C++ [dcl.init.aggr]p3
@@ -40,8 +40,8 @@
 struct TooFew { int a; char* b; int c; }; 
 TooFew too_few = { 1, "asdf" }; // okay
 
-struct NoDefaultConstructor { // expected-note{{candidate function}}
-  NoDefaultConstructor(int); // expected-note{{candidate function}}
+struct NoDefaultConstructor { // expected-note 5 {{candidate function}}
+  NoDefaultConstructor(int); // expected-note 5 {{candidate function}}
 };
 struct TooFewError {
   int a;
@@ -53,7 +53,7 @@
 TooFewError too_few_okay2[2] = { 1, 1 };
 TooFewError too_few_error2[2] = { 1 }; // expected-error{{no matching constructor}}
 
-NoDefaultConstructor too_few_error3[3] = { }; // expected-error{{no matching constructor}}
+NoDefaultConstructor too_few_error3[3] = { }; // expected-error 3 {{no matching constructor}}
 
 // C++ [dcl.init.aggr]p8
 struct Empty { };
diff --git a/test/SemaCXX/dynamic-cast.cpp b/test/SemaCXX/dynamic-cast.cpp
index 654f2e4..1fa8c3d 100644
--- a/test/SemaCXX/dynamic-cast.cpp
+++ b/test/SemaCXX/dynamic-cast.cpp
@@ -8,7 +8,7 @@
 struct E : A {};
 struct F : B, E {};
 
-struct Incomplete; // expected-note{{forward declaration of 'struct Incomplete'}}
+struct Incomplete; // expected-note 2 {{forward declaration of 'struct Incomplete'}}
 
 struct Poly
 {
diff --git a/test/SemaCXX/functional-cast.cpp b/test/SemaCXX/functional-cast.cpp
index 3b65031..9db742e 100644
--- a/test/SemaCXX/functional-cast.cpp
+++ b/test/SemaCXX/functional-cast.cpp
@@ -10,8 +10,8 @@
 
 // FIXME: error messages for implicitly-declared special member
 // function candidates are very poor
-struct NoValueInit { // expected-note{{candidate function}} 
-  NoValueInit(int i, int j); // expected-note{{candidate function}}
+struct NoValueInit { // expected-note 2 {{candidate function}} 
+  NoValueInit(int i, int j); // expected-note 2 {{candidate function}}
 };
 
 void test_cxx_functional_value_init() {
diff --git a/test/SemaCXX/namespace.cpp b/test/SemaCXX/namespace.cpp
index 7af25ec..ea7737e 100644
--- a/test/SemaCXX/namespace.cpp
+++ b/test/SemaCXX/namespace.cpp
@@ -1,5 +1,5 @@
 // RUN: clang -fsyntax-only -verify %s 
-namespace A { // expected-note {{previous definition is here}}
+namespace A { // expected-note 2 {{previous definition is here}}
   int A;
   void f() { A = 0; }
 }
diff --git a/test/SemaCXX/new-delete.cpp b/test/SemaCXX/new-delete.cpp
index ce96897..5618b47 100644
--- a/test/SemaCXX/new-delete.cpp
+++ b/test/SemaCXX/new-delete.cpp
@@ -5,8 +5,8 @@
 struct S // expected-note {{candidate}}
 {
   S(int, int, double); // expected-note {{candidate}}
-  S(double, int); // expected-note {{candidate}} expected-note {{candidate}}
-  S(float, int); // expected-note {{candidate}} expected-note {{candidate}}
+  S(double, int); // expected-note 2 {{candidate}}
+  S(float, int); // expected-note 2 {{candidate}}
 };
 struct T; // expected-note{{forward declaration of 'struct T'}}
 struct U
@@ -18,9 +18,9 @@
 {
 };
 
-void* operator new(size_t); // expected-note {{candidate}}
-void* operator new(size_t, int*); // expected-note {{candidate}}
-void* operator new(size_t, float*); // expected-note {{candidate}}
+void* operator new(size_t); // expected-note 2 {{candidate}}
+void* operator new(size_t, int*); // expected-note 3 {{candidate}}
+void* operator new(size_t, float*); // expected-note 3 {{candidate}}
 
 void good_news()
 {
diff --git a/test/SemaCXX/overload-member-call.cpp b/test/SemaCXX/overload-member-call.cpp
index 8b7b148..07936e7 100644
--- a/test/SemaCXX/overload-member-call.cpp
+++ b/test/SemaCXX/overload-member-call.cpp
@@ -1,8 +1,8 @@
 // RUN: clang -fsyntax-only -verify %s
 
 struct X {
-  int& f(int) const; // expected-note{{candidate function}}
-  float& f(int); // expected-note{{candidate function}}
+  int& f(int) const; // expected-note 2 {{candidate function}}
+  float& f(int); // expected-note 2 {{candidate function}}
 
   void test_f(int x) const {
     int& i = f(x);
@@ -12,9 +12,9 @@
     float& f2 = f(x);
   }
 
-  int& g(int) const; // expected-note{{candidate function}}
-  float& g(int); // expected-note{{candidate function}}
-  static double& g(double); // expected-note{{candidate function}}
+  int& g(int) const; // expected-note 2 {{candidate function}}
+  float& g(int); // expected-note 2 {{candidate function}}
+  static double& g(double); // expected-note 2 {{candidate function}}
 
   void h(int);
 
diff --git a/test/SemaCXX/try-catch.cpp b/test/SemaCXX/try-catch.cpp
index 0d72f11..cb5d0f8 100644
--- a/test/SemaCXX/try-catch.cpp
+++ b/test/SemaCXX/try-catch.cpp
@@ -1,6 +1,6 @@
 // RUN: clang -fsyntax-only -verify %s
 
-struct A; // expected-note{{forward declaration of 'struct A'}}
+struct A; // expected-note 3 {{forward declaration of 'struct A'}}
 
 void f()
 {
diff --git a/test/SemaObjC/check-dup-objc-decls-1.m b/test/SemaObjC/check-dup-objc-decls-1.m
index fa9b867..5498850 100644
--- a/test/SemaObjC/check-dup-objc-decls-1.m
+++ b/test/SemaObjC/check-dup-objc-decls-1.m
@@ -18,13 +18,13 @@
 @class OBJECT ;	// expected-error {{redefinition of 'OBJECT' as different kind of symbol}}
 
 
-typedef int Gorf;  // expected-note {{previous definition is here}}
+typedef int Gorf;  // expected-note 2 {{previous definition is here}}
 
 @interface Gorf @end // expected-error {{redefinition of 'Gorf' as different kind of symbol}}
 
 void Gorf() // expected-error {{redefinition of 'Gorf' as different kind of symbol}}
 {
-	int Bar, Foo, FooBar;
+  int Bar, Foo, FooBar;
 }
 
 @protocol P -im1; @end