summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/expr/bitfield9.C
blob: 177f65b8800dbfc74b6040bb7799c9e709685920 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// PR c++/32346
// { dg-do run }
// { dg-options "-Wno-overflow" }

extern "C" void abort();

struct S {
  long long i : 32;
};

void f(int i, int j) {
  if (i != 0xabcdef01)
    abort();
  if (j != 0)
    abort();
}

void g(S s) {
  f(s.i, 0);
}

int main() {
  S s;
  s.i = 0xabcdef01;
  g(s);
}