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] - Blame information for rev 301

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

Line No. Rev Author Line
1 297 jeremybenn
/* Varargs and vectors!  */
2
 
3
#include <stdarg.h>
4
#include <limits.h>
5
 
6
#define vector __attribute__((vector_size(16)))
7
 
8
const vector unsigned int v1 = {10,11,12,13};
9
const vector unsigned int v2 = {20,21,22,23};
10
 
11
void foo(int a, ...)
12
{
13
  va_list args;
14
  vector unsigned int v;
15
 
16
  va_start (args, a);
17
  v = va_arg (args, vector unsigned int);
18
  if (a != 1 || memcmp (&v, &v1, sizeof (v)) != 0)
19
    abort ();
20
  a = va_arg (args, int);
21
  if (a != 2)
22
    abort ();
23
  v = va_arg (args, vector unsigned int);
24
  if (memcmp (&v, &v2, sizeof (v)) != 0)
25
    abort ();
26
  va_end (args);
27
}
28
 
29
int main(void)
30
{
31
#if INT_MAX == 2147483647
32
  foo (1, (vector unsigned int){10,11,12,13}, 2,
33
       (vector unsigned int){20,21,22,23});
34
#endif
35
  return 0;
36
}
37
 

powered by: WebSVN 2.1.0

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