blob: 2d74cb401dc2a458132c6630d4c95b2fb626d2e3 [file] [log] [blame]
Dan Gohman2d65d352009-08-25 15:38:29 +00001// RUN: %llvmgcc -w -S %s -o - | llvm-as -o /dev/null
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002
3
4typedef struct BF {
5 int A : 1;
6 char B;
7 int C : 13;
8} BF;
9
10char *test1(BF *b) {
11 return &b->B; // Must be able to address non-bitfield
12}
13
14void test2(BF *b) { // Increment and decrement operators
15 b->A++;
16 --b->C;
17}
18
19void test3(BF *b) {
20 b->C = 12345; // Store
21}
22
23int test4(BF *b) {
24 return b->C; // Load
25}
26
27void test5(BF *b, int i) { // array ref
28 b[i].C = 12345;
29}
30