1  /* { dg-require-effective-target indirect_jumps } */
       2  
       3  #include "test-setjmp.h"
       4  #include <stddef.h>
       5  #include <stdlib.h>
       6  
       7  extern int foo (int) __attribute__ ((__pure__));
       8  
       9  static jmp_buf env;
      10  
      11  static void inner (void)
      12  {
      13    void *ptr = malloc (1024); /* { dg-message "allocated here" }  */
      14    longjmp (env, 1); /* { dg-warning "leak of 'ptr'" } */
      15    free (ptr);
      16  }
      17  
      18  void outer (void)
      19  {
      20    int i;
      21  
      22    foo (0);
      23  
      24    i = SETJMP(env);
      25  
      26    if (i == 0)
      27      {
      28        foo (1);
      29        inner ();
      30      }
      31  
      32    foo (3);
      33  }