aboutsummaryrefslogtreecommitdiffstats
path: root/test/clightgen/bitfields.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/clightgen/bitfields.c')
-rw-r--r--test/clightgen/bitfields.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/clightgen/bitfields.c b/test/clightgen/bitfields.c
new file mode 100644
index 00000000..34f6a686
--- /dev/null
+++ b/test/clightgen/bitfields.c
@@ -0,0 +1,13 @@
+struct s {
+ int a: 10;
+ char : 6;
+ _Bool b : 1;
+ int : 0;
+ short c: 7;
+};
+
+int f(void)
+{
+ struct s x = { -1, 1, 2 };
+ return x.a + x.b + x.c;
+}