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

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gcc.dg/] [compat/] [struct-by-value-22_y.c] - Blame information for rev 384

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
#include <stdarg.h>
2
#include "compat-common.h"
3
#include "mixed-struct-defs.h"
4
#include "mixed-struct-check.h"
5
 
6
#ifdef SKIP_VA
7
const int test_va = 0;
8
#else
9
const int test_va = 1;
10
#endif
11
 
12
#ifndef SKIP_VLA_IN_STRUCT
13
#define T(NAME, FIELDS, TYPE, FIELDINIT, FIELDTEST)                     \
14
void                                                                    \
15
testva##NAME (int n, ...)                                               \
16
{                                                                       \
17
  va_list ap;                                                           \
18
  if (test_va)                                                          \
19
    {                                                                   \
20
      struct S { FIELDS TYPE a[n]; } s;                                 \
21
      int fail = 0, i, j;                                                \
22
                                                                        \
23
      va_start (ap, n);                                                 \
24
      for (j = 0; j < 2; ++j)                                            \
25
        {                                                               \
26
          s = va_arg (ap, struct S);                                    \
27
          for (i = 0; i < n; ++i)                                        \
28
            if (s.a[i] != 12 + n - i)                                   \
29
              ++fail;                                                   \
30
          if (fail)                                                     \
31
            { DEBUG_FAIL; }                                             \
32
          if (!j && va_arg (ap, int) != n)                              \
33
            { DEBUG_FAIL; }                                             \
34
          FIELDTEST;                                                    \
35
        }                                                               \
36
      va_end (ap);                                                      \
37
    }                                                                   \
38
}
39
 
40
#include "struct-by-value-22_x.c"
41
#endif

powered by: WebSVN 2.1.0

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