diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-08-06 05:08:45 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-08-06 05:08:45 +0000 |
commit | 10e3dedb6f6bf999e23700f876f7e19e650ef642 (patch) | |
tree | 3ebf1c376b75781e96752d54840639fdf3ff0866 /test/CodeGen/2008-07-22-packed-bitfield-access.c | |
parent | 1fc01fa64d4992d87c37f8a75632530ed686dec4 (diff) |
Fix bitfield accesses which straddle the boundary of the underlying
type.
- This generates somewhat less optimal code than before but this is
not hard to rectify once stable (at the cost of slightly more
complex code).
- This currently always uses little-endian ordering of the bitfield.
- This breaks the CodeGen/bitfield.c test because it was grepping for
hard-coded assembly instructions. Will fix once a better test case
is constructed (hard to do without execution).
- This fixes SingleSource/UnitTests/2006-01-23-InitializedBitField.c
and Regression/C/PR1386.c from the test suite.
- <rdar://problem/6085090>, <rdar://problem/6094169>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/2008-07-22-packed-bitfield-access.c')
-rw-r--r-- | test/CodeGen/2008-07-22-packed-bitfield-access.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/CodeGen/2008-07-22-packed-bitfield-access.c b/test/CodeGen/2008-07-22-packed-bitfield-access.c new file mode 100644 index 0000000000..b41b5e0e40 --- /dev/null +++ b/test/CodeGen/2008-07-22-packed-bitfield-access.c @@ -0,0 +1,10 @@ +// RUN: clang %s -emit-llvm -o - + +int main () { + struct foo { + unsigned a:16; + unsigned b:32 __attribute__ ((packed)); + } x; + x.b = 0x56789abcL; + return 0; +} |