aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/pr66648.c33
2 files changed, 38 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f832fb1..55e4cb0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-07-25 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/66648
+ * gcc.target/i386/pr66648.c: New test.
+
2015-07-25 Tom de Vries <tom@codesourcery.com>
* gcc.dg/graphite/graphite.exp: Include uns-*.c files in
diff --git a/gcc/testsuite/gcc.target/pr66648.c b/gcc/testsuite/gcc.target/pr66648.c
new file mode 100644
index 0000000..88c126f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/pr66648.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -mstringop-strategy=unrolled_loop -mtune=nocona" } */
+
+#define PATTERN 0xdeadbeef
+#define SIZE 32
+
+struct S { int i; char str[SIZE]; int j; };
+
+void __attribute__((noclone, noinline))
+my_memcpy (char *, const char *, unsigned int);
+
+void
+my_memcpy (char *dst, const char *src, unsigned int len)
+{
+ if (len < 8)
+ __builtin_abort ();
+
+ __builtin_memcpy (dst, src, len);
+}
+
+int
+main (void)
+{
+ const char str[SIZE]= "1234567890123456789012345678901";
+ struct S *s = __builtin_malloc (sizeof (struct S));
+
+ s->j = PATTERN;
+ my_memcpy (s->str, str, SIZE);
+ if (s->j != PATTERN)
+ __builtin_abort ();
+
+ return 0;
+}