From: michaelh Date: Sat, 21 Jul 2001 04:40:54 +0000 (+0000) Subject: Added bug cases. Added decent support for distclean X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=2ee35049f829fc523bab32504f31cfdef6745757;p=fw%2Fsdcc Added bug cases. Added decent support for distclean git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1089 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/Makefile b/Makefile index 5a02a6d9..c1a785f9 100644 --- a/Makefile +++ b/Makefile @@ -2,19 +2,17 @@ # # -CFLAGS+=-g - SHELL = /bin/sh -AUTOCONF = autoconf PRJDIR = . -srcdir = . -include $(srcdir)/Makefile.common SDCC_MISC = debugger/mcs51 sim/ucsim SDCC_LIBS = support/cpp support/cpp2 SDCC_DOC = doc +# Parts that are not normally compiled but need to be cleaned +SDCC_EXTRA = support/regression support/makebin + SDCC_ASLINK = as/mcs51 as link SDCC_PACKIHX = packihx @@ -117,10 +115,9 @@ clean: $(MAKE) -f clean.mk clean @echo "+ Cleaning packages in their directories..." for pkg in $(PKGS); do\ - $(MAKE) PORTS="$(PORTS)" -C $$pkg clean ;\ + $(MAKE) PORTS="$(PORTS)" -C $$pkg -f clean.mk clean ;\ done - # Deleting all files created by configuring or building the program # ----------------------------------------------------------------- distclean: @@ -128,9 +125,11 @@ distclean: $(MAKE) -f clean.mk distclean @echo "+ DistCleaning packages using clean.mk..." for pkg in $(PKGS); do\ - $(MAKE) -C $$pkg -f clean.mk PORTS="$(PORTS)" distclean ;\ + $(MAKE) -C $$pkg PORTS="$(PORTS)" -f clean.mk distclean ;\ + done + for pkg in $(SDCC_EXTRA); do \ + $(MAKE) -C $$pkg clean; \ done - # Like clean but some files may still exist # ----------------------------------------- diff --git a/as/Makefile b/as/Makefile index 2f583ad0..ff3e994b 100644 --- a/as/Makefile +++ b/as/Makefile @@ -7,9 +7,6 @@ DOCS = README abstra.doc appendk.txt asmlnk.doc asxhtm.html format.txt all: $(MAKE) -C z80 _as-z80 _as-gbz80 E=$(E) BUILDDIR=../../bin/ -clean: - $(MAKE) -C z80 clean - install: install-doc $(INSTALL) $(PRJDIR)/bin/as-z80 `echo $(bindir)/as-z80|sed '$(transform)'` $(STRIP) -s `echo $(bindir)/as-z80|sed '$(transform)'` @@ -19,3 +16,5 @@ install: install-doc install-doc: $(INSTALL) -d $(docdir)/aslink cp -f `find doc -maxdepth 1 -not -type d` $(docdir)/aslink + +include clean.mk diff --git a/as/clean.mk b/as/clean.mk new file mode 100644 index 00000000..93bc4b0a --- /dev/null +++ b/as/clean.mk @@ -0,0 +1,6 @@ +clean: + $(MAKE) -C z80 -f clean.mk clean + +distclean: + $(MAKE) -C z80 -f clean.mk distclean + diff --git a/as/z80/Makefile b/as/z80/Makefile index 5b8e5c0e..98dace11 100644 --- a/as/z80/Makefile +++ b/as/z80/Makefile @@ -44,11 +44,10 @@ $(OBJDIR)/%.o: %.c $(OBJDIR)/%.o: $(SLIB)/%.c $(CC) -c $(CFLAGS) -o $@ $< -clean: - rm -rf $(OBJS) $(BINS) $(OBJDIR) - _as-z80: $(MAKE) EXT=-z80$(E) _as-gbz80: $(MAKE) EXT=-gbz80$(E) OPTS=-DGAMEBOY + +include clean.mk diff --git a/as/z80/clean.mk b/as/z80/clean.mk index 4c86a51d..5c2a9007 100644 --- a/as/z80/clean.mk +++ b/as/z80/clean.mk @@ -1,15 +1,15 @@ # Deleting all files created by building the program # -------------------------------------------------- clean: + rm -rf obj rm -f *core *[%~] *.[oa] rm -f .[a-z]*~ rm -f $(PRJDIR)/as-z80 as-z80 - # Deleting all files created by configuring or building the program # ----------------------------------------------------------------- distclean: clean - rm -f Makefile *.dep + rm -f *.dep # Like clean but some files may still exist diff --git a/clean.mk b/clean.mk index 29e9e940..a7ec1016 100644 --- a/clean.mk +++ b/clean.mk @@ -5,13 +5,12 @@ clean: rm -f .[a-z]*~ -rm -f bin/* - # Deleting all files created by configuring or building the program # ----------------------------------------------------------------- distclean: clean rm -f config.cache config.log config.status Makefile.common rm -f sdccconf.h main.mk *.dep - rm ports.all ports.build + rm -f ports.all ports.build # Like clean but some files may still exist # ----------------------------------------- diff --git a/debugger/mcs51/clean.mk b/debugger/mcs51/clean.mk index c677b3d0..3a67269c 100644 --- a/debugger/mcs51/clean.mk +++ b/debugger/mcs51/clean.mk @@ -3,7 +3,7 @@ clean: rm -f *core *[%~] *.[oa] rm -f .[a-z]*~ - rm -f $(PRJDIR)/bin/sdcdb + rm -f $(PRJDIR)/bin/sdcdb \ $(PRJDIR)/support/Util/SDCCerr.o # Deleting all files created by configuring or building the program diff --git a/device/lib/gbz80/Makefile b/device/lib/gbz80/Makefile index 34ff5108..906a06a3 100644 --- a/device/lib/gbz80/Makefile +++ b/device/lib/gbz80/Makefile @@ -23,4 +23,4 @@ $(LIB): $(OBJ) Makefile _dummy _dummy: clean: - rm -f $(OBJ) *~ $(CLEANSPEC) *.dump* + rm -f $(OBJ) *~ $(CLEANSPEC) *.dump* *.asm *.lib diff --git a/device/lib/z80/Makefile b/device/lib/z80/Makefile index ba6e5673..f26d835d 100644 --- a/device/lib/z80/Makefile +++ b/device/lib/z80/Makefile @@ -23,4 +23,4 @@ $(LIB): $(OBJ) Makefile _dummy _dummy: clean: - rm -f $(OBJ) *~ $(CLEANSPEC) *.dump* + rm -f $(OBJ) *~ $(CLEANSPEC) *.dump* *.asm *.lib diff --git a/doc/Makefile b/doc/Makefile index a715ec29..72b79f61 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -39,14 +39,4 @@ $(TSS).html: $(TSS).tex # the glossary, not implemented yet # makeindex -s l2hglo.ist -o $@ $< - -clean: - # remove intermediate file, not the final pdf's and html's - # because these are needed for the distribution - rm -rf *.tex *.aux *.dvi *.idx *.ilg *.ind *.log *.toc *~ \#* \ - *.ps */*.css */*.pl *.gif core - -superclean: - $(MAKE) clean - # now get rid of the generated pdf's and html's as well - rm -rf *.pdf $(MANUAL).html $(TSS).html \ No newline at end of file +include clean.mk diff --git a/doc/clean.mk b/doc/clean.mk new file mode 100644 index 00000000..2e7d978a --- /dev/null +++ b/doc/clean.mk @@ -0,0 +1,11 @@ +# remove intermediate file, not the final pdf's and html's +# because these are needed for the distribution +clean: + rm -rf *.tex *.aux *.dvi *.idx *.ilg *.ind *.log *.toc *~ \#* \ + *.ps */*.css */*.pl *.gif core + +# now get rid of the generated pdf's and html's as well +superclean: clean + rm -rf *.pdf $(MANUAL).html $(TSS).html + +distclean: superclean diff --git a/link/Makefile b/link/Makefile index 580fca07..0e333367 100644 --- a/link/Makefile +++ b/link/Makefile @@ -7,13 +7,10 @@ PORTS = z80 gbz80 all: $(MAKE) -C z80 _link-z80 _link-gbz80 E=$(E) BUILDDIR=../../bin/ -clean: - $(MAKE) -C z80 clean - install: $(INSTALL) $(PRJDIR)/bin/link-z80 `echo $(bindir)/link-z80|sed '$(transform)'` $(STRIP) `echo $(bindir)/link-z80|sed '$(transform)'` $(INSTALL) $(PRJDIR)/bin/link-gbz80 `echo $(bindir)/link-gbz80|sed '$(transform)'` $(STRIP) `echo $(bindir)/link-gbz80|sed '$(transform)'` - +include clean.mk diff --git a/link/clean.mk b/link/clean.mk new file mode 100644 index 00000000..27351ebf --- /dev/null +++ b/link/clean.mk @@ -0,0 +1,4 @@ +clean: + $(MAKE) -C z80 -f clean.mk clean + +distclean: clean diff --git a/link/z80/Makefile b/link/z80/Makefile index 7fc703b4..5c096f1a 100644 --- a/link/z80/Makefile +++ b/link/z80/Makefile @@ -33,11 +33,10 @@ $(OBJDIR)/%.o: %.c $(OBJDIR)/%.o: $(SLIB)/%.c $(CC) -c $(CFLAGS) -o $@ $< -clean: - rm -rf $(OBJS) $(BINS) $(OBJDIR) - _link-z80: $(MAKE) EXT=-z80$(E) PORT=z80 _link-gbz80: $(MAKE) EXT=-gbz80$(E) OPTS=-DGAMEBOY PORT=z80 + +include clean.mk diff --git a/link/z80/clean.mk b/link/z80/clean.mk index 911047eb..8394c52a 100644 --- a/link/z80/clean.mk +++ b/link/z80/clean.mk @@ -4,19 +4,18 @@ clean: rm -f *core *[%~] *.[oa] rm -f .[a-z]*~ rm -f $(PRJDIR)/link-z80 link-z80 - + rm -f *.dep + rm -rf obj # Deleting all files created by configuring or building the program # ----------------------------------------------------------------- distclean: clean - rm -f Makefile *.dep # Like clean but some files may still exist # ----------------------------------------- mostlyclean: clean - # Deleting everything that can reconstructed by this Makefile. It deletes # everything deleted by distclean plus files created by bison, etc. # ----------------------------------------------------------------------- diff --git a/packihx/clean.mk b/packihx/clean.mk index 0b76693f..64f8c1a0 100644 --- a/packihx/clean.mk +++ b/packihx/clean.mk @@ -4,4 +4,4 @@ clean: rm -f packihx distclean realclean: clean - rm -f config.* + rm -f config.* Makefile diff --git a/sim/ucsim/Makefile b/sim/ucsim/Makefile index 0d029cb4..9f737410 100644 --- a/sim/ucsim/Makefile +++ b/sim/ucsim/Makefile @@ -49,7 +49,8 @@ uninstall: # Deleting all files created by building the program # -------------------------------------------------- clean: - $(MAKE) -f clean.mk clean + rm -f *core *[%~] *.[oa] *.so ucsim + rm -f .[a-z]*~ @for pkg in $(PKGS); do\ $(MAKE) -C $$pkg -f clean.mk clean ;\ done @@ -58,7 +59,8 @@ clean: # Deleting all files created by configuring or building the program # ----------------------------------------------------------------- distclean: clean - $(MAKE) -f clean.mk distclean + rm -f config.cache config.log config.status + rm -f ddconfig.h main.mk *.dep @for pkg in $(PKGS); do\ $(MAKE) -C $$pkg -f clean.mk distclean ;\ done @@ -68,7 +70,6 @@ distclean: clean # Like clean but some files may still exist # ----------------------------------------- mostlyclean: clean - $(MAKE) -f clean.mk mostlyclean @for pkg in $(PKGS); do\ $(MAKE) -C $$pkg -f clean.mk mostlyclean ;\ done @@ -78,7 +79,6 @@ mostlyclean: clean # everything deleted by distclean plus files created by bison, stc. # ----------------------------------------------------------------------- realclean: distclean - $(MAKE) -f clean.mk realclean @for pkg in $(PKGS); do\ $(MAKE) -C $$pkg -f clean.mk realclean ;\ done diff --git a/sim/ucsim/clean.mk b/sim/ucsim/clean.mk index 93eefab0..6446fb20 100644 --- a/sim/ucsim/clean.mk +++ b/sim/ucsim/clean.mk @@ -1,23 +1,22 @@ +# PENDING: Delegate up to the Makefile + # Deleting all files created by building the program # -------------------------------------------------- clean: - rm -f *core *[%~] *.[oa] *.so ucsim - rm -f .[a-z]*~ - + make clean # Deleting all files created by configuring or building the program # ----------------------------------------------------------------- -distclean: clean - rm -f config.cache config.log config.status - rm -f ddconfig.h main.mk *.dep - +distclean: + make distclean # Like clean but some files may still exist # ----------------------------------------- -mostlyclean: clean - +mostlyclean: + make mostlyclean # Deleting everything that can reconstructed by this Makefile. It deletes # everything deleted by distclean plus files created by bison, etc. # ----------------------------------------------------------------------- -realclean: distclean +realclean: + make realclean \ No newline at end of file diff --git a/src/SDCCmain.c b/src/SDCCmain.c index aff6322f..8313902a 100644 --- a/src/SDCCmain.c +++ b/src/SDCCmain.c @@ -329,27 +329,6 @@ printVersionInfo () ); } -/* - "\t-m - Target processor . Default %s\n" - "\t Try --version for supported values of \n" - "\t--model-large - Large Model\n" - "\t--model-small - Small Model (default)\n" - "\t--stack-auto - Stack automatic variables\n" - "\t--xstack - Use external stack\n" - "\t--xram-loc - External Ram start location\n" - "\t--xstack-loc - Xternal Stack Location\n" - "\t--code-loc - Code Segment Location\n" - "\t--stack-loc - Stack pointer initial value\n" - "\t--data-loc - Direct data start location\n" - "\t--idata-loc - Indirect data start location\n" - "\t--iram-size - Internal Ram size\n" - "\t--nojtbound - Don't generate boundary check for jump tables\n" - "\t--generic - All unqualified ptrs converted to '_generic'\n" - "PreProcessor Options :-\n" - "\t-Dmacro - Define Macro\n" - "\t-Ipath - Include \"*.h\" path\n" - "Note: this is NOT a complete list of options see docs for details\n", -*/ /*-----------------------------------------------------------------*/ /* printUsage - prints command line syntax */ /*-----------------------------------------------------------------*/ @@ -575,13 +554,25 @@ _setModel (int model, const char *sz) then for input of '--optxyz' or '--opt xyz' returns xyz. */ static char * -getStringArg(const char *szStart, char **argv, int *pi) +getStringArg(const char *szStart, char **argv, int *pi, int argc) { - if (argv[*pi][strlen(szStart)]) { - return &argv[*pi][strlen(szStart)]; + if (argv[*pi][strlen(szStart)]) + { + return &argv[*pi][strlen(szStart)]; } - else { - return argv[++(*pi)]; + else + { + ++(*pi); + if (*pi >= argc) + { + werror (E_ARGUMENT_MISSING, szStart); + /* Die here rather than checking for errors later. */ + exit(-1); + } + else + { + return argv[++(*pi)]; + } } } @@ -589,9 +580,9 @@ getStringArg(const char *szStart, char **argv, int *pi) getStringArg. */ static int -getIntArg(const char *szStart, char **argv, int *pi) +getIntArg(const char *szStart, char **argv, int *pi, int argc) { - return (int)floatFromVal(constVal(getStringArg(szStart, argv, pi))); + return (int)floatFromVal(constVal(getStringArg(szStart, argv, pi, argc))); } static bool @@ -762,13 +753,13 @@ parseCmdLine (int argc, char **argv) if (strcmp (argv[i], OPTION_PEEP_FILE) == 0) { - options.peep_file = getStringArg(OPTION_PEEP_FILE, argv, &i); + options.peep_file = getStringArg(OPTION_PEEP_FILE, argv, &i, argc); continue; } if (strcmp (argv[i], OPTION_LIB_PATH) == 0) { - libPaths[nlibPaths++] = getStringArg(OPTION_LIB_PATH, argv, &i); + libPaths[nlibPaths++] = getStringArg(OPTION_LIB_PATH, argv, &i, argc); continue; } @@ -781,49 +772,49 @@ parseCmdLine (int argc, char **argv) if (strcmp (argv[i], OPTION_CALLEE_SAVES) == 0) { - parseWithComma (options.calleeSaves, getStringArg(OPTION_CALLEE_SAVES, argv, &i)); + parseWithComma (options.calleeSaves, getStringArg(OPTION_CALLEE_SAVES, argv, &i, argc)); continue; } if (strcmp (argv[i], OPTION_XSTACK_LOC) == 0) { - options.xstack_loc = getIntArg(OPTION_XSTACK_LOC, argv, &i); + options.xstack_loc = getIntArg(OPTION_XSTACK_LOC, argv, &i, argc); continue; } if (strcmp (argv[i], OPTION_STACK_LOC) == 0) { - options.stack_loc = getIntArg(OPTION_STACK_LOC, argv, &i); + options.stack_loc = getIntArg(OPTION_STACK_LOC, argv, &i, argc); continue; } if (strcmp (argv[i], OPTION_XRAM_LOC) == 0) { - options.xdata_loc = getIntArg(OPTION_XRAM_LOC, argv, &i); + options.xdata_loc = getIntArg(OPTION_XRAM_LOC, argv, &i, argc); continue; } if (strcmp (argv[i], OPTION_IRAM_SIZE) == 0) { - options.iram_size = getIntArg(OPTION_IRAM_SIZE, argv, &i); + options.iram_size = getIntArg(OPTION_IRAM_SIZE, argv, &i, argc); continue; } if (strcmp (argv[i], OPTION_DATA_LOC) == 0) { - options.data_loc = getIntArg(OPTION_DATA_LOC, argv, &i); + options.data_loc = getIntArg(OPTION_DATA_LOC, argv, &i, argc); continue; } if (strcmp (argv[i], OPTION_IDATA_LOC) == 0) { - options.idata_loc = getIntArg(OPTION_IDATA_LOC, argv, &i); + options.idata_loc = getIntArg(OPTION_IDATA_LOC, argv, &i, argc); continue; } if (strcmp (argv[i], OPTION_CODE_LOC) == 0) { - options.code_loc = getIntArg(OPTION_CODE_LOC, argv, &i); + options.code_loc = getIntArg(OPTION_CODE_LOC, argv, &i, argc); continue; } @@ -846,15 +837,16 @@ parseCmdLine (int argc, char **argv) } if (strcmp (argv[i], OPTION_LESS_PEDANTIC) == 0) - { - setErrorLogLevel(ERROR_LEVEL_WARNING); - continue; - } - - if (strcmp (&argv[i][1], OPTION_SHORT_IS_8BITS) == 0) { - options.shortis8bits=1; - continue; - } + { + setErrorLogLevel(ERROR_LEVEL_WARNING); + continue; + } + + if (strcmp (&argv[i][1], OPTION_SHORT_IS_8BITS) == 0) + { + options.shortis8bits=1; + continue; + } if (!port->parseOption (&argc, argv, &i)) { @@ -886,25 +878,25 @@ parseCmdLine (int argc, char **argv) break; case 'L': - libPaths[nlibPaths++] = getStringArg("-L", argv, &i); + libPaths[nlibPaths++] = getStringArg("-L", argv, &i, argc); break; case 'l': - libFiles[nlibFiles++] = getStringArg("-l", argv, &i); + libFiles[nlibFiles++] = getStringArg("-l", argv, &i, argc); break; case 'W': /* linker options */ if (argv[i][2] == 'l') { - parseWithComma(linkOptions, getStringArg("-Wl", argv, &i)); + parseWithComma(linkOptions, getStringArg("-Wl", argv, &i, argc)); } else { /* assembler options */ if (argv[i][2] == 'a') { - parseWithComma ((char **) asmOptions, getStringArg("-Wa", argv, &i)); + parseWithComma ((char **) asmOptions, getStringArg("-Wa", argv, &i, argc)); } else { diff --git a/src/clean.mk b/src/clean.mk index 61be2b99..fa96fbae 100644 --- a/src/clean.mk +++ b/src/clean.mk @@ -1,11 +1,14 @@ +CLEANALLPORTS = avr ds390 izt mcs51 pic z80 +PRJDIR = .. + # Deleting all files created by building the program # -------------------------------------------------- clean: rm -f *core *[%~] *.[oa] *.output rm -f .[a-z]*~ \#* rm -f $(PRJDIR)/bin/sdcc sdcc - for port in $(PORTS) ; do\ - $(MAKE) -C $$port clean ;\ + for port in $(CLEANALLPORTS) ; do\ + $(MAKE) -C $$port -f ../port-clean.mk clean ;\ done diff --git a/src/port-clean.mk b/src/port-clean.mk new file mode 100644 index 00000000..a0855223 --- /dev/null +++ b/src/port-clean.mk @@ -0,0 +1,5 @@ +clean: + rm -f $(LIB) *.o *~ port.a *.lst *.asm *.sym *~ *.cdb *.dep *.rul + +distclean: clean + diff --git a/src/port.mk b/src/port.mk index 9df7548e..2b2f83a3 100644 --- a/src/port.mk +++ b/src/port.mk @@ -43,5 +43,4 @@ Makefile.dep: $(PREBUILD) Makefile $(SOURCES) $(SPECIAL) *.h $(PRJDIR)/*.h $(PRJ include Makefile.dep -clean: - rm -f $(LIB) *.o *~ port.a $(CLEANSPEC) +include ../port-clean.mk diff --git a/src/z80/gen.c b/src/z80/gen.c index 342dac24..ffef3648 100644 --- a/src/z80/gen.c +++ b/src/z80/gen.c @@ -4583,9 +4583,13 @@ genLeftShiftLiteral (operand * left, wassert (0); } - else if (shCount >= (size * 8)) - while (size--) - aopPut (AOP (result), "!zero", size); + else if (shCount >= (size * 8)) + { + while (size--) + { + aopPut (AOP (result), "!zero", size); + } + } else { switch (size) @@ -4597,7 +4601,7 @@ genLeftShiftLiteral (operand * left, genlshTwo (result, left, shCount); break; case 4: - wassert (0); + wassertl (0, "Shifting of longs is currently unsupported"); break; default: wassert (0); diff --git a/support/cpp/clean.mk b/support/cpp/clean.mk index c94cd6c4..14ea6bd6 100644 --- a/support/cpp/clean.mk +++ b/support/cpp/clean.mk @@ -1,3 +1,5 @@ +PRJDIR = ../.. + # Deleting all files created by building the program # -------------------------------------------------- clean: diff --git a/support/cpp2/clean.mk b/support/cpp2/clean.mk new file mode 100644 index 00000000..8b506b61 --- /dev/null +++ b/support/cpp2/clean.mk @@ -0,0 +1,26 @@ +PRJDIR = ../.. + +# Deleting all files created by building the program +# -------------------------------------------------- +clean: + rm -f *core *[%~] *.[oa] + rm -f .[a-z]*~ + rm -f $(PRJDIR)/bin/sdcpp + + +# Deleting all files created by configuring or building the program +# ----------------------------------------------------------------- +distclean: clean + rm -f config.cache config.log config.status + rm -f Makefile *.dep auto-host.h configargs.h cstamp-h + + +# Like clean but some files may still exist +# ----------------------------------------- +mostlyclean: clean + + +# Deleting everything that can reconstructed by this Makefile. It deletes +# everything deleted by distclean plus files created by bison, etc. +# ----------------------------------------------------------------------- +realclean: distclean diff --git a/support/regression/Makefile b/support/regression/Makefile index 67344aa9..98ef6d7d 100644 --- a/support/regression/Makefile +++ b/support/regression/Makefile @@ -170,7 +170,7 @@ $(RESULTS): $(SUB_RESULTS) # BeginGeneric rules clean: - rm -rf $(CASES_DIR) $(RESULTS_DIR) + rm -rf $(CASES_DIR) $(RESULTS_DIR) *.pyc inter-port-clean: rm -f fwk/lib/*.o diff --git a/support/regression/tests/bug-223113.c b/support/regression/tests/bug-223113.c new file mode 100644 index 00000000..de4e1e50 --- /dev/null +++ b/support/regression/tests/bug-223113.c @@ -0,0 +1,31 @@ +/* + *------------------------------------------------- + */ + int putch( int Ch ) +{ + return( Ch ); +} + /* + * *------------------------------------------------- + * */ + int puts( char *Str ) +{ + char *Ptr; + + for( Ptr = Str; *Ptr != '\0'; Ptr++ ) + { + putch( *Ptr ); + } + + return( (Ptr - Str) ); +} + /* + * *-------------------------------------------------- + * */ + void main( void ) +{ + puts( "hello world\n" ); +} + /* + * *---------------------------------------------------- + * */ diff --git a/support/regression/tests/bug-408972.c b/support/regression/tests/bug-408972.c new file mode 100644 index 00000000..98f47e15 --- /dev/null +++ b/support/regression/tests/bug-408972.c @@ -0,0 +1,23 @@ +long leftShiftLong (long l) { + /* PENDING: Disabled. + return (l << 3); + */ + return l; +} + + +int leftShiftIntMasked (int v) { + /* PENDING: Disabled. + return ((v & 0xff00U) << 3); + */ + return v; +} + +int leftShiftIntMasked2 (int v) { + return ((v & 0xff) << 8); +} + + +int leftShiftIntMasked3 (int v) { + return ((v & 0xff) << 3); +} diff --git a/support/regression/tests/bug-426632.c b/support/regression/tests/bug-426632.c new file mode 100644 index 00000000..ae5a3a45 --- /dev/null +++ b/support/regression/tests/bug-426632.c @@ -0,0 +1,35 @@ +typedef struct { + unsigned char year; /* Current + * year (with offset 1900) */ + unsigned char month; /* Month (1 = + * Jan., ..., 12 = Dec.) */ + unsigned char day; /* Day of + * month (1 to 31) */ +} DATE_STRUCT; + +unsigned char year; +unsigned char month; +unsigned char day; + +void *main() +{ + float i; + float y; + void *p; + DATE_STRUCT d; + DATE_STRUCT *date_ptr; + + date_ptr = &d; + + year = date_ptr->year; + month = date_ptr->month; + day = date_ptr->day; + + i = 1.35; + i += 2; + y = 1; + y = y+i; + i = y; + p = &y; + return p; +}