(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
debug/
btf/
btf-int-1.c
       1  /* Tests for BTF integer base types.
       2  
       3       0       f       ff      00   ff
       4     | 0 | encoding | offset | 00 | bits |
       5     encoding:
       6       signed  1 << 24
       7       char    2 << 24  (not used)
       8       bool    4 << 24
       9  
      10     All offsets in this test should be 0.
      11     This test does _not_ check number of bits, as it may vary between targets.
      12   */
      13  
      14  /* { dg-do compile } */
      15  /* { dg-options "-O0 -gbtf -dA" } */
      16  
      17  /* Check for 9 BTF_KIND_INT types.  */
      18  /* { dg-final { scan-assembler-times "\[\t \]0x1000000\[\t \]+\[^\n\]*btt_info" 9 } } */
      19  
      20  /* Check the signed flags, but not bit size. */
      21  /* { dg-final { scan-assembler-times "\[\t \]0x10000\[0-9a-zA-Z\]{2}\[\t \]+\[^\n\]*bti_encoding" 4 } } */
      22  /* { dg-final { scan-assembler-times "\[\t \]0x\[0-9a-zA-Z\]{2}\[\t \]+\[^\n\]*bti_encoding" 3 } } */
      23  /* { dg-final { scan-assembler-times "\[\t \]0x\[0-9a-zA-Z\]\[\t \]+\[^\n\]*bti_encoding" 1 } } */
      24  /* { dg-final { scan-assembler-times "\[\t \]0x40000\[0-9a-zA-Z\]{2}\[\t \]+\[^\n\]*bti_encoding" 1 } } */
      25  
      26  /* Check that there is a string entry for each type name.  */
      27  /* { dg-final { scan-assembler-times "ascii \"unsigned char.0\"\[\t \]+\[^\n\]*btf_string" 1 } } */
      28  /* { dg-final { scan-assembler-times "ascii \"signed char.0\"\[\t \]+\[^\n\]*btf_string" 1 } } */
      29  /* { dg-final { scan-assembler-times "ascii \"short unsigned int.0\"\[\t \]+\[^\n\]*btf_string" 1 } } */
      30  /* { dg-final { scan-assembler-times "ascii \"short int.0\"\[\t \]+\[^\n\]*btf_string" 1 } } */
      31  /* { dg-final { scan-assembler-times "ascii \"unsigned int.0\"\[\t \]+\[^\n\]*btf_string" 1 } } */
      32  /* { dg-final { scan-assembler-times "ascii \"int.0\"\[\t \]+\[^\n\]*btf_string" 1 } } */
      33  /* { dg-final { scan-assembler-times "ascii \"long unsigned int.0\"\[\t \]+\[^\n\]*btf_string" 1 } } */
      34  /* { dg-final { scan-assembler-times "ascii \"long int.0\"\[\t \]+\[^\n\]*btf_string" 1 } } */
      35  
      36  unsigned char a = 11;
      37  signed char b = -22;
      38  
      39  unsigned short c = 33;
      40  signed short d = 44;
      41  
      42  unsigned int e = 55;
      43  signed int f = -66;
      44  
      45  unsigned long int g = 77;
      46  signed long int h = 88;
      47  
      48  _Bool x = 1;