aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Dvorak <dvorakz@suse.cz>2006-05-13 21:52:31 +0200
committerZdenek Dvorak <rakdver@gcc.gnu.org>2006-05-13 19:52:31 +0000
commitbecd11a1d8fd608dd1394e6089e84db042bda719 (patch)
tree6c665dc645654c212104955f84b70cb036a5b9ab
parentccce6917884d8f5108b7c20d352196b6ffd3e555 (diff)
downloadgcc-becd11a1d8fd608dd1394e6089e84db042bda719.zip
gcc-becd11a1d8fd608dd1394e6089e84db042bda719.tar.gz
gcc-becd11a1d8fd608dd1394e6089e84db042bda719.tar.bz2
pr27003.c: New test.
* gcc.dg/pr27003.c: New test. From-SVN: r113743
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/pr27003.c31
2 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index cad4c32..8fd6a10 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2006-05-13 Zdenek Dvorak <dvorakz@suse.cz>
+
+ * gcc.dg/pr27003.c: New test.
+
2006-05-12 Steve Ellcey <sje@cup.hp.com>
* lib/target-supports.dg (check_cxa_atexit_available): Change
diff --git a/gcc/testsuite/gcc.dg/pr27003.c b/gcc/testsuite/gcc.dg/pr27003.c
new file mode 100644
index 0000000..5e416f4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr27003.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-do run } */
+/* { dg-options "-Os" } */
+
+unsigned int
+foo (unsigned int x)
+{
+ unsigned int r = x;
+ while (--x)
+ r *= x;
+ return r;
+}
+
+unsigned long long
+bar (unsigned long long x)
+{
+ unsigned long long r = x;
+ while (--x)
+ r *= x;
+ return r;
+}
+
+extern void abort (void);
+
+int
+main (void)
+{
+ if (foo (5) != 120 || bar (5) != 120)
+ abort ();
+ return 0;
+}