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.target/] [x86_64/] [abi/] [callabi/] [vaarg-3.c] - Blame information for rev 328

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 328 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 fct1 (CROSS_VA_LIST argp, ...)
14
{
15
  long long p1,p2;
16
  int ret = 1;
17
  va_list argp_2;
18
 
19
    __va_start (argp_2,argp);
20
  do {
21
    p1 = __va_arg (argp_2, long long);
22
    p2 = CROSS_VA_ARG (argp, long long);
23
    if (p1 != p2)
24
      ret = 0;
25
  } while (ret && p1 != 0);
26
  __va_end (argp_2);
27
  return ret;
28
}
29
 
30
static
31
int CALLABI_CROSS fct2 (int dummy, ...)
32
{
33
  CROSS_VA_LIST argp;
34
  int ret = dummy;
35
 
36
  CROSS_VA_START (argp, dummy);
37
  ret += fct1 (argp, SZ_ARGS);
38
  CROSS_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.