On Mon, 2007-05-14 at 23:54 -0700, Chris Lattner wrote: > > Add a test case for PR1420: http://llvm.org/PR1420 > > Further, execution tests should go in llvm-test, not in llvm/test.
I've done this to get it some attention. The corresponding test in llvm-test has been failing for four months and no one has fixed it. I don't understand this part of llvm-gcc at all so I thought I'd make a PR and simplify the test case. > > -Chris > > > > > --- > > Diffs of the changes: (+35 -0) > > > > 2007-05-15-FieldAccess.cpp | 35 +++++++++++++++++++++++++++++++++++ > > 1 files changed, 35 insertions(+) > > > > > > Index: llvm/test/C++Frontend/2007-05-15-FieldAccess.cpp > > diff -c /dev/null llvm/test/C++Frontend/2007-05-15-FieldAccess.cpp:1.1 > > *** /dev/null Tue May 15 01:52:25 2007 > > --- llvm/test/C++Frontend/2007-05-15-FieldAccess.cpp Tue May 15 > > 01:52:15 2007 > > *************** > > *** 0 **** > > --- 1,35 ---- > > + // Test case for PR1420 > > + // RUN: %llvmgxx %s -O0 -o %t.exe > > + // RUN: %t.exe > %t.out > > + // RUN: grep {sizeof(bitFieldStruct) == 8} %t.out > > + // RUN: grep {Offset bitFieldStruct.i = 0} %t.out > > + // RUN: grep {Offset bitFieldStruct.c2 = 7} %t.out > > + // XFAIL: * > > + > > + #include <stdio.h> > > + > > + class bitFieldStruct { > > + public: > > + int i; > > + unsigned char c:7; > > + int s:17; > > + char c2; > > + }; > > + > > + int main() > > + { > > + printf("sizeof(bitFieldStruct) == %d\n", sizeof(bitFieldStruct)); > > + > > + if (sizeof(bitFieldStruct) != 2 * sizeof(int)) > > + printf("bitFieldStruct should be %d but is %d \n", > > + 2 * sizeof(int), sizeof(bitFieldStruct)); > > + > > + bitFieldStruct x; > > + > > + char* xip = (char*) &x.i; > > + char* xc2p = (char*) &x.c2; > > + printf("Offset bitFieldStruct.i = %d\n", xip - xip); > > + printf("Offset bitFieldStruct.c2 = %d\n", xc2p - xip); > > + > > + return 0; > > + } > > > > > > > > _______________________________________________ > > llvm-commits mailing list > > llvm-commits@cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits