summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr47800.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/pr47800.c')
-rw-r--r--gcc/testsuite/gcc.target/i386/pr47800.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/pr47800.c b/gcc/testsuite/gcc.target/i386/pr47800.c
new file mode 100644
index 000000000..45c817bc6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr47800.c
@@ -0,0 +1,15 @@
+/* PR target/47800 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=nocona" } */
+
+int
+foo (unsigned char *x, unsigned char *y)
+{
+ unsigned char a;
+ for (a = 0; x < y; x++)
+ if (a & 0x80)
+ a = (unsigned char) (a << 1) + 1 + *x;
+ else
+ a = (unsigned char) (a << 1) + *x;
+ return a;
+}