1: /* Nesting catchers. */

  3: #include <stdio.h>

  5: #include "exception-local.h"

  7: int
  8: main (int argc, char **argv)
  9: {
 10:   try
 11:     {
 12:       try
 13:         {
 14:           try
 15:             {
 16:               throw (0);
 17:             }
 18:           catch
 19:             on (0)
 20:               printf ("0 catched. OK.\n");

 22:           throw (1);
 23:         }
 24:       catch
 25:         {
 26:           on (1)
 27:             printf ("1 catched. OK.\n");
 28:         }

 30:       throw (2);
 31:     }
 32:   catch
 33:     {
 34:       on (2)
 35:         printf ("2 catched. OK.\n");
 36:     }

 38:   throw (3);
 39:            
 40:   exit (0);
 41: }