summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
diff options
context:
space:
mode:
authorAndy Gibbs <andyg1001@hotmail.co.uk>2012-10-19 12:36:49 +0000
committerAndy Gibbs <andyg1001@hotmail.co.uk>2012-10-19 12:36:49 +0000
commitac51de6ec2f01fce1d9dadf59a86ffe825c42bc7 (patch)
tree0791be5a26a231653d9a6c1aa0172dca1afc4662 /clang/test/Sema
parent8eb77d847e8a5cba03682bd948613c7162e56a86 (diff)
downloadbcm5719-llvm-ac51de6ec2f01fce1d9dadf59a86ffe825c42bc7.tar.gz
bcm5719-llvm-ac51de6ec2f01fce1d9dadf59a86ffe825c42bc7.zip
Fix directive parsing in VerifyDiagnosticConsumer so that it ensures that "expected" is at the start of the word and will no longer accept typos such as "junkexpected-*" as a valid "expected-*" directive. A very few test-cases had to be amended to adhere to the new rule.
Patch reviewed by David Blaikie. llvm-svn: 166279
Diffstat (limited to 'clang/test/Sema')
-rw-r--r--clang/test/Sema/compound-literal.c18
-rw-r--r--clang/test/Sema/vector-cast.c12
2 files changed, 15 insertions, 15 deletions
diff --git a/clang/test/Sema/compound-literal.c b/clang/test/Sema/compound-literal.c
index bac7b0e6024..c5c0c17143f 100644
--- a/clang/test/Sema/compound-literal.c
+++ b/clang/test/Sema/compound-literal.c
@@ -6,15 +6,15 @@ struct foo { int a, b; };
static struct foo t = (struct foo){0,0};
static struct foo t1 = __builtin_choose_expr(0, (struct foo){0,0}, (struct foo){0,0});
static struct foo t2 = {0,0};
-static struct foo t3 = t2; // -expected-error {{initializer element is not a compile-time constant}}
+static struct foo t3 = t2; // expected-error {{initializer element is not a compile-time constant}}
static int *p = (int []){2,4};
static int x = (int){1};
-static int *p2 = (int []){2,x}; // -expected-error {{initializer element is not a compile-time constant}}
-static long *p3 = (long []){2,"x"}; // -expected-warning {{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char [2]'}}
+static int *p2 = (int []){2,x}; // expected-error {{initializer element is not a compile-time constant}}
+static long *p3 = (long []){2,"x"}; // expected-warning {{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char [2]'}}
-typedef struct { } cache_t; // -expected-warning{{empty struct is a GNU extension}}
-static cache_t clo_I1_cache = ((cache_t) { } ); // -expected-warning{{use of GNU empty initializer extension}}
+typedef struct { } cache_t; // expected-warning{{empty struct is a GNU extension}}
+static cache_t clo_I1_cache = ((cache_t) { } ); // expected-warning{{use of GNU empty initializer extension}}
typedef struct Test {int a;int b;} Test;
static Test* ll = &(Test) {0,0};
@@ -27,11 +27,11 @@ int main(int argc, char **argv) {
}
struct Incomplete; // expected-note{{forward declaration of 'struct Incomplete'}}
-struct Incomplete* I1 = &(struct Incomplete){1, 2, 3}; // -expected-error {{variable has incomplete type}}
+struct Incomplete* I1 = &(struct Incomplete){1, 2, 3}; // expected-error {{variable has incomplete type}}
void IncompleteFunc(unsigned x) {
- struct Incomplete* I2 = (struct foo[x]){1, 2, 3}; // -expected-error {{variable-sized object may not be initialized}}
- (void){1,2,3}; // -expected-error {{variable has incomplete type}}
- (void(void)) { 0 }; // -expected-error{{illegal initializer type 'void (void)'}}
+ struct Incomplete* I2 = (struct foo[x]){1, 2, 3}; // expected-error {{variable-sized object may not be initialized}}
+ (void){1,2,3}; // expected-error {{variable has incomplete type}}
+ (void(void)) { 0 }; // expected-error{{illegal initializer type 'void (void)'}}
}
// PR6080
diff --git a/clang/test/Sema/vector-cast.c b/clang/test/Sema/vector-cast.c
index f1cf0134dc1..7fa6e86aa10 100644
--- a/clang/test/Sema/vector-cast.c
+++ b/clang/test/Sema/vector-cast.c
@@ -10,22 +10,22 @@ void f()
t2 v2;
t3 v3;
- v2 = (t2)v1; // -expected-error {{invalid conversion between vector type \
+ v2 = (t2)v1; // expected-error {{invalid conversion between vector type \
't2' and 't1' of different size}}
- v1 = (t1)v2; // -expected-error {{invalid conversion between vector type \
+ v1 = (t1)v2; // expected-error {{invalid conversion between vector type \
't1' and 't2' of different size}}
v3 = (t3)v2;
- v1 = (t1)(char *)10; // -expected-error {{invalid conversion between vector \
+ v1 = (t1)(char *)10; // expected-error {{invalid conversion between vector \
type 't1' and scalar type 'char *'}}
v1 = (t1)(long long)10;
- v1 = (t1)(short)10; // -expected-error {{invalid conversion between vector \
+ v1 = (t1)(short)10; // expected-error {{invalid conversion between vector \
type 't1' and integer type 'short' of different size}}
long long r1 = (long long)v1;
- short r2 = (short)v1; // -expected-error {{invalid conversion between vector \
+ short r2 = (short)v1; // expected-error {{invalid conversion between vector \
type 't1' and integer type 'short' of different size}}
- char *r3 = (char *)v1; // -expected-error {{invalid conversion between vector\
+ char *r3 = (char *)v1; // expected-error {{invalid conversion between vector\
type 't1' and scalar type 'char *'}}
}
OpenPOWER on IntegriCloud