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

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

Line No. Rev Author Line
1 149 jeremybenn
#include "compat-common.h"
2
#include "struct-align-1.h"
3
 
4
#define SETUP(NAME,V1,V2,V3)                            \
5
char v1_##NAME = V1;                                    \
6
double v2_##NAME = V2;                                  \
7
int v3_##NAME = V3;                                     \
8
                                                        \
9
struct B1_##NAME b1_##NAME = { V1, V2 };                \
10
struct B2_##NAME b2_##NAME = { V1, { V2 } };            \
11
struct B3_##NAME b3_##NAME = { V1, { V2, V3 } };        \
12
                                                        \
13
struct B1_##NAME ab1_##NAME[2] =                        \
14
  { { V1, V2 }, { V1, V2 } };                           \
15
struct B2_##NAME ab2_##NAME[2] =                        \
16
  { { V1, { V2 } }, { V1, { V2 } } };                   \
17
struct B3_##NAME ab3_##NAME[2] =                        \
18
  { { V1, { V2, V3 } }, { V1, { V2, V3 } } };           \
19
                                                        \
20
extern void test_##NAME (void);                         \
21
extern void checkp1_##NAME (struct B1_##NAME *);        \
22
extern void checkp2_##NAME (struct B2_##NAME *);        \
23
extern void checkp3_##NAME (struct B3_##NAME *);        \
24
extern void checkg1_##NAME (void);                      \
25
extern void checkg2_##NAME (void);                      \
26
extern void checkg3_##NAME (void);                      \
27
                                                        \
28
void                                                    \
29
pass1_##NAME (struct B1_##NAME s)                       \
30
{                                                       \
31
  checkp1_##NAME (&s);                                  \
32
}                                                       \
33
                                                        \
34
void                                                    \
35
pass2_##NAME (struct B2_##NAME s)                       \
36
{                                                       \
37
  checkp2_##NAME (&s);                                  \
38
}                                                       \
39
                                                        \
40
void                                                    \
41
pass3_##NAME (struct B3_##NAME s)                       \
42
{                                                       \
43
  checkp3_##NAME (&s);                                  \
44
}                                                       \
45
                                                        \
46
struct B1_##NAME                                        \
47
return1_##NAME (void)                                   \
48
{                                                       \
49
  return ab1_##NAME[0];                                 \
50
}                                                       \
51
                                                        \
52
struct B2_##NAME                                        \
53
return2_##NAME (void)                                   \
54
{                                                       \
55
  return ab2_##NAME[0];                                 \
56
}                                                       \
57
                                                        \
58
struct B3_##NAME                                        \
59
return3_##NAME (void)                                   \
60
{                                                       \
61
  return ab3_##NAME[0];                                 \
62
}
63
 
64
#define CHECK(NAME) test_##NAME()
65
 
66
#if __INT_MAX__ > 32767
67
SETUP (orig, 49, 1.0, 111111)
68
#else
69
SETUP (orig, 49, 1.0, 1111)
70
#endif
71
#ifndef SKIP_ATTRIBUTE
72
#if __INT_MAX__ > 32767
73
SETUP (p_all, 50, 2.0, 222222)
74
SETUP (p_inner, 51, 3.0, 333333)
75
SETUP (p_outer, 52, 4.0, 444444)
76
SETUP (a_max, 53, 5.0, 555555)
77
SETUP (m_outer_p_inner, 54, 6.0, 666666)
78
SETUP (m_inner_p_outer, 55, 7.0, 777777)
79
#else
80
SETUP (p_all, 50, 2.0, 2222)
81
SETUP (p_inner, 51, 3.0, 3333)
82
SETUP (p_outer, 52, 4.0, 4444)
83
SETUP (a_max, 53, 5.0, 5555)
84
SETUP (m_outer_p_inner, 54, 6.0, 6666)
85
SETUP (m_inner_p_outer, 55, 7.0, 7777)
86
#endif
87
#endif
88
 
89
void
90
struct_align_1_x (void)
91
{
92
  DEBUG_INIT
93
 
94
  CHECK (orig);
95
#ifndef SKIP_ATTRIBUTE
96
  CHECK (p_all);
97
  CHECK (p_inner);
98
  CHECK (p_outer);
99
  CHECK (a_max);
100
  CHECK (m_outer_p_inner);
101
  CHECK (m_inner_p_outer);
102
#endif
103
 
104
  DEBUG_FINI
105
 
106
  if (fails != 0)
107
    abort ();
108
}

powered by: WebSVN 2.1.0

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