1 /* { dg-do run { target powerpc*-*-* } } */
2 /* { dg-xfail-if "" { "powerpc-*-eabispe*" "powerpc-ibm-aix*" } { "*" } { "" } } */
3 /* { dg-options "-maltivec -mabi=altivec -fno-inline" } */
8 #include "altivec_check.h"
10 #define vector __attribute__((vector_size (16)))
12 const vector
unsigned int v1
= {10,11,12,13};
13 const vector
unsigned int v2
= {20,21,22,23};
14 const vector
unsigned int v3
= {30,31,32,33};
15 const vector
unsigned int v4
= {40,41,42,43};
17 void foo(vector
unsigned int a
, ...)
20 vector
unsigned int v
;
23 if (memcmp (&a
, &v1
, sizeof (v
)) != 0)
25 v
= va_arg (args
, vector
unsigned int);
26 if (memcmp (&v
, &v2
, sizeof (v
)) != 0)
28 v
= va_arg (args
, vector
unsigned int);
29 if (memcmp (&v
, &v3
, sizeof (v
)) != 0)
31 v
= va_arg (args
, vector
unsigned int);
32 if (memcmp (&v
, &v4
, sizeof (v
)) != 0)
37 void bar(vector
unsigned int a
, ...)
40 vector
unsigned int v
;
44 if (memcmp (&a
, &v1
, sizeof (v
)) != 0)
46 b
= va_arg (args
, int);
49 v
= va_arg (args
, vector
unsigned int);
50 if (memcmp (&v
, &v2
, sizeof (v
)) != 0)
52 v
= va_arg (args
, vector
unsigned int);
53 if (memcmp (&v
, &v3
, sizeof (v
)) != 0)
61 /* In this call, in the Darwin ABI, the first argument goes into v2
62 the second one into r9-r10 and memory,
63 and the next two in memory. */
64 foo ((vector
unsigned int){10,11,12,13},
65 (vector
unsigned int){20,21,22,23},
66 (vector
unsigned int){30,31,32,33},
67 (vector
unsigned int){40,41,42,43});
68 /* In this call, in the Darwin ABI, the first argument goes into v2
69 the second one into r9, then r10 is reserved and
70 there are two words of padding in memory, and the next two arguments
71 go after the padding. */
72 bar ((vector
unsigned int){10,11,12,13}, 2,
73 (vector
unsigned int){20,21,22,23},
74 (vector
unsigned int){30,31,32,33});
80 /* Exit on systems without AltiVec. */