1  /* Test BTF generation of anonymous struct.
       2  
       3     We expect two BTF struct records:
       4     - struct foo, with two fields "a" and "bar"
       5     - struct <anonymous> with one field "b"
       6  
       7     The anonymous struct should have a name of 0, pointing to the null string
       8     at the start of the string table.  */
       9  
      10  /* { dg-do compile } */
      11  /* { dg-options "-O0 -gbtf -dA" } */
      12  
      13  /* Struct type with 2 members (struct foo).  */
      14  /* { dg-final { scan-assembler-times "\[\t \]0x4000002\[\t \]+\[^\n\]*btt_info" 1 } } */
      15  /* Struct type with 1 member (anon struct).  */
      16  /* { dg-final { scan-assembler-times "\[\t \]0x4000001\[\t \]+\[^\n\]*btt_info" 1 } } */
      17  /* { dg-final { scan-assembler-times "\[\t \]0\[\t \]+\[^\n\]*btt_name" 1 } } */
      18  
      19  struct foo
      20  {
      21    int a;
      22    struct { int b; } bar;
      23  } myfoo;