[llvm-commits] CVS: llvm/test/Regression/CFrontend/2003-09-18-BitfieldTests.c
Chris Lattner
lattner at cs.uiuc.edu
Fri Sep 19 00:23:01 PDT 2003
Changes in directory llvm/test/Regression/CFrontend:
2003-09-18-BitfieldTests.c added (r1.1)
---
Log message:
a bitfield stress test to exercise various parts of the front-end.
---
Diffs of the changes:
Index: llvm/test/Regression/CFrontend/2003-09-18-BitfieldTests.c
diff -c /dev/null llvm/test/Regression/CFrontend/2003-09-18-BitfieldTests.c:1.1
*** /dev/null Fri Sep 19 00:22:20 2003
--- llvm/test/Regression/CFrontend/2003-09-18-BitfieldTests.c Fri Sep 19 00:22:10 2003
***************
*** 0 ****
--- 1,28 ----
+
+ typedef struct BF {
+ int A : 1;
+ char B;
+ int C : 13;
+ } BF;
+
+ char *test1(BF *b) {
+ return &b->B; // Must be able to address non-bitfield
+ }
+
+ void test2(BF *b) { // Increment and decrement operators
+ b->A++;
+ --b->C;
+ }
+
+ void test3(BF *b) {
+ b->C = 12345; // Store
+ }
+
+ int test4(BF *b) {
+ return b->C; // Load
+ }
+
+ void test5(BF *b, int i) { // array ref
+ b[i].C = 12345;
+ }
+
More information about the llvm-commits
mailing list