mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Bitstruct implementation.
This commit is contained in:
committed by
Christoffer Lerno
parent
29e7af843a
commit
4f09b0c351
47
test/test_suite/bitstruct/bitstruct_overlap.c3
Normal file
47
test/test_suite/bitstruct/bitstruct_overlap.c3
Normal file
@@ -0,0 +1,47 @@
|
||||
bitstruct Foo1 : char
|
||||
{
|
||||
int a : 2..5;
|
||||
int b : 5..6; // #error: Overlapping members
|
||||
}
|
||||
|
||||
bitstruct Foo2 : char
|
||||
{
|
||||
int a : 2..5;
|
||||
int b : 4..6; // #error: Overlapping members
|
||||
}
|
||||
|
||||
bitstruct Foo3 : char
|
||||
{
|
||||
int a : 2..5;
|
||||
int b : 2..6; // #error: Overlapping members
|
||||
}
|
||||
|
||||
bitstruct Foo4 : char
|
||||
{
|
||||
int a : 2..5;
|
||||
int b : 1..6; // #error: Overlapping members
|
||||
}
|
||||
|
||||
bitstruct Foo5 : char
|
||||
{
|
||||
int a : 2..5;
|
||||
int b : 1..3; // #error: Overlapping members
|
||||
}
|
||||
|
||||
bitstruct Foo6 : char
|
||||
{
|
||||
int a : 2..5;
|
||||
int b : 1..1;
|
||||
}
|
||||
|
||||
bitstruct Foo7 : char @overlap
|
||||
{
|
||||
int a : 2..5;
|
||||
int b : 1..3;
|
||||
}
|
||||
|
||||
bitstruct Foo8 : char
|
||||
{
|
||||
int a : 2..5;
|
||||
bool b : 3; // #error: Overlapping members
|
||||
}
|
||||
Reference in New Issue
Block a user