aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/array-init-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/array-init-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/array-init-1.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/array-init-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/array-init-1.c
new file mode 100644
index 000000000..14ec9552e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/array-init-1.c
@@ -0,0 +1,25 @@
+/* Test that both arrays are initialized by store_by_pieces. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+struct A { char c[10]; };
+extern void baz (struct A *);
+
+void
+foo (void)
+{
+ struct A a = { "abcdefghi" };
+ baz (&a);
+}
+
+void
+bar (void)
+{
+ struct A a;
+ __builtin_strcpy (&a.c[0], "abcdefghi");
+ baz (&a);
+}
+
+/* { dg-final { scan-assembler-not "abcdefghi" { target i?86-*-* x86_64-*-* ia64-*-* } } } */
+/* { dg-final { scan-assembler-times "7017280452245743464\|7523094288207667809\|6867666564636261\|1684234849\|64636261" 2 { target i?86-*-* x86_64-*-* ia64-*-* } } } */