This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Add a test case for PR40209
- From: Neil Vachharajani <nvachhar at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Ian Lance Taylor <iant at google dot com>
- Date: Fri, 18 Sep 2009 13:06:02 -0700
- Subject: [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