| 1 |
/* { dg-options "-g3 -O" } */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
|
| 4 |
/* Here's the deal: f4 is inlined into main, f3 is inlined into f4, f2 is |
| 5 |
inlined into f1. The DIE of main should contain DW_TAG_inlined_subroutines |
| 6 |
children for f4, f3, f2 and f1. Also, there should be a DIE representing |
| 7 |
and out of line instance of f4, aside the DIE representing its abstract |
| 8 |
instance. |
| 9 |
We used to fail to emit debugging info for t1, because it was moved |
| 10 |
inside the (inlined) block of f1, marked as abstract, then we'd crash. */ |
| 11 |
|
| 12 |
#define UNUSED __attribute__((unused)) |
| 13 |
#define EXT __extension__ |
| 14 |
|
| 15 |
int undef(void); |
| 16 |
|
| 17 |
inline static void |
| 18 |
f1 (int i UNUSED) |
| 19 |
{ |
| 20 |
} |
| 21 |
|
| 22 |
inline static void |
| 23 |
f2 (void) |
| 24 |
{ |
| 25 |
f1 (EXT ({ int t1 UNUSED; undef (); })); |
| 26 |
} |
| 27 |
|
| 28 |
inline static void |
| 29 |
f3 (void) |
| 30 |
{ |
| 31 |
int v1 UNUSED; |
| 32 |
int v2 UNUSED; |
| 33 |
|
| 34 |
EXT ({ int t2 UNUSED; if (0) undef (); 0; }) |
| 35 |
&& EXT ({ int t3 UNUSED; if (0) undef (); 0; }); |
| 36 |
|
| 37 |
if (1) |
| 38 |
{ |
| 39 |
undef (); |
| 40 |
if (1) |
| 41 |
f2 (); |
| 42 |
} |
| 43 |
|
| 44 |
{ |
| 45 |
undef (); |
| 46 |
} |
| 47 |
} |
| 48 |
|
| 49 |
inline static void |
| 50 |
f4 (void) |
| 51 |
{ |
| 52 |
EXT ({ undef (); 1; }) && EXT ({ int t4 UNUSED = ({ 1; }); 1; }); |
| 53 |
|
| 54 |
{ } |
| 55 |
|
| 56 |
EXT ({ int t5 UNUSED; if (0) undef (); 0; }); |
| 57 |
|
| 58 |
f4 (); |
| 59 |
|
| 60 |
undef (); |
| 61 |
f3 (); |
| 62 |
|
| 63 |
return; |
| 64 |
} |
| 65 |
|
| 66 |
int |
| 67 |
main () |
| 68 |
{ |
| 69 |
int foo = 1; |
| 70 |
f4 (); |
| 71 |
} |