summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Sema')
-rw-r--r--clang/test/Sema/array-declared-as-incorrect-type.c6
-rw-r--r--clang/test/Sema/enum.c6
-rw-r--r--clang/test/Sema/function.c8
-rw-r--r--clang/test/Sema/implicit-decl.c2
-rw-r--r--clang/test/Sema/merge-decls.c4
-rw-r--r--clang/test/Sema/predefined-function.c8
-rw-r--r--clang/test/Sema/redefinition.c4
-rw-r--r--clang/test/Sema/struct-compat.c8
-rw-r--r--clang/test/Sema/switch-duplicate-defaults.c10
-rw-r--r--clang/test/Sema/switch.c14
-rw-r--r--clang/test/Sema/tentative-decls.c12
-rw-r--r--clang/test/Sema/typedef-redef.c2
12 files changed, 41 insertions, 43 deletions
diff --git a/clang/test/Sema/array-declared-as-incorrect-type.c b/clang/test/Sema/array-declared-as-incorrect-type.c
index e7dd458dc0c..9b7d8b7a74e 100644
--- a/clang/test/Sema/array-declared-as-incorrect-type.c
+++ b/clang/test/Sema/array-declared-as-incorrect-type.c
@@ -3,14 +3,14 @@
extern int a1[];
int a1[1];
-extern int a2[]; // expected-error {{previous definition is here}}
+extern int a2[]; // expected-note {{previous definition is here}}
float a2[1]; // expected-error {{redefinition of 'a2'}}
extern int a3[][2];
int a3[1][2];
-extern int a4[][2]; // expected-error {{previous definition is here}}
+extern int a4[][2]; // expected-note {{previous definition is here}}
int a4[2]; // expected-error {{redefinition of 'a4'}}
-extern int a5[1][2][3]; // expected-error {{previous definition is here}}
+extern int a5[1][2][3]; // expected-note {{previous definition is here}}
int a5[3][2][1]; // expected-error {{redefinition of 'a5'}}
diff --git a/clang/test/Sema/enum.c b/clang/test/Sema/enum.c
index ba93aaa2eec..b06882b4d34 100644
--- a/clang/test/Sema/enum.c
+++ b/clang/test/Sema/enum.c
@@ -30,8 +30,8 @@ int test2(int i)
}
// PR2020
-union u0; // expected-error {{previous use is here}}
-enum u0 { U0A }; // expected-error {{error: use of 'u0' with tag type that does not match previous declaration}}
+union u0; // expected-note {{previous use is here}}
+enum u0 { U0A }; // expected-error {{use of 'u0' with tag type that does not match previous declaration}}
// rdar://6095136
@@ -52,6 +52,6 @@ void test4() {
enum someenum {}; // expected-warning {{use of empty enum extension}}
// <rdar://problem/6093889>
-enum e0 { // expected-error {{previous definition is here}}
+enum e0 { // expected-note {{previous definition is here}}
E0 = sizeof(enum e0 { E1 }) // expected-error {{nested redefinition}}
};
diff --git a/clang/test/Sema/function.c b/clang/test/Sema/function.c
index 152205dd244..7c67bbaa633 100644
--- a/clang/test/Sema/function.c
+++ b/clang/test/Sema/function.c
@@ -6,15 +6,15 @@ void f(double (* restrict a)[5]);
int foo (__const char *__path);
int foo(__const char *__restrict __file);
-void func(const char*); //expected-error{{previous declaration is here}}
-void func(char*); //expected-error{{conflicting types for 'func'}}
+void func(const char*); // expected-note {{previous declaration is here}}
+void func(char*); // expected-error{{conflicting types for 'func'}}
void g(int (*)(const void **, const void **));
void g(int (*compar)()) {
}
-void h(); //expected-error{{previous declaration is here}}
-void h (const char *fmt, ...) {} //expected-error{{conflicting types for 'h'}}
+void h(); // expected-note {{previous declaration is here}}
+void h (const char *fmt, ...) {} // expected-error{{conflicting types for 'h'}}
// PR1965
int t5(b); // expected-error {{parameter list without types}}
diff --git a/clang/test/Sema/implicit-decl.c b/clang/test/Sema/implicit-decl.c
index ea40e61afb0..099cf9d20ea 100644
--- a/clang/test/Sema/implicit-decl.c
+++ b/clang/test/Sema/implicit-decl.c
@@ -7,7 +7,7 @@ void func() {
int32_t *vector[16];
const char compDesc[16 + 1];
int32_t compCount = 0;
- if (_CFCalendarDecomposeAbsoluteTimeV(compDesc, vector, compCount)) { // expected-error{{previous implicit declaration is here}}
+ if (_CFCalendarDecomposeAbsoluteTimeV(compDesc, vector, compCount)) { // expected-note {{previous implicit declaration is here}}
}
return ((void *)0);
}
diff --git a/clang/test/Sema/merge-decls.c b/clang/test/Sema/merge-decls.c
index 50ce4787699..b26532c5eac 100644
--- a/clang/test/Sema/merge-decls.c
+++ b/clang/test/Sema/merge-decls.c
@@ -3,7 +3,7 @@
void foo(void);
void foo(void) {}
void foo(void);
-void foo(void); // expected-error{{previous declaration is here}}
+void foo(void); // expected-note {{previous declaration is here}}
void foo(int); // expected-error {{conflicting types for 'foo'}}
@@ -14,6 +14,6 @@ int funcdef()
int funcdef();
-int funcdef2() { return 0; } // expected-error{{previous definition is here}}
+int funcdef2() { return 0; } // expected-note {{previous definition is here}}
int funcdef2() { return 0; } // expected-error {{redefinition of 'funcdef2'}}
diff --git a/clang/test/Sema/predefined-function.c b/clang/test/Sema/predefined-function.c
index e8c396525d1..2a254cceb7e 100644
--- a/clang/test/Sema/predefined-function.c
+++ b/clang/test/Sema/predefined-function.c
@@ -4,7 +4,7 @@ char *funk(int format);
enum Test {A=-1};
char *funk(enum Test x);
-int eli(float b); // expected-error {{previous declaration is here}}
+int eli(float b); // expected-note {{previous declaration is here}}
int b(int c) {return 1;}
int foo();
@@ -16,7 +16,7 @@ int foo()
}
int bar();
-int bar(int i) // expected-error {{previous definition is here}}
+int bar(int i) // expected-note {{previous definition is here}}
{
return 0;
}
@@ -26,14 +26,14 @@ int bar() // expected-error {{redefinition of 'bar'}}
}
#if 0
-int foobar(int); // error {{previous declaration is here}}
+int foobar(int); // note {{previous declaration is here}}
int foobar() // error {{conflicting types for 'foobar'}}
{
return 0;
}
#endif
-int wibble(); // expected-error {{previous declaration is here}}
+int wibble(); // expected-note {{previous declaration is here}}
float wibble() // expected-error {{conflicting types for 'wibble'}}
{
return 0.0f;
diff --git a/clang/test/Sema/redefinition.c b/clang/test/Sema/redefinition.c
index c45779fdeef..9ad77f61a73 100644
--- a/clang/test/Sema/redefinition.c
+++ b/clang/test/Sema/redefinition.c
@@ -1,5 +1,5 @@
// RUN: clang %s -fsyntax-only -verify
-int f(int) { } // expected-error{{previous definition is here}}
+int f(int) { } // expected-note {{previous definition is here}}
int f(int);
-int f(int) { } // expected-error{{redefinition of 'f'}}
+int f(int) { } // expected-error {{redefinition of 'f'}}
diff --git a/clang/test/Sema/struct-compat.c b/clang/test/Sema/struct-compat.c
index a4492d12e2a..489ff471fab 100644
--- a/clang/test/Sema/struct-compat.c
+++ b/clang/test/Sema/struct-compat.c
@@ -1,17 +1,17 @@
/* RUN: clang %s -fsyntax-only -pedantic -verify
*/
-extern struct {int a;} x; // expected-error{{previous definition is here}}
-extern struct {int a;} x; // expected-error{{redefinition of 'x'}}
+extern struct {int a;} x; // expected-note {{previous definition is here}}
+extern struct {int a;} x; // expected-error {{redefinition of 'x'}}
struct x;
int a(struct x* b) {
// Per C99 6.7.2.3, since the outer and inner "struct x"es have different
// scopes, they don't refer to the same type, and are therefore incompatible
-struct x {int a;} *c = b; // expected-warning{{incompatible pointer types}}
+struct x {int a;} *c = b; // expected-warning {{incompatible pointer types}}
}
struct x {int a;} r;
int b() {
-struct x {char x;} s = r; // expected-error{{incompatible type initializing}}
+struct x {char x;} s = r; // expected-error {{incompatible type initializing}}
}
diff --git a/clang/test/Sema/switch-duplicate-defaults.c b/clang/test/Sema/switch-duplicate-defaults.c
deleted file mode 100644
index 9ef683b48b9..00000000000
--- a/clang/test/Sema/switch-duplicate-defaults.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: clang -fsyntax-only -verify %s
-
-void f (int z) {
- switch(z) {
- default: // expected-error {{first label is here}}
- default: // expected-error {{multiple default labels in one switch}}
- break;
- }
-}
-
diff --git a/clang/test/Sema/switch.c b/clang/test/Sema/switch.c
index 63e5fe33b7d..5886fefbd95 100644
--- a/clang/test/Sema/switch.c
+++ b/clang/test/Sema/switch.c
@@ -8,17 +8,17 @@ void f (int z) {
void foo(int X) {
switch (X) {
- case 42: ; // expected-error {{previous case value}}
+ case 42: ; // expected-note {{previous case}}
case 5000000000LL: // expected-warning {{overflow}}
case 42: // expected-error {{duplicate case value}}
;
case 100 ... 99: ; // expected-warning {{empty case range}}
- case 43: ; // expected-error {{previous case value}}
+ case 43: ; // expected-note {{previous case}}
case 43 ... 45: ; // expected-error {{duplicate case value}}
- case 100 ... 20000:; // expected-error {{previous case value}}
+ case 100 ... 20000:; // expected-note {{previous case}}
case 15000 ... 40000000:; // expected-error {{duplicate case value}}
}
}
@@ -60,3 +60,11 @@ void test4()
}
}
+void test5(int z) {
+ switch(z) {
+ default: // expected-note {{previous case defined here}}
+ default: // expected-error {{multiple default labels in one switch}}
+ break;
+ }
+}
+
diff --git a/clang/test/Sema/tentative-decls.c b/clang/test/Sema/tentative-decls.c
index 3a2fd5a235d..0e4b13a8434 100644
--- a/clang/test/Sema/tentative-decls.c
+++ b/clang/test/Sema/tentative-decls.c
@@ -9,12 +9,12 @@ const int b [1] = {1};
extern const int c[] = {1}; // expected-warning{{'extern' variable has an initializer}}
const int c[];
-int i1 = 1; // expected-error{{previous definition is here}}
-int i1 = 2; // expected-error{{redefinition of 'i1'}} // expected-error{{previous definition is here}}
+int i1 = 1; // expected-note {{previous definition is here}}
+int i1 = 2; // expected-error {{redefinition of 'i1'}} // expected-note {{previous definition is here}}
int i1;
int i1;
-extern int i1; // expected-error{{previous definition is here}}
-static int i1; // expected-error{{static declaration of 'i1' follows non-static declaration}} expected-error{{previous definition is here}}
+extern int i1; // expected-note {{previous definition is here}}
+static int i1; // expected-error{{static declaration of 'i1' follows non-static declaration}} expected-note {{previous definition is here}}
int i1 = 3; // expected-error{{redefinition of 'i1'}} expected-error{{non-static declaration of 'i1' follows static declaration}}
__private_extern__ int pExtern;
@@ -28,11 +28,11 @@ int (*pToArray)[];
int (*pToArray)[8];
int redef[10];
-int redef[]; // expected-error{{previous definition is here}}
+int redef[]; // expected-note {{previous definition is here}}
int redef[11]; // expected-error{{redefinition of 'redef'}}
void func() {
- extern int i1; // expected-error{{previous definition is here}}
+ extern int i1; // expected-note {{previous definition is here}}
static int i1; // expected-error{{static declaration of 'i1' follows non-static declaration}}
}
diff --git a/clang/test/Sema/typedef-redef.c b/clang/test/Sema/typedef-redef.c
index d3904dd147d..76b8a3cddef 100644
--- a/clang/test/Sema/typedef-redef.c
+++ b/clang/test/Sema/typedef-redef.c
@@ -6,7 +6,7 @@ typedef __SIZE_TYPE__ size_t;
-typedef const int x; // expected-error {{previous definition is here}}
+typedef const int x; // expected-note {{previous definition is here}}
extern x a;
typedef int x; // expected-error {{typedef redefinition with different types}}
extern x a;
OpenPOWER on IntegriCloud