Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / calloc-2.c
blob3e5504e763edd9a6fef398e37db8146672af8bf6
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 int n, nn;
5 void* f()
7 char *p = __builtin_calloc (n, 1);
8 p[42] = '\n';
9 __builtin_memset (p, 0, nn);
10 return p;
13 void* g(int m1, int m2)
15 char *p = __builtin_malloc (m2);
16 while (--m1)
18 __builtin_memset (p, 0, m2);
19 p[n] = 'b';
21 return p;
24 /* { dg-final { scan-tree-dump-times "malloc" 1 "optimized" } } */
25 /* { dg-final { scan-tree-dump-times "calloc" 1 "optimized" } } */
26 /* { dg-final { scan-tree-dump-times "memset" 2 "optimized" } } */