*** empty log message ***

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@1012 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2001-02-01 13:34:18 +00:00
commit 9f8c7a554a
14 changed files with 720 additions and 625 deletions

View file

@ -3,9 +3,21 @@
#include "wad.h"
#include <assert.h>
int seg_crash(int n) {
typedef struct Foo {
double a;
double b;
float c;
} Foo;
static int type_crash(int n, short m, char c, double x, float y, Foo f, void *ptr) {
int *a = 0;
if (n > 0) seg_crash(n-1);
*a = 3;
return 1;
}
static int seg_crash(int n, double x,
float y) {
int *a = 0;
if (n > 0) seg_crash(n-1,x,y);
*a = 3;
return 1;
}
@ -61,23 +73,26 @@ static int test(int x, int (*f)(int)) {
int main(int argc, char **argv) {
int n;
int (*f)(int);
Foo foo = { 3.14, 28.18, 1.0 };
printf("starting.\n");
if (strcmp(argv[1],"abort") == 0) {
abort_crash(0);
} else if (strcmp(argv[1],"seg") ==0) {
seg_crash(0);
seg_crash(0,1,2);
} else if (strcmp(argv[1],"bus") == 0) {
bus_crash(0);
} else if (strcmp(argv[1],"ret") == 0) {
call_func(4,seg_crash);
call_func(4,abort_crash);
} else if (strcmp(argv[1],"test") == 0) {
test(-1000,seg_crash);
test(-1000,abort_crash);
} else if (strcmp(argv[1],"double") == 0) {
double_crash(3.14159,2.1828);
} else if (strcmp(argv[1],"math") == 0) {
math_crash(3,0);
} else if (strcmp(argv[1],"type") == 0) {
type_crash(34,42,17, 3.14159, 2.1828, foo, &foo);
}
multi(3,5,10,3.14);
}