view gcc/testsuite/g++.dg/pr71694.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
line wrap: on
line source

/* { dg-do compile } */
/* { dg-options "-O2 -fno-store-merging" } */

struct B {
    B() {}
    int x;
    int a : 6;
    int b : 6;
    int c : 6;
};

struct C : B {
    char d;
};

C c;

int main()
{
  /* We have to make sure to not cause a store data race between
     c.c and c.d residing in the tail padding of B.  */
  c.c = 1;
  c.d = 2;
}

/* In particular on x86 c.d should not be loaded/stored via movl.  */
/* { dg-final { scan-assembler-not "movl" { target { x86_64-*-* i?86-*-* } } } } */