1 /* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
2 /* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
3 /* { dg-require-effective-target powerpc_altivec_ok } */
4 /* { dg-options "-maltivec -mabi=altivec -fno-inline" } */
8 extern void exit (int);
9 extern void abort (void);
10 extern int memcmp (const void *, const void *, __SIZE_TYPE__
);
12 #define vector __attribute__((vector_size (16)))
14 const vector
unsigned int v1
= {10,11,12,13};
15 const vector
unsigned int v2
= {20,21,22,23};
16 const vector
unsigned int v3
= {30,31,32,33};
17 const vector
unsigned int v4
= {40,41,42,43};
19 void foo(vector
unsigned int a
, ...)
22 vector
unsigned int v
;
25 if (memcmp (&a
, &v1
, sizeof (v
)) != 0)
27 v
= va_arg (args
, vector
unsigned int);
28 if (memcmp (&v
, &v2
, sizeof (v
)) != 0)
30 v
= va_arg (args
, vector
unsigned int);
31 if (memcmp (&v
, &v3
, sizeof (v
)) != 0)
33 v
= va_arg (args
, vector
unsigned int);
34 if (memcmp (&v
, &v4
, sizeof (v
)) != 0)
39 void bar(vector
unsigned int a
, ...)
42 vector
unsigned int v
;
46 if (memcmp (&a
, &v1
, sizeof (v
)) != 0)
48 b
= va_arg (args
, int);
51 v
= va_arg (args
, vector
unsigned int);
52 if (memcmp (&v
, &v2
, sizeof (v
)) != 0)
54 v
= va_arg (args
, vector
unsigned int);
55 if (memcmp (&v
, &v3
, sizeof (v
)) != 0)
63 /* In this call, in the Darwin ABI, the first argument goes into v2
64 the second one into r9-r10 and memory,
65 and the next two in memory. */
66 foo ((vector
unsigned int){10,11,12,13},
67 (vector
unsigned int){20,21,22,23},
68 (vector
unsigned int){30,31,32,33},
69 (vector
unsigned int){40,41,42,43});
70 /* In this call, in the Darwin ABI, the first argument goes into v2
71 the second one into r9, then r10 is reserved and
72 there are two words of padding in memory, and the next two arguments
73 go after the padding. */
74 bar ((vector
unsigned int){10,11,12,13}, 2,
75 (vector
unsigned int){20,21,22,23},
76 (vector
unsigned int){30,31,32,33});