| 1 |
/* Test BTF extern linkage for functions. |
| 2 |
|
| 3 |
We expect to see one BTF_KIND_FUNC type with global linkage (foo), and |
| 4 |
one BTF_KIND_FUNC type with extern linkage (extfunc). */ |
| 5 |
|
| 6 |
/* { dg-do compile } */ |
| 7 |
/* { dg-options "-O0 -gbtf -dA" } */ |
| 8 |
|
| 9 |
/* { dg-final { scan-assembler-times " BTF_KIND_FUNC\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*linkage=2\[\\r\\n\]+\[^\\r\\n\]*\\(BTF_KIND_FUNC_PROTO ''" 1 } } */ |
| 10 |
/* { dg-final { scan-assembler-times " BTF_KIND_FUNC\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*linkage=1\[\\r\\n\]+\[^\\r\\n\]*\\(BTF_KIND_FUNC_PROTO ''" 1 } } */ |
| 11 |
|
| 12 |
extern int extfunc(int a, int b); |
| 13 |
|
| 14 |
int foo (int x) { |
| 15 |
|
| 16 |
int y = extfunc (x, x+1); |
| 17 |
|
| 18 |
return y; |
| 19 |
} |