diff options
author | Uttam Pawar <uttamp@us.ibm.com> | 2004-12-14 18:43:57 +0000 |
---|---|---|
committer | Janis Johnson <janis@gcc.gnu.org> | 2004-12-14 18:43:57 +0000 |
commit | f90ac3f0e40f8d7876f8abecc782dd0befd4e2a6 (patch) | |
tree | e32f12da38d33977fc29fafc448d5db2d6c15cf6 /gcc/testsuite | |
parent | 29bfcb6de7ffe290a8944f067eaba33622bac5f2 (diff) | |
download | gcc-f90ac3f0e40f8d7876f8abecc782dd0befd4e2a6.zip gcc-f90ac3f0e40f8d7876f8abecc782dd0befd4e2a6.tar.gz gcc-f90ac3f0e40f8d7876f8abecc782dd0befd4e2a6.tar.bz2 |
rs6000.c (rs6000_handle_altivec_attribute_tree): Report errors for vector types with invalid component types.
* rs6000.c (rs6000_handle_altivec_attribute_tree): Report errors
for vector types with invalid component types.
testsuite:
* gcc.dg/altivec-types-1.c: New test.
* gcc.dg/altivec-types-2.c: New test.
* gcc.dg/altivec-types-3.c: New test.
* gcc.dg/altivec-types-4.c: New test.
* g++.dg/ext/altivec-types-1.C: New test.
* g++.dg/ext/altivec-types-2.C: New test.
* g++.dg/ext/altivec-types-3.C: New test.
* g++.dg/ext/altivec-types-4.C: New test.
Co-Authored-By: Janis Johnson <janis187@us.ibm.com>
From-SVN: r92154
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/altivec-types-1.C | 87 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/altivec-types-2.C | 13 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/altivec-types-3.C | 13 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/altivec-types-4.C | 14 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/altivec-types-1.c | 87 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/altivec-types-2.c | 13 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/altivec-types-3.c | 13 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/altivec-types-4.c | 14 |
9 files changed, 265 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 720506d..28cd86c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,14 @@ +2004-12-14 Janis Johnson <janis187@us.ibm.com + + * gcc.dg/altivec-types-1.c: New test. + * gcc.dg/altivec-types-2.c: New test. + * gcc.dg/altivec-types-3.c: New test. + * gcc.dg/altivec-types-4.c: New test. + * g++.dg/ext/altivec-types-1.C: New test. + * g++.dg/ext/altivec-types-2.C: New test. + * g++.dg/ext/altivec-types-3.C: New test. + * g++.dg/ext/altivec-types-4.C: New test. + 2004-12-14 Jakub Jelinek <jakub@redhat.com> PR middle-end/18951 diff --git a/gcc/testsuite/g++.dg/ext/altivec-types-1.C b/gcc/testsuite/g++.dg/ext/altivec-types-1.C new file mode 100644 index 0000000..9ebab95 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/altivec-types-1.C @@ -0,0 +1,87 @@ +/* { dg-do compile { target powerpc*-*-linux* } } */ +/* { dg-options "-maltivec" } */ + +/* Valid AltiVec vector types should be accepted with no warnings. */ + +__vector char vc; +__vector unsigned char vuc; +__vector signed char vsc; +__vector __bool char vbc; +__vector short vh; +__vector signed short vsh; +__vector unsigned short vuh; +__vector short int vhi; +__vector signed short int vshi; +__vector unsigned short int vuhi; +__vector __bool short vbh; +__vector __bool short int vbhi; +__vector int vi; +__vector unsigned int vui; +__vector signed int vsi; +__vector __bool int vbi; +__vector unsigned vuj; +__vector signed vsj; +__vector __bool vbj; +__vector float vf; + +/* These should be rejected as invalid AltiVec types. */ + +__vector bool vb; /* { dg-error "AltiVec types" "" } */ +__vector long long vll; /* { dg-error "AltiVec types" "" } */ +__vector unsigned long long vull; /* { dg-error "AltiVec types" "" } */ +__vector signed long long vsll; /* { dg-error "AltiVec types" "" } */ +__vector __bool long long vbll; /* { dg-error "AltiVec types" "" } */ +__vector long long int vlli; /* { dg-error "AltiVec types" "" } */ +__vector unsigned long long int vulli; /* { dg-error "AltiVec types" "" } */ +__vector signed long long int vslli; /* { dg-error "AltiVec types" "" } */ +__vector __bool long long int vblli; /* { dg-error "AltiVec types" "" } */ +__vector double vd1; /* { dg-error "AltiVec types" "" } */ +__vector long double vld; /* { dg-error "AltiVec types" "" } */ +__vector _Complex float vcf; /* { dg-error "AltiVec types" "" } */ +__vector _Complex double vcd; /* { dg-error "AltiVec types" "" } */ +__vector _Complex long double vcld; /* { dg-error "AltiVec types" "" } */ +__vector _Complex signed char vcsc; /* { dg-error "AltiVec types" "" } */ +__vector _Complex unsigned char vcuc; /* { dg-error "AltiVec types" "" } */ +__vector _Complex short vcss; /* { dg-error "AltiVec types" "" } */ +__vector _Complex unsigned short vcus; /* { dg-error "AltiVec types" "" } */ +__vector _Complex int vcsi; /* { dg-error "AltiVec types" "" } */ +__vector _Complex unsigned int vcui; /* { dg-error "AltiVec types" "" } */ +__vector _Complex long vcsl; /* { dg-error "AltiVec types" "" } */ +__vector _Complex unsigned long vcul; /* { dg-error "AltiVec types" "" } */ +__vector _Complex long long vcsll; /* { dg-error "AltiVec types" "" } */ +__vector _Complex unsigned long long vcull; /* { dg-error "AltiVec types" "" } */ +__vector __complex float v_cf; /* { dg-error "AltiVec types" "" } */ +__vector __complex double v_cd; /* { dg-error "AltiVec types" "" } */ +__vector __complex long double v_cld; /* { dg-error "AltiVec types" "" } */ +__vector __complex signed char v_csc; /* { dg-error "AltiVec types" "" } */ +__vector __complex unsigned char v_cuc; /* { dg-error "AltiVec types" "" } */ +__vector __complex short v_css; /* { dg-error "AltiVec types" "" } */ +__vector __complex unsigned short v_cus; /* { dg-error "AltiVec types" "" } */ +__vector __complex int v_csi; /* { dg-error "AltiVec types" "" } */ +__vector __complex unsigned int v_cui; /* { dg-error "AltiVec types" "" } */ +__vector __complex long v_csl; /* { dg-error "AltiVec types" "" } */ +__vector __complex unsigned long v_cul; /* { dg-error "AltiVec types" "" } */ +__vector __complex long long v_csll; /* { dg-error "AltiVec types" "" } */ +__vector __complex unsigned long long v_cull; /* { dg-error "AltiVec types" "" } */ + +/* These should be rejected because the component types are invalid. We + don't care about the actual error messages here. */ + +__vector __bool unsigned char vbuc; /* { dg-error "error" "" } */ +__vector __bool signed char vbsc; /* { dg-error "error" "" } */ +__vector __bool unsigned short vbuh; /* { dg-error "error" "" } */ +__vector __bool signed short vbsh; /* { dg-error "error" "" } */ +__vector __bool unsigned int vbui; /* { dg-error "error" "" } */ +__vector __bool signed int vbsi; /* { dg-error "error" "" } */ +__vector __bool unsigned vbuj; /* { dg-error "error" "" } */ +__vector __bool signed vbsj; /* { dg-error "error" "" } */ +__vector signed float vsf; /* { dg-error "error" "" } */ +__vector unsigned float vuf; /* { dg-error "error" "" } */ +__vector short float vsf; /* { dg-error "error" "" } */ +__vector signed double vsd; /* { dg-error "error" "" } */ +__vector unsigned double vud; /* { dg-error "error" "" } */ +__vector short double vsd; /* { dg-error "error" "" } */ +__vector __bool float vbf; /* { dg-error "error" "" } */ +__vector __bool double vbd; /* { dg-error "error" "" } */ +__vector __bool short float blf; /* { dg-error "error" "" } */ +__vector __bool short double vlbd; /* { dg-error "error" "" } */ diff --git a/gcc/testsuite/g++.dg/ext/altivec-types-2.C b/gcc/testsuite/g++.dg/ext/altivec-types-2.C new file mode 100644 index 0000000..4f4d3f3 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/altivec-types-2.C @@ -0,0 +1,13 @@ +/* { dg-do compile { target powerpc*-*-linux* } } */ +/* { dg-require-effective-target ilp32 } */ +/* { dg-options "-maltivec" } */ + +/* These should get warnings for 32-bit code. */ + +__vector long vl; /* { dg-warning "deprecated" "" } */ +__vector unsigned long vul; /* { dg-warning "deprecated" "" } */ +__vector signed long vsl; /* { dg-warning "deprecated" "" } */ +__vector __bool long int vbli; /* { dg-warning "deprecated" "" } */ +__vector long int vli; /* { dg-warning "deprecated" "" } */ +__vector unsigned long int vuli; /* { dg-warning "deprecated" "" } */ +__vector signed long int vsli; /* { dg-warning "deprecated" "" } */ diff --git a/gcc/testsuite/g++.dg/ext/altivec-types-3.C b/gcc/testsuite/g++.dg/ext/altivec-types-3.C new file mode 100644 index 0000000..42fd3ca --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/altivec-types-3.C @@ -0,0 +1,13 @@ +/* { dg-do compile { target powerpc*-*-linux* } } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-maltivec" } */ + +/* These should be rejected for 64-bit code. */ + +__vector long vl; /* { dg-error "invalid for 64" "" } */ +__vector unsigned long vul; /* { dg-error "invalid for 64" "" } */ +__vector signed long vsl; /* { dg-error "invalid for 64" "" } */ +__vector __bool long int vbli; /* { dg-error "invalid for 64" "" } */ +__vector long int vli; /* { dg-error "invalid for 64" "" } */ +__vector unsigned long int vuli; /* { dg-error "invalid for 64" "" } */ +__vector signed long int vsli; /* { dg-error "invalid for 64" "" } */ diff --git a/gcc/testsuite/g++.dg/ext/altivec-types-4.C b/gcc/testsuite/g++.dg/ext/altivec-types-4.C new file mode 100644 index 0000000..bc2296c --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/altivec-types-4.C @@ -0,0 +1,14 @@ +/* { dg-do compile { target powerpc*-*-linux* } } */ +/* { dg-require-effective-target ilp32 } */ +/* { dg-options "-maltivec -mno-warn-altivec-long" } */ + +/* These should not get warnings for 32-bit code when the warning is + disabled. */ + +__vector long vl; +__vector unsigned long vul; +__vector signed long vsl; +__vector __bool long int vbli; +__vector long int vli; +__vector unsigned long int vuli; +__vector signed long int vsli; diff --git a/gcc/testsuite/gcc.dg/altivec-types-1.c b/gcc/testsuite/gcc.dg/altivec-types-1.c new file mode 100644 index 0000000..0772abc --- /dev/null +++ b/gcc/testsuite/gcc.dg/altivec-types-1.c @@ -0,0 +1,87 @@ +/* { dg-do compile { target powerpc*-*-linux* } } */ +/* { dg-options "-maltivec" } */ + +/* Valid AltiVec vector types should be accepted with no warnings. */ + +__vector char vc; +__vector unsigned char vuc; +__vector signed char vsc; +__vector __bool char vbc; +__vector short vh; +__vector signed short vsh; +__vector unsigned short vuh; +__vector short int vhi; +__vector signed short int vshi; +__vector unsigned short int vuhi; +__vector __bool short vbh; +__vector __bool short int vbhi; +__vector int vi; +__vector unsigned int vui; +__vector signed int vsi; +__vector __bool int vbi; +__vector unsigned vuj; +__vector signed vsj; +__vector __bool vbj; +__vector float vf; + +/* These should be rejected as invalid AltiVec types. */ + +__vector long long vll; /* { dg-error "AltiVec types" "" } */ +__vector unsigned long long vull; /* { dg-error "AltiVec types" "" } */ +__vector signed long long vsll; /* { dg-error "AltiVec types" "" } */ +__vector __bool long long vbll; /* { dg-error "AltiVec types" "" } */ +__vector long long int vlli; /* { dg-error "AltiVec types" "" } */ +__vector unsigned long long int vulli; /* { dg-error "AltiVec types" "" } */ +__vector signed long long int vslli; /* { dg-error "AltiVec types" "" } */ +__vector __bool long long int vblli; /* { dg-error "AltiVec types" "" } */ +__vector double vd1; /* { dg-error "AltiVec types" "" } */ +__vector long double vld; /* { dg-error "AltiVec types" "" } */ +__vector _Bool vb; /* { dg-error "AltiVec types" "" } */ +__vector _Complex float vcf; /* { dg-error "AltiVec types" "" } */ +__vector _Complex double vcd; /* { dg-error "AltiVec types" "" } */ +__vector _Complex long double vcld; /* { dg-error "AltiVec types" "" } */ +__vector _Complex signed char vcsc; /* { dg-error "AltiVec types" "" } */ +__vector _Complex unsigned char vcuc; /* { dg-error "AltiVec types" "" } */ +__vector _Complex short vcss; /* { dg-error "AltiVec types" "" } */ +__vector _Complex unsigned short vcus; /* { dg-error "AltiVec types" "" } */ +__vector _Complex int vcsi; /* { dg-error "AltiVec types" "" } */ +__vector _Complex unsigned int vcui; /* { dg-error "AltiVec types" "" } */ +__vector _Complex long vcsl; /* { dg-error "AltiVec types" "" } */ +__vector _Complex unsigned long vcul; /* { dg-error "AltiVec types" "" } */ +__vector _Complex long long vcsll; /* { dg-error "AltiVec types" "" } */ +__vector _Complex unsigned long long vcull; /* { dg-error "AltiVec types" "" } */ +__vector __complex float v_cf; /* { dg-error "AltiVec types" "" } */ +__vector __complex double v_cd; /* { dg-error "AltiVec types" "" } */ +__vector __complex long double v_cld; /* { dg-error "AltiVec types" "" } */ +__vector __complex signed char v_csc; /* { dg-error "AltiVec types" "" } */ +__vector __complex unsigned char v_cuc; /* { dg-error "AltiVec types" "" } */ +__vector __complex short v_css; /* { dg-error "AltiVec types" "" } */ +__vector __complex unsigned short v_cus; /* { dg-error "AltiVec types" "" } */ +__vector __complex int v_csi; /* { dg-error "AltiVec types" "" } */ +__vector __complex unsigned int v_cui; /* { dg-error "AltiVec types" "" } */ +__vector __complex long v_csl; /* { dg-error "AltiVec types" "" } */ +__vector __complex unsigned long v_cul; /* { dg-error "AltiVec types" "" } */ +__vector __complex long long v_csll; /* { dg-error "AltiVec types" "" } */ +__vector __complex unsigned long long v_cull; /* { dg-error "AltiVec types" "" } */ + +/* These should be rejected because the component types are invalid. We + don't care about the actual error messages here. */ + +__vector __bool unsigned char vbuc; /* { dg-error "error" "" } */ +__vector __bool signed char vbsc; /* { dg-error "error" "" } */ +__vector __bool unsigned short vbuh; /* { dg-error "error" "" } */ +__vector __bool signed short vbsh; /* { dg-error "error" "" } */ +__vector __bool unsigned int vbui; /* { dg-error "error" "" } */ +__vector __bool signed int vbsi; /* { dg-error "error" "" } */ +__vector __bool unsigned vbuj; /* { dg-error "error" "" } */ +__vector __bool signed vbsj; /* { dg-error "error" "" } */ +__vector signed float vsf; /* { dg-error "error" "" } */ +__vector unsigned float vuf; /* { dg-error "error" "" } */ +__vector short float vsf; /* { dg-error "error" "" } */ +__vector signed double vsd; /* { dg-error "error" "" } */ +__vector unsigned double vud; /* { dg-error "error" "" } */ +__vector short double vsd; /* { dg-error "error" "" } */ +__vector __bool float vbf; /* { dg-error "error" "" } */ +__vector __bool double vbd; /* { dg-error "error" "" } */ +__vector __bool short float blf; /* { dg-error "error" "" } */ +__vector __bool short double vlbd; /* { dg-error "error" "" } */ diff --git a/gcc/testsuite/gcc.dg/altivec-types-2.c b/gcc/testsuite/gcc.dg/altivec-types-2.c new file mode 100644 index 0000000..4f4d3f3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/altivec-types-2.c @@ -0,0 +1,13 @@ +/* { dg-do compile { target powerpc*-*-linux* } } */ +/* { dg-require-effective-target ilp32 } */ +/* { dg-options "-maltivec" } */ + +/* These should get warnings for 32-bit code. */ + +__vector long vl; /* { dg-warning "deprecated" "" } */ +__vector unsigned long vul; /* { dg-warning "deprecated" "" } */ +__vector signed long vsl; /* { dg-warning "deprecated" "" } */ +__vector __bool long int vbli; /* { dg-warning "deprecated" "" } */ +__vector long int vli; /* { dg-warning "deprecated" "" } */ +__vector unsigned long int vuli; /* { dg-warning "deprecated" "" } */ +__vector signed long int vsli; /* { dg-warning "deprecated" "" } */ diff --git a/gcc/testsuite/gcc.dg/altivec-types-3.c b/gcc/testsuite/gcc.dg/altivec-types-3.c new file mode 100644 index 0000000..42fd3ca --- /dev/null +++ b/gcc/testsuite/gcc.dg/altivec-types-3.c @@ -0,0 +1,13 @@ +/* { dg-do compile { target powerpc*-*-linux* } } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-maltivec" } */ + +/* These should be rejected for 64-bit code. */ + +__vector long vl; /* { dg-error "invalid for 64" "" } */ +__vector unsigned long vul; /* { dg-error "invalid for 64" "" } */ +__vector signed long vsl; /* { dg-error "invalid for 64" "" } */ +__vector __bool long int vbli; /* { dg-error "invalid for 64" "" } */ +__vector long int vli; /* { dg-error "invalid for 64" "" } */ +__vector unsigned long int vuli; /* { dg-error "invalid for 64" "" } */ +__vector signed long int vsli; /* { dg-error "invalid for 64" "" } */ diff --git a/gcc/testsuite/gcc.dg/altivec-types-4.c b/gcc/testsuite/gcc.dg/altivec-types-4.c new file mode 100644 index 0000000..bc2296c --- /dev/null +++ b/gcc/testsuite/gcc.dg/altivec-types-4.c @@ -0,0 +1,14 @@ +/* { dg-do compile { target powerpc*-*-linux* } } */ +/* { dg-require-effective-target ilp32 } */ +/* { dg-options "-maltivec -mno-warn-altivec-long" } */ + +/* These should not get warnings for 32-bit code when the warning is + disabled. */ + +__vector long vl; +__vector unsigned long vul; +__vector signed long vsl; +__vector __bool long int vbli; +__vector long int vli; +__vector unsigned long int vuli; +__vector signed long int vsli; |