Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 117 additions & 0 deletions check/fixes.frm
Original file line number Diff line number Diff line change
Expand Up @@ -4525,6 +4525,123 @@ assert stdout =~ exact_pattern(<<'EOF')
sumpow: 129
EOF
*--#] Issue796c :
*--#[ Issue856 :
#-
Off Statistics;
CFunction f,g,h;

#define MODE "1"
#define MAX "4"

* Each expression is a different size:
#do i = 1,`MAX'
Local test`i' = f(`i')^`i';
Local htest`i' = g(`i')^{`i'+`MAX'};
Local ihtest`i' = h(`i')^{`i'+2*`MAX'};
#enddo
.sort

* Start with "htest" expr hidden
Hide htest1,...,htest`MAX';
.sort

#do i = 1,`MAX'
UnHide htest`i';
.sort
IntoHide ihtest`i';
#if `MODE' == 1
InParallel;
#endif
Multiply 2;
.sort
Hide htest`i';
#enddo
.sort

* UnHide all, mixture of InParallel and regular:
InParallel htest1,...,htest`MAX';
UnHide;
.sort


* Reset
Hide htest1,...,htest`MAX';
.sort

* Same again, with UnHide in the inparallel module
#do i = 1,`MAX'
UnHide htest`i';
IntoHide ihtest`i';
#if `MODE' == 1
InParallel;
#endif
Multiply 2;
.sort
Hide htest`i';
#enddo
.sort

UnHide;
.sort


* Reset
Hide htest1,...,htest`MAX';
.sort

* Same again, leave the first expression in the Hide file
#do i = 2,`MAX'
UnHide htest`i';
.sort
IntoHide ihtest`i';
#if `MODE' == 1
InParallel;
#endif
Multiply 2;
.sort
Hide htest`i';
#enddo
.sort

UnHide;
.sort


* Reset
Hide htest1,...,htest`MAX';
.sort

* Same again, leave the first expression in the Hide file, but take from the end
#do i = `MAX',2,-1
UnHide htest`i';
.sort
IntoHide ihtest`i';
#if `MODE' == 1
InParallel;
#endif
Multiply 2;
.sort
Hide htest`i';
#enddo
.sort

UnHide;
Print;
.end
assert succeeded?
assert result("test1") =~ expr("16384*f(1)")
assert result("htest1") =~ expr("4*g(1)^5")
assert result("ihtest1") =~ expr("256*h(1)^9")
assert result("test2") =~ expr("16384*f(2)^2")
assert result("htest2") =~ expr("16*g(2)^6")
assert result("ihtest2") =~ expr("256*h(2)^10")
assert result("test3") =~ expr("16384*f(3)^3")
assert result("htest3") =~ expr("16*g(3)^7")
assert result("ihtest3") =~ expr("1024*h(3)^11")
assert result("test4") =~ expr("16384*f(4)^4")
assert result("htest4") =~ expr("16*g(4)^8")
assert result("ihtest4") =~ expr("4096*h(4)^12")
*--#] Issue856 :
*--#[ PullReq535 :
* This test requires more than the specified 50K workspace.
#:maxtermsize 200
Expand Down
6 changes: 6 additions & 0 deletions sources/proces.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ int Processor(void)
AN.PolyFunTodo = 0;
#ifdef HIDEDEBUG
MesPrint("Status at the start of Processor (HideLevel = %d)",AC.HideLevel);
MesPrint("File %s POfill %l POfull %l POsize %l", AR.infile->name ,AR.infile->POfill -AR.infile->PObuffer ,AR.infile->POfull -AR.infile->PObuffer ,AR.infile->POsize/sizeof(WORD) );
MesPrint("File %s POfill %l POfull %l POsize %l", AR.outfile->name ,AR.outfile->POfill -AR.outfile->PObuffer ,AR.outfile->POfull -AR.outfile->PObuffer ,AR.outfile->POsize/sizeof(WORD) );
MesPrint("File %s POfill %l POfull %l POsize %l", AR.hidefile->name ,AR.hidefile->POfill-AR.hidefile->PObuffer,AR.hidefile->POfull-AR.hidefile->PObuffer,AR.hidefile->POsize/sizeof(WORD));
for ( i = 0; i < NumExpressions; i++ ) {
e = Expressions+i;
ExprStatus(e);
Expand Down Expand Up @@ -644,6 +647,9 @@ commonread:;
AT.WorkPointer = term;
#ifdef HIDEDEBUG
MesPrint("Status at the end of Processor (HideLevel = %d)",AC.HideLevel);
MesPrint("File %s POfill %l POfull %l POsize %l", AR.infile->name ,AR.infile->POfill -AR.infile->PObuffer ,AR.infile->POfull -AR.infile->PObuffer ,AR.infile->POsize/sizeof(WORD) );
MesPrint("File %s POfill %l POfull %l POsize %l", AR.outfile->name ,AR.outfile->POfill -AR.outfile->PObuffer ,AR.outfile->POfull -AR.outfile->PObuffer ,AR.outfile->POsize/sizeof(WORD) );
MesPrint("File %s POfill %l POfull %l POsize %l", AR.hidefile->name ,AR.hidefile->POfill-AR.hidefile->PObuffer,AR.hidefile->POfull-AR.hidefile->PObuffer,AR.hidefile->POsize/sizeof(WORD));
for ( i = 0; i < NumExpressions; i++ ) {
e = Expressions+i;
ExprStatus(e);
Expand Down
4 changes: 2 additions & 2 deletions sources/store.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ void SetScratch(FILEHANDLE *f, POSITION *position)
if ( f == AR.hidefile ) whichInInBuf = &(AR.InHiBuf);
else whichInInBuf = &(AR.InInBuf);
#ifdef HIDEDEBUG
if ( f == AR.hidefile ) MesPrint("In the hide file");
else MesPrint("In the input file");
if ( f == AR.hidefile ) MesPrint("In the hide file: %s", f->name);
else MesPrint("In the input file: %s", f->name);
MesPrint("SetScratch to position %15p",position);
MesPrint("POposition = %15p, full = %l, fill = %l"
,&(f->POposition),(f->POfull-f->PObuffer)*sizeof(WORD)
Expand Down
1 change: 0 additions & 1 deletion sources/threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -1785,7 +1785,6 @@ bucketstolen:;
goto ProcErr;
}
AB[0]->R.outfile = oldoutfile;
AB[0]->R.hidefile->POfull = AB[0]->R.hidefile->POfill;
AB[0]->R.expflags = AR.expflags;
UNLOCK(AS.outputslock);

Expand Down
Loading