aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.apple/apple-altivec-6.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.apple/apple-altivec-6.c')
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-6.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-6.c b/gcc/testsuite/gcc.apple/apple-altivec-6.c
new file mode 100644
index 00000000000..09e1f6861bf
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/apple-altivec-6.c
@@ -0,0 +1,31 @@
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-maltivec" } */
+
+#include <altivec.h>
+
+extern void abort();
+
+int main()
+{
+ vector unsigned int tiny = (vector unsigned int) ((vector signed int) (0x00800000, 0xBF800000, 0x3E800000, 0));
+ unsigned int af[4] = {
+ (signed int)0x00800000,
+ (signed int)0xBF800000,
+ (signed int)0x3E800000,
+ (signed int)0};
+
+ union u {
+ vector unsigned int vf;
+ unsigned int ai[4];
+ }vu;
+ int i;
+
+ vu.vf = tiny;
+
+ for (i=0; i < 4; i++)
+ if (af[i] != vu.ai[i])
+ abort();
+
+ return 0;
+}
+