From 09ebf088fb1219108e41ecdaf5c918ddc9b906ff Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Wed, 12 Mar 2003 16:47:07 +0000 Subject: [PATCH] * gcc.c-torture/execute/20030224-2.c: New test. From-SVN: r64251 --- gcc/testsuite/ChangeLog | 4 +++ .../gcc.c-torture/execute/20030224-2.c | 28 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/execute/20030224-2.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 73405565b9c..4c34daa7fb8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2003-03-12 Daniel Jacobowitz + + * gcc.c-torture/execute/20030224-2.c: New test. + 2003-03-12 Eric Botcazou * gcc.dg/decl-3.c: New test. diff --git a/gcc/testsuite/gcc.c-torture/execute/20030224-2.c b/gcc/testsuite/gcc.c-torture/execute/20030224-2.c new file mode 100644 index 00000000000..5b692fb4669 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20030224-2.c @@ -0,0 +1,28 @@ +/* Make sure that we don't free any temp stack slots associated with + initializing marker before we're finished with them. */ + +extern void abort(); + +typedef struct { short v16; } __attribute__((packed)) jint16_t; + +struct node { + jint16_t magic; + jint16_t nodetype; + int totlen; +} __attribute__((packed)); + +struct node node, *node_p = &node; + +int main() +{ + struct node marker = { + .magic = (jint16_t) {0x1985}, + .nodetype = (jint16_t) {0x2003}, + .totlen = node_p->totlen + }; + if (marker.magic.v16 != 0x1985) + abort(); + if (marker.nodetype.v16 != 0x2003) + abort(); + return 0; +}