| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-tree-optimized --param early-inlining-insns=14" } */ |
| 3 |
#define _UNUSED_ __attribute__((__unused__)) |
| 4 |
|
| 5 |
typedef int TEST_F30 (int *v); |
| 6 |
typedef void TEST_F31 (int *v); |
| 7 |
typedef void TEST_F32 (int *v, int r); |
| 8 |
|
| 9 |
typedef struct TEST_T30_ { |
| 10 |
TEST_F30 * pf30; |
| 11 |
TEST_F31 * pf31; |
| 12 |
TEST_F32 * pf32; |
| 13 |
} TEST_T30; |
| 14 |
|
| 15 |
static inline |
| 16 |
int test_f30 (int *v) |
| 17 |
{ |
| 18 |
*v = 1; |
| 19 |
return 0; |
| 20 |
}//test_f30() |
| 21 |
|
| 22 |
static inline |
| 23 |
void test_f31 (int *v _UNUSED_) |
| 24 |
{ |
| 25 |
}//test_f31() |
| 26 |
|
| 27 |
static inline |
| 28 |
void test_f32 (int *v, int r _UNUSED_) |
| 29 |
{ |
| 30 |
*v = 0; |
| 31 |
}//test_f32() |
| 32 |
|
| 33 |
static const |
| 34 |
TEST_T30 test_t30 = { |
| 35 |
.pf30 = test_f30, |
| 36 |
.pf31 = test_f31, |
| 37 |
.pf32 = test_f32, |
| 38 |
}; |
| 39 |
|
| 40 |
static inline |
| 41 |
int test_f10 (const TEST_T30 *pt30, int *v) |
| 42 |
{ |
| 43 |
int r = pt30->pf30(v); |
| 44 |
pt30->pf31(v); |
| 45 |
pt30->pf32(v, r); |
| 46 |
return 0; |
| 47 |
}//test_f10() |
| 48 |
|
| 49 |
int test_f00 (int *v) |
| 50 |
{ |
| 51 |
return test_f10(&test_t30, v); |
| 52 |
}//test_f00() |
| 53 |
|
| 54 |
/* Everything should be inlined and only test_f00 body should appear. */ |
| 55 |
/* { dg-final { scan-tree-dump-not "test_f10" "optimized" } } */ |
| 56 |
/* { dg-final { scan-tree-dump-not "test_f3" "optimized" } } */ |