PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr86017.c
blobf216e83c7b32f7c1d206490203c4cb316541bb14
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-store-merging" } */
4 void f (void*);
6 void g (void)
8 char a[8];
9 __builtin_memset (a, 0, 8);
11 f (a);
14 void h (void)
16 char a[8];
17 __builtin_memset (a, 0, 1);
18 __builtin_memset (a + 1, 0, 1);
19 __builtin_memset (a + 2, 0, 1);
20 __builtin_memset (a + 3, 0, 1);
21 __builtin_memset (a + 4, 0, 1);
22 __builtin_memset (a + 5, 0, 1);
23 __builtin_memset (a + 6, 0, 1);
24 __builtin_memset (a + 7, 0, 1);
26 f (a);
29 /* { dg-final { scan-tree-dump "Merged into 1 stores" "store-merging" } } */