projects
/
libfirm
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
fix assembler nodes
[libfirm]
/
ir
/
be
/
test
/
bf_constfold.c
1
#include <stdio.h>
2
3
/* Demonstrates a bug where constant folding ignores width of bitfields */
4
5
struct __attribute__((packed)) A
6
{
7
unsigned int i:1, l:1, j:3, k:11;
8
};
9
struct A sA;
10
11
int main()
12
{
13
unsigned int mask;
14
struct A x;
15
16
sA.k = -1;
17
mask = sA.k;
18
x = sA;
19
20
printf("Val1: %x (expected 7ff) val2: %x (expected 7ff)\n", mask, x.k);
21
22
return 0;
23
}