summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr42898.c
blob: df8b46a62950de83c9cbd492e122463cd91f7501 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do compile } */
/* { dg-options "-fdump-tree-optimized" } */

struct hardware {
  int parm1:8;
  int :4;
  int parm2:4;
  int parm3:15;
  int parm4:1;
};

void f1(volatile struct hardware *ptr)
{
  *ptr=(struct hardware) {
    .parm1=42,
    .parm2=13,
    .parm3=11850,
    .parm4=1,
  };
}

/* { dg-final { scan-tree-dump-times "\\*ptr" 1 "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */