-
-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bit field IR storage from weird integer to i8 array
Fixes #4646.
- Loading branch information
Showing
6 changed files
with
79 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// RUN: %ldc -c -preview=bitfields %s | ||
|
||
struct BitField { | ||
uint _0 : 1; | ||
uint _1 : 1; | ||
uint _2 : 1; | ||
uint _3 : 1; | ||
uint _4 : 1; | ||
uint _5 : 1; | ||
uint _6 : 1; | ||
uint _7 : 1; | ||
uint _8 : 1; | ||
uint _9 : 1; | ||
uint _10 : 1; | ||
uint _11 : 1; | ||
uint _12 : 1; | ||
uint _13 : 1; | ||
uint _14 : 1; | ||
uint _15 : 1; | ||
uint _16 : 1; | ||
} | ||
|
||
static assert(BitField.sizeof == 4); | ||
static assert(BitField.alignof == 4); | ||
|
||
struct Foo { | ||
BitField bf; | ||
} | ||
|
||
static assert(Foo.sizeof == 4); | ||
static assert(Foo.alignof == 4); |