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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [dfp/] [func-vararg-size0.c] - Blame information for rev 154

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

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

powered by: WebSVN 2.1.0

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