OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [va-arg-25.c] - Rev 301

Go to most recent revision | Compare with Previous | Blame | View Log

/* Varargs and vectors!  */
 
#include <stdarg.h>
#include <limits.h>
 
#define vector __attribute__((vector_size(16)))
 
const vector unsigned int v1 = {10,11,12,13};
const vector unsigned int v2 = {20,21,22,23};
 
void foo(int a, ...)
{
  va_list args;
  vector unsigned int v;
 
  va_start (args, a);
  v = va_arg (args, vector unsigned int);
  if (a != 1 || memcmp (&v, &v1, sizeof (v)) != 0)
    abort ();
  a = va_arg (args, int);
  if (a != 2)
    abort ();
  v = va_arg (args, vector unsigned int);
  if (memcmp (&v, &v2, sizeof (v)) != 0)
    abort ();
  va_end (args);
}
 
int main(void)
{
#if INT_MAX == 2147483647
  foo (1, (vector unsigned int){10,11,12,13}, 2,
       (vector unsigned int){20,21,22,23});
#endif
  return 0;
}
 
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.