5 extension_loaded("psi") or die("skip - need ext/psi");
11 function validate($check, $psi) {
12 if ($check !== psi_validate_string($psi)) {
13 printf("Assertion failed!\nExpected: %s\n\n%s\n\n",
14 $check ? "true" : "false", $psi);
18 validate(true, "typedef void *bar;");
19 validate(true, "typedef long foo;");
20 validate(true, "typedef struct foo bar;");
21 validate(true, "typedef struct {int a;} foo;");
22 validate(true, "struct a::(8,8); \ntypedef struct a a_t;");
23 validate(true, "typedef struct a a_t; \nstruct a::(8,8);");
35 validate(true, "typedef int foo(int bar);");
36 validate(true, "typedef int (foo)(int bar);");
37 validate(true, "typedef int (*foo)(int bar);");
38 validate(true, "typedef int *(*foo)(int bar);");
39 validate(true, "typedef int *(*bar)(int baz); \ntypedef int *(*foo)(bar bar);");
40 validate(true, "typedef int bar(int baz); \ntypedef int *(*foo)(bar bar);");