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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [pragma-pack-2.c] - Blame information for rev 313

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

Line No. Rev Author Line
1 298 jeremybenn
/* On Solaris, #pragma pack should accept macro expansion.  */
2
 
3
/* { dg-do run { target *-*-solaris2.* } } */
4
 
5
extern void abort (void);
6
 
7
struct {
8
        char one;
9
        long two;
10
} defaultalign;
11
 
12
#define ALIGNHIGH 16
13
 
14
#pragma pack(ALIGNHIGH)
15
struct {
16
        char one;
17
        long two;
18
} sixteen;
19
 
20
#define ALIGN1(X) 1
21
#pragma pack(ALIGN1(4))
22
struct {
23
        char one;
24
        long two;
25
} two;
26
 
27
#define ALIGN2(X) X
28
#pragma pack(ALIGN2(2))
29
struct {
30
        char one;
31
        long two;
32
} three;
33
 
34
#define EMPTY
35
#pragma pack(EMPTY)
36
struct {
37
        char one;
38
        long two;
39
} resetalign;
40
 
41
main()
42
{
43
        if(sizeof(sixteen) < sizeof(defaultalign)) abort();
44
        if(sizeof(two) >= sizeof(defaultalign)) abort();
45
        if(sizeof(three) <= sizeof(two)) abort();
46
        if(sizeof(resetalign) != sizeof(defaultalign)) abort();
47
        return 0;
48
}

powered by: WebSVN 2.1.0

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