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-align-2_x.c] - Blame information for rev 384

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 SETUP(NAME,V1,V2,V3)                                    \
11
struct outer_##NAME {                                           \
12
  int i;                                                        \
13
  struct epoll_event_##NAME ee;                                 \
14
};                                                              \
15
                                                                \
16
unsigned int v1_##NAME = V1;                                    \
17
unsigned int v2_##NAME = V2;                                    \
18
unsigned long long v3_##NAME = V3;                              \
19
                                                                \
20
struct outer_##NAME s_##NAME[2] =                               \
21
 { {V1, { V2, V3 } }, { V1, { V2, V3 } } };                     \
22
                                                                \
23
extern void test_##NAME (void);                                 \
24
extern void checkp_##NAME (struct outer_##NAME *);              \
25
extern void checkg_##NAME (void);                               \
26
                                                                \
27
void                                                            \
28
pass_##NAME (struct outer_##NAME s)                             \
29
{                                                               \
30
  checkp_##NAME (&s);                                           \
31
}                                                               \
32
                                                                \
33
struct outer_##NAME                                             \
34
return_##NAME (void)                                            \
35
{                                                               \
36
  return s_##NAME[0];                                           \
37
}
38
 
39
#define CHECK(NAME)                                             \
40
  test_##NAME()
41
 
42
SETUP (orig,101, 102, 0x0101010101010101ULL)
43
#ifndef SKIP_ATTRIBUTE
44
SETUP (structmax, 103, 104, 0x1212121212121212ULL)
45
SETUP (struct4, 105, 106, 0x2323232323232323ULL)
46
SETUP (struct8, 107, 108, 0x3434343434343434ULL)
47
SETUP (data4, 109, 110, 0x4545454545454545ULL)
48
SETUP (data8, 111, 112, 0x5656565656565656ULL)
49
SETUP (p, 113, 114, 0x6767676767676767ULL)
50
SETUP (pstruct4, 115, 116, 0x7878787878787878ULL)
51
SETUP (pstruct8, 117, 118, 0x8989898989898989ULL)
52
SETUP (pdata4, 119, 120, 0x9A9A9A9A9A9A9A9AULL)
53
SETUP (pdata8, 121, 122, 0xABABABABABABABABULL)
54
#endif
55
 
56
void
57
struct_align_2_x (void)
58
{
59
  DEBUG_INIT
60
 
61
  CHECK (orig);
62
#ifndef SKIP_ATTRIBUTE
63
  CHECK (structmax);
64
  CHECK (struct4);
65
  CHECK (struct8);
66
  CHECK (data4);
67
  CHECK (data8);
68
  CHECK (p);
69
  CHECK (pstruct4);
70
  CHECK (pstruct8);
71
  CHECK (pdata4);
72
  CHECK (pdata8);
73
#endif
74
 
75
  DEBUG_FINI
76
 
77
  if (fails != 0)
78
    abort ();
79
}
80
 
81
#else
82
 
83
void struct_align_2_x (void) {}
84
 
85
#endif  /* INT_MAX */

powered by: WebSVN 2.1.0

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