aboutsummaryrefslogtreecommitdiff
path: root/test/bitfield-unnamed-size-align.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/bitfield-unnamed-size-align.c')
-rw-r--r--test/bitfield-unnamed-size-align.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/bitfield-unnamed-size-align.c b/test/bitfield-unnamed-size-align.c
new file mode 100644
index 0000000..505467b
--- /dev/null
+++ b/test/bitfield-unnamed-size-align.c
@@ -0,0 +1,12 @@
+struct s {
+ int : 8;
+ char c;
+};
+union u {
+ int : 8;
+ char c;
+};
+int s1 = sizeof(struct s);
+int s2 = _Alignof(struct s);
+int u1 = sizeof(union u);
+int u2 = _Alignof(union u);