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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [rx/] [packed-struct.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 323 jeremybenn
/* { dg-do compile } */
2
 
3
struct unpacked
4
{
5
  int i;
6
  char c;
7
};
8
 
9
#pragma pack(1)
10
 
11
struct packed
12
{
13
  int i;
14
  char c;
15
};
16
 
17
struct packed_contains_unpacked
18
{
19
  char c;
20
  struct unpacked uuuu;  /* This should generate an error message.  */
21
};                      /* { dg-error "unpacked structure/union inside a packed struct" "XFAILed until patch for generic GCC structure layout code is accepted" { xfail rx-*-* } } */
22
 
23
union contains_unpacked
24
{
25
  char c;
26
  struct unpacked uuuu;  /* This should not.  */
27
};
28
 
29
struct packed_contains_packed
30
{
31
  char c;
32
  struct packed ppppp;   /* This should not.  */
33
};
34
 
35
#pragma pack()
36
 
37
struct unpacked_contains_packed
38
{
39
  char c;
40
  struct packed p;
41
};
42
 
43
struct unpacked_contains_unpacked
44
{
45
  char c;
46
  struct unpacked u;
47
};
48
 
49
 
50
int s1 = sizeof (struct unpacked);
51
int s2 = sizeof (struct packed);
52
int s3 = sizeof (struct packed_contains_unpacked);
53
int s4 = sizeof (struct packed_contains_packed);
54
int s5 = sizeof (struct unpacked_contains_packed);
55
int s6 = sizeof (struct unpacked_contains_unpacked);

powered by: WebSVN 2.1.0

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