2014-09-24 16:45:10 +02:00
|
|
|
/*
|
|
|
|
!!DESCRIPTION!! bit field bug
|
|
|
|
!!ORIGIN!! testsuite
|
|
|
|
!!LICENCE!! Public Domain
|
|
|
|
!!AUTHOR!! Johan Kotlinski
|
|
|
|
*/
|
|
|
|
|
2014-11-22 16:59:31 +01:00
|
|
|
#include "common.h"
|
|
|
|
|
2014-09-24 16:45:10 +02:00
|
|
|
#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) */
|