OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [pragma-align.c] - Rev 298

Compare with Previous | Blame | View Log

/* Prove that HANDLE_SYSTEMV_PRAGMA alignment handling works somewhat. */
 
/* { dg-do run { target i?86-*-linux* x86_64-*-linux* i?86-*-*bsd* *-*-solaris2.* } } */
 
extern void abort (void);
 
struct {
        char one;
        long two;
} defaultalign;
 
#if defined(__LP64__)
#pragma pack(8)
#else
#pragma pack(4)
#endif
struct {
        char one;
        long two;
} sixteen;
 
#pragma pack(1)
struct {
        char one;
        long two;
} two;
 
#pragma pack(2)
struct {
        char one;
        long two;
} three;
 
#pragma pack()
struct {
        char one;
        long two;
} resetalign;
 
main()
{
        if(sizeof(sixteen) < sizeof(defaultalign)) abort();
        if(sizeof(two) >= sizeof(defaultalign)) abort();
        if(sizeof(three) <= sizeof(two)) abort();
        if(sizeof(resetalign) != sizeof(defaultalign)) abort();
	return 0;
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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