Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / calloc-1.c
blobf6ff9a0da14e3164320ede2eedde73dd6d861c02
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 extern int a;
5 extern int *b;
6 int n;
7 void* f(long *q)
9 int *p = __builtin_malloc (n);
10 ++*q;
11 if (p)
13 ++*q;
14 a = 2;
15 __builtin_memset (p, 0, n);
16 *b = 3;
18 return p;
20 void* g(void)
22 float *p = __builtin_calloc (8, 4);
23 return __builtin_memset (p, 0, 24); // not 32
26 /* { dg-final { scan-tree-dump-times "calloc" 2 "optimized" } } */
27 /* { dg-final { scan-tree-dump-not "malloc" "optimized" } } */
28 /* { dg-final { scan-tree-dump-not "memset" "optimized" } } */