| 1 |
/* Test BTF generation for extern variables. */ |
| 2 |
|
| 3 |
/* { dg-do compile } */ |
| 4 |
/* { dg-options "-O0 -gbtf -dA" } */ |
| 5 |
|
| 6 |
/* Expect 4 variables. */ |
| 7 |
/* { dg-final { scan-assembler-times "\[\t \]0xe000000\[\t \]+\[^\n\]*btv_info" 4 } } */ |
| 8 |
|
| 9 |
/* 2 extern, 1 global, 1 static. */ |
| 10 |
/* { dg-final { scan-assembler-times "\[\t \]0\[\t \]+\[^\n\]*btv_linkage" 1 } } */ |
| 11 |
/* { dg-final { scan-assembler-times "\[\t \]0x1\[\t \]+\[^\n\]*btv_linkage" 1 } } */ |
| 12 |
/* { dg-final { scan-assembler-times "\[\t \]0x2\[\t \]+\[^\n\]*btv_linkage" 2 } } */ |
| 13 |
|
| 14 |
extern int a; |
| 15 |
extern const int b; |
| 16 |
int c; |
| 17 |
static const int d = 5; |
| 18 |
|
| 19 |
int foo (int x) |
| 20 |
{ |
| 21 |
c = a + b + x; |
| 22 |
|
| 23 |
return c + d; |
| 24 |
} |