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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [pack-test-3.c] - Blame information for rev 750

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do compile } */
2
 
3
/* Copyright (C) 2003 Free Software Foundation, Inc.
4
   Contributed by Nathan Sidwell 15 Jul 2003 <nathan@codesourcery.com> */
5
 
6
/* you should not be able to pack a typedef to a struct, only the
7
   underlying struct can be packed.  */
8
 
9
/* ok */
10
struct u1
11
{
12
  char field1;
13
  short field2;
14
  int field3;
15
};
16
 
17
/* ok */
18
typedef struct p1 {
19
   char  field1;
20
   short field2;
21
   int field3;
22
} __attribute__ ((packed)) p1_t1;
23
 
24
/* ok */
25
typedef struct __attribute__ ((packed)) p2 {
26
   char  field1;
27
   short field2;
28
   int field3;
29
} p2_t1;
30
 
31
int ary1[sizeof (struct p1) == sizeof (p1_t1) ? 1 : -1];
32
int ary2[sizeof (struct p2) == sizeof (p2_t1) ? 1 : -1];
33
int ary3[sizeof (struct p1) == sizeof (struct p2) ? 1 : -1];
34
 
35
/* not ok */
36
typedef struct u1 __attribute__ ((packed)) u1_t1; /* { dg-warning "attribute ignored" "" }*/
37
typedef struct u1 u1_t2 __attribute__ ((packed)); /* { dg-warning "attribute ignored" "" }*/
38
 
39
typedef struct p3 {
40
   char  field1;
41
   short field2;
42
   int field3;
43
} p3_t1 __attribute__ ((packed)); /* { dg-warning "attribute ignored" "" }*/
44
 

powered by: WebSVN 2.1.0

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