aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/debug/btf/btf-variables-2.c
blob: 5f0c0b6e02d8cef6fc0c2032939282441205a045 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* BTF generation for variables with removed type.

   BTF does not support vector types, so no representation for the type
   of 'bar' will be emitted. In this test, we check to also ensure that the
   variable 'bar' is not emitted, as it references a type that is not supported
   in BTF.  */

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

/* We expect only 3 variables.  */
/* { dg-final { scan-assembler-times "\[\t \]0xe000000\[\t \]+\[^\n\]*btv_info" 3 } } */

/* { dg-final { scan-assembler-times " BTF_KIND_VAR 'foo'" 1 } } */
/* { dg-final { scan-assembler-times " BTF_KIND_VAR 'baz'" 1 } } */
/* { dg-final { scan-assembler-times " BTF_KIND_VAR 'myst'" 1 } } */
/* { dg-final { scan-assembler-times "ascii \"foo.0\"\[\t \]+\[^\n\]*btf_string" 1 } } */
/* { dg-final { scan-assembler-times "ascii \"baz.0\"\[\t \]+\[^\n\]*btf_string" 1 } } */
/* { dg-final { scan-assembler-times "ascii \"myst.0\"\[\t \]+\[^\n\]*btf_string" 1 } } */

int foo;
float __attribute__((__vector_size__(16))) bar;
int baz[10];

struct st
{
  int a;
  int b : 6;
  int c : 2;
} myst;