re PR tree-optimization/38405 ((silent failure) handling bitfield in ternary)
authorH.J. Lu <hongjiu.lu@intel.com>
Sun, 7 Dec 2008 16:43:15 +0000 (16:43 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Sun, 7 Dec 2008 16:43:15 +0000 (08:43 -0800)
2008-12-07  H.J. Lu  <hongjiu.lu@intel.com>

PR tree-optimization/38405
* gcc.dg/torture/pr38405.c: New.

From-SVN: r142538

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr38405.c [new file with mode: 0644]

index d7b0da024e17286d47fbaf15c7f7aeeb70708928..098e6627dd0fa6516257c1a4870409f64a186199 100644 (file)
@@ -1,3 +1,8 @@
+2008-12-07  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR tree-optimization/38405
+       * gcc.dg/torture/pr38405.c: New.
+
 2008-12-07  Eric Botcazou  <ebotcazou@adacore.com>
 
        * 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 (file)
index 0000000..3f93445
--- /dev/null
@@ -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;
+}