Actual source code: ex33.c

  1: static char help[] = "Tests PetscStack.\n\n";

  3: #include <petscsys.h>

  5: #if !defined(PETSCSTACKSIZE)
  6: #define PETSCSTACKSIZE 64
  7: #endif

  9: PetscErrorCode correct()
 10: {
 12:   return(0);
 13: }

 15: PetscErrorCode correctu()
 16: {
 18:   return(0);
 19: }

 21: PetscErrorCode foo()
 22: {
 23:   return(0);
 24: }

 26: PetscErrorCode bar()
 27: {
 29:   return 0;
 30: }

 32: PetscErrorCode baru()
 33: {
 35:   return 0;
 36: }

 38: int main(int argc,char **argv)
 39: {
 41:   PetscBool      flg = PETSC_FALSE;

 43:   PetscInitialize(&argc,&argv,(char*)0,help);if (ierr) return ierr;
 44: #if defined(PETSC_USE_DEBUG)
 45:   PetscOptionsGetBool(NULL,NULL,"-checkstack",&flg,NULL);
 46: #endif
 47:   PetscPrintf(PETSC_COMM_WORLD,"%s for stack\n",flg ? "Checking" : "Not checking");
 48:   for (PetscInt i = 0; i < PETSCSTACKSIZE+1; i++) { correct(); }
 49:   for (PetscInt i = 0; i < PETSCSTACKSIZE+1; i++) { foo(); }
 50:   for (PetscInt i = 0; i < PETSCSTACKSIZE+1; i++) { bar(); }
 51:   for (PetscInt i = 0; i < PETSCSTACKSIZE+1; i++) { foo(); }
 52:   for (PetscInt i = 0; i < PETSCSTACKSIZE+1; i++) { baru(); }
 53:   for (PetscInt i = 0; i < PETSCSTACKSIZE+1; i++) { foo(); }
 54:   PetscFinalize();
 55:   return ierr;
 56: }

 58: /*TEST

 60:   test:

 62: TEST*/