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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [x86_64/] [abi/] [callabi/] [vaarg-2.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 691 jeremybenn
/* Test for cross x86_64<->w64 abi va_list calls.
2
*/
3
/* Origin: Kai Tietz <kai.tietz@onevision.com> */
4
/* { dg-do run } */
5
/* { dg-options "-std=gnu99" } */
6
#include "callabi.h"
7
 
8
extern void abort (void);
9
 
10
#define SZ_ARGS 1ll,2ll,3ll,4ll,5ll,6ll,7ll,0ll
11
 
12
static
13
int CALLABI_CROSS fct1 (va_list argp, ...)
14
{
15
  long long p1,p2;
16
  int ret = 1;
17
  CROSS_VA_LIST argp_2;
18
  CROSS_VA_START (argp_2,argp);
19
 
20
  do {
21
    p1 = CROSS_VA_ARG (argp_2, long long);
22
    p2 = __va_arg (argp, long long);
23
    if (p1 != p2)
24
      ret = 0;
25
  } while (ret && p1 != 0);
26
  CROSS_VA_END (argp_2);
27
  return ret;
28
}
29
 
30
static
31
int fct2 (int dummy, ...)
32
{
33
  va_list argp;
34
  int ret = dummy;
35
 
36
  __va_start (argp, dummy);
37
  ret += fct1 (argp, SZ_ARGS);
38
  __va_end (argp);
39
  return ret;
40
}
41
 
42
int main()
43
{
44
  if (fct2 (-1, SZ_ARGS) != 0)
45
    abort ();
46
  return 0;
47
}

powered by: WebSVN 2.1.0

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