# $IdPath$
-SUBDIRS = intl src po doc
+SUBDIRS = check intl src po doc tests
EXTRA_DIST = config/install-sh config/missing config/mkinstalldirs \
config/config.guess config/config.sub
--- /dev/null
+# $IdPath$
+
+noinst_LIBRARIES=libcheck.a
+
+libcheck_a_SOURCES = \
+ check.c \
+ check_run.c \
+ check.h \
+ check_impl.h \
+ check_msg.c \
+ check_msg.h \
+ check_log.c \
+ check_log.h \
+ check_print.c \
+ check_print.h \
+ error.c \
+ error.h \
+ list.c \
+ list.h
+
+if DEV
+CFLAGS = -ansi -pedantic -Wall -g
+endif
esac
AC_OUTPUT(Makefile
+ check/Makefile
intl/Makefile
po/Makefile.in
src/Makefile
src/optimizers/dbg/Makefile
src/objfmts/Makefile
src/objfmts/dbg/Makefile
+ src/tests/Makefile
doc/Makefile
doc/user/Makefile
doc/programmer/Makefile
doc/programmer/queue/Makefile
+ tests/Makefile
)
esac
AC_OUTPUT(Makefile
+ check/Makefile
intl/Makefile
po/Makefile.in
src/Makefile
src/optimizers/dbg/Makefile
src/objfmts/Makefile
src/objfmts/dbg/Makefile
+ src/tests/Makefile
doc/Makefile
doc/user/Makefile
doc/programmer/Makefile
doc/programmer/queue/Makefile
+ tests/Makefile
)
# include <string.h>
#endif
+#include "globals.h"
+
#include "bytecode.h"
#include "section.h"
#include "objfmt.h"
RCSID("$IdPath$");
-char *filename = (char *)NULL;
-unsigned int line_number = 1;
-unsigned int mode_bits = 32;
-
int
main(int argc, char *argv[])
{
--- /dev/null
+/* $IdPath$
+ * Global variables
+ *
+ * Copyright (C) 2001 Peter Johnson
+ *
+ * This file is part of YASM.
+ *
+ * YASM is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * YASM is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "util.h"
+
+#include <stdio.h>
+
+RCSID("$IdPath$");
+
+char *filename = (char *)NULL;
+unsigned int line_number = 1;
+unsigned int mode_bits = 32;
--- /dev/null
+.*.sw?
+Makefile.in
+Makefile
+.deps
+bytecode_test
--- /dev/null
+# $IdPath$
+
+TESTS = \
+ bytecode_test
+
+noinst_PROGRAMS = \
+ bytecode_test
+
+bytecode_test_SOURCES = \
+ bytecode_test.c
+
+INCLUDES= -I$(top_srcdir) -I$(top_srcdir)/src -I$(top_srcdir)/check
+LDADD = \
+ $(top_builddir)/check/libcheck.a \
+ $(top_builddir)/src/parsers/nasm/libparser.a \
+ $(top_builddir)/src/preprocs/raw/libpreproc.a \
+ $(top_builddir)/src/optimizers/dbg/liboptimizer.a \
+ $(top_builddir)/src/objfmts/dbg/libobjfmt.a \
+ $(top_builddir)/src/libyasm.a \
+ $(INTLLIBS)
+
--- /dev/null
+/* $IdPath$
+ *
+ */
+#include <stdlib.h>
+#include "check.h"
+
+#include "util.h"
+
+#include "bytecode.h"
+
+START_TEST(test_ConvertRegToEA)
+{
+ effaddr static_val, *allocp, *retp;
+
+ /* Test with static passing */
+ fail_unless(ConvertRegToEA(&static_val, 1) == &static_val,
+ "No allocation should be performed if non-NULL passed in ptr");
+}
+END_TEST
+
+Suite *bytecode_suite(void)
+{
+ Suite *s = suite_create("bytecode");
+ TCase *tc_conversion = tcase_create("Conversion");
+
+ suite_add_tcase(s, tc_conversion);
+ tcase_add_test(tc_conversion, test_ConvertRegToEA);
+
+ return s;
+}
+
+int main(void)
+{
+ int nf;
+ Suite *s = bytecode_suite();
+ SRunner *sr = srunner_create(s);
+ srunner_run_all(sr, CRNORMAL);
+ nf = srunner_ntests_failed(sr);
+ srunner_free(sr);
+ suite_free(s);
+ return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+}
# $IdPath$
-SUBDIRS = parsers preprocs optimizers objfmts
+SUBDIRS = parsers preprocs optimizers objfmts . tests
INCLUDES = -I$(top_builddir)/intl
bin_PROGRAMS = yasm
-yasm_SOURCES = \
+yasm_SOURCES = main.c
+
+yasm_LDADD = \
+ parsers/nasm/libparser.a \
+ preprocs/raw/libpreproc.a \
+ optimizers/dbg/liboptimizer.a \
+ objfmts/dbg/libobjfmt.a \
+ libyasm.a \
+ $(INTLLIBS)
+
+noinst_LIBRARIES = libyasm.a
+
+libyasm_a_SOURCES = \
bytecode.c \
bytecode.h \
errwarn.c \
errwarn.h \
expr.c \
expr.h \
- main.c \
symrec.c \
symrec.h \
+ globals.c \
globals.h \
util.h \
section.h \
optimizer.h \
strcasecmp.c
-yasm_LDADD = \
- parsers/nasm/libparser.a \
- preprocs/raw/libpreproc.a \
- optimizers/dbg/liboptimizer.a \
- objfmts/dbg/libobjfmt.a \
- $(INTLLIBS)
-
if DEV
CFLAGS = -ansi -pedantic -Wall -g
endif
--- /dev/null
+/* $IdPath$
+ * Global variables
+ *
+ * Copyright (C) 2001 Peter Johnson
+ *
+ * This file is part of YASM.
+ *
+ * YASM is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * YASM is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "util.h"
+
+#include <stdio.h>
+
+RCSID("$IdPath$");
+
+char *filename = (char *)NULL;
+unsigned int line_number = 1;
+unsigned int mode_bits = 32;
--- /dev/null
+/* $IdPath$
+ * Global variables
+ *
+ * Copyright (C) 2001 Peter Johnson
+ *
+ * This file is part of YASM.
+ *
+ * YASM is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * YASM is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "util.h"
+
+#include <stdio.h>
+
+RCSID("$IdPath$");
+
+char *filename = (char *)NULL;
+unsigned int line_number = 1;
+unsigned int mode_bits = 32;
# include <string.h>
#endif
+#include "globals.h"
+
#include "bytecode.h"
#include "section.h"
#include "objfmt.h"
RCSID("$IdPath$");
-char *filename = (char *)NULL;
-unsigned int line_number = 1;
-unsigned int mode_bits = 32;
-
int
main(int argc, char *argv[])
{
--- /dev/null
+.*.sw?
+Makefile.in
+Makefile
+.deps
+bytecode_test
--- /dev/null
+# $IdPath$
+
+TESTS = \
+ bytecode_test
+
+noinst_PROGRAMS = \
+ bytecode_test
+
+bytecode_test_SOURCES = \
+ bytecode_test.c
+
+INCLUDES= -I$(top_srcdir) -I$(top_srcdir)/src -I$(top_srcdir)/check
+LDADD = \
+ $(top_builddir)/check/libcheck.a \
+ $(top_builddir)/src/parsers/nasm/libparser.a \
+ $(top_builddir)/src/preprocs/raw/libpreproc.a \
+ $(top_builddir)/src/optimizers/dbg/liboptimizer.a \
+ $(top_builddir)/src/objfmts/dbg/libobjfmt.a \
+ $(top_builddir)/src/libyasm.a \
+ $(INTLLIBS)
+
--- /dev/null
+/* $IdPath$
+ *
+ */
+#include <stdlib.h>
+#include "check.h"
+
+#include "util.h"
+
+#include "bytecode.h"
+
+START_TEST(test_ConvertRegToEA)
+{
+ effaddr static_val, *allocp, *retp;
+
+ /* Test with static passing */
+ fail_unless(ConvertRegToEA(&static_val, 1) == &static_val,
+ "No allocation should be performed if non-NULL passed in ptr");
+}
+END_TEST
+
+Suite *bytecode_suite(void)
+{
+ Suite *s = suite_create("bytecode");
+ TCase *tc_conversion = tcase_create("Conversion");
+
+ suite_add_tcase(s, tc_conversion);
+ tcase_add_test(tc_conversion, test_ConvertRegToEA);
+
+ return s;
+}
+
+int main(void)
+{
+ int nf;
+ Suite *s = bytecode_suite();
+ SRunner *sr = srunner_create(s);
+ srunner_run_all(sr, CRNORMAL);
+ nf = srunner_ntests_failed(sr);
+ srunner_free(sr);
+ suite_free(s);
+ return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+}
--- /dev/null
+.*.sw?
+Makefile.in
+Makefile
+.deps
--- /dev/null
+# $IdPath$
+
+#TESTS = \
+
+#noinst_PROGRAMS = \
+
+INCLUDES= -I$(top_srcdir) -I$(top_srcdir)/src -I$(top_srcdir)/check
+LDADD = \
+ $(top_builddir)/check/libcheck.a \
+ $(top_builddir)/src/parsers/nasm/libparser.a \
+ $(top_builddir)/src/preprocs/raw/libpreproc.a \
+ $(top_builddir)/src/optimizers/dbg/liboptimizer.a \
+ $(top_builddir)/src/objfmts/dbg/libobjfmt.a \
+ $(top_builddir)/src/libyasm.a \
+ $(INTLLIBS)
+