[llvm-commits] CVS: llvm/test/C++Frontend/2007-05-16-ReverseBitFieldCrash.cpp
Devang Patel
dpatel at apple.com
Wed May 16 23:22:30 PDT 2007
Changes in directory llvm/test/C++Frontend:
2007-05-16-ReverseBitFieldCrash.cpp added (r1.1)
---
Log message:
New test.
---
Diffs of the changes: (+24 -0)
2007-05-16-ReverseBitFieldCrash.cpp | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+)
Index: llvm/test/C++Frontend/2007-05-16-ReverseBitFieldCrash.cpp
diff -c /dev/null llvm/test/C++Frontend/2007-05-16-ReverseBitFieldCrash.cpp:1.1
*** /dev/null Thu May 17 01:22:22 2007
--- llvm/test/C++Frontend/2007-05-16-ReverseBitFieldCrash.cpp Thu May 17 01:22:12 2007
***************
*** 0 ****
--- 1,24 ----
+ // RUN: %llvmgxx %s -emit-llvm -S -o -
+
+ #pragma reverse_bitfields on
+ typedef unsigned long UINT32;
+
+ extern void abort(void);
+
+ typedef struct TestStruct
+ {
+ long first: 15,
+ second: 17;
+ } TestStruct;
+
+ int main (int argc, char * const argv[]) {
+
+ TestStruct testStruct = {1, 0};
+
+ UINT32 dw = *(UINT32 *)(&testStruct);
+
+ if(!(dw & 0xFFFF))
+ abort ();
+
+ return 0;
+ }
More information about the llvm-commits
mailing list