aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr120660.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr120660.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr120660.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr120660.c b/gcc/testsuite/gcc.dg/pr120660.c
new file mode 100644
index 0000000..6e8c5e8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr120660.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-O -favoid-store-forwarding" } */
+
+int c;
+
+short
+foo (short s)
+{
+ __builtin_memset (&s, c, 1);
+ return s;
+}
+
+int
+main ()
+{
+ short x = foo (0x1111);
+ if (x != 0x1100 && x != 0x0011)
+ __builtin_abort();
+}