Chris Lattner | c6a200e | 2003-09-19 05:22:10 +0000 | [diff] [blame] | 1 | |
2 | typedef struct BF { | ||||
3 | int A : 1; | ||||
4 | char B; | ||||
5 | int C : 13; | ||||
6 | } BF; | ||||
7 | |||||
8 | char *test1(BF *b) { | ||||
9 | return &b->B; // Must be able to address non-bitfield | ||||
10 | } | ||||
11 | |||||
12 | void test2(BF *b) { // Increment and decrement operators | ||||
13 | b->A++; | ||||
14 | --b->C; | ||||
15 | } | ||||
16 | |||||
17 | void test3(BF *b) { | ||||
18 | b->C = 12345; // Store | ||||
19 | } | ||||
20 | |||||
21 | int test4(BF *b) { | ||||
22 | return b->C; // Load | ||||
23 | } | ||||
24 | |||||
25 | void test5(BF *b, int i) { // array ref | ||||
26 | b[i].C = 12345; | ||||
27 | } | ||||
28 |