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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [compat/] [struct-by-value-22_y.c] - Blame information for rev 149

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

Line No. Rev Author Line
1 149 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
#define T(NAME, FIELDS, TYPE, FIELDINIT, FIELDTEST)                     \
13
void                                                                    \
14
testva##NAME (int n, ...)                                               \
15
{                                                                       \
16
  va_list ap;                                                           \
17
  if (test_va)                                                          \
18
    {                                                                   \
19
      struct S { FIELDS TYPE a[n]; } s;                                 \
20
      int fail = 0, i, j;                                                \
21
                                                                        \
22
      va_start (ap, n);                                                 \
23
      for (j = 0; j < 2; ++j)                                            \
24
        {                                                               \
25
          s = va_arg (ap, struct S);                                    \
26
          for (i = 0; i < n; ++i)                                        \
27
            if (s.a[i] != 12 + n - i)                                   \
28
              ++fail;                                                   \
29
          if (fail)                                                     \
30
            { DEBUG_FAIL; }                                             \
31
          if (!j && va_arg (ap, int) != n)                              \
32
            { DEBUG_FAIL; }                                             \
33
          FIELDTEST;                                                    \
34
        }                                                               \
35
      va_end (ap);                                                      \
36
    }                                                                   \
37
}
38
 
39
#include "struct-by-value-22_x.c"

powered by: WebSVN 2.1.0

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