2009-09-22 Neil Vachharajani <nvachhar@google.com>
authornvachhar <nvachhar@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 Sep 2009 16:48:19 +0000 (16:48 +0000)
committernvachhar <nvachhar@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 Sep 2009 16:48:19 +0000 (16:48 +0000)
        * testsuite/gcc.dg/pr40209.c: Add test case.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152032 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 36ecde8..254de0b 100644 (file)
@@ -1,3 +1,7 @@
+2009-09-22  Neil Vachharajani  <nvachhar@google.com>
+
+       * testsuite/gcc.dg/pr40209.c: Add test case.
+
 2009-09-22  Janis Johnson  <janis187@us.ibm.com>
 
        * config/i386/i386.c (ix86_scalar_mode_supported_p): Don't return
diff --git a/gcc/testsuite/gcc.dg/pr40209.c b/gcc/testsuite/gcc.dg/pr40209.c
new file mode 100644 (file)
index 0000000..f367f7c
--- /dev/null
@@ -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.*" } */