mirror of
https://github.com/cc65/cc65.git
synced 2024-09-06 18:54:30 +00:00
26 lines
384 B
C
26 lines
384 B
C
|
/*
|
||
|
!!DESCRIPTION!! bit field bug
|
||
|
!!ORIGIN!! testsuite
|
||
|
!!LICENCE!! Public Domain
|
||
|
!!AUTHOR!! Johan Kotlinski
|
||
|
*/
|
||
|
|
||
|
#include <assert.h>
|
||
|
|
||
|
struct {
|
||
|
int foo : 7;
|
||
|
int bar : 4;
|
||
|
} baz = { 0, 2 };
|
||
|
|
||
|
int main() {
|
||
|
char bar = baz.bar;
|
||
|
|
||
|
assert(2 == bar);
|
||
|
|
||
|
printf("it works :)\n");
|
||
|
|
||
|
/* if not assert() */
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
/* Assert fails. (SVN rev 4381) */
|