projects
/
libfirm
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
indentation fixed
[libfirm]
/
ir
/
be
/
test
/
fehler53.c
1
#include <stdio.h>
2
3
struct bitfield {
4
unsigned int code : 8;
5
unsigned int bit1 : 1;
6
unsigned int bit2 : 1;
7
unsigned int bit3 : 1;
8
} bf = {7, 1, 0, 1 };
9
10
int main()
11
{
12
bf.code = 0xffffffff;
13
printf("Res: %d (should be 255)\n", bf.code);
14
printf("R2: %d %d %d (should be 1 0 1)\n", bf.bit1, bf.bit2, bf.bit3);
15
bf.code += 1;
16
printf("Res: %d (should be 0)\n", bf.code);
17
return 0;
18
}