libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / Wfree-nonheap-object-7.c
blob6116bfa4d8eaf811452b59c5342a3f0b149ab231
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -Wfree-nonheap-object" } */
4 struct local_caches *get_local_caches_lcs;
5 void *calloc(long, long);
6 void *realloc();
8 struct local_caches {
9 int *t_mem_caches;
12 struct local_caches *get_local_caches() {
13 if (get_local_caches_lcs)
14 return get_local_caches_lcs;
15 get_local_caches_lcs = calloc(1, 0);
16 return get_local_caches_lcs;
19 void libtrace_ocache_free() {
20 struct local_caches lcs = *get_local_caches(), __trans_tmp_1 = lcs;
22 struct local_caches *lcs = &__trans_tmp_1;
23 lcs->t_mem_caches += 10;
24 __trans_tmp_1.t_mem_caches = realloc(__trans_tmp_1.t_mem_caches, sizeof(int)); // { dg-warning "called on pointer (?:(?!PHI).)*nonzero offset" }