Added bug cases. Added decent support for distclean
authormichaelh <michaelh@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 21 Jul 2001 04:40:54 +0000 (04:40 +0000)
committermichaelh <michaelh@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 21 Jul 2001 04:40:54 +0000 (04:40 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1089 4a8a32a2-be11-0410-ad9d-d568d2c75423

29 files changed:
Makefile
as/Makefile
as/clean.mk [new file with mode: 0644]
as/z80/Makefile
as/z80/clean.mk
clean.mk
debugger/mcs51/clean.mk
device/lib/gbz80/Makefile
device/lib/z80/Makefile
doc/Makefile
doc/clean.mk [new file with mode: 0644]
link/Makefile
link/clean.mk [new file with mode: 0644]
link/z80/Makefile
link/z80/clean.mk
packihx/clean.mk
sim/ucsim/Makefile
sim/ucsim/clean.mk
src/SDCCmain.c
src/clean.mk
src/port-clean.mk [new file with mode: 0644]
src/port.mk
src/z80/gen.c
support/cpp/clean.mk
support/cpp2/clean.mk [new file with mode: 0644]
support/regression/Makefile
support/regression/tests/bug-223113.c [new file with mode: 0644]
support/regression/tests/bug-408972.c [new file with mode: 0644]
support/regression/tests/bug-426632.c [new file with mode: 0644]

index 5a02a6d936a53be4f1fa7b94d9d07682b158f3cd..c1a785f92a5600a87068a1410f44f32e26a8dd09 100644 (file)
--- 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
 # -----------------------------------------
index 2f583ad0d6ed5884afb36717be1635a62c962785..ff3e994bd92a79e2a7dae6e794714a9996a7d40f 100644 (file)
@@ -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 (file)
index 0000000..93bc4b0
--- /dev/null
@@ -0,0 +1,6 @@
+clean:
+       $(MAKE) -C z80 -f clean.mk clean
+
+distclean:
+       $(MAKE) -C z80 -f clean.mk distclean
+
index 5b8e5c0ef5e2a040daa1f64c256e075af01d78a2..98dace119bd22b4661b5a120b0d6cdda833a9c3e 100644 (file)
@@ -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
index 4c86a51d69cda05fab86ebb016ffb7f49f64a8e3..5c2a90071f3c8ad2dbbc840becf162077385c36c 100644 (file)
@@ -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
index 29e9e940f1a3659fb4d695c3d9ec588795697812..a7ec1016bd4f681e1c93090ed8c738b43d4ae0a2 100644 (file)
--- 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
 # -----------------------------------------
index c677b3d062a9b4623798024833e5a9a35b332b64..3a67269ce00631ea5dbc1c789e9ee0ccac1d1232 100644 (file)
@@ -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
index 34ff51089fc3990cd0331cd414c7681cc7f22b18..906a06a33633cde650b64d18e1f767bbaaaa3403 100644 (file)
@@ -23,4 +23,4 @@ $(LIB): $(OBJ) Makefile _dummy
 _dummy:
 
 clean:
-       rm -f $(OBJ) *~ $(CLEANSPEC) *.dump*
+       rm -f $(OBJ) *~ $(CLEANSPEC) *.dump* *.asm *.lib
index ba6e567361ed66a262c85826f5987d68025af182..f26d835dcf69ff3ebbafadebdcda282a0e8e4a0a 100644 (file)
@@ -23,4 +23,4 @@ $(LIB): $(OBJ) Makefile _dummy
 _dummy:
 
 clean:
-       rm -f $(OBJ) *~ $(CLEANSPEC) *.dump*
+       rm -f $(OBJ) *~ $(CLEANSPEC) *.dump* *.asm *.lib
index a715ec29bdee8e88c41799ef6912523d1bd0cd3d..72b79f61bd24486920837f4f97b8f25791156f53 100644 (file)
@@ -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 (file)
index 0000000..2e7d978
--- /dev/null
@@ -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
index 580fca0742ccb39b29d9c422ff737fb1fef53963..0e33336762578634d915c29ac5f68fdb917099e1 100644 (file)
@@ -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 (file)
index 0000000..27351eb
--- /dev/null
@@ -0,0 +1,4 @@
+clean:
+       $(MAKE) -C z80 -f clean.mk clean
+
+distclean: clean
index 7fc703b4a9a7851b7caa1ceb35dacb3c2376f7fa..5c096f1ac31c0b64f6aebe8598244208597732dd 100644 (file)
@@ -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
index 911047eb7355fc0db3b18684b4ebb0f59e2cea95..8394c52a3e4829679779f31bc588cbd779454f70 100644 (file)
@@ -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.
 # -----------------------------------------------------------------------
index 0b76693fb791ddfd775f96a11cea467ad016ed8d..64f8c1a08aad3b1bf15fde86f16c73bffe6e512a 100644 (file)
@@ -4,4 +4,4 @@ clean:
        rm -f packihx
 
 distclean realclean: clean
-       rm -f config.*
+       rm -f config.* Makefile
index 0d029cb4400e37c031c1425a6a26e388f899a648..9f737410ee886df01400ba6fd0c50dba5e8fde30 100644 (file)
@@ -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
index 93eefab0064c834833d093e95646d5fe3295b4d2..6446fb20ec3e60f98865e919643417f06c692d5b 100644 (file)
@@ -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
index aff6322f673eb4cd3c62a1d3d5a1ae2fccd8f350..8313902a13680e6e16b661495c3d49077a7a2e4e 100644 (file)
@@ -329,27 +329,6 @@ printVersionInfo ()
     );
 }
 
-/*
-       "\t-m<proc>             -     Target processor <proc>.  Default %s\n"
-          "\t                           Try --version for supported values of <proc>\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 <nnnn>    -     External Ram start location\n"
-          "\t--xstack-loc <nnnn>  -     Xternal Stack Location\n"
-          "\t--code-loc <nnnn>    -     Code Segment Location\n"
-          "\t--stack-loc <nnnn>   -     Stack pointer initial value\n"
-          "\t--data-loc <nnnn>    -     Direct data start location\n"
-          "\t--idata-loc <nnnn>   -     Indirect data start location\n"
-          "\t--iram-size <nnnn>   -     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
                    {
index 61be2b99143ff180e984f225b081a1f81f6d1eb9..fa96fbae8b700e83fa714d56f4c03c077e4c5460 100644 (file)
@@ -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 (file)
index 0000000..a085522
--- /dev/null
@@ -0,0 +1,5 @@
+clean:
+       rm -f $(LIB) *.o *~ port.a *.lst *.asm *.sym *~ *.cdb *.dep *.rul
+
+distclean: clean
+
index 9df7548e83c330c087eea5c0288895a6d6ee3bcf..2b2f83a3e203f3811d29077b26e5b003e68c4cd4 100644 (file)
@@ -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
index 342dac243c8a9c162e76d297aed855d1c8cb40ef..ffef364818ec9c0c860d9fd2d5943f6694de1c8e 100644 (file)
@@ -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);
index c94cd6c49255baa5d58c40ded5190491ad0c9fc7..14ea6bd6cf0d31bbe94733d2005ace5104933fd4 100644 (file)
@@ -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 (file)
index 0000000..8b506b6
--- /dev/null
@@ -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
index 67344aa9183b1b14d37d3d8c39e56dc9e41e2785..98ef6d7ddc9b3c56827afe93ca97d7e2eccb4251 100644 (file)
@@ -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 (file)
index 0000000..de4e1e5
--- /dev/null
@@ -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 (file)
index 0000000..98f47e1
--- /dev/null
@@ -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 (file)
index 0000000..ae5a3a4
--- /dev/null
@@ -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; 
+}