OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [c-c++-common/] [dfp/] [func-vararg-size0.c] - Blame information for rev 295

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 295 jeremybenn
/* C99 6.5.2.2 Function calls.  */
2
 
3
#include <stdarg.h>
4
#include "dfp-dbg.h"
5
 
6
struct S1
7
{
8
  struct
9
  {
10
    _Decimal64 e;
11
  } b[0];
12
};
13
 
14
/* Test handling vararg parameters whose size is 0.  */
15
 
16
int check_var(int z,...)
17
{
18
  double d;
19
  struct S1 s1;
20
  long long result;
21
  va_list ap;
22
  va_start (ap, z);
23
  d = va_arg (ap, double);
24
  s1 = va_arg (ap, struct S1);
25
  result = va_arg (ap, long long);
26
  va_end (ap);
27
  return (result == 2LL);
28
 
29
}
30
 
31
int
32
main ()
33
{
34
  struct S1 s1;
35
  struct S1 a1[5];
36
 
37
  if (check_var(5, 1.0, s1, 2LL, a1[2], a1[2]) == 0)
38
    FAILURE
39
 
40
  FINISH
41
}

powered by: WebSVN 2.1.0

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