-
-
Notifications
You must be signed in to change notification settings - Fork 613
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
130 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,7 @@ static assert(testc() == 1); | |
|
||
union U | ||
{ | ||
extern(C): | ||
uint a:3; | ||
uint b:1; | ||
ulong c:64; | ||
|
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,50 @@ | ||
/* REQUIRED_ARGS: -preview=bitfields | ||
* TEST_OUTPUT: | ||
--- | ||
fail_compilation/bitinsane.d(124): Error: Unpredictable bit field layout detected starting at bit field `i` | ||
fail_compilation/bitinsane.d(125): Bit offset for `j` expected 5, actual 0 | ||
fail_compilation/bitinsane.d(125): To disable this check specify an extern that is not D i.e. `extern(C)` | ||
fail_compilation/bitinsane.d(132): Error: Unpredictable bit field layout detected starting at bit field `x` | ||
fail_compilation/bitinsane.d(133): Bit offset for `y` expected 5, actual 0 | ||
fail_compilation/bitinsane.d(133): To disable this check specify an extern that is not D i.e. `extern(C)` | ||
--- | ||
*/ | ||
|
||
#line 100 | ||
|
||
struct Stuff_System { | ||
extern(System): | ||
int before1; | ||
ubyte k1:4; | ||
ubyte k2:4; | ||
ubyte i:5; | ||
ubyte j:4; | ||
int after1; | ||
|
||
struct { | ||
int before2; | ||
ubyte w1:4; | ||
ubyte w2:4; | ||
ubyte x:5; | ||
ubyte y:4; | ||
int after2; | ||
} | ||
} | ||
|
||
struct Stuff_D { | ||
int before1; | ||
ubyte k1:4; | ||
ubyte k2:4; | ||
ubyte i:5; | ||
ubyte j:4; | ||
int after1; | ||
|
||
struct { | ||
int before2; | ||
ubyte w1:4; | ||
ubyte w2:4; | ||
ubyte x:5; | ||
ubyte y:4; | ||
int after2; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -25,6 +25,7 @@ void test1() | |
|
||
struct S | ||
{ | ||
extern(C): | ||
uint a:3; | ||
uint b:1; | ||
ulong c:64; | ||
|
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