1  /* { dg-do compile } */
       2  /* { dg-options "-O2 -fcf-protection" } */
       3  /* { dg-final { scan-assembler-times {\mendbr} 2 } } */
       4  
       5  struct ucontext;
       6  
       7  extern int (*bar) (struct ucontext *)
       8  #ifdef __has_attribute
       9  # if __has_attribute (__indirect_return__)
      10    __attribute__((__indirect_return__))
      11  # endif
      12  #endif
      13  ;
      14  
      15  extern int res;
      16  
      17  void
      18  foo (struct ucontext *oucp)
      19  {
      20    res = bar (oucp);
      21  }