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 test case for PR40209


Back in May, I had submitted a patch to fix a compiler ICE due to
stale data flow analysis.  The bug report (PR40209) had a test case
that was not added to dejagnu.  This patch adds the test case as
suggested by Ian.

Verified test case passes on i686/x86-linux.  Ok for trunk?

2009-09-18  Neil Vachharajani  <nvachhar@google.com>

        * testsuite/gcc.dg/pr40209.c: Add test case.

--- testsuite/gcc.dg/pr40209.c.orig
+++ testsuite/gcc.dg/pr40209.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fprofile-use" } */
+
+void process(const char *s);
+
+struct BaseHolder {
+  unsigned int base_;
+};
+
+void UInt2Str(struct BaseHolder *b, unsigned int x) {
+  static const char digit[] = "0123456789abcdefghijklmnopqrstuvwxyz";
+  char buf[100];
+  int i = 100;
+  do {
+    buf[--i] = digit[x % b->base_];
+    x /= b->base_;
+  } while (x > 0);
+  process(buf);
+}
+
+/* Ignore a warning that is irrelevant to the purpose of this test.  */
+/* { dg-prune-output ".*\.gcda not found, execution counts estimated.*" } */


-- 
Neil Vachharajani
Google
650-214-1804


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