| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-effective-target arm_eabi } */ |
| 3 |
/* { dg-options "-O2" } */ |
| 4 |
/* { dg-final { scan-assembler-times "ldr\[\\t \]+\[^\n\]*,\[\\t \]*\\\[\[^\n\]*\\\]" 2 } } */ |
| 5 |
/* { dg-final { scan-assembler-times "str\[\\t \]+\[^\n\]*,\[\\t \]*\\\[\[^\n\]*\\\]" 2 } } */ |
| 6 |
/* { dg-final { scan-assembler-not "strb" } } */ |
| 7 |
|
| 8 |
struct thing { |
| 9 |
unsigned a: 8; |
| 10 |
unsigned b: 8; |
| 11 |
unsigned c: 8; |
| 12 |
unsigned d: 8; |
| 13 |
}; |
| 14 |
|
| 15 |
struct thing2 { |
| 16 |
volatile unsigned a: 8; |
| 17 |
volatile unsigned b: 8; |
| 18 |
volatile unsigned c: 8; |
| 19 |
volatile unsigned d: 8; |
| 20 |
}; |
| 21 |
|
| 22 |
void test1(volatile struct thing *t) |
| 23 |
{ |
| 24 |
t->a = 5; |
| 25 |
} |
| 26 |
|
| 27 |
void test2(struct thing2 *t) |
| 28 |
{ |
| 29 |
t->a = 5; |
| 30 |
} |