diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-07-13 17:21:42 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-07-13 17:21:42 +0000 |
commit | 1928da94b55683957759d5c5ff4593a118773394 (patch) | |
tree | 48b44512b5db8ced345df4a1a56b5065cf2a14d9 /test/Parser/cxx-altivec.cpp | |
parent | 53992adde3eda3ccf9da63bc7e45673f043de18f (diff) | |
download | FreeBSD-src-1928da94b55683957759d5c5ff4593a118773394.zip FreeBSD-src-1928da94b55683957759d5c5ff4593a118773394.tar.gz |
Update clang to r108243.
Diffstat (limited to 'test/Parser/cxx-altivec.cpp')
-rw-r--r-- | test/Parser/cxx-altivec.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/test/Parser/cxx-altivec.cpp b/test/Parser/cxx-altivec.cpp index 66d4f32..a70eea0 100644 --- a/test/Parser/cxx-altivec.cpp +++ b/test/Parser/cxx-altivec.cpp @@ -1,5 +1,4 @@ // RUN: %clang_cc1 -triple=powerpc-apple-darwin8 -faltivec -fsyntax-only -verify %s -// This is the same as the C version: __vector char vv_c; __vector signed char vv_sc; @@ -14,7 +13,9 @@ __vector int vv_i; __vector signed int vv_sint; __vector unsigned int vv_ui; __vector float vv_f; -__vector bool vv_b; +__vector bool char vv_bc; +__vector bool short vv_bs; +__vector bool int vv_bi; __vector __pixel vv_p; __vector pixel vv__p; __vector int vf__r(); @@ -34,7 +35,9 @@ vector int v_i; vector signed int v_sint; vector unsigned int v_ui; vector float v_f; -vector bool v_b; +vector bool char v_bc; +vector bool short v_bs; +vector bool int v_bi; vector __pixel v_p; vector pixel v__p; vector int f__r(); @@ -64,6 +67,14 @@ __vector double vv_d1; // expected-error {{cannot use 'double' wit vector double v_d2; // expected-error {{cannot use 'double' with '__vector'}} __vector long double vv_ld3; // expected-warning {{Use of 'long' with '__vector' is deprecated}} expected-error {{cannot use 'double' with '__vector'}} vector long double v_ld4; // expected-warning {{Use of 'long' with '__vector' is deprecated}} expected-error {{cannot use 'double' with '__vector'}} +vector bool v_b; // expected-error {{error: C++ requires a type specifier for all declarations}} +vector bool float v_bf; // expected-error {{cannot use 'float' with '__vector bool'}} +vector bool double v_bd; // expected-error {{cannot use 'double' with '__vector bool'}} +vector bool pixel v_bp; // expected-error {{cannot use '__pixel' with '__vector bool'}} +vector bool signed char v_bsc; // expected-error {{cannot use 'signed' with '__vector bool'}} +vector bool unsigned int v_bsc2; // expected-error {{cannot use 'unsigned' with '__vector bool'}} +vector bool long v_bl; // expected-error {{cannot use 'long' with '__vector bool'}} +vector bool long long v_bll; // expected-error {{cannot use 'long long' with '__vector bool'}} void f() { __vector unsigned int v = {0,0,0,0}; @@ -107,3 +118,11 @@ class c_v { void f__a2(int b, vector int a); }; + +// bug 6895 - Vectorl literal casting confusion. +vector char v1 = (vector char)((vector int)(1, 2, 3, 4)); +vector char v2 = (vector char)((vector float)(1.0f, 2.0f, 3.0f, 4.0f)); +vector char v3 = (vector char)((vector int)('a', 'b', 'c', 'd')); +vector int v4 = (vector int)(1, 2, 3, 4); +vector float v5 = (vector float)(1.0f, 2.0f, 3.0f, 4.0f); +vector char v6 = (vector char)((vector int)(1+2, -2, (int)(2.0 * 3), -(5-3))); |