Skip to content
Snippets Groups Projects
Commit 475a843f authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Prepared for testing of wide programs.

Rev: bin/test_pike.pike:1.17
parent 2583b4dd
No related branches found
No related tags found
No related merge requests found
#!/usr/local/bin/pike #!/usr/local/bin/pike
/* $Id: test_pike.pike,v 1.16 1999/02/20 20:22:30 grubba Exp $ */ /* $Id: test_pike.pike,v 1.17 1999/02/20 21:27:50 grubba Exp $ */
#include <simulate.h> #include <simulate.h>
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#define _verify_internals() #define _verify_internals()
#endif #endif
#define SHIFT_MAX 0 /* 3 */
int foo(string opt) int foo(string opt)
{ {
if(opt=="" || !opt) return 1; if(opt=="" || !opt) return 1;
...@@ -168,14 +170,21 @@ int main(int argc, string *argv) ...@@ -168,14 +170,21 @@ int main(int argc, string *argv)
werror(test+"\n"); werror(test+"\n");
} }
for(int shift=0;shift <= SHIFT_MAX;shift++) {
if(check > 1) _verify_internals(); if(check > 1) _verify_internals();
string fname = argv[f] + ": Test " + (e + 1); string fname = argv[f] + ": Test " + (e + 1) +
" (shift " + shift + ")";
string widener = ([ 0:"",
1:"\nint \x30c6\x30b9\x30c8=0;\n",
2:"\nint \x10001=0;\n" ])[shift];
switch(type) switch(type)
{ {
case "COMPILE": case "COMPILE":
if(catch(compile_string(test, fname))) if(catch(compile_string(test + widener, fname)))
{ {
werror(fname + " failed.\n"); werror(fname + " failed.\n");
werror(test+"\n"); werror(test+"\n");
...@@ -187,7 +196,7 @@ int main(int argc, string *argv) ...@@ -187,7 +196,7 @@ int main(int argc, string *argv)
case "COMPILE_ERROR": case "COMPILE_ERROR":
master()->set_inhibit_compile_errors(1); master()->set_inhibit_compile_errors(1);
if(catch(compile_string(test, fname))) if(catch(compile_string(test + widener, fname)))
{ {
successes++; successes++;
}else{ }else{
...@@ -200,7 +209,7 @@ int main(int argc, string *argv) ...@@ -200,7 +209,7 @@ int main(int argc, string *argv)
case "EVAL_ERROR": case "EVAL_ERROR":
master()->set_inhibit_compile_errors(1); master()->set_inhibit_compile_errors(1);
if(catch(clone(compile_string(test, fname))->a())) if(catch(clone(compile_string(test + widener, fname))->a()))
{ {
successes++; successes++;
}else{ }else{
...@@ -212,7 +221,7 @@ int main(int argc, string *argv) ...@@ -212,7 +221,7 @@ int main(int argc, string *argv)
break; break;
default: default:
o=clone(compile_string(test,fname)); o=clone(compile_string(test + widener,fname));
if(check > 1) _verify_internals(); if(check > 1) _verify_internals();
...@@ -291,6 +300,8 @@ int main(int argc, string *argv) ...@@ -291,6 +300,8 @@ int main(int argc, string *argv)
if(fail && errors) if(fail && errors)
exit(1); exit(1);
}
if(!--end) exit(0); if(!--end) exit(0);
a=b=0; a=b=0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment