This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Add a testcase for PR tree-optimization/38405


PR tree-optimization/38405:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38405

disappeared between revision 142341 and revision 142508. This patch
adds a testcase. OK for trunk?

Thanks.


H.J.
----
2008-12-07  H.J. Lu  <hongjiu.lu@intel.com>

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

--- gcc.dg/torture/pr38405.c.foo	2008-12-07 08:30:26.000000000 -0800
+++ gcc.dg/torture/pr38405.c	2008-12-07 08:28:35.000000000 -0800
@@ -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;
+}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]