aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.apple/altivec-4.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.apple/altivec-4.c')
-rw-r--r--gcc/testsuite/gcc.apple/altivec-4.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.apple/altivec-4.c b/gcc/testsuite/gcc.apple/altivec-4.c
new file mode 100644
index 00000000000..c81cc7676aa
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/altivec-4.c
@@ -0,0 +1,23 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-faltivec" } */
+
+extern void abort();
+
+#include <stdio.h>
+int main()
+{
+ int i;
+ union u {
+ vector signed short uv;
+ signed short val[8];
+ } v;
+
+ vector signed short SpecialConstants = (vector signed short)( 1, 2, 3, 4, 5, 6,7,8);
+ v.uv = SpecialConstants;
+ for (i=0; i < 8; i++)
+ if (v.val[i] != i+1)
+ abort();
+ return 0;
+}
+