(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
arm/
pr66912.c
       1  /* { dg-do compile { target *-*-linux* arm*-*-uclinuxfdpiceabi } } */
       2  /* { dg-options "-O2 -fpic" } */
       3  
       4  __attribute__((visibility("protected")))
       5  int n_common;
       6  
       7  __attribute__((weak, visibility("protected")))
       8  int n_weak_common;
       9  
      10  __attribute__((visibility("protected")))
      11  int n_init = -1;
      12  
      13  __attribute__((weak, visibility("protected")))
      14  int n_weak_init = -1;
      15  
      16  int
      17  f1 ()
      18  {
      19    /* { dg-final { scan-assembler "\\.word\\tn_common\\(GOT\\)" } } */
      20    return n_common;
      21  }
      22  
      23  int
      24  f2 ()
      25  {
      26    /* { dg-final { scan-assembler "\\.word\\tn_weak_common\\(GOT\\)" } } */
      27    return n_weak_common;
      28  }
      29  
      30  int
      31  f3 ()
      32  {
      33    /* { dg-final { scan-assembler "\\.word\\tn_init\\(GOT\\)" } } */
      34    return n_init;
      35  }
      36  
      37  int
      38  f4 ()
      39  {
      40    /* { dg-final { scan-assembler "\\.word\\tn_weak_init\\(GOT\\)" } } */
      41    return n_weak_init;
      42  }