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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [pragma-align.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Prove that HANDLE_SYSTEMV_PRAGMA alignment handling works somewhat. */
2
 
3
/* { dg-do run { target i?86-*-linux* x86_64-*-linux* i?86-*-*bsd* i?86-*-sco3.2v5* *-*-solaris2.* } } */
4
 
5
extern void abort (void);
6
 
7
struct {
8
        char one;
9
        long two;
10
} defaultalign;
11
 
12
#if defined(__LP64__)
13
#pragma pack(8)
14
#else
15
#pragma pack(4)
16
#endif
17
struct {
18
        char one;
19
        long two;
20
} sixteen;
21
 
22
#pragma pack(1)
23
struct {
24
        char one;
25
        long two;
26
} two;
27
 
28
#pragma pack(2)
29
struct {
30
        char one;
31
        long two;
32
} three;
33
 
34
#pragma pack()
35
struct {
36
        char one;
37
        long two;
38
} resetalign;
39
 
40
main()
41
{
42
        if(sizeof(sixteen) < sizeof(defaultalign)) abort();
43
        if(sizeof(two) >= sizeof(defaultalign)) abort();
44
        if(sizeof(three) <= sizeof(two)) abort();
45
        if(sizeof(resetalign) != sizeof(defaultalign)) abort();
46
        return 0;
47
}

powered by: WebSVN 2.1.0

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