diff options
author | Jakub Jelinek <jakub@redhat.com> | 2012-02-14 07:15:35 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2012-02-14 07:15:35 +0100 |
commit | 45f41865ff05c95063563c5c0e2e4306c40f08a7 (patch) | |
tree | 8eb32a64dbd1fd610d6b8ec9aceff9719e62f75f /gcc/testsuite/c-c++-common/pr52181.c | |
parent | 1380aca7e6219817086aaacf9b264cf4b5a84727 (diff) | |
download | gcc-45f41865ff05c95063563c5c0e2e4306c40f08a7.zip gcc-45f41865ff05c95063563c5c0e2e4306c40f08a7.tar.gz gcc-45f41865ff05c95063563c5c0e2e4306c40f08a7.tar.bz2 |
re PR c/52181 (merge_decls doesn't handle DECL_USER_ALIGN properly)
PR c/52181
* c-decl.c (merge_decls): Copy DECL_USER_ALIGN bit from olddecl to
newdecl.
* decl.c (duplicate_decls): If olddecl has bigger DECL_ALIGN than
newdecl, copy DECL_ALIGN to newdecl and or DECL_USER_ALIGN bits.
* c-c++-common/pr52181.c: New test.
From-SVN: r184193
Diffstat (limited to 'gcc/testsuite/c-c++-common/pr52181.c')
-rw-r--r-- | gcc/testsuite/c-c++-common/pr52181.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/pr52181.c b/gcc/testsuite/c-c++-common/pr52181.c new file mode 100644 index 0000000..e09bc92 --- /dev/null +++ b/gcc/testsuite/c-c++-common/pr52181.c @@ -0,0 +1,13 @@ +/* PR c/52181 */ +/* { dg-do compile } */ + +extern const int v1[]; +const int __attribute__((aligned(16))) v1[] = { 1 }; +extern const int __attribute__((aligned(16))) v2[]; +const int v2[] = { 1 }; +extern const int __attribute__((aligned(16))) v3[]; +const int __attribute__((aligned(16))) v3[] = { 1 }; +const int __attribute__((aligned(16))) v4[] = { 1 }; +int test[(__alignof__ (v4) != __alignof__ (v1) /* { dg-bogus "is negative" } */ + || __alignof__ (v4) != __alignof__ (v2) + || __alignof__ (v4) != __alignof__ (v3)) ? -1 : 0]; |