diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-06-29 18:34:35 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-06-29 18:34:35 +0000 |
commit | f35e76552f68dc07bedc75f006e0ae1a9a18e81c (patch) | |
tree | b8d67f07bd9c0202731adf2b7e05cd6d7dd306fc /clang/test | |
parent | a4575f5b31fdf23633dfe5cc71d9da24a074aa3d (diff) | |
download | bcm5719-llvm-f35e76552f68dc07bedc75f006e0ae1a9a18e81c.tar.gz bcm5719-llvm-f35e76552f68dc07bedc75f006e0ae1a9a18e81c.zip |
Sema: Fix a subtle i64 -> i32 truncation which broke layout of large structures
with bit-fields.
llvm-svn: 107185
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Sema/bitfield-layout.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Sema/bitfield-layout.c b/clang/test/Sema/bitfield-layout.c index edc44bdefa0..2655fc70cd4 100644 --- a/clang/test/Sema/bitfield-layout.c +++ b/clang/test/Sema/bitfield-layout.c @@ -30,3 +30,13 @@ CHECK_ALIGN(struct, e, 1) struct f {__attribute((aligned(8))) int x : 30, y : 30, z : 30;}; CHECK_SIZE(struct, f, 24) CHECK_ALIGN(struct, f, 8) + +// Large structure (overflows i32, in bits). +struct s0 { + char a[0x32100000]; + int x:30, y:30; +}; + +CHECK_SIZE(struct, s0, 0x32100008) +CHECK_ALIGN(struct, s0, 4) + |