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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [compat/] [struct-align-2_y.c] - Blame information for rev 298

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

Line No. Rev Author Line
1 298 jeremybenn
/* Disable this test for 16-bit targets.  */
2
 
3
#include <limits.h>
4
 
5
#if !(defined __GNUC__) || (INT_MAX > 32767)
6
 
7
#include "compat-common.h"
8
#include "struct-align-2.h"
9
 
10
#define TEST(NAME)                                              \
11
struct outer_##NAME {                                           \
12
  int i;                                                        \
13
  struct epoll_event_##NAME ee;                                 \
14
};                                                              \
15
                                                                \
16
extern unsigned int v1_##NAME;                                  \
17
extern unsigned int v2_##NAME;                                  \
18
extern unsigned long long v3_##NAME;                            \
19
                                                                \
20
extern struct outer_##NAME s_##NAME[2];                         \
21
                                                                \
22
extern void pass_##NAME (struct outer_##NAME);                  \
23
extern struct outer_##NAME return_##NAME (void);                \
24
                                                                \
25
void                                                            \
26
checkp_##NAME (struct outer_##NAME *p)                          \
27
{                                                               \
28
  if (p->i != v1_##NAME)                                        \
29
    DEBUG_CHECK;                                                \
30
  if (p->ee.events != v2_##NAME)                                \
31
    DEBUG_CHECK;                                                \
32
  if (p->ee.data != v3_##NAME)                                  \
33
    DEBUG_CHECK;                                                \
34
}                                                               \
35
                                                                \
36
void                                                            \
37
test_##NAME (void)                                              \
38
{                                                               \
39
  struct outer_##NAME s;                                        \
40
  DEBUG_FPUTS (DESC_##NAME);                                    \
41
  DEBUG_NL;                                                     \
42
  DEBUG_FPUTS ("  global array");                               \
43
  checkp_##NAME (&s_##NAME[0]);                                 \
44
  checkp_##NAME (&s_##NAME[1]);                                 \
45
  DEBUG_NL;                                                     \
46
  DEBUG_FPUTS ("  argument");                                   \
47
  pass_##NAME (s_##NAME[0]);                                    \
48
  DEBUG_NL;                                                     \
49
  DEBUG_FPUTS ("  function result");                            \
50
  s = return_##NAME ();                                         \
51
  checkp_##NAME (&s);                                           \
52
  DEBUG_NL;                                                     \
53
}
54
 
55
TEST (orig)
56
#ifndef SKIP_ATTRIBUTE
57
TEST (structmax)
58
TEST (struct4)
59
TEST (struct8)
60
TEST (data4)
61
TEST (data8)
62
TEST (p)
63
TEST (pstruct4)
64
TEST (pstruct8)
65
TEST (pdata4)
66
TEST (pdata8)
67
#endif
68
 
69
#else
70
 
71
int i;  /* prevent compiling an empty file */
72
 
73
#endif  /* INT_MAX */

powered by: WebSVN 2.1.0

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