diff options
| author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-05-17 01:18:59 +0000 |
|---|---|---|
| committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-05-17 01:18:59 +0000 |
| commit | 6e0d5d67954481d8f0f7acce942cbbdc362ca1b2 (patch) | |
| tree | 03cdfd481d803e1b442da212fdc32a4b216c7ec9 | |
| parent | 260ded10aef1997238cdcd370127807f358de4bf (diff) | |
| download | ppe42-gcc-6e0d5d67954481d8f0f7acce942cbbdc362ca1b2.tar.gz ppe42-gcc-6e0d5d67954481d8f0f7acce942cbbdc362ca1b2.zip | |
* execute/990326-1.c: Force bitfields to be aligned.
(e4, f4): New tests.
(main): Call them.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26961 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/990326-1.c | 41 |
2 files changed, 34 insertions, 13 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e4038c1c657..ff2e800f2ec 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +1999-05-17 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> + + * execute/990326-1.c: Force bitfields to be aligned. + (e4, f4): New tests. + (main): Call them. + 1999-05-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * gcc.dg/noreturn-1.c: New test. diff --git a/gcc/testsuite/gcc.c-torture/execute/990326-1.c b/gcc/testsuite/gcc.c-torture/execute/990326-1.c index 1b8e5d80550..d7427cf8512 100644 --- a/gcc/testsuite/gcc.c-torture/execute/990326-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/990326-1.c @@ -58,7 +58,7 @@ b3() struct c { unsigned int c:4, b:14, a:14; -}; +} __attribute__ ((aligned)); int c1() @@ -86,7 +86,7 @@ c3() struct d { unsigned int a:14, b:14, c:4; -}; +} __attribute__ ((aligned)); int d1() @@ -114,7 +114,7 @@ d3() struct e { int c:4, b:14, a:14; -}; +} __attribute__ ((aligned)); int e1() @@ -140,9 +140,17 @@ e3() return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16)); } +int +e4() +{ + static struct e x = { -1, -1, 0 }; + + return x.a == 0 && x.b & 0x2000; +} + struct f { int a:14, b:14, c:4; -}; +} __attribute__ ((aligned)); int f1() @@ -168,12 +176,20 @@ f3() return ((x.a & ~8) == (y.a & ~32) && (x.b & ~64) == (y.b & ~16)); } +int +f4() +{ + static struct f x = { 0, -1, -1 }; + + return x.a == 0 && x.b & 0x2000; +} + struct gx { int c:4, b:14, a:14; -}; +} __attribute__ ((aligned)); struct gy { int b:14, a:14, c:4; -}; +} __attribute__ ((aligned)); int g1() @@ -244,10 +260,10 @@ g7() struct hx { int a:14, b:14, c:4; -}; +} __attribute__ ((aligned)); struct hy { int c:4, a:14, b:14; -}; +} __attribute__ ((aligned)); int h1() @@ -316,11 +332,6 @@ h7() (x.b & 0x3ff0) == (y.b & 0x03ff)); } -struct foo { - int junk; /* this is to force alignment */ - unsigned char w, x, y, z; -}; - int main() { @@ -354,12 +365,16 @@ main() abort (); if (!e3 ()) abort (); + if (!e4 ()) + abort (); if (!f1 ()) abort (); if (!f2 ()) abort (); if (!f3 ()) abort (); + if (!f4 ()) + abort (); if (!g1 ()) abort (); if (!g2 ()) |

