2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / darwin-abi-2.c
blob81da83c424fe2909cb9c50ab494f65147ba98756
1 /* { dg-do run { target powerpc*-*-darwin* } } */
3 /* You might think you'd need -maltivec for this, but actually you
4 don't; GCC will happily do everything in GPRs, and it still
5 tests that the ABI is correct. */
7 #include <stdio.h>
9 #define vector __attribute__((vector_size(16)))
11 int main(void)
13 vector unsigned int v = { 100, 200, 300, 400 };
14 vector unsigned int w = { 4, 5, 6, 7 };
15 char x[64];
16 sprintf (x, "%lvu,%d,%lvu", v, 1, w);
17 if (strcmp (x, "100 200 300 400,1,4 5 6 7") != 0)
19 puts (x);
20 abort ();
22 return 0;