bitfield-bool-layout.c 556 B

123456789101112131415161718192021222324252627
  1. struct bfb {
  2. _Bool a:1;
  3. _Bool f:1;
  4. _Bool z:1;
  5. };
  6. struct bfb foo(struct bfb s)
  7. {
  8. return s;
  9. }
  10. /*
  11. * check-name: bitfield-bool-layout
  12. * check-description: given that bool is here 1-bit wide
  13. * each field here above completely 'fill' a bool.
  14. * Thus 3 bools need to be allocated, but since the
  15. * alignment is 1-byte the result has a size of 3
  16. * bytes, 24 bits thus instead of 8.
  17. * check-command: test-linearize -Wno-decl $file
  18. *
  19. * check-known-to-fail
  20. * check-output-ignore
  21. * check-output-excludes: ret\\.24
  22. * check-output-contains: ret\\.8
  23. */