summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ultrasp9.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-04 07:13:03 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-04 07:13:03 +0000
commit845fab376188113c5029cb6ee004f78d1951ff5f (patch)
treeeafe7d8651fbe62104030c889a1ac08787a4a629 /gcc/testsuite/gcc.dg/ultrasp9.c
parent8877d71a364fccd5906ab847e78e8244d30b3d9a (diff)
downloadgcc-845fab376188113c5029cb6ee004f78d1951ff5f.tar.gz
PR optimization/11018
* config/sparc/sparc.c (sparc_v8plus_shift): Use which_alternative consistently to decide whether the scratch register is really required. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67429 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/ultrasp9.c')
-rw-r--r--gcc/testsuite/gcc.dg/ultrasp9.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/ultrasp9.c b/gcc/testsuite/gcc.dg/ultrasp9.c
new file mode 100644
index 00000000000..885420e0509
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ultrasp9.c
@@ -0,0 +1,39 @@
+/* PR optimization/11018 */
+/* Originator: <partain@dcs.gla.ac.uk> */
+/* { dg-do run { target sparc*-*-* } } */
+/* { dg-options "-O2 -mcpu=ultrasparc" } */
+
+/* This used to fail on 32-bit Ultrasparc because
+ of broken DImode shift patterns. */
+
+extern void abort(void);
+
+typedef unsigned long long uint64_t;
+typedef unsigned int size_t;
+
+
+void to_octal (uint64_t value, char *where, size_t size)
+{
+ uint64_t v = value;
+ size_t i = size;
+
+ do
+ {
+ where[--i] = '0' + (v & ((1 << 3) - 1));
+ v >>= 3;
+ }
+ while (i);
+}
+
+
+int main (void)
+{
+ char buf[8];
+
+ to_octal(010644, buf, 6);
+
+ if (buf[1] != '1')
+ abort();
+
+ return 0;
+}