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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [va-arg-25.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 689 jeremybenn
/* Varargs and vectors!  */
2
 
3
/* { dg-do run } */
4
/* { dg-options "-msse" { target { i?86-*-* x86_64-*-* } } } */
5
/* { dg-require-effective-target sse_runtime { target { i?86-*-* x86_64-*-* } } } */
6
/* { dg-options "-mabi=altivec -maltivec" { target { powerpc-*-* powerpc64-*-* } } } */
7
/* { dg-require-effective-target vmx_hw { target { powerpc-*-* powerpc64--*-* } } } */
8
 
9
#include <stdarg.h>
10
#include <stdlib.h>
11
#include <limits.h>
12
 
13
#define vector __attribute__((vector_size(16)))
14
 
15
const vector unsigned int v1 = {10,11,12,13};
16
const vector unsigned int v2 = {20,21,22,23};
17
 
18
void foo(int a, ...)
19
{
20
  va_list args;
21
  vector unsigned int v;
22
 
23
  va_start (args, a);
24
  v = va_arg (args, vector unsigned int);
25
  if (a != 1 || memcmp (&v, &v1, sizeof (v)) != 0)
26
    abort ();
27
  a = va_arg (args, int);
28
  if (a != 2)
29
    abort ();
30
  v = va_arg (args, vector unsigned int);
31
  if (memcmp (&v, &v2, sizeof (v)) != 0)
32
    abort ();
33
  va_end (args);
34
}
35
 
36
int main(void)
37
{
38
#if INT_MAX == 2147483647
39
  foo (1, (vector unsigned int){10,11,12,13}, 2,
40
       (vector unsigned int){20,21,22,23});
41
#endif
42
  return 0;
43
}
44
 

powered by: WebSVN 2.1.0

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