aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/debug/btf/btf-variables-5.c
blob: 8aae76cacabd7728475d21d17def66df8ba027c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* Test BTF generation for extern variable with both non-defining and
   defining declarations.

   In this case, only a single variable record should be emitted,
   with 'global' linkage. However two array types will be generated.  */

/* { dg-do compile } */
/* { dg-options "-O0 -gbtf -dA" } */

/* Expect 1 variable with global (1) linkage.  */
/* { dg-final { scan-assembler-times "\[\t \]0xe000000\[\t \]+\[^\n\]*btv_info" 1 } } */
/* { dg-final { scan-assembler-times "\[\t \]0x1\[\t \]+\[^\n\]*btv_linkage" 1 } } */

/* Expect 2 array types, one of which is unsized.  */
/* { dg-final { scan-assembler-times "\[\t \]0x4\[\t \]+\[^\n\]*bta_nelems" 1 } } */
/* { dg-final { scan-assembler-times "\[\t \]0\[\t \]+\[^\n\]*bta_nelems" 1 } } */

extern const char FOO[];
const char FOO[] = "foo";