| 1 |
/* { dg-require-effective-target label_values } */ |
| 2 |
|
| 3 |
/* As a quality of implementation issue, we should not prevent inlining |
| 4 |
of function explicitly marked inline just because a label therein had |
| 5 |
its address taken. */ |
| 6 |
|
| 7 |
void abort (void); |
| 8 |
void exit (int); |
| 9 |
|
| 10 |
static void *ptr1, *ptr2; |
| 11 |
static int i = 1; |
| 12 |
|
| 13 |
static __inline__ void doit(void **pptr, int cond) |
| 14 |
{ |
| 15 |
if (cond) { |
| 16 |
here: |
| 17 |
*pptr = &&here; |
| 18 |
} |
| 19 |
} |
| 20 |
|
| 21 |
__attribute__ ((noinline)) |
| 22 |
static void f(int cond) |
| 23 |
{ |
| 24 |
doit (&ptr1, cond); |
| 25 |
} |
| 26 |
|
| 27 |
__attribute__ ((noinline)) |
| 28 |
static void g(int cond) |
| 29 |
{ |
| 30 |
doit (&ptr2, cond); |
| 31 |
} |
| 32 |
|
| 33 |
__attribute__ ((noinline)) |
| 34 |
static void bar(void); |
| 35 |
|
| 36 |
int main() |
| 37 |
{ |
| 38 |
f (i); |
| 39 |
bar(); |
| 40 |
g (i); |
| 41 |
|
| 42 |
#ifdef __OPTIMIZE__ |
| 43 |
if (ptr1 == ptr2) |
| 44 |
abort (); |
| 45 |
#endif |
| 46 |
|
| 47 |
exit (0); |
| 48 |
} |
| 49 |
|
| 50 |
void bar(void) { } |