From b785655ae0d48300b042024df7f1c4267de3dc11 Mon Sep 17 00:00:00 2001 From: sdattalo Date: Fri, 11 Apr 2003 00:31:19 +0000 Subject: [PATCH] Pointers - Applied function ptr patch from Steve Tell. Fixed bugs with data pointers. Modified the pic regression Makefile and rt.sh script for gpasm 11.0 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2501 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 11 +++ src/pic/gen.c | 146 +++++++++++++++++++------------------- src/pic/genarith.c | 2 + src/pic/pcode.c | 4 +- src/pic/pcode.h | 10 +++ src/pic/pcodepeep.c | 24 ++++++- src/pic/pcoderegs.c | 54 +++++++++----- src/pic/ralloc.c | 12 +++- src/regression/Makefile | 10 ++- src/regression/mult1.c | 4 +- src/regression/pointer1.c | 6 ++ src/regression/rt.sh | 3 +- 12 files changed, 188 insertions(+), 98 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7c33a70d..7ce94bdb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2003-04-10 Scott Dattalo + + * src/pic/* Applied the pointer-to-function patch from Steve Tell. + * src/pic/* Fixed several pointer bugs. (PIC port broke when the ruonly bit was + set - this bit used to not be set...). + * src/pic/gen.c Fixed buf 609268 ==> x = (x+1) & 0xf; generated + bad code in PIC Port + * src/regression/and2.c added to test bug 609268 + * src/regression/Makefile added and2.c to regression test + + 2003-04-08 * src/mcs51/gen.c (gen51Code): display reg usage in --icode-in-asm diff --git a/src/pic/gen.c b/src/pic/gen.c index 5cde6064..c4a5a8bf 100644 --- a/src/pic/gen.c +++ b/src/pic/gen.c @@ -813,22 +813,34 @@ void aopOp (operand *op, iCode *ic, bool result) } if (sym->ruonly ) { - /* - sym->aop = op->aop = aop = newAsmop(AOP_PCODE); - aop->aopu.pcop = popGetImmd(sym->usl.spillLoc->rname,0,sym->usl.spillLoc->offset); - //allocDirReg (IC_LEFT(ic)); - aop->size = getSize(sym->type); - */ + if(sym->isptr) { // && sym->uptr + aop = op->aop = sym->aop = newAsmop(AOP_PCODE); + aop->aopu.pcop = newpCodeOp(NULL,PO_GPR_POINTER); //popCopyReg(&pc_fsr); + + //PCOI(aop->aopu.pcop)->_const = 0; + //PCOI(aop->aopu.pcop)->index = 0; + /* + DEBUGpic14_emitcode(";","%d: rname %s, val %d, const = %d", + __LINE__,sym->rname, 0, PCOI(aop->aopu.pcop)->_const); + */ + //allocDirReg (IC_LEFT(ic)); - unsigned i; + aop->size = getSize(sym->type); + DEBUGpic14_emitcode(";","%d",__LINE__); + return; - aop = op->aop = sym->aop = newAsmop(AOP_STR); - aop->size = getSize(sym->type); - for ( i = 0 ; i < fReturnSizePic ; i++ ) - aop->aopu.aop_str[i] = fReturn[i]; + } else { - DEBUGpic14_emitcode(";","%d",__LINE__); - return; + unsigned i; + + aop = op->aop = sym->aop = newAsmop(AOP_STR); + aop->size = getSize(sym->type); + for ( i = 0 ; i < fReturnSizePic ; i++ ) + aop->aopu.aop_str[i] = fReturn[i]; + + DEBUGpic14_emitcode(";","%d",__LINE__); + return; + } } /* else spill location */ @@ -1357,7 +1369,7 @@ pCodeOp *popGet (asmop *aop, int offset) //, bool bit16, bool dname) PCOR(pcop)->instance = offset; pcop->type = PCOR(pcop)->r->pc_type; //rs = aop->aopu.aop_reg[offset]->name; - //DEBUGpic14_emitcode(";","%d regiser idx = %d name =%s",__LINE__,rIdx,rs); + DEBUGpic14_emitcode(";","%d regiser idx = %d ",__LINE__,rIdx); return pcop; } @@ -1640,7 +1652,8 @@ void mov2w (asmop *aop, int offset) DEBUGpic14_emitcode ("; ***","%s %d offset=%d",__FUNCTION__,__LINE__,offset); if ( aop->type == AOP_PCODE || - aop->type == AOP_LIT ) + aop->type == AOP_LIT || + aop->type == AOP_IMMD ) emitpcode(POC_MOVLW,popGet(aop,offset)); else emitpcode(POC_MOVFW,popGet(aop,offset)); @@ -2156,6 +2169,7 @@ static void assignResultValue(operand * oper) size--; emitpcode(POC_MOVWF, popGet(AOP(oper),size)); GpsuedoStkPtr++; + DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); } while (size--) { @@ -2486,8 +2500,10 @@ static void genCall (iCode *ic) static void genPcall (iCode *ic) { sym_link *dtype; - symbol *rlbl = newiTempLabel(NULL); - + symbol *albl = newiTempLabel(NULL); + symbol *blbl = newiTempLabel(NULL); + PIC_OPCODE poc; + operand *left; DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); /* if caller saves & we have not saved then */ @@ -2503,54 +2519,48 @@ static void genPcall (iCode *ic) (FUNC_REGBANK(currFunc->type) != FUNC_REGBANK(dtype))) saverbank(FUNC_REGBANK(dtype),ic,TRUE); - - /* push the return address on to the stack */ - pic14_emitcode("mov","a,#%05d_DS_",(rlbl->key+100)); - pic14_emitcode("push","acc"); - pic14_emitcode("mov","a,#(%05d_DS_ >> 8)",(rlbl->key+100)); - pic14_emitcode("push","acc"); - - if (options.model == MODEL_FLAT24) - { - pic14_emitcode("mov","a,#(%05d_DS_ >> 16)",(rlbl->key+100)); - pic14_emitcode("push","acc"); - } - - /* now push the calling address */ - aopOp(IC_LEFT(ic),ic,FALSE); + left = IC_LEFT(ic); + aopOp(left,ic,FALSE); + DEBUGpic14_AopType(__LINE__,left,NULL,NULL); pushSide(IC_LEFT(ic), FPTRSIZE); - freeAsmop(IC_LEFT(ic),NULL,ic,TRUE); - - /* if send set is not empty the assign */ + /* if send set is not empty, assign parameters */ if (_G.sendSet) { - iCode *sic ; - for (sic = setFirstItem(_G.sendSet) ; sic ; - sic = setNextItem(_G.sendSet)) { - int size, offset = 0; - aopOp(IC_LEFT(sic),sic,FALSE); - size = AOP_SIZE(IC_LEFT(sic)); - while (size--) { - char *l = aopGet(AOP(IC_LEFT(sic)),offset, - FALSE,FALSE); - if (strcmp(l,fReturn[offset])) - pic14_emitcode("mov","%s,%s", - fReturn[offset], - l); - offset++; - } - freeAsmop (IC_LEFT(sic),NULL,sic,TRUE); - } - _G.sendSet = NULL; + DEBUGpic14_emitcode ("; ***","%s %d - WARNING arg-passing to indirect call not supported",__FUNCTION__,__LINE__); + /* no way to pass args - W always gets used to make the call */ } +/* first idea - factor out a common helper function and call it. + But don't know how to get it generated only once in its own block - pic14_emitcode("ret",""); - pic14_emitcode("","%05d_DS_:",(rlbl->key+100)); + if(AOP_TYPE(IC_LEFT(ic)) == AOP_DIR) { + char *rname; + char *buffer; + rname = IC_LEFT(ic)->aop->aopu.aop_dir; + DEBUGpic14_emitcode ("; ***","%s %d AOP_DIR %s",__FUNCTION__,__LINE__,rname); + buffer = Safe_calloc(1,strlen(rname)+16); + sprintf(buffer, "%s_goto_helper", rname); + addpCode2pBlock(pb,newpCode(POC_CALL,newpCodeOp(buffer,PO_STR))); + free(buffer); + } +*/ + emitpcode(POC_CALL,popGetLabel(albl->key)); + emitpcode(POC_GOTO,popGetLabel(blbl->key)); + emitpLabel(albl->key); + + poc = ( (AOP_TYPE(left) == AOP_PCODE) ? POC_MOVLW : POC_MOVFW); + + emitpcode(poc,popGet(AOP(left),1)); + emitpcode(POC_MOVWF,popCopyReg(&pc_pclath)); + emitpcode(poc,popGet(AOP(left),0)); + emitpcode(POC_MOVWF,popCopyReg(&pc_pcl)); + + emitpLabel(blbl->key); + freeAsmop(IC_LEFT(ic),NULL,ic,TRUE); - /* if we need assign a result value */ + /* if we need to assign a result value */ if ((IS_ITEMP(IC_RESULT(ic)) && (OP_SYMBOL(IC_RESULT(ic))->nRegs || OP_SYMBOL(IC_RESULT(ic))->spildir)) || @@ -2565,20 +2575,6 @@ static void genPcall (iCode *ic) freeAsmop(IC_RESULT(ic),NULL,ic,TRUE); } - /* adjust the stack for parameters if - required */ - if (ic->parmBytes) { - int i; - if (ic->parmBytes > 3) { - pic14_emitcode("mov","a,%s",spname); - pic14_emitcode("add","a,#0x%02x", (- ic->parmBytes) & 0xff); - pic14_emitcode("mov","%s,a",spname); - } else - for ( i = 0 ; i < ic->parmBytes ;i++) - pic14_emitcode("dec","%s",spname); - - } - /* if register bank was saved then unsave them */ if (currFunc && dtype && (FUNC_REGBANK(currFunc->type) != FUNC_REGBANK(dtype))) @@ -3016,8 +3012,10 @@ static void genRet (iCode *ic) l = aopGet(AOP(IC_LEFT(ic)),offset, FALSE,FALSE); if (strcmp(fReturn[offset],l)) { - if( ( (AOP(IC_LEFT(ic))->type) == AOP_IMMD) || - ((AOP(IC_LEFT(ic))->type) == AOP_LIT) ) { + if ((((AOP(IC_LEFT(ic))->type) == AOP_PCODE) && + AOP(IC_LEFT(ic))->aopu.pcop->type == PO_IMMEDIATE) || + ( (AOP(IC_LEFT(ic))->type) == AOP_IMMD) || + ( (AOP(IC_LEFT(ic))->type) == AOP_LIT) ) { emitpcode(POC_MOVLW, popGet(AOP(IC_LEFT(ic)),offset)); }else { emitpcode(POC_MOVFW, popGet(AOP(IC_LEFT(ic)),offset)); @@ -9337,6 +9335,10 @@ static void genAssign (iCode *ic) emitpcode(POC_BTFSS, popGet(AOP(right),0)); emitpcode(POC_INCF, popGet(AOP(result),0)); } + } else if (AOP_TYPE(right) == AOP_IMMD) { + DEBUGpic14_emitcode ("; ***","%s %d AOP_IMMD",__FUNCTION__,__LINE__); + emitpcode(POC_MOVLW, popGet(AOP(right),offset)); + emitpcode(POC_MOVWF, popGet(AOP(result),offset)); } else { DEBUGpic14_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__); emitpcode(POC_MOVFW, popGet(AOP(right),offset)); diff --git a/src/pic/genarith.c b/src/pic/genarith.c index f998a7c4..b96dcdac 100644 --- a/src/pic/genarith.c +++ b/src/pic/genarith.c @@ -118,6 +118,8 @@ const char *pCodeOpType( pCodeOp *pcop) return "PO_INTCON"; case PO_GPR_REGISTER: return "PO_GPR_REGISTER"; + case PO_GPR_POINTER: + return "PO_GPR_POINTER"; case PO_GPR_BIT: return "PO_GPR_BIT"; case PO_GPR_TEMP: diff --git a/src/pic/pcode.c b/src/pic/pcode.c index cb2cfcc9..8dbfda78 100644 --- a/src/pic/pcode.c +++ b/src/pic/pcode.c @@ -2227,6 +2227,7 @@ pCodeOp *newpCodeOp(char *name, PIC_OPTYPE type) pcop = newpCodeOpReg(-1); break; + case PO_GPR_POINTER: case PO_GPR_REGISTER: if(name) pcop = newpCodeOpRegFromStr(name); @@ -2511,7 +2512,8 @@ char *get_op(pCodeOp *pcop,char *buffer, size_t size) SAFE_snprintf(&buffer,&size,"%s",PCOR(pcop)->r->name); return buffer; } - return PCOR(pcop)->r->name; + //return PCOR(pcop)->r->name; + return pcop->name; break; case PO_GPR_TEMP: r = pic14_regWithIdx(PCOR(pcop)->r->rIdx); diff --git a/src/pic/pcode.h b/src/pic/pcode.h index 86c24508..46010a3f 100644 --- a/src/pic/pcode.h +++ b/src/pic/pcode.h @@ -143,6 +143,7 @@ typedef enum PO_GPR_REGISTER, // A general purpose register PO_GPR_BIT, // A bit of a general purpose register PO_GPR_TEMP, // A general purpose temporary register + PO_GPR_POINTER, // A general purpose pointer PO_SFR_REGISTER, // A special function register (e.g. PORTA) PO_PCL, // Program counter Low register PO_PCLATH, // Program counter Latch high register @@ -345,6 +346,15 @@ typedef struct pCodeOpRegBit } pCodeOpRegBit; +typedef struct pCodeOpRegPtr +{ + pCodeOpReg pcor; // The Register containing this bit + + // PIC_OPTYPE subtype; // The type of this register. + // unsigned int inBitSpace: 1; /* True if in bit space, else + +} pCodeOpRegPtr; + typedef struct pCodeOpWild { pCodeOp pcop; diff --git a/src/pic/pcodepeep.c b/src/pic/pcodepeep.c index e6eea822..9acc689f 100644 --- a/src/pic/pcodepeep.c +++ b/src/pic/pcodepeep.c @@ -1712,7 +1712,8 @@ int pCodePeepMatchLine(pCodePeep *peepBlock, pCode *pcs, pCode *pcd) case PO_GPR_TEMP: case PO_FSR: //case PO_INDF: - n = PCOR(PCI(pcs)->pcop)->r->name; + //n = PCOR(PCI(pcs)->pcop)->r->name; + n = PCI(pcs)->pcop->name; break; default: @@ -1863,6 +1864,26 @@ void pCodeInsertAfter(pCode *pc1, pCode *pc2) } +/*------------------------------------------------------------------*/ +/* pCodeInsertBefore - splice in the pCode chain starting with pc2 */ +/* into the pCode chain containing pc1 */ +/*------------------------------------------------------------------*/ +void pCodeInsertBefore(pCode *pc1, pCode *pc2) +{ + + if(!pc1 || !pc2) + return; + + pc2->prev = pc1->prev; + if(pc1->prev) + pc1->prev->next = pc2; + + pc2->pb = pc1->pb; + pc2->next = pc1; + pc1->prev = pc2; + +} + /*-----------------------------------------------------------------*/ /* pCodeOpCopy - copy a pcode operator */ /*-----------------------------------------------------------------*/ @@ -1927,6 +1948,7 @@ pCodeOp *pCodeOpCopy(pCodeOp *pcop) return pcopnew; break; + case PO_GPR_POINTER: case PO_GPR_REGISTER: case PO_GPR_TEMP: case PO_FSR: diff --git a/src/pic/pcoderegs.c b/src/pic/pcoderegs.c index a7f72cc8..f5ea147a 100644 --- a/src/pic/pcoderegs.c +++ b/src/pic/pcoderegs.c @@ -37,12 +37,14 @@ #include "pcodeflow.h" extern void pCodeInsertAfter(pCode *pc1, pCode *pc2); +extern void pCodeInsertBefore(pCode *pc1, pCode *pc2); extern void dbg_dumpregusage(void); extern pCode * findPrevInstruction(pCode *pci); extern pBranch * pBranchAppend(pBranch *h, pBranch *n); void unlinkpCode(pCode *pc); extern int pCodeSearchCondition(pCode *pc, unsigned int cond); - +char *pCode2str(char *str, int size, pCode *pc); +void SAFE_snprintf(char **str, size_t *size, const char *format, ...); int total_registers_saved=0; int register_optimization=1; @@ -233,18 +235,16 @@ void pCodeRegMapLiveRanges(pBlock *pb) /*-----------------------------------------------------------------* * *-----------------------------------------------------------------*/ -static void Remove1pcode(pCode *pc, regs *reg) +static void Remove1pcode(pCode *pc, regs *reg, int debug_code) { + pCode *pcn=NULL; if(!reg || !pc) return; deleteSetItem (&(reg->reglives.usedpCodes),pc); -/* - fprintf(stderr,"removing instruction:\n"); - pc->print(stderr,pc); -*/ + if(PCI(pc)->label) { pcn = findNextInstruction(pc->next); @@ -266,6 +266,25 @@ static void Remove1pcode(pCode *pc, regs *reg) } } + + if(1){ + /* + Debug stuff. Comment out the instruction we're about to delete. + */ + + char buff1[256]; + int size = 256; + + char *pbuff,**ppbuff; + pbuff = buff1; + ppbuff = &pbuff; + + SAFE_snprintf(ppbuff,&size, ";%d", debug_code); + pCode2str(*ppbuff, size, pc); + pCodeInsertBefore(pc, newpCodeCharP(buff1)); + fprintf(stderr,"removing instruction:\n%s\n",buff1); + } + pc->destruct(pc); } @@ -325,8 +344,8 @@ void RemoveRegsFromSet(set *regset) pc->print(stderr,pc); fprintf(stderr,"reg %s, type =%d\n",r->name, r->type); } - //fprintf(stderr," removing reg %s because it is used only once\n",reg->name); - Remove1pcode(pc, reg); + fprintf(stderr," removing reg %s because it is used only once\n",reg->name); + Remove1pcode(pc, reg, 1); /* unlinkpCode(pc); deleteSetItem (&(reg->reglives.usedpCodes),pc); @@ -366,14 +385,16 @@ void RemoveUnusedRegisters(void) *-----------------------------------------------------------------*/ static void Remove2pcodes(pCode *pcflow, pCode *pc1, pCode *pc2, regs *reg, int can_free) { + static int debug_code=99; if(!reg) return; + fprintf(stderr,"%s\n",__FUNCTION__); if(pc1) - Remove1pcode(pc1, reg); + Remove1pcode(pc1, reg, debug_code++); if(pc2) { - Remove1pcode(pc2, reg); + Remove1pcode(pc2, reg, debug_code++); deleteSetItem (&(PCFL(pcflow)->registers), reg); if(can_free) { @@ -452,7 +473,7 @@ int pCodeOptime2pCodes(pCode *pc1, pCode *pc2, pCode *pcfl_used, regs *reg, int */ pCode *newpc; - //fprintf(stderr, " CLRF/MOVFW. instruction after MOVFW is:\n"); + fprintf(stderr, " CLRF/MOVFW. instruction after MOVFW is:\n"); pct1 = findNextInstruction(pc2->next); if(PCI(pct1)->op == POC_MOVWF) { @@ -470,7 +491,7 @@ int pCodeOptime2pCodes(pCode *pc1, pCode *pc2, pCode *pcfl_used, regs *reg, int total_registers_saved++; // debugging stats. } else if((PCI(pc1)->op == POC_CLRF) && (PCI(pc2)->op == POC_IORFW) ){ - //fprintf(stderr, " CLRF/IORFW.\n"); + fprintf(stderr, " CLRF/IORFW.\n"); pct2 = findNextInstruction(pc2->next); @@ -514,6 +535,7 @@ int pCodeOptime2pCodes(pCode *pc1, pCode *pc2, pCode *pcfl_used, regs *reg, int if(pCodeSearchCondition(pct2, PCC_Z) < 1) { pCode *pct3 = findNextInstruction(pct2->next); + fprintf(stderr,"ABCD\n"); pct2->seq = pc1->seq; unlinkpCode(pct2); pCodeInsertAfter(findPrevInstruction(pc1->prev),pct2); @@ -686,10 +708,10 @@ void OptimizeRegUsage(set *fregs, int optimize_multi_uses, int optimize_level) /* register has been used twice without ever being assigned */ - //fprintf(stderr,"WARNING %s: reg %s used without being assigned\n",__FUNCTION__,reg->name); + fprintf(stderr,"WARNING %s: reg %s used without being assigned\n",__FUNCTION__,reg->name); } else { - //fprintf(stderr,"WARNING %s: reg %s assigned without being used\n",__FUNCTION__,reg->name); + fprintf(stderr,"WARNING %s: reg %s assigned without being used\n",__FUNCTION__,reg->name); Remove2pcodes(pcfl_assigned, pc1, pc2, reg, 1); total_registers_saved++; // debugging stats. } @@ -700,13 +722,13 @@ void OptimizeRegUsage(set *fregs, int optimize_multi_uses, int optimize_level) if(used && !pcfl_used && pcfl_assigned) { pCode *pc; - //fprintf(stderr,"WARNING %s: reg %s assigned without being used\n",__FUNCTION__,reg->name); + fprintf(stderr,"WARNING %s: reg %s assigned without being used\n",__FUNCTION__,reg->name); pc = setFirstItem(reg->reglives.usedpCodes); while(pc) { pcfl_assigned = PCODE(PCI(pc)->pcflow); - Remove1pcode(pc, reg); + Remove1pcode(pc, reg,2); deleteSetItem (&(PCFL(pcfl_assigned)->registers), reg); /* diff --git a/src/pic/ralloc.c b/src/pic/ralloc.c index c02badac..4307f236 100644 --- a/src/pic/ralloc.c +++ b/src/pic/ralloc.c @@ -2436,14 +2436,22 @@ regTypeNum () /* if used in return only then we don't need registers */ - if (sym->ruonly || sym->accuse) { + if (sym->accuse) { if (IS_AGGREGATE (sym->type) || sym->isptr) sym->type = aggrToPtr (sym->type, FALSE); - debugLog (" %d - no reg needed - used as a return\n", __LINE__); + debugLog (" %d - no reg needed - accumulator used\n", __LINE__); continue; } + if (sym->ruonly) { + //if (IS_AGGREGATE (sym->type) || sym->isptr) + // sym->type = aggrToPtr (sym->type, FALSE); + debugLog (" %d - used as a return\n", __LINE__); + + //continue; + } + /* if the symbol has only one definition & that definition is a get_pointer and the pointer we are getting is rematerializable and diff --git a/src/regression/Makefile b/src/regression/Makefile index 2a3aadc2..fbcda342 100644 --- a/src/regression/Makefile +++ b/src/regression/Makefile @@ -47,7 +47,7 @@ CC = ../../bin/sdcc -HEADER=/usr/local/share/gpasm/header +#HEADER=/usr/local/share/gpasm/header .SUFFIXES: .asm .c .cod .stc @@ -90,7 +90,8 @@ SRC = b.c \ sub2.c \ switch1.c \ while.c \ - xor.c + xor.c \ + ptrfunc.c # mul1.c \ @@ -108,7 +109,10 @@ all: test # The .cod files are generated by gpasm # these get loaded by gpsim. .asm.cod: - gpasm -c -I $(HEADER) $*.asm + gpasm $*.asm + +# gpasm -c -I $(HEADER) $*.asm + # The .stc files are script files for gpsim .cod.stc: diff --git a/src/regression/mult1.c b/src/regression/mult1.c index d6b3f3e2..a5308746 100644 --- a/src/regression/mult1.c +++ b/src/regression/mult1.c @@ -96,7 +96,7 @@ void main(void) c1 = 1; c3 = 5; - //m1(); + m1(); uc1 = 0x10; m2(2); @@ -107,7 +107,7 @@ void main(void) ui3 = ui1*ui2; // uint = uint * unit - m3(TESTLIT); + //m3(TESTLIT); success = failures; done(); diff --git a/src/regression/pointer1.c b/src/regression/pointer1.c index 67faf00b..b030c1b3 100644 --- a/src/regression/pointer1.c +++ b/src/regression/pointer1.c @@ -53,6 +53,7 @@ f2 (unsigned int *uiP) } + unsigned char * f3 (void) { @@ -60,6 +61,7 @@ f3 (void) return &achar0; } + void f4(unsigned char *ucP, unsigned char uc) { @@ -100,6 +102,7 @@ void index_by_pointer(unsigned char *index, unsigned char expected_value) } + void main (void) { @@ -127,6 +130,9 @@ main (void) acharP = f3 (); if ((acharP == 0) || (*acharP)) failures++; + achar0 = 42; + if(*acharP != 42) + failures++; achar0 = 5; f4(&achar0, achar0); diff --git a/src/regression/rt.sh b/src/regression/rt.sh index 60692136..da4d72c2 100755 --- a/src/regression/rt.sh +++ b/src/regression/rt.sh @@ -9,7 +9,8 @@ fi # compile ../../bin/sdcc -S -mpic14 $1.c -gpasm -c -I /usr/local/share/gpasm/header $1.asm +#gpasm -c -I /usr/local/share/gpasm/header $1.asm +gpasm $1.asm ./create_stc $1.cod $1.stc ./simulate $1.stc garbage.log cat garbage.log -- 2.30.2