From: H.J. Lu Date: Sun, 7 Dec 2008 16:43:15 +0000 (+0000) Subject: re PR tree-optimization/38405 ((silent failure) handling bitfield in ternary) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2abffaa239593e6c8914ad9e90843c7066a3d5e8;p=platform%2Fupstream%2Fgcc.git re PR tree-optimization/38405 ((silent failure) handling bitfield in ternary) 2008-12-07 H.J. Lu PR tree-optimization/38405 * gcc.dg/torture/pr38405.c: New. From-SVN: r142538 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d7b0da0..098e662 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-12-07 H.J. Lu + + PR tree-optimization/38405 + * gcc.dg/torture/pr38405.c: New. + 2008-12-07 Eric Botcazou * gnat.dg/aggr10.adb: New test. diff --git a/gcc/testsuite/gcc.dg/torture/pr38405.c b/gcc/testsuite/gcc.dg/torture/pr38405.c new file mode 100644 index 0000000..3f93445 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr38405.c @@ -0,0 +1,29 @@ +/* { dg-do run } */ + +extern void abort (); +extern int printf (char *__format, ...); + +struct vpiBinaryConst { + int signed_flag :1; + int sized_flag :1; +}; + +int binary_get(int code, struct vpiBinaryConst *rfp) +{ + switch (code) { + case 1: + return rfp->signed_flag ? 1 : 0; + default: + printf("error: %d not supported\n", code); + return code; + } +} + +int main(void) +{ + struct vpiBinaryConst x={1,0}; + int y=binary_get(1, &x); + if (y!=1) + abort (); + return 0; +}