aboutsummaryrefslogtreecommitdiff
path: root/tests/core/test_bitfields.in
blob: cbc7ccf239c22b4a045c72c4e6e4e79d7f0b31f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>
struct bitty {
  unsigned x : 1;
  unsigned y : 1;
  unsigned z : 1;
};
int main() {
  bitty b;
  printf("*");
  for (int i = 0; i <= 1; i++)
    for (int j = 0; j <= 1; j++)
      for (int k = 0; k <= 1; k++) {
        b.x = i;
        b.y = j;
        b.z = k;
        printf("%d,%d,%d,", b.x, b.y, b.z);
      }
  printf("*\n");
  return 0;
}