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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [compat/] [struct-align-1_y.c] - Blame information for rev 708

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

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

powered by: WebSVN 2.1.0

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