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