mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- Bitstruct as substruct fails to properly work with designated initializers. #2827
This commit is contained in:
18
test/test_suite/bitstruct/bitstruct_designated_deep.c3t
Normal file
18
test/test_suite/bitstruct/bitstruct_designated_deep.c3t
Normal file
@@ -0,0 +1,18 @@
|
||||
// #target: macos-x64
|
||||
module test;
|
||||
struct Foo4
|
||||
{
|
||||
bitstruct : short
|
||||
{
|
||||
short expand : 1..7;
|
||||
bool b : 8;
|
||||
}
|
||||
}
|
||||
fn void main()
|
||||
{
|
||||
Foo4 f4 = { .expand = 2, .b };
|
||||
}
|
||||
|
||||
/* #expect: test.ll
|
||||
|
||||
@.__const = private unnamed_addr constant %Foo4 { i16 260 }, align 2
|
||||
@@ -91,12 +91,10 @@ fn void test4()
|
||||
Flags1 flags1 = {.a, .b, .c};
|
||||
flags1 = {.a};
|
||||
flags1 = {.a = true, .b = true, .c = false};
|
||||
flags1 = {.a, .b = true, .c = true}; // #error: Mixing the omission
|
||||
Foo foo = { .x = 0, .z }; // #error: needs a value
|
||||
|
||||
Flags2 flags2 = {.b, .d};
|
||||
flags2 = {.b, .c, .d}; // #error: needs a value
|
||||
flags2 = {.a, .c = 1, .d}; // #error: Mixing the omission
|
||||
|
||||
Flags2_Struct flags2s;
|
||||
flags2s = {.b, .c, .d}; // #error: needs a value
|
||||
|
||||
Reference in New Issue
Block a user