diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2009-10-23 14:22:18 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2009-10-23 14:22:18 +0000 |
commit | 5563df30b9c8d1fe87a54baae0d6bd86642563f4 (patch) | |
tree | 3fdd91eae574e32453a4baf462961c742df2691a /test/Sema | |
parent | e5557c18e5d41b4b62f2af8a24af20eba40b0225 (diff) | |
download | FreeBSD-src-5563df30b9c8d1fe87a54baae0d6bd86642563f4.zip FreeBSD-src-5563df30b9c8d1fe87a54baae0d6bd86642563f4.tar.gz |
Update clang to r84949.
Diffstat (limited to 'test/Sema')
-rw-r--r-- | test/Sema/attr-noreturn.c | 6 | ||||
-rw-r--r-- | test/Sema/exprs.c | 9 | ||||
-rw-r--r-- | test/Sema/switch.c | 7 | ||||
-rw-r--r-- | test/Sema/vector-assign.c | 12 | ||||
-rw-r--r-- | test/Sema/vector-init.c | 7 |
5 files changed, 36 insertions, 5 deletions
diff --git a/test/Sema/attr-noreturn.c b/test/Sema/attr-noreturn.c index b83eb94..14011be 100644 --- a/test/Sema/attr-noreturn.c +++ b/test/Sema/attr-noreturn.c @@ -15,14 +15,14 @@ int f2() __attribute__((noreturn(1, 2))); // expected-error {{attribute requires void f3() __attribute__((noreturn)); void f3() { - return; // expected-error {{function 'f3' declared 'noreturn' should not return}} + return; // expected-warning {{function 'f3' declared 'noreturn' should not return}} } -#pragma clang diagnostic warning "-Winvalid-noreturn" +#pragma clang diagnostic error "-Winvalid-noreturn" void f4() __attribute__((noreturn)); void f4() { - return; // expected-warning {{function 'f4' declared 'noreturn' should not return}} + return; // expected-error {{function 'f4' declared 'noreturn' should not return}} } // PR4685 diff --git a/test/Sema/exprs.c b/test/Sema/exprs.c index 69a2320..2bcc0f8 100644 --- a/test/Sema/exprs.c +++ b/test/Sema/exprs.c @@ -103,3 +103,12 @@ void test14() { __m64 mask = (__m64)((__v4hi)a > (__v4hi)a); } + +// PR5242 +typedef unsigned long *test15_t; + +test15_t test15(void) { + return (test15_t)0 + (test15_t)0; // expected-error {{invalid operands to binary expression ('test15_t' (aka 'unsigned long *') and 'test15_t')}} +} + + diff --git a/test/Sema/switch.c b/test/Sema/switch.c index 5999f34..122947e 100644 --- a/test/Sema/switch.c +++ b/test/Sema/switch.c @@ -68,3 +68,10 @@ void test5(int z) { } } +void test6() { + const char ch = 'a'; + switch(ch) { + case 1234: // expected-warning {{overflow converting case value}} + break; + } +} diff --git a/test/Sema/vector-assign.c b/test/Sema/vector-assign.c index 5162e1a..bf9c7f3 100644 --- a/test/Sema/vector-assign.c +++ b/test/Sema/vector-assign.c @@ -5,7 +5,7 @@ typedef signed int v1s __attribute__ ((vector_size (4))); typedef float v2f __attribute__ ((vector_size(8))); typedef signed short v4ss __attribute__ ((vector_size (8))); -void f() { +void test1() { v2s v1; v2u v2; v1s v3; @@ -39,7 +39,15 @@ void f() { } // PR2263 -float f2(__attribute__((vector_size(16))) float a, int b) { +float test2(__attribute__((vector_size(16))) float a, int b) { return a[b]; } +// PR4838 +typedef long long __attribute__((__vector_size__(2 * sizeof(long long)))) +longlongvec; + +void test3a(longlongvec *); +void test3(const unsigned *src) { + test3a(src); // expected-warning {{incompatible pointer types passing 'unsigned int const *', expected 'longlongvec *'}} +} diff --git a/test/Sema/vector-init.c b/test/Sema/vector-init.c index 6eab324..18104d8 100644 --- a/test/Sema/vector-init.c +++ b/test/Sema/vector-init.c @@ -21,3 +21,10 @@ float4 array3[2] = { {1.0, 2.0, 3.0}, 5.0, 6.0, 7.0, 8.0, __attribute__((vector_size(16))) // expected-error {{unsupported type 'float (void)' for vector_size attribute, please use on typedef}} float f1(void) { } + + + +// PR5265 +typedef float __attribute__((ext_vector_type (3))) float3; +int test2[(sizeof(float3) == sizeof(float4))*2-1]; + |