URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
/* { dg-do run } */
|
/* { dg-do run } */
|
/* { dg-options "-O2" } */
|
/* { dg-options "-O2" } */
|
#include <stdlib.h>
|
#include <stdlib.h>
|
struct s {
|
struct s {
|
unsigned short f: 16;
|
unsigned short f: 16;
|
unsigned short y: 8;
|
unsigned short y: 8;
|
unsigned short g: 2;
|
unsigned short g: 2;
|
unsigned int x;
|
unsigned int x;
|
};
|
};
|
|
|
void set (struct s*, int) __attribute__((noinline));
|
void set (struct s*, int) __attribute__((noinline));
|
void set (struct s* p, int flags) {
|
void set (struct s* p, int flags) {
|
p->g = flags << 1;
|
p->g = flags << 1;
|
}
|
}
|
main() {
|
main() {
|
struct s foo = {0 , 0, 3, 0};
|
struct s foo = {0 , 0, 3, 0};
|
set (&foo, -1);
|
set (&foo, -1);
|
if (foo.g != 2)
|
if (foo.g != 2)
|
abort();
|
abort();
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.