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_y.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 TEST(NAME)                                              \
5
extern char v1_##NAME;                                          \
6
extern double v2_##NAME;                                        \
7
extern int v3_##NAME;                                           \
8
                                                                \
9
extern struct B1_##NAME b1_##NAME, ab1_##NAME[2];               \
10
extern struct B2_##NAME b2_##NAME, ab2_##NAME[2];               \
11
extern struct B3_##NAME b3_##NAME, ab3_##NAME[2];               \
12
                                                                \
13
extern void pass1_##NAME (struct B1_##NAME);                    \
14
extern void pass2_##NAME (struct B2_##NAME);                    \
15
extern void pass3_##NAME (struct B3_##NAME);                    \
16
extern struct B1_##NAME return1_##NAME (void);                  \
17
extern struct B2_##NAME return2_##NAME (void);                  \
18
extern struct B3_##NAME return3_##NAME (void);                  \
19
                                                                \
20
void                                                            \
21
checkp1_##NAME (struct B1_##NAME *p)                            \
22
{                                                               \
23
  if (p->c != v1_##NAME)                                        \
24
    DEBUG_CHECK;                                                \
25
  if (p->d != v2_##NAME)                                        \
26
    DEBUG_CHECK;                                                \
27
}                                                               \
28
                                                                \
29
void                                                            \
30
checkp2_##NAME (struct B2_##NAME *p)                            \
31
{                                                               \
32
  if (p->c != v1_##NAME)                                        \
33
    DEBUG_CHECK;                                                \
34
  if (p->a2.d != v2_##NAME)                                     \
35
    DEBUG_CHECK;                                                \
36
}                                                               \
37
                                                                \
38
void                                                            \
39
checkp3_##NAME (struct B3_##NAME *p)                            \
40
{                                                               \
41
  if (p->c != v1_##NAME)                                        \
42
    DEBUG_CHECK;                                                \
43
  if (p->a3.d != v2_##NAME)                                     \
44
    DEBUG_CHECK;                                                \
45
  if (p->a3.i != v3_##NAME)                                     \
46
    DEBUG_CHECK;                                                \
47
}                                                               \
48
                                                                \
49
void                                                            \
50
test_##NAME (void)                                              \
51
{                                                               \
52
  struct B1_##NAME s1;                                          \
53
  struct B2_##NAME s2;                                          \
54
  struct B3_##NAME s3;                                          \
55
  DEBUG_FPUTS (DESC_##NAME);                                    \
56
  DEBUG_NL;                                                     \
57
  DEBUG_FPUTS ("  global variable");                            \
58
  checkp1_##NAME (&b1_##NAME);                                  \
59
  checkp2_##NAME (&b2_##NAME);                                  \
60
  checkp3_##NAME (&b3_##NAME);                                  \
61
  DEBUG_NL;                                                     \
62
  DEBUG_FPUTS ("  global array");                               \
63
  checkp1_##NAME (&ab1_##NAME[1]);                              \
64
  checkp2_##NAME (&ab2_##NAME[1]);                              \
65
  checkp3_##NAME (&ab3_##NAME[1]);                              \
66
  DEBUG_NL;                                                     \
67
  DEBUG_FPUTS ("  argument");                                   \
68
  pass1_##NAME (b1_##NAME);                                     \
69
  pass2_##NAME (b2_##NAME);                                     \
70
  pass3_##NAME (b3_##NAME);                                     \
71
  DEBUG_NL;                                                     \
72
  DEBUG_FPUTS ("  function result");                            \
73
  s1 = return1_##NAME ();                                       \
74
  checkp1_##NAME (&s1);                                         \
75
  s2 = return2_##NAME ();                                       \
76
  checkp2_##NAME (&s2);                                         \
77
  s3 = return3_##NAME ();                                       \
78
  checkp3_##NAME (&s3);                                         \
79
  DEBUG_NL;                                                     \
80
}
81
 
82
TEST (orig)
83
#ifndef SKIP_ATTRIBUTE
84
TEST (p_all)
85
TEST (p_inner)
86
TEST (p_outer)
87
TEST (a_max)
88
TEST (m_outer_p_inner)
89
TEST (m_inner_p_outer)
90
#endif

powered by: WebSVN 2.1.0

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