libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / pr97357.c
blob6b391b7a743d94f1c3f7eeab33b4826d58fe2dd3
1 /* { dg-do compile } */
2 /* { dg-options "-O3" } */
3 /* { dg-require-effective-target indirect_jumps } */
5 #include <setjmp.h>
6 #include <stdlib.h>
8 void * my_malloc (size_t size);
10 typedef struct glk {
11 struct glk *nxt;
12 } glk;
14 typedef struct Lock
16 glk ByteLock;
17 } Lock;
19 static Lock *l, *lk;
21 void bytelocks(glk *rethead, jmp_buf jb)
23 glk *cur, *cur_lk;
25 if (( setjmp (jb)) == 0)
26 for (cur = &l->ByteLock; cur != ((glk *)0) ; cur = (cur)->nxt)
27 for (cur_lk = &lk->ByteLock; cur_lk != ((glk *)0); cur_lk = cur_lk->nxt)
29 glk *retrng;
31 if(!rethead)
32 rethead = (glk *) my_malloc (sizeof(glk));
33 retrng = (glk *) my_malloc (sizeof(glk));
35 retrng->nxt = rethead;
38 return;