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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.dg/] [compat/] [struct-by-value-22_y.c] - Diff between revs 298 and 338

Only display areas with differences | Details | Blame | View Log

Rev 298 Rev 338
#include <stdarg.h>
#include <stdarg.h>
#include "compat-common.h"
#include "compat-common.h"
#include "mixed-struct-defs.h"
#include "mixed-struct-defs.h"
#include "mixed-struct-check.h"
#include "mixed-struct-check.h"
 
 
#ifdef SKIP_VA
#ifdef SKIP_VA
const int test_va = 0;
const int test_va = 0;
#else
#else
const int test_va = 1;
const int test_va = 1;
#endif
#endif
 
 
#ifndef SKIP_VLA_IN_STRUCT
#ifndef SKIP_VLA_IN_STRUCT
#define T(NAME, FIELDS, TYPE, FIELDINIT, FIELDTEST)                     \
#define T(NAME, FIELDS, TYPE, FIELDINIT, FIELDTEST)                     \
void                                                                    \
void                                                                    \
testva##NAME (int n, ...)                                               \
testva##NAME (int n, ...)                                               \
{                                                                       \
{                                                                       \
  va_list ap;                                                           \
  va_list ap;                                                           \
  if (test_va)                                                          \
  if (test_va)                                                          \
    {                                                                   \
    {                                                                   \
      struct S { FIELDS TYPE a[n]; } s;                                 \
      struct S { FIELDS TYPE a[n]; } s;                                 \
      int fail = 0, i, j;                                                \
      int fail = 0, i, j;                                                \
                                                                        \
                                                                        \
      va_start (ap, n);                                                 \
      va_start (ap, n);                                                 \
      for (j = 0; j < 2; ++j)                                            \
      for (j = 0; j < 2; ++j)                                            \
        {                                                               \
        {                                                               \
          s = va_arg (ap, struct S);                                    \
          s = va_arg (ap, struct S);                                    \
          for (i = 0; i < n; ++i)                                        \
          for (i = 0; i < n; ++i)                                        \
            if (s.a[i] != 12 + n - i)                                   \
            if (s.a[i] != 12 + n - i)                                   \
              ++fail;                                                   \
              ++fail;                                                   \
          if (fail)                                                     \
          if (fail)                                                     \
            { DEBUG_FAIL; }                                             \
            { DEBUG_FAIL; }                                             \
          if (!j && va_arg (ap, int) != n)                              \
          if (!j && va_arg (ap, int) != n)                              \
            { DEBUG_FAIL; }                                             \
            { DEBUG_FAIL; }                                             \
          FIELDTEST;                                                    \
          FIELDTEST;                                                    \
        }                                                               \
        }                                                               \
      va_end (ap);                                                      \
      va_end (ap);                                                      \
    }                                                                   \
    }                                                                   \
}
}
 
 
#include "struct-by-value-22_x.c"
#include "struct-by-value-22_x.c"
#endif
#endif
 
 

powered by: WebSVN 2.1.0

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