| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fno-store-merging" } */ |
| 3 |
/* { dg-additional-options "-fno-PIE" { target ia32 } } */ |
| 4 |
/* { dg-additional-options "-fno-common -mdynamic-no-pic" { target { ia32 && { x86_64-*-darwin* i?86-*-darwin* } } } } */ |
| 5 |
|
| 6 |
struct B { |
| 7 |
B() {} |
| 8 |
int x; |
| 9 |
int a : 6; |
| 10 |
int b : 6; |
| 11 |
int c : 6; |
| 12 |
}; |
| 13 |
|
| 14 |
struct C : B { |
| 15 |
char d; |
| 16 |
}; |
| 17 |
|
| 18 |
C c; |
| 19 |
|
| 20 |
int main() |
| 21 |
{ |
| 22 |
/* We have to make sure to not cause a store data race between |
| 23 |
c.c and c.d residing in the tail padding of B. */ |
| 24 |
c.c = 1; |
| 25 |
c.d = 2; |
| 26 |
} |
| 27 |
|
| 28 |
/* In particular on x86 c.d should not be loaded/stored via movl. */ |
| 29 |
/* { dg-final { scan-assembler-not "movl" { target { x86_64-*-* i?86-*-* } } } } */ |