Debian Codegraph @

gcc/testsuite/g++.dg/expr/bitfield9.C

raw
1 // PR c++/32346
2 // { dg-do run }
3 // { dg-options "-Wno-overflow" }
4
5 extern "C" void abort();
6
7 typedef int int32_t __attribute__((mode (__SI__)));
8
9 struct S {
10 long long i : 32;
11 };
12
13 void f(int32_t i, int32_t j) {
14 if (i != 0xabcdef01)
15 abort();
16 if (j != 0)
17 abort();
18 }
19
20 void g(S s) {
21 f(s.i, 0);
22 }
23
24 int main() {
25 S s;
26 s.i = 0xabcdef01;
27 g(s);
28 }