summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr25559.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2006-01-04 08:07:09 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2006-01-04 08:07:09 +0000
commit39cc3e6db49658d78cf2f69b62d8307c6785149a (patch)
tree3cac5cc0fee67f928ce2528c8de83b7102ca5f10 /gcc/testsuite/gcc.dg/pr25559.c
parent9338678e8a336a8fb58dbdd27f407cc467a90faa (diff)
downloadgcc-39cc3e6db49658d78cf2f69b62d8307c6785149a.tar.gz
PR c/25559
* c-common.c (handle_vector_size_attribute): Reject zero vector size as well as sizes not multiple of component size. * gcc.dg/pr25559.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109316 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr25559.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr25559.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr25559.c b/gcc/testsuite/gcc.dg/pr25559.c
new file mode 100644
index 00000000000..7879a1558b6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr25559.c
@@ -0,0 +1,10 @@
+/* PR c/25559 */
+/* { dg-do compile } */
+
+#define vs(n) __attribute__((vector_size (n)))
+int vs (-1) a; /* { dg-warning "attribute ignored" } */
+int vs (0) b; /* { dg-error "zero vector size" } */
+int vs (1) c; /* { dg-error "multiple of component size" } */
+int vs (sizeof (int) / 2) d; /* { dg-error "multiple of component size" } */
+int vs (sizeof (int)) e;
+int vs (sizeof (int) * 2) f;