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: {
11: return 0;
12: }
14: PetscErrorCode correctu()
15: {
17: return 0;
18: }
20: PetscErrorCode foo()
21: {
22: return 0;
23: }
25: PetscErrorCode bar()
26: {
27: return 0;
28: }
30: PetscErrorCode baru()
31: {
33: return 0;
34: }
36: int main(int argc,char **argv)
37: {
38: PetscBool flg = PETSC_FALSE;
40: PetscInitialize(&argc,&argv,(char*)0,help);
41: #if defined(PETSC_USE_DEBUG)
42: PetscOptionsGetBool(NULL,NULL,"-checkstack",&flg,NULL);
43: #endif
44: PetscPrintf(PETSC_COMM_WORLD,"%s for stack\n",flg ? "Checking" : "Not checking");
45: for (PetscInt i = 0; i < PETSCSTACKSIZE+1; i++) correct();
46: for (PetscInt i = 0; i < PETSCSTACKSIZE+1; i++) foo();
47: for (PetscInt i = 0; i < PETSCSTACKSIZE+1; i++) bar();
48: for (PetscInt i = 0; i < PETSCSTACKSIZE+1; i++) foo();
49: for (PetscInt i = 0; i < PETSCSTACKSIZE+1; i++) baru();
50: for (PetscInt i = 0; i < PETSCSTACKSIZE+1; i++) foo();
51: PetscFinalize();
52: return 0;
53: }
55: /*TEST
57: test:
59: TEST*/