aboutsummaryrefslogtreecommitdiff
path: root/test/3.cff
diff options
context:
space:
mode:
Diffstat (limited to 'test/3.cff')
-rw-r--r--test/3.cff10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/3.cff b/test/3.cff
index 7103225..7a92c12 100644
--- a/test/3.cff
+++ b/test/3.cff
@@ -1,5 +1,13 @@
import "libc.hff";
+bitfield ColorMaskFlags : u32 {
+ red 1 bool,
+ green 1 bool,
+ blue 1 bool,
+ alpha 1 bool,
+ id (8,3),
+};
+
fn sum(res int, ...) int {
let ap va_list = {};
ap->start();
@@ -16,4 +24,6 @@ fn sum(res int, ...) int {
extern fn main(argc int, argv **u8) int {
printf("= %d\n", sum(1,2,3,42,-1,0));
+ let rgb = ColorMaskFlags { .red: #t, .blue: #t, .id: 13};
+ printf("0x%X\n", rgb.#raw);
}