OSDN Git Service

new
authoraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 7 Dec 2001 18:52:06 +0000 (18:52 +0000)
committeraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 7 Dec 2001 18:52:06 +0000 (18:52 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47765 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/gcc.dg/altivec-2.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/altivec-2.c b/gcc/testsuite/gcc.dg/altivec-2.c
new file mode 100644 (file)
index 0000000..596a414
--- /dev/null
@@ -0,0 +1,38 @@
+/* { dg-do compile { target powerpc-*-* } } */
+/* { dg-options "-maltivec" } */
+
+/* Program to test the vector_size attribute.  This needs to run on a
+   target that has vectors, so use AltiVec.  */
+
+#define vector __attribute__((vector_size(16)))
+
+vector int foobar;
+
+/* Only floats and integrals allowed.  We don't care if they map to SIs.  */
+struct X { int frances; };
+vector struct X hotdog;        /* { dg-bogus "invalid vector type" "case 1" } */
+
+/* We don't have a V2DF.  */
+vector double x;       /* { dg-bogus "no vector mode" "case 2" } */
+
+/* Arrays of vectors.  */
+vector char b[10], ouch;
+
+/* Pointers of vectors.  */
+vector short *shoe, polish;
+
+int xxx[sizeof(foobar) == 16 ? 69 : -1];
+
+int nc17[sizeof(shoe) == sizeof (char *) ? 69 : -1];
+
+code ()
+{
+  *shoe = polish;
+  b[1] = ouch;
+}
+
+vector short
+hoop ()
+{
+  return polish;
+}