Commit bdfbee2008a for nodejs
commit bdfbee2008a32fd42eef4e73284e316a519f9d2a
Author: Antoine du Hamel <duhamelantoine1995@gmail.com>
Date: Tue Dec 1 10:22:11 2026 +0100
tools: do not vendor libffi testsuite nor doc
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67866
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
diff --git a/deps/libffi/doc/Makefile.am b/deps/libffi/doc/Makefile.am
deleted file mode 100644
index 43b650aea7a..00000000000
--- a/deps/libffi/doc/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-## Process this with automake to create Makefile.in
-
-info_TEXINFOS = libffi.texi
diff --git a/deps/libffi/doc/Makefile.in b/deps/libffi/doc/Makefile.in
deleted file mode 100644
index 47dce4f87a4..00000000000
--- a/deps/libffi/doc/Makefile.in
+++ /dev/null
@@ -1,832 +0,0 @@
-# Makefile.in generated by automake 1.18.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2025 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-VPATH = @srcdir@
-am__is_gnu_make = { \
- if test -z '$(MAKELEVEL)'; then \
- false; \
- elif test -n '$(MAKE_HOST)'; then \
- true; \
- elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
- true; \
- else \
- false; \
- fi; \
-}
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-am__rm_f = rm -f $(am__rm_f_notfound)
-am__rm_rf = rm -rf $(am__rm_f_notfound)
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = doc
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \
- $(top_srcdir)/m4/ax_cc_maxopt.m4 \
- $(top_srcdir)/m4/ax_cflags_warn_all.m4 \
- $(top_srcdir)/m4/ax_check_compile_flag.m4 \
- $(top_srcdir)/m4/ax_compiler_vendor.m4 \
- $(top_srcdir)/m4/ax_configure_args.m4 \
- $(top_srcdir)/m4/ax_enable_builddir.m4 \
- $(top_srcdir)/m4/ax_gcc_archflag.m4 \
- $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \
- $(top_srcdir)/m4/ax_prepend_flag.m4 \
- $(top_srcdir)/m4/ax_require_defined.m4 \
- $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
- $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
- $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/version.texi \
- $(srcdir)/stamp-vti $(am__DIST_COMMON)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/fficonfig.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-SOURCES =
-DIST_SOURCES =
-AM_V_DVIPS = $(am__v_DVIPS_@AM_V@)
-am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@)
-am__v_DVIPS_0 = @echo " DVIPS " $@;
-am__v_DVIPS_1 =
-AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@)
-am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@)
-am__v_MAKEINFO_0 = @echo " MAKEINFO" $@;
-am__v_MAKEINFO_1 =
-AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@)
-am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@)
-am__v_INFOHTML_0 = @echo " INFOHTML" $@;
-am__v_INFOHTML_1 =
-AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@)
-am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@)
-am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@;
-am__v_TEXI2DVI_1 =
-AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@)
-am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@)
-am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@;
-am__v_TEXI2PDF_1 =
-AM_V_texinfo = $(am__v_texinfo_@AM_V@)
-am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@)
-am__v_texinfo_0 = -q
-am__v_texinfo_1 =
-AM_V_texidevnull = $(am__v_texidevnull_@AM_V@)
-am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@)
-am__v_texidevnull_0 = > /dev/null
-am__v_texidevnull_1 =
-INFO_DEPS = $(srcdir)/libffi.info
-am__TEXINFO_TEX_DIR = $(srcdir)
-DVIS = libffi.dvi
-PDFS = libffi.pdf
-PSS = libffi.ps
-HTMLS = libffi.html
-TEXINFOS = libffi.texi
-TEXI2DVI = texi2dvi
-TEXI2PDF = $(TEXI2DVI) --pdf --batch
-MAKEINFOHTML = $(MAKEINFO) --html
-AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
-DVIPS = dvips
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__installdirs = "$(DESTDIR)$(infodir)"
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \
- }
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in mdate-sh texinfo.tex
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AM_LTLDFLAGS = @AM_LTLDFLAGS@
-AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-CSCOPE = @CSCOPE@
-CTAGS = @CTAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-ETAGS = @ETAGS@
-EXEEXT = @EXEEXT@
-FFI_EXEC_TRAMPOLINE_TABLE = @FFI_EXEC_TRAMPOLINE_TABLE@
-FFI_VERSION_NUMBER = @FFI_VERSION_NUMBER@
-FFI_VERSION_STRING = @FFI_VERSION_STRING@
-FGREP = @FGREP@
-FILECMD = @FILECMD@
-GREP = @GREP@
-HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
-HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OPT_LDFLAGS = @OPT_LDFLAGS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PRTDIAG = @PRTDIAG@
-RANLIB = @RANLIB@
-READELF = @READELF@
-SECTION_LDFLAGS = @SECTION_LDFLAGS@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-TARGET = @TARGET@
-TARGETDIR = @TARGETDIR@
-TARGET_OBJ = @TARGET_OBJ@
-VERSION = @VERSION@
-WASM64_MEMORY64 = @WASM64_MEMORY64@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-ac_ct_READELF = @ac_ct_READELF@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__rm_f_notfound = @am__rm_f_notfound@
-am__tar = @am__tar@
-am__untar = @am__untar@
-am__xargs_n = @am__xargs_n@
-ax_enable_builddir_sed = @ax_enable_builddir_sed@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-runstatedir = @runstatedir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sys_symbol_underscore = @sys_symbol_underscore@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-tmake_file = @tmake_file@
-toolexecdir = @toolexecdir@
-toolexeclibdir = @toolexeclibdir@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-info_TEXINFOS = libffi.texi
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .dvi .html .info .pdf .ps .texi
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --gnu doc/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-.texi.info:
- $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \
- am__cwd=`pwd` && $(am__cd) $(srcdir) && \
- rm -rf $$backupdir && mkdir $$backupdir && \
- if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
- for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
- if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
- done; \
- else :; fi && \
- cd "$$am__cwd"; \
- if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
- -o $@ $<; \
- then \
- rc=0; \
- $(am__cd) $(srcdir); \
- else \
- rc=$$?; \
- $(am__cd) $(srcdir) && \
- $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
- fi; \
- rm -rf $$backupdir; exit $$rc
-
-.texi.dvi:
- $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
- MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
- $(TEXI2DVI) $(AM_TEXI2FLAGS) -I $(srcdir) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \
- $<
-
-.texi.pdf:
- $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
- MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
- $(TEXI2PDF) $(AM_TEXI2FLAGS) -I $(srcdir) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \
- $<
-
-.texi.html:
- $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp)
- $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
- -o $(@:.html=.htp) $<; \
- then \
- rm -rf $@ && mv $(@:.html=.htp) $@; \
- else \
- rm -rf $(@:.html=.htp); exit 1; \
- fi
-$(srcdir)/libffi.info: libffi.texi $(srcdir)/version.texi
-libffi.dvi: libffi.texi $(srcdir)/version.texi
-libffi.pdf: libffi.texi $(srcdir)/version.texi
-libffi.html: libffi.texi $(srcdir)/version.texi
-$(srcdir)/version.texi: @MAINTAINER_MODE_TRUE@ $(srcdir)/stamp-vti
-$(srcdir)/stamp-vti: libffi.texi $(top_srcdir)/configure
- @(dir=.; test -f ./libffi.texi || dir=$(srcdir); \
- set `$(SHELL) $(srcdir)/mdate-sh $$dir/libffi.texi`; \
- echo "@set UPDATED $$1 $$2 $$3"; \
- echo "@set UPDATED-MONTH $$2 $$3"; \
- echo "@set EDITION $(VERSION)"; \
- echo "@set VERSION $(VERSION)") > vti.tmp$$$$ && \
- (cmp -s vti.tmp$$$$ $(srcdir)/version.texi \
- || (echo "Updating $(srcdir)/version.texi" && \
- cp vti.tmp$$$$ $(srcdir)/version.texi.tmp$$$$ && \
- mv $(srcdir)/version.texi.tmp$$$$ $(srcdir)/version.texi)) && \
- rm -f vti.tmp$$$$ $(srcdir)/version.texi.$$$$
- @cp $(srcdir)/version.texi $@
-
-mostlyclean-vti:
- -rm -f vti.tmp* $(srcdir)/version.texi.tmp*
-
-maintainer-clean-vti:
-@MAINTAINER_MODE_TRUE@ -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi
-.dvi.ps:
- $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
- $(DVIPS) $(AM_V_texinfo) -o $@ $<
-
-uninstall-dvi-am:
- @$(NORMAL_UNINSTALL)
- @list='$(DVIS)'; test -n "$(dvidir)" || list=; \
- for p in $$list; do \
- $(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \
- rm -f "$(DESTDIR)$(dvidir)/$$f"; \
- done
-
-uninstall-html-am:
- @$(NORMAL_UNINSTALL)
- @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \
- for p in $$list; do \
- $(am__strip_dir) \
- echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \
- rm -rf "$(DESTDIR)$(htmldir)/$$f"; \
- done
-
-uninstall-info-am:
- @$(PRE_UNINSTALL)
- @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \
- list='$(INFO_DEPS)'; \
- for file in $$list; do \
- relfile=`echo "$$file" | sed 's|^.*/||'`; \
- echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
- if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
- then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \
- done; \
- else :; fi
- @$(NORMAL_UNINSTALL)
- @list='$(INFO_DEPS)'; \
- for file in $$list; do \
- relfile=`echo "$$file" | sed 's|^.*/||'`; \
- relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
- (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \
- echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \
- rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
- else :; fi); \
- done
-
-uninstall-pdf-am:
- @$(NORMAL_UNINSTALL)
- @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
- for p in $$list; do \
- $(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \
- rm -f "$(DESTDIR)$(pdfdir)/$$f"; \
- done
-
-uninstall-ps-am:
- @$(NORMAL_UNINSTALL)
- @list='$(PSS)'; test -n "$(psdir)" || list=; \
- for p in $$list; do \
- $(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \
- rm -f "$(DESTDIR)$(psdir)/$$f"; \
- done
-
-dist-info: $(INFO_DEPS)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- list='$(INFO_DEPS)'; \
- for base in $$list; do \
- case $$base in \
- $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
- esac; \
- if test -f $$base; then d=.; else d=$(srcdir); fi; \
- base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \
- for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \
- if test -f $$file; then \
- relfile=`expr "$$file" : "$$d/\(.*\)"`; \
- test -f "$(distdir)/$$relfile" || \
- cp -p $$file "$(distdir)/$$relfile"; \
- else :; fi; \
- done; \
- done
-
-mostlyclean-aminfo:
- -$(am__rm_rf) libffi.t2d libffi.t2p
-
-clean-aminfo:
- -$(am__rm_rf) libffi.dvi libffi.pdf libffi.ps libffi.html
-
-maintainer-clean-aminfo:
- @list='$(INFO_DEPS)'; for i in $$list; do \
- i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
- echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
- rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
- done
-tags TAGS:
-
-ctags CTAGS:
-
-cscope cscopelist:
-
-
-distdir: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) distdir-am
-
-distdir-am: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$(top_distdir)" distdir="$(distdir)" \
- dist-info
-check-am: all-am
-check: check-am
-all-am: Makefile $(INFO_DEPS)
-installdirs:
- for dir in "$(DESTDIR)$(infodir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -$(am__rm_f) $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-aminfo clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am: $(DVIS)
-
-html: html-am
-
-html-am: $(HTMLS)
-
-info: info-am
-
-info-am: $(INFO_DEPS)
-
-install-data-am: install-info-am
-
-install-dvi: install-dvi-am
-
-install-dvi-am: $(DVIS)
- @$(NORMAL_INSTALL)
- @list='$(DVIS)'; test -n "$(dvidir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \
- done
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am: $(HTMLS)
- @$(NORMAL_INSTALL)
- @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \
- $(am__strip_dir) \
- d2=$$d$$p; \
- if test -d "$$d2"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \
- $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
- echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \
- $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \
- else \
- list2="$$list2 $$d2"; \
- fi; \
- done; \
- test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
- done; }
-install-info: install-info-am
-
-install-info-am: $(INFO_DEPS)
- @$(NORMAL_INSTALL)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \
- fi; \
- for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- esac; \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
- file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
- for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
- $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
- if test -f $$ifile; then \
- echo "$$ifile"; \
- else : ; fi; \
- done; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done
- @$(POST_INSTALL)
- @if $(am__can_run_installinfo); then \
- list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
- for file in $$list; do \
- relfile=`echo "$$file" | sed 's|^.*/||'`; \
- echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
- install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
- done; \
- else : ; fi
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am: $(PDFS)
- @$(NORMAL_INSTALL)
- @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done
-install-ps: install-ps-am
-
-install-ps-am: $(PSS)
- @$(NORMAL_INSTALL)
- @list='$(PSS)'; test -n "$(psdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-aminfo \
- maintainer-clean-generic maintainer-clean-vti
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-aminfo mostlyclean-generic \
- mostlyclean-libtool mostlyclean-vti
-
-pdf: pdf-am
-
-pdf-am: $(PDFS)
-
-ps: ps-am
-
-ps-am: $(PSS)
-
-uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \
- uninstall-pdf-am uninstall-ps-am
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-aminfo clean-generic \
- clean-libtool cscopelist-am ctags-am dist-info distclean \
- distclean-generic distclean-libtool distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-aminfo maintainer-clean-generic \
- maintainer-clean-vti mostlyclean mostlyclean-aminfo \
- mostlyclean-generic mostlyclean-libtool mostlyclean-vti pdf \
- pdf-am ps ps-am tags-am uninstall uninstall-am \
- uninstall-dvi-am uninstall-html-am uninstall-info-am \
- uninstall-pdf-am uninstall-ps-am
-
-.PRECIOUS: Makefile
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
-
-# Tell GNU make to disable its built-in pattern rules.
-%:: %,v
-%:: RCS/%,v
-%:: RCS/%
-%:: s.%
-%:: SCCS/s.%
diff --git a/deps/libffi/doc/libffi.info b/deps/libffi/doc/libffi.info
deleted file mode 100644
index ef2df81be6b..00000000000
--- a/deps/libffi/doc/libffi.info
+++ /dev/null
@@ -1,1246 +0,0 @@
-This is libffi.info, produced by makeinfo version 7.2 from libffi.texi.
-
-This manual is for libffi, a portable foreign function interface
-library.
-
- Copyright © 2008-2026 Anthony Green and Red Hat, Inc.
-
- Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
- The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-INFO-DIR-SECTION Development
-START-INFO-DIR-ENTRY
-* libffi: (libffi). Portable foreign function interface library.
-END-INFO-DIR-ENTRY
-
-
-File: libffi.info, Node: Top, Next: Introduction, Up: (dir)
-
-libffi
-******
-
-This manual is for libffi, a portable foreign function interface
-library.
-
- Copyright © 2008-2026 Anthony Green and Red Hat, Inc.
-
- Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
- The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-* Menu:
-
-* Introduction:: What is libffi?
-* Using libffi:: How to use libffi.
-* Memory Usage:: Where memory for closures comes from.
-* Missing Features:: Things libffi can't do.
-* Index:: Index.
-
-
-File: libffi.info, Node: Introduction, Next: Using libffi, Prev: Top, Up: Top
-
-1 What is libffi?
-*****************
-
-Compilers for high level languages generate code that follow certain
-conventions. These conventions are necessary, in part, for separate
-compilation to work. One such convention is the “calling convention”.
-The calling convention is a set of assumptions made by the compiler
-about where function arguments will be found on entry to a function. A
-calling convention also specifies where the return value for a function
-is found. The calling convention is also sometimes called the “ABI” or
-“Application Binary Interface”.
-
- Some programs may not know at the time of compilation what arguments
-are to be passed to a function. For instance, an interpreter may be
-told at run-time about the number and types of arguments used to call a
-given function. ‘libffi’ can be used in such programs to provide a
-bridge from the interpreter program to compiled code.
-
- The ‘libffi’ library provides a portable, high level programming
-interface to various calling conventions. This allows a programmer to
-call any function specified by a call interface description at run time.
-
- FFI stands for Foreign Function Interface. A foreign function
-interface is the popular name for the interface that allows code written
-in one language to call code written in another language. The ‘libffi’
-library really only provides the lowest, machine dependent layer of a
-fully featured foreign function interface. A layer must exist above
-‘libffi’ that handles type conversions for values passed between the two
-languages.
-
-
-File: libffi.info, Node: Using libffi, Next: Memory Usage, Prev: Introduction, Up: Top
-
-2 Using libffi
-**************
-
-* Menu:
-
-* The Basics:: The basic libffi API.
-* Simple Example:: A simple example.
-* Types:: libffi type descriptions.
-* Multiple ABIs:: Different passing styles on one platform.
-* Reusable Call Plans:: Building a call plan once and reusing it.
-* The Closure API:: Writing a generic function.
-* Closure Example:: A closure example.
-* Thread Safety:: Thread safety.
-
-
-File: libffi.info, Node: The Basics, Next: Simple Example, Up: Using libffi
-
-2.1 The Basics
-==============
-
-‘libffi’ assumes that you have a pointer to the function you wish to
-call and that you know the number and types of arguments to pass it, as
-well as the return type of the function.
-
- The first thing you must do is create an ‘ffi_cif’ object that
-matches the signature of the function you wish to call. This is a
-separate step because it is common to make multiple calls using a single
-‘ffi_cif’. The “cif” in ‘ffi_cif’ stands for Call InterFace. To
-prepare a call interface object, use the function ‘ffi_prep_cif’.
-
- -- Function: ffi_status ffi_prep_cif (ffi_cif *CIF, ffi_abi ABI,
- unsigned int NARGS, ffi_type *RTYPE, ffi_type **ARGTYPES)
- This initializes CIF according to the given parameters.
-
- ABI is the ABI to use; normally ‘FFI_DEFAULT_ABI’ is what you want.
- *note Multiple ABIs:: for more information.
-
- NARGS is the number of arguments that this function accepts.
-
- RTYPE is a pointer to an ‘ffi_type’ structure that describes the
- return type of the function. *Note Types::.
-
- ARGTYPES is a vector of ‘ffi_type’ pointers. ARGTYPES must have
- NARGS elements. If NARGS is 0, this argument is ignored.
-
- ‘ffi_prep_cif’ returns a ‘libffi’ status code, of type
- ‘ffi_status’. This will be either ‘FFI_OK’ if everything worked
- properly; ‘FFI_BAD_TYPEDEF’ if one of the ‘ffi_type’ objects is
- incorrect; or ‘FFI_BAD_ABI’ if the ABI parameter is invalid.
-
- If the function being called is variadic (varargs) then
-‘ffi_prep_cif_var’ must be used instead of ‘ffi_prep_cif’.
-
- -- Function: ffi_status ffi_prep_cif_var (ffi_cif *CIF, ffi_abi ABI,
- unsigned int NFIXEDARGS, unsigned int NTOTALARGS, ffi_type
- *RTYPE, ffi_type **ARGTYPES)
- This initializes CIF according to the given parameters for a call
- to a variadic function. In general its operation is the same as
- for ‘ffi_prep_cif’ except that:
-
- NFIXEDARGS is the number of fixed arguments, prior to any variadic
- arguments. It must be greater than zero.
-
- NTOTALARGS the total number of arguments, including variadic and
- fixed arguments. ARGTYPES must have this many elements.
-
- ‘ffi_prep_cif_var’ will return ‘FFI_BAD_ARGTYPE’ if any of the
- variable argument types are ‘ffi_type_float’ (promote to
- ‘ffi_type_double’ first), or any integer type small than an int
- (promote to an int-sized type first).
-
- Note that, different cif's must be prepped for calls to the same
- function when different numbers of arguments are passed.
-
- Also note that a call to ‘ffi_prep_cif_var’ with
- NFIXEDARGS=NOTOTALARGS is NOT equivalent to a call to
- ‘ffi_prep_cif’.
-
- Note that the resulting ‘ffi_cif’ holds pointers to all the
-‘ffi_type’ objects that were used during initialization. You must
-ensure that these type objects have a lifetime at least as long as that
-of the ‘ffi_cif’.
-
- To call a function using an initialized ‘ffi_cif’, use the ‘ffi_call’
-function:
-
- -- Function: void ffi_call (ffi_cif *CIF, void *FN, void *RVALUE, void
- **AVALUES)
- This calls the function FN according to the description given in
- CIF. CIF must have already been prepared using ‘ffi_prep_cif’.
-
- RVALUE is a pointer to a chunk of memory that will hold the result
- of the function call. This must be large enough to hold the
- result, no smaller than the system register size (generally 32 or
- 64 bits), and must be suitably aligned; it is the caller's
- responsibility to ensure this. If CIF declares that the function
- returns ‘void’ (using ‘ffi_type_void’), then RVALUE is ignored.
-
- RVALUE may also be ‘NULL’, in which case the call is performed and
- the return value is discarded. This works for any return type,
- including structures returned in memory; ‘libffi’ supplies internal
- scratch space for the callee when needed.
-
- In most situations, ‘libffi’ will handle promotion according to the
- ABI. However, for historical reasons, there is a special case with
- return values that must be handled by your code. In particular,
- for integral (not ‘struct’) types that are narrower than the system
- register size, the return value will be widened by ‘libffi’.
- ‘libffi’ provides a type, ‘ffi_arg’, that can be used as the return
- type. For example, if the CIF was defined with a return type of
- ‘char’, ‘libffi’ will try to store a full ‘ffi_arg’ into the return
- value.
-
- AVALUES is a vector of ‘void *’ pointers that point to the memory
- locations holding the argument values for a call. If CIF declares
- that the function has no arguments (i.e., NARGS was 0), then
- AVALUES is ignored. ‘ffi_call’ does not modify the vector or the
- argument values it points to, so both may be reused for subsequent
- calls.
-
- Note that while the return value must be register-sized, arguments
- should exactly match their declared type. For example, if an
- argument is a ‘short’, then the entry in AVALUES should point to an
- object declared as ‘short’; but if the return type is ‘short’, then
- RVALUE should point to an object declared as a larger type -
- usually ‘ffi_arg’.
-
- -- Function: const char * ffi_get_version (void)
- Returns the library version as a string. This string is also
- available at build time as the macro ‘FFI_VERSION_STRING’.
-
- -- Function: unsigned long ffi_get_version_number (void)
- Returns the library version as an unsigned long value where version
- "x.y.z" is represented as the number x*10000+y*100+z. This number
- is also available at build time as the macro ‘FFI_VERSION_NUMBER’.
-
- -- Function: unsigned int ffi_get_default_abi (void)
- Return the value of ‘FFI_DEFAULT_ABI’.
-
- -- Function: size_t ffi_get_closure_size (void)
- Return ‘sizeof(ffi_closure)’.
-
-
-File: libffi.info, Node: Simple Example, Next: Types, Prev: The Basics, Up: Using libffi
-
-2.2 Simple Example
-==================
-
-Here is a trivial example that calls ‘puts’ a few times.
-
- #include <stdio.h>
- #include <ffi.h>
-
- int main()
- {
- ffi_cif cif;
- ffi_type *args[1];
- void *values[1];
- char *s;
- ffi_arg rc;
-
- /* Initialize the argument info vectors */
- args[0] = &ffi_type_pointer;
- values[0] = &s;
-
- /* Initialize the cif */
- if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_sint, args) == FFI_OK)
- {
- s = "Hello World!";
- ffi_call(&cif, (void(*)())puts, &rc, values);
- /* rc now holds the result of the call to puts */
-
- /* values holds a pointer to the function's arg, so to
- call puts() again all we need to do is change the
- value of s */
- s = "This is cool!";
- ffi_call(&cif, (void(*)())puts, &rc, values);
- }
-
- return 0;
- }
-
-
-File: libffi.info, Node: Types, Next: Multiple ABIs, Prev: Simple Example, Up: Using libffi
-
-2.3 Types
-=========
-
-* Menu:
-
-* Primitive Types:: Built-in types.
-* Structures:: Structure types.
-* Size and Alignment:: Size and alignment of types.
-* Arrays Unions Enums:: Arrays, unions, and enumerations.
-* Type Example:: Structure type example.
-* Complex:: Complex types.
-* Complex Type Example:: Complex type example.
-* Vector Types:: Vector (SIMD) types.
-
-
-File: libffi.info, Node: Primitive Types, Next: Structures, Up: Types
-
-2.3.1 Primitive Types
----------------------
-
-‘Libffi’ provides a number of built-in type descriptors that can be used
-to describe argument and return types:
-
-‘ffi_type_void’
- The type ‘void’. This cannot be used for argument types, only for
- return values.
-
-‘ffi_type_uint8’
- An unsigned, 8-bit integer type.
-
-‘ffi_type_sint8’
- A signed, 8-bit integer type.
-
-‘ffi_type_uint16’
- An unsigned, 16-bit integer type.
-
-‘ffi_type_sint16’
- A signed, 16-bit integer type.
-
-‘ffi_type_uint32’
- An unsigned, 32-bit integer type.
-
-‘ffi_type_sint32’
- A signed, 32-bit integer type.
-
-‘ffi_type_uint64’
- An unsigned, 64-bit integer type.
-
-‘ffi_type_sint64’
- A signed, 64-bit integer type.
-
-‘ffi_type_float’
- The C ‘float’ type.
-
-‘ffi_type_double’
- The C ‘double’ type.
-
-‘ffi_type_uchar’
- The C ‘unsigned char’ type.
-
-‘ffi_type_schar’
- The C ‘signed char’ type. (Note that there is not an exact
- equivalent to the C ‘char’ type in ‘libffi’; ordinarily you should
- either use ‘ffi_type_schar’ or ‘ffi_type_uchar’ depending on
- whether ‘char’ is signed.)
-
-‘ffi_type_ushort’
- The C ‘unsigned short’ type.
-
-‘ffi_type_sshort’
- The C ‘short’ type.
-
-‘ffi_type_uint’
- The C ‘unsigned int’ type.
-
-‘ffi_type_sint’
- The C ‘int’ type.
-
-‘ffi_type_ulong’
- The C ‘unsigned long’ type.
-
-‘ffi_type_slong’
- The C ‘long’ type.
-
-‘ffi_type_longdouble’
- On platforms that have a C ‘long double’ type, this is defined. On
- other platforms, it is not.
-
-‘ffi_type_pointer’
- A generic ‘void *’ pointer. You should use this for all pointers,
- regardless of their real type.
-
-‘ffi_type_complex_float’
- The C ‘_Complex float’ type.
-
-‘ffi_type_complex_double’
- The C ‘_Complex double’ type.
-
-‘ffi_type_complex_longdouble’
- The C ‘_Complex long double’ type. On platforms that have a C
- ‘long double’ type, this is defined. On other platforms, it is
- not.
-
- Each of these is of type ‘ffi_type’, so you must take the address
-when passing to ‘ffi_prep_cif’.
-
-
-File: libffi.info, Node: Structures, Next: Size and Alignment, Prev: Primitive Types, Up: Types
-
-2.3.2 Structures
-----------------
-
-‘libffi’ is perfectly happy passing structures back and forth. You must
-first describe the structure to ‘libffi’ by creating a new ‘ffi_type’
-object for it.
-
- -- Data type: ffi_type
- The ‘ffi_type’ has the following members:
- ‘size_t size’
- This is set by ‘libffi’; you should initialize it to zero.
-
- ‘unsigned short alignment’
- This is set by ‘libffi’; you should initialize it to zero.
-
- ‘unsigned short type’
- For a structure, this should be set to ‘FFI_TYPE_STRUCT’.
-
- ‘ffi_type **elements’
- This is a ‘NULL’-terminated array of pointers to ‘ffi_type’
- objects. There is one element per field of the struct.
-
- Note that ‘libffi’ has no special support for bit-fields. You
- must manage these manually.
-
- The ‘size’ and ‘alignment’ fields will be filled in by ‘ffi_prep_cif’
-or ‘ffi_prep_cif_var’, as needed.
-
-
-File: libffi.info, Node: Size and Alignment, Next: Arrays Unions Enums, Prev: Structures, Up: Types
-
-2.3.3 Size and Alignment
-------------------------
-
-‘libffi’ will set the ‘size’ and ‘alignment’ fields of an ‘ffi_type’
-object for you. It does so using its knowledge of the ABI.
-
- You might expect that you can simply read these fields for a type
-that has been laid out by ‘libffi’. However, there are some caveats.
-
- • The size or alignment of some of the built-in types may vary
- depending on the chosen ABI.
-
- • The size and alignment of a new structure type will not be set by
- ‘libffi’ until it has been passed to ‘ffi_prep_cif’ or
- ‘ffi_get_struct_offsets’.
-
- • A structure type cannot be shared across ABIs. Instead each ABI
- needs its own copy of the structure type.
-
- So, before examining these fields, it is safest to pass the
-‘ffi_type’ object to ‘ffi_prep_cif’ or ‘ffi_get_struct_offsets’ first.
-This function will do all the needed setup.
-
- ffi_type *desired_type;
- ffi_abi desired_abi;
- ...
- ffi_cif cif;
- if (ffi_prep_cif (&cif, desired_abi, 0, desired_type, NULL) == FFI_OK)
- {
- size_t size = desired_type->size;
- unsigned short alignment = desired_type->alignment;
- }
-
- ‘libffi’ also provides a way to get the offsets of the members of a
-structure.
-
- -- Function: ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type
- *struct_type, size_t *offsets)
- Compute the offset of each element of the given structure type.
- ABI is the ABI to use; this is needed because in some cases the
- layout depends on the ABI.
-
- OFFSETS is an out parameter. The caller is responsible for
- providing enough space for all the results to be written - one
- element per element type in STRUCT_TYPE. If OFFSETS is ‘NULL’,
- then the type will be laid out but not otherwise modified. This
- can be useful for accessing the type's size or layout, as mentioned
- above.
-
- This function returns ‘FFI_OK’ on success; ‘FFI_BAD_ABI’ if ABI is
- invalid; or ‘FFI_BAD_TYPEDEF’ if STRUCT_TYPE is invalid in some
- way. Note that only ‘FFI_STRUCT’ types are valid here.
-
-
-File: libffi.info, Node: Arrays Unions Enums, Next: Type Example, Prev: Size and Alignment, Up: Types
-
-2.3.4 Arrays, Unions, and Enumerations
---------------------------------------
-
-2.3.4.1 Arrays
-..............
-
-‘libffi’ does not have direct support for arrays or unions. However,
-they can be emulated using structures.
-
- To emulate an array, simply create an ‘ffi_type’ using
-‘FFI_TYPE_STRUCT’ with as many members as there are elements in the
-array.
-
- ffi_type array_type;
- ffi_type **elements
- int i;
-
- elements = malloc ((n + 1) * sizeof (ffi_type *));
- for (i = 0; i < n; ++i)
- elements[i] = array_element_type;
- elements[n] = NULL;
-
- array_type.size = array_type.alignment = 0;
- array_type.type = FFI_TYPE_STRUCT;
- array_type.elements = elements;
-
- Note that arrays cannot be passed or returned by value in C -
-structure types created like this should only be used to refer to
-members of real ‘FFI_TYPE_STRUCT’ objects.
-
- Some ABIs classify array fields differently from structurally
-identical structure fields. Because ‘ffi_type’ has no separate array
-tag, this emulation cannot express that distinction. On those targets,
-passing or returning an enclosing structure containing an emulated array
-by value is not supported.
-
- However, a phony array type like this will not cause any errors from
-‘libffi’ if you use it as an argument or return type. This may be
-confusing.
-
-2.3.4.2 Unions
-..............
-
-A union can also be emulated using ‘FFI_TYPE_STRUCT’. In this case,
-however, you must make sure that the size and alignment match the real
-requirements of the union.
-
- One simple way to do this is to ensue that each element type is laid
-out. Then, give the new structure type a single element; the size of
-the largest element; and the largest alignment seen as well.
-
- This example uses the ‘ffi_prep_cif’ trick to ensure that each
-element type is laid out.
-
- ffi_abi desired_abi;
- ffi_type union_type;
- ffi_type **union_elements;
-
- int i;
- ffi_type element_types[2];
-
- element_types[1] = NULL;
-
- union_type.size = union_type.alignment = 0;
- union_type.type = FFI_TYPE_STRUCT;
- union_type.elements = element_types;
-
- for (i = 0; union_elements[i]; ++i)
- {
- ffi_cif cif;
- if (ffi_prep_cif (&cif, desired_abi, 0, union_elements[i], NULL) == FFI_OK)
- {
- if (union_elements[i]->size > union_type.size)
- {
- union_type.size = union_elements[i];
- size = union_elements[i]->size;
- }
- if (union_elements[i]->alignment > union_type.alignment)
- union_type.alignment = union_elements[i]->alignment;
- }
- }
-
-2.3.4.3 Enumerations
-....................
-
-‘libffi’ does not have any special support for C ‘enum’s. Although any
-given ‘enum’ is implemented using a specific underlying integral type,
-exactly which type will be used cannot be determined by ‘libffi’ - it
-may depend on the values in the enumeration or on compiler flags such as
-‘-fshort-enums’. *Note (gcc)Structures unions enumerations and
-bit-fields implementation::, for more information about how GCC handles
-enumerations.
-
-
-File: libffi.info, Node: Type Example, Next: Complex, Prev: Arrays Unions Enums, Up: Types
-
-2.3.5 Type Example
-------------------
-
-The following example initializes a ‘ffi_type’ object representing the
-‘tm’ struct from Linux's ‘time.h’.
-
- Here is how the struct is defined:
-
- struct tm {
- int tm_sec;
- int tm_min;
- int tm_hour;
- int tm_mday;
- int tm_mon;
- int tm_year;
- int tm_wday;
- int tm_yday;
- int tm_isdst;
- /* Those are for future use. */
- long int __tm_gmtoff__;
- __const char *__tm_zone__;
- };
-
- Here is the corresponding code to describe this struct to ‘libffi’:
-
- {
- ffi_type tm_type;
- ffi_type *tm_type_elements[12];
- int i;
-
- tm_type.size = tm_type.alignment = 0;
- tm_type.type = FFI_TYPE_STRUCT;
- tm_type.elements = tm_type_elements;
-
- for (i = 0; i < 9; i++)
- tm_type_elements[i] = &ffi_type_sint;
-
- tm_type_elements[9] = &ffi_type_slong;
- tm_type_elements[10] = &ffi_type_pointer;
- tm_type_elements[11] = NULL;
-
- /* tm_type can now be used to represent tm argument types and
- return types for ffi_prep_cif() */
- }
-
-
-File: libffi.info, Node: Complex, Next: Complex Type Example, Prev: Type Example, Up: Types
-
-2.3.6 Complex Types
--------------------
-
-‘libffi’ supports the complex types defined by the C99 standard
-(‘_Complex float’, ‘_Complex double’ and ‘_Complex long double’ with the
-built-in type descriptors ‘ffi_type_complex_float’,
-‘ffi_type_complex_double’ and ‘ffi_type_complex_longdouble’.
-
- Custom complex types like ‘_Complex int’ can also be used. An
-‘ffi_type’ object has to be defined to describe the complex type to
-‘libffi’.
-
- -- Data type: ffi_type
- ‘size_t size’
- This must be manually set to the size of the complex type.
-
- ‘unsigned short alignment’
- This must be manually set to the alignment of the complex
- type.
-
- ‘unsigned short type’
- For a complex type, this must be set to ‘FFI_TYPE_COMPLEX’.
-
- ‘ffi_type **elements’
-
- This is a ‘NULL’-terminated array of pointers to ‘ffi_type’
- objects. The first element is set to the ‘ffi_type’ of the
- complex's base type. The second element must be set to
- ‘NULL’.
-
- The section *note Complex Type Example:: shows a way to determine the
-‘size’ and ‘alignment’ members in a platform independent way.
-
- For platforms that have no complex support in ‘libffi’ yet, the
-functions ‘ffi_prep_cif’ and ‘ffi_prep_args’ abort the program if they
-encounter a complex type.
-
-
-File: libffi.info, Node: Complex Type Example, Next: Vector Types, Prev: Complex, Up: Types
-
-2.3.7 Complex Type Example
---------------------------
-
-This example demonstrates how to use complex types:
-
- #include <stdio.h>
- #include <ffi.h>
- #include <complex.h>
-
- void complex_fn(_Complex float cf,
- _Complex double cd,
- _Complex long double cld)
- {
- printf("cf=%f+%fi\ncd=%f+%fi\ncld=%f+%fi\n",
- (float)creal (cf), (float)cimag (cf),
- (float)creal (cd), (float)cimag (cd),
- (float)creal (cld), (float)cimag (cld));
- }
-
- int main()
- {
- ffi_cif cif;
- ffi_type *args[3];
- void *values[3];
- _Complex float cf;
- _Complex double cd;
- _Complex long double cld;
-
- /* Initialize the argument info vectors */
- args[0] = &ffi_type_complex_float;
- args[1] = &ffi_type_complex_double;
- args[2] = &ffi_type_complex_longdouble;
- values[0] = &cf;
- values[1] = &cd;
- values[2] = &cld;
-
- /* Initialize the cif */
- if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
- &ffi_type_void, args) == FFI_OK)
- {
- cf = 1.0 + 20.0 * I;
- cd = 300.0 + 4000.0 * I;
- cld = 50000.0 + 600000.0 * I;
- /* Call the function */
- ffi_call(&cif, (void (*)(void))complex_fn, 0, values);
- }
-
- return 0;
- }
-
- This is an example for defining a custom complex type descriptor for
-compilers that support them:
-
- /*
- * This macro can be used to define new complex type descriptors
- * in a platform independent way.
- *
- * name: Name of the new descriptor is ffi_type_complex_<name>.
- * type: The C base type of the complex type.
- */
- #define FFI_COMPLEX_TYPEDEF(name, type, ffitype) \
- static ffi_type *ffi_elements_complex_##name [2] = { \
- (ffi_type *)(&ffitype), NULL \
- }; \
- struct struct_align_complex_##name { \
- char c; \
- _Complex type x; \
- }; \
- ffi_type ffi_type_complex_##name = { \
- sizeof(_Complex type), \
- offsetof(struct struct_align_complex_##name, x), \
- FFI_TYPE_COMPLEX, \
- (ffi_type **)ffi_elements_complex_##name \
- }
-
- /* Define new complex type descriptors using the macro: */
- /* ffi_type_complex_sint */
- FFI_COMPLEX_TYPEDEF(sint, int, ffi_type_sint);
- /* ffi_type_complex_uchar */
- FFI_COMPLEX_TYPEDEF(uchar, unsigned char, ffi_type_uint8);
-
- The new type descriptors can then be used like one of the built-in
-type descriptors in the previous example.
-
-
-File: libffi.info, Node: Vector Types, Prev: Complex Type Example, Up: Types
-
-2.3.8 Vector Types
-------------------
-
-‘libffi’ can marshal vector (SIMD) types -- the values produced by GCC's
-‘__attribute__((vector_size (N)))’ and Clang's ‘ext_vector_type’ -- on
-the platforms listed in the support table below. A vector is described
-just like a structure, except that every element pointer refers to the
-_same_ fundamental scalar type and the number of elements is the number
-of vector lanes.
-
- -- Data type: ffi_type
- ‘size_t size’
- This must be set to ‘0’. ‘libffi’ computes the storage size
- (see below) from the element type and lane count.
-
- ‘unsigned short alignment’
- This must be set to ‘0’. ‘libffi’ computes the alignment.
-
- ‘unsigned short type’
- For a vector type, this must be set to ‘FFI_TYPE_VECTOR’.
-
- ‘ffi_type **elements’
- This is a ‘NULL’-terminated array of pointers to ‘ffi_type’
- objects. Every entry must point to the same scalar element
- type, and the number of entries is the vector's lane count N
- (N >= 1). The element type must be one of ‘ffi_type_float’,
- ‘ffi_type_double’, or a fixed-width integer (‘ffi_type_uint8’
- through ‘ffi_type_sint64’); ‘long double’ and aggregate
- element types are not permitted.
-
-Computed layout
-...............
-
-Because the caller leaves ‘size’ and ‘alignment’ at ‘0’, ‘libffi’
-derives them so that applications need not encode compiler- or
-platform-specific rules:
-
- • ‘size’ is lane\_size \times N rounded _up_ to the next power of
- two. This matches Clang's ‘ext_vector_type’ storage -- for example
- a three-lane ‘float’ vector occupies 16 bytes and a three-lane
- ‘double’ vector occupies 32 bytes. GCC's ‘vector_size’ already
- requires power-of-two byte totals, so the rule is identical there.
-
- • ‘alignment’ is ‘min(size, 16)’.
-
- If the element list is heterogeneous, empty, or uses a disallowed
-element type, ‘ffi_prep_cif’ returns ‘FFI_BAD_TYPEDEF’.
-
-psABI framing
-.............
-
-At the call boundary the platform's processor-specific ABI (AAPCS64 on
-AArch64, the System V x86-64 psABI on x86-64) decides how a vector is
-passed and returned, independently of which compiler produced it. The
-historical divergence between GCC's ‘vector_size’ and Clang's
-‘ext_vector_type’ concerns only in-memory _layout_ (notably the padding
-of odd-lane vectors such as ‘float3’); the power-of-two size rule above
-pins that layout down, so a value marshalled by ‘libffi’ matches what a
-natively compiled caller or callee expects.
-
-Per-port support
-................
-
-Port Vector support
---------------------------------------------------------------------------
-AArch64 (AAPCS64) 8- and 16-byte vectors in a single V/Q register;
- homogeneous vector aggregates (structs of up to
- four identical 8- or 16-byte vectors) in
- consecutive V/Q registers. A bare vector larger
- than 16 bytes (for example a 32-byte ‘double4’)
- has no short-vector register class and is passed
- and returned in memory, exactly as AAPCS64 and
- current compilers do.
-x86-64 (System V 8- and 16-byte vectors in an SSE register (‘%xmm0’
-psABI) for returns). A bare vector larger than 16 bytes
- needs ‘%ymm’/‘%zmm’ register handling that this
- port does not yet implement, so ‘ffi_prep_cif’
- returns ‘FFI_BAD_TYPEDEF’ for it.
-Other ports Not supported: ‘ffi_prep_cif’ returns
- ‘FFI_BAD_TYPEDEF’ for any signature that mentions
- a vector type, including one nested inside a
- struct.
-
-
-File: libffi.info, Node: Multiple ABIs, Next: Reusable Call Plans, Prev: Types, Up: Using libffi
-
-2.4 Multiple ABIs
-=================
-
-A given platform may provide multiple different ABIs at once. For
-instance, the x86 platform has both ‘stdcall’ and ‘fastcall’ functions.
-
- ‘libffi’ provides some support for this. However, this is
-necessarily platform-specific.
-
-
-File: libffi.info, Node: Reusable Call Plans, Next: The Closure API, Prev: Multiple ABIs, Up: Using libffi
-
-2.5 Reusable Call Plans
-=======================
-
-When the same signature is called many times - as language bindings
-typically do - you can build a “call plan” once and reuse it, so that
-each call avoids the work ‘ffi_call’ would otherwise repeat on every
-invocation. A plan is an opaque, caller-owned object built from a
-prepared ‘ffi_cif’.
-
- -- Function: ffi_call_plan * ffi_call_plan_alloc (ffi_cif *CIF)
- Builds and returns a reusable plan for the signature described by
- CIF, which must already have been prepared with ‘ffi_prep_cif’.
- The plan does not copy CIF; CIF must remain valid for as long as
- the plan is used.
-
- Returns ‘NULL’ only when memory cannot be allocated. A signature
- for which no accelerated path exists is still valid: the returned
- plan simply falls back to ‘ffi_call’ when it is invoked.
-
- -- Function: void ffi_call_plan_invoke (ffi_call_plan *PLAN, void *FN,
- void *RVALUE, void **AVALUES)
- Calls FN using PLAN. The FN, RVALUE, and AVALUES arguments have
- exactly the same meaning as for ‘ffi_call’ (*note The Basics::),
- including the rule that integral return values narrower than a
- register are widened to ‘ffi_arg’.
-
- A plan is immutable once built, so a single plan may be invoked
- concurrently from multiple threads without additional locking.
-
- -- Function: void ffi_call_plan_free (ffi_call_plan *PLAN)
- Releases a plan returned by ‘ffi_call_plan_alloc’. Passing ‘NULL’
- is harmless. The ‘ffi_cif’ the plan was built from is not
- affected.
-
- -- Function: size_t ffi_call_plan_size (ffi_call_plan *PLAN)
- Returns the total number of bytes ‘libffi’ allocated for PLAN,
- including any internal argument-placement data it owns. Returns
- zero when PLAN is ‘NULL’. The result does not include the
- ‘ffi_cif’, which the caller owns. This is intended for embedders
- that account for the memory held by long-lived plans and would
- otherwise have to guess at the size of an opaque type.
-
-
-File: libffi.info, Node: The Closure API, Next: Closure Example, Prev: Reusable Call Plans, Up: Using libffi
-
-2.6 The Closure API
-===================
-
-‘libffi’ also provides a way to write a generic function - a function
-that can accept and decode any combination of arguments. This can be
-useful when writing an interpreter, or to provide wrappers for arbitrary
-functions.
-
- This facility is called the “closure API”. Closures are not supported
-on all platforms; you can check the ‘FFI_CLOSURES’ define to determine
-whether they are supported on the current platform.
-
- Because closures work by assembling a tiny function at runtime, they
-require special allocation on platforms that have a non-executable heap.
-Memory management for closures is handled by a pair of functions:
-
- -- Function: void *ffi_closure_alloc (size_t SIZE, void **CODE)
- Allocate a chunk of memory holding SIZE bytes. This returns a
- pointer to the writable address, and sets *CODE to the
- corresponding executable address.
-
- SIZE should be sufficient to hold a ‘ffi_closure’ object.
-
- -- Function: void ffi_closure_free (void *WRITABLE)
- Free memory allocated using ‘ffi_closure_alloc’. The argument is
- the writable address that was returned.
-
- It is not safe to free a closure while it may still be invoked,
- including from within the closure's own callback (that is, you must
- not free a closure from the function it dispatches to while that
- call is in progress). Doing so frees the executable trampoline
- that is still in use. The caller is responsible for ensuring no
- thread is, or can begin, calling the closure before it is freed.
-
- Once you have allocated the memory for a closure, you must construct
-a ‘ffi_cif’ describing the function call. Finally you can prepare the
-closure function:
-
- -- Function: ffi_status ffi_prep_closure_loc (ffi_closure *CLOSURE,
- ffi_cif *CIF, void (*FUN) (ffi_cif *CIF, void *RET, void
- **ARGS, void *USER_DATA), void *USER_DATA, void *CODELOC)
- Prepare a closure function. The arguments to
- ‘ffi_prep_closure_loc’ are:
-
- CLOSURE
- The address of a ‘ffi_closure’ object; this is the writable
- address returned by ‘ffi_closure_alloc’.
-
- CIF
- The ‘ffi_cif’ describing the function parameters. Note that
- this object, and the types to which it refers, must be kept
- alive until the closure itself is freed.
-
- USER_DATA
- An arbitrary datum that is passed, uninterpreted, to your
- closure function.
-
- CODELOC
- The executable address returned by ‘ffi_closure_alloc’.
-
- FUN
- The function which will be called when the closure is invoked.
- It is called with the arguments:
-
- CIF
- The ‘ffi_cif’ passed to ‘ffi_prep_closure_loc’.
-
- RET
- A pointer to the memory used for the function's return
- value.
-
- If the function is declared as returning ‘void’, then
- this value is garbage and should not be used.
-
- Otherwise, FUN must fill the object to which this points,
- following the same special promotion behavior as
- ‘ffi_call’. That is, in most cases, RET points to an
- object of exactly the size of the type specified when CIF
- was constructed. However, integral types narrower than
- the system register size are widened. In these cases
- your program may assume that RET points to an ‘ffi_arg’
- object.
-
- ARGS
- A vector of pointers to memory holding the arguments to
- the function.
-
- USER_DATA
- The same USER_DATA that was passed to
- ‘ffi_prep_closure_loc’.
-
- ‘ffi_prep_closure_loc’ will return ‘FFI_OK’ if everything went ok,
- and one of the other ‘ffi_status’ values on error.
-
- After calling ‘ffi_prep_closure_loc’, you can cast CODELOC to the
- appropriate pointer-to-function type.
-
- You may see old code referring to ‘ffi_prep_closure’. This function
-is deprecated, as it cannot handle the need for separate writable and
-executable addresses.
-
-
-File: libffi.info, Node: Closure Example, Next: Thread Safety, Prev: The Closure API, Up: Using libffi
-
-2.7 Closure Example
-===================
-
-A trivial example that creates a new ‘puts’ by binding ‘fputs’ with
-‘stdout’.
-
- #include <stdio.h>
- #include <ffi.h>
-
- /* Acts like puts with the file given at time of enclosure. */
- void puts_binding(ffi_cif *cif, void *ret, void* args[],
- void *stream)
- {
- *(ffi_arg *)ret = fputs(*(char **)args[0], (FILE *)stream);
- }
-
- typedef int (*puts_t)(char *);
-
- int main()
- {
- ffi_cif cif;
- ffi_type *args[1];
- ffi_closure *closure;
-
- void *bound_puts;
- int rc;
-
- /* Allocate closure and bound_puts */
- closure = ffi_closure_alloc(sizeof(ffi_closure), &bound_puts);
-
- if (closure)
- {
- /* Initialize the argument info vectors */
- args[0] = &ffi_type_pointer;
-
- /* Initialize the cif */
- if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_sint, args) == FFI_OK)
- {
- /* Initialize the closure, setting stream to stdout */
- if (ffi_prep_closure_loc(closure, &cif, puts_binding,
- stdout, bound_puts) == FFI_OK)
- {
- rc = ((puts_t)bound_puts)("Hello World!");
- /* rc now holds the result of the call to fputs */
- }
- }
- }
-
- /* Deallocate both closure, and bound_puts */
- ffi_closure_free(closure);
-
- return 0;
- }
-
-
-File: libffi.info, Node: Thread Safety, Prev: Closure Example, Up: Using libffi
-
-2.8 Thread Safety
-=================
-
-‘libffi’ is not completely thread-safe. However, many parts are, and if
-you follow some simple rules, you can use it safely in a multi-threaded
-program.
-
- • ‘ffi_prep_cif’ may modify the ‘ffi_type’ objects passed to it. It
- is best to ensure that only a single thread prepares a given
- ‘ffi_cif’ at a time.
-
- • On some platforms, ‘ffi_prep_cif’ may modify the size and alignment
- of some types, depending on the chosen ABI. On these platforms, if
- you switch between ABIs, you must ensure that there is only one
- call to ‘ffi_prep_cif’ at a time.
-
- Currently the only affected platform is PowerPC and the only
- affected type is ‘long double’.
-
-
-File: libffi.info, Node: Memory Usage, Next: Missing Features, Prev: Using libffi, Up: Top
-
-3 Memory Usage
-**************
-
-Note that memory allocated by ‘ffi_closure_alloc’ and freed by
-‘ffi_closure_free’ does not come from the same general pool of memory
-that ‘malloc’ and ‘free’ use. To accomodate security settings, ‘libffi’
-may aquire memory, for example, by mapping temporary files into multiple
-places in the address space (once to write out the closure, a second to
-execute it). The search follows this list, using the first that works:
-
- • A anonymous mapping (i.e. not file-backed)
-
- • ‘memfd_create()’, if the kernel supports it.
-
- • A file created in the directory referenced by the environment
- variable ‘LIBFFI_TMPDIR’.
-
- • Likewise for the environment variable ‘TMPDIR’.
-
- • A file created in ‘/tmp’.
-
- • A file created in ‘/var/tmp’.
-
- • A file created in ‘/dev/shm’.
-
- • A file created in the user's home directory (‘$HOME’).
-
- • A file created in any directory listed in ‘/etc/mtab’.
-
- • A file created in any directory listed in ‘/proc/mounts’.
-
- If security settings prohibit using any of these for closures,
-‘ffi_closure_alloc’ will fail.
-
-
-File: libffi.info, Node: Missing Features, Next: Index, Prev: Memory Usage, Up: Top
-
-4 Missing Features
-******************
-
-‘libffi’ is missing a few features. We welcome patches to add support
-for these.
-
- • Variadic closures.
-
- • There is no support for bit fields in structures.
-
- • The "raw" API is undocumented.
-
- • The Go API is undocumented.
-
-
-File: libffi.info, Node: Index, Prev: Missing Features, Up: Top
-
-Index
-*****
-
- [index ]
-* Menu:
-
-* ABI: Introduction. (line 13)
-* Application Binary Interface: Introduction. (line 13)
-* calling convention: Introduction. (line 13)
-* cif: The Basics. (line 14)
-* closure API: The Closure API. (line 13)
-* closures: The Closure API. (line 13)
-* const char *: The Basics. (line 113)
-* FFI: Introduction. (line 31)
-* ffi_call: The Basics. (line 72)
-* ffi_call_plan *: Reusable Call Plans. (line 12)
-* ffi_call_plan_alloc: Reusable Call Plans. (line 12)
-* ffi_call_plan_free: Reusable Call Plans. (line 32)
-* ffi_call_plan_invoke: Reusable Call Plans. (line 22)
-* ffi_call_plan_size: Reusable Call Plans. (line 37)
-* ffi_closure_alloc: The Closure API. (line 19)
-* ffi_closure_free: The Closure API. (line 26)
-* FFI_CLOSURES: The Closure API. (line 13)
-* ffi_get_closure_size: The Basics. (line 125)
-* ffi_get_default_abi: The Basics. (line 122)
-* ffi_get_struct_offsets: Size and Alignment. (line 39)
-* ffi_get_version: The Basics. (line 113)
-* ffi_get_version_number: The Basics. (line 117)
-* ffi_prep_cif: The Basics. (line 16)
-* ffi_prep_cif_var: The Basics. (line 39)
-* ffi_prep_closure_loc: The Closure API. (line 41)
-* ffi_status: The Basics. (line 16)
-* ffi_status <1>: The Basics. (line 39)
-* ffi_status <2>: Size and Alignment. (line 39)
-* ffi_status <3>: The Closure API. (line 41)
-* ffi_type: Structures. (line 10)
-* ffi_type <1>: Structures. (line 10)
-* ffi_type <2>: Complex. (line 15)
-* ffi_type <3>: Complex. (line 15)
-* ffi_type <4>: Vector Types. (line 13)
-* ffi_type <5>: Vector Types. (line 13)
-* ffi_type_complex_double: Primitive Types. (line 82)
-* ffi_type_complex_float: Primitive Types. (line 79)
-* ffi_type_complex_longdouble: Primitive Types. (line 85)
-* ffi_type_double: Primitive Types. (line 41)
-* ffi_type_float: Primitive Types. (line 38)
-* ffi_type_longdouble: Primitive Types. (line 71)
-* ffi_type_pointer: Primitive Types. (line 75)
-* ffi_type_schar: Primitive Types. (line 47)
-* ffi_type_sint: Primitive Types. (line 62)
-* ffi_type_sint16: Primitive Types. (line 23)
-* ffi_type_sint32: Primitive Types. (line 29)
-* ffi_type_sint64: Primitive Types. (line 35)
-* ffi_type_sint8: Primitive Types. (line 17)
-* ffi_type_slong: Primitive Types. (line 68)
-* ffi_type_sshort: Primitive Types. (line 56)
-* ffi_type_uchar: Primitive Types. (line 44)
-* ffi_type_uint: Primitive Types. (line 59)
-* ffi_type_uint16: Primitive Types. (line 20)
-* ffi_type_uint32: Primitive Types. (line 26)
-* ffi_type_uint64: Primitive Types. (line 32)
-* ffi_type_uint8: Primitive Types. (line 14)
-* ffi_type_ulong: Primitive Types. (line 65)
-* ffi_type_ushort: Primitive Types. (line 53)
-* ffi_type_void: Primitive Types. (line 10)
-* Foreign Function Interface: Introduction. (line 31)
-* size_t: The Basics. (line 125)
-* size_t <1>: Reusable Call Plans. (line 37)
-* unsigned int: The Basics. (line 122)
-* unsigned long: The Basics. (line 117)
-* void: The Basics. (line 72)
-* void <1>: Reusable Call Plans. (line 22)
-* void <2>: Reusable Call Plans. (line 32)
-* void <3>: The Closure API. (line 19)
-* void <4>: The Closure API. (line 26)
-
-
-Tag Table:
-Node: Top1387
-Node: Introduction2909
-Node: Using libffi4569
-Node: The Basics5172
-Node: Simple Example11346
-Node: Types12403
-Node: Primitive Types12967
-Node: Structures15284
-Node: Size and Alignment16395
-Node: Arrays Unions Enums18666
-Node: Type Example21955
-Node: Complex23261
-Node: Complex Type Example24775
-Node: Vector Types27848
-Node: Multiple ABIs31887
-Node: Reusable Call Plans32274
-Node: The Closure API34467
-Node: Closure Example38809
-Node: Thread Safety40452
-Node: Memory Usage41285
-Node: Missing Features42560
-Node: Index42937
-
-End Tag Table
-
-
-Local Variables:
-coding: utf-8
-End:
diff --git a/deps/libffi/doc/libffi.pdf b/deps/libffi/doc/libffi.pdf
deleted file mode 100644
index 4e98b8d634f..00000000000
Binary files a/deps/libffi/doc/libffi.pdf and /dev/null differ
diff --git a/deps/libffi/doc/libffi.texi b/deps/libffi/doc/libffi.texi
deleted file mode 100644
index 619c4ed34e9..00000000000
--- a/deps/libffi/doc/libffi.texi
+++ /dev/null
@@ -1,1227 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-@c %**start of header
-@setfilename libffi.info
-@include version.texi
-@settitle libffi: the portable foreign function interface library
-@setchapternewpage off
-@c %**end of header
-
-@c Merge the standard indexes into a single one.
-@syncodeindex fn cp
-@syncodeindex vr cp
-@syncodeindex ky cp
-@syncodeindex pg cp
-@syncodeindex tp cp
-
-@copying
-
-This manual is for libffi, a portable foreign function interface
-library.
-
-Copyright @copyright{} 2008--2026 Anthony Green and Red Hat, Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-``Software''), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-@end copying
-
-@dircategory Development
-@direntry
-* libffi: (libffi). Portable foreign function interface library.
-@end direntry
-
-@titlepage
-@title libffi: a foreign function interface library
-@subtitle For Version @value{VERSION} of libffi
-@author Anthony Green
-@page
-@vskip 0pt plus 1filll
-@insertcopying
-@end titlepage
-
-
-@ifnottex
-@node Top
-@top libffi
-
-@insertcopying
-
-@menu
-* Introduction:: What is libffi?
-* Using libffi:: How to use libffi.
-* Memory Usage:: Where memory for closures comes from.
-* Missing Features:: Things libffi can't do.
-* Index:: Index.
-@end menu
-
-@end ifnottex
-
-
-@node Introduction
-@chapter What is libffi?
-
-Compilers for high level languages generate code that follow certain
-conventions. These conventions are necessary, in part, for separate
-compilation to work. One such convention is the @dfn{calling
-convention}. The calling convention is a set of assumptions made by
-the compiler about where function arguments will be found on entry to
-a function. A calling convention also specifies where the return
-value for a function is found. The calling convention is also
-sometimes called the @dfn{ABI} or @dfn{Application Binary Interface}.
-@cindex calling convention
-@cindex ABI
-@cindex Application Binary Interface
-
-Some programs may not know at the time of compilation what arguments
-are to be passed to a function. For instance, an interpreter may be
-told at run-time about the number and types of arguments used to call
-a given function. @code{libffi} can be used in such programs to
-provide a bridge from the interpreter program to compiled code.
-
-The @code{libffi} library provides a portable, high level programming
-interface to various calling conventions. This allows a programmer to
-call any function specified by a call interface description at run
-time.
-
-@acronym{FFI} stands for Foreign Function Interface. A foreign
-function interface is the popular name for the interface that allows
-code written in one language to call code written in another language.
-The @code{libffi} library really only provides the lowest, machine
-dependent layer of a fully featured foreign function interface. A
-layer must exist above @code{libffi} that handles type conversions for
-values passed between the two languages.
-@cindex FFI
-@cindex Foreign Function Interface
-
-
-@node Using libffi
-@chapter Using libffi
-
-@menu
-* The Basics:: The basic libffi API.
-* Simple Example:: A simple example.
-* Types:: libffi type descriptions.
-* Multiple ABIs:: Different passing styles on one platform.
-* Reusable Call Plans:: Building a call plan once and reusing it.
-* The Closure API:: Writing a generic function.
-* Closure Example:: A closure example.
-* Thread Safety:: Thread safety.
-@end menu
-
-
-@node The Basics
-@section The Basics
-
-@code{libffi} assumes that you have a pointer to the function you wish
-to call and that you know the number and types of arguments to pass
-it, as well as the return type of the function.
-
-The first thing you must do is create an @code{ffi_cif} object that
-matches the signature of the function you wish to call. This is a
-separate step because it is common to make multiple calls using a
-single @code{ffi_cif}. The @dfn{cif} in @code{ffi_cif} stands for
-Call InterFace. To prepare a call interface object, use the function
-@code{ffi_prep_cif}.
-@cindex cif
-
-@findex ffi_prep_cif
-@defun ffi_status ffi_prep_cif (ffi_cif *@var{cif}, ffi_abi @var{abi}, unsigned int @var{nargs}, ffi_type *@var{rtype}, ffi_type **@var{argtypes})
-This initializes @var{cif} according to the given parameters.
-
-@var{abi} is the ABI to use; normally @code{FFI_DEFAULT_ABI} is what
-you want. @ref{Multiple ABIs} for more information.
-
-@var{nargs} is the number of arguments that this function accepts.
-
-@var{rtype} is a pointer to an @code{ffi_type} structure that
-describes the return type of the function. @xref{Types}.
-
-@var{argtypes} is a vector of @code{ffi_type} pointers.
-@var{argtypes} must have @var{nargs} elements. If @var{nargs} is 0,
-this argument is ignored.
-
-@code{ffi_prep_cif} returns a @code{libffi} status code, of type
-@code{ffi_status}. This will be either @code{FFI_OK} if everything
-worked properly; @code{FFI_BAD_TYPEDEF} if one of the @code{ffi_type}
-objects is incorrect; or @code{FFI_BAD_ABI} if the @var{abi} parameter
-is invalid.
-@end defun
-
-If the function being called is variadic (varargs) then
-@code{ffi_prep_cif_var} must be used instead of @code{ffi_prep_cif}.
-
-@findex ffi_prep_cif_var
-@defun ffi_status ffi_prep_cif_var (ffi_cif *@var{cif}, ffi_abi @var{abi}, unsigned int @var{nfixedargs}, unsigned int @var{ntotalargs}, ffi_type *@var{rtype}, ffi_type **@var{argtypes})
-This initializes @var{cif} according to the given parameters for
-a call to a variadic function. In general its operation is the
-same as for @code{ffi_prep_cif} except that:
-
-@var{nfixedargs} is the number of fixed arguments, prior to any
-variadic arguments. It must be greater than zero.
-
-@var{ntotalargs} the total number of arguments, including variadic
-and fixed arguments. @var{argtypes} must have this many elements.
-
-@code{ffi_prep_cif_var} will return @code{FFI_BAD_ARGTYPE} if any of
-the variable argument types are @code{ffi_type_float} (promote to
-@code{ffi_type_double} first), or any integer type small than an int
-(promote to an int-sized type first).
-
-Note that, different cif's must be prepped for calls to the same
-function when different numbers of arguments are passed.
-
-Also note that a call to @code{ffi_prep_cif_var} with
-@var{nfixedargs}=@var{nototalargs} is NOT equivalent to a call to
-@code{ffi_prep_cif}.
-
-@end defun
-
-Note that the resulting @code{ffi_cif} holds pointers to all the
-@code{ffi_type} objects that were used during initialization. You
-must ensure that these type objects have a lifetime at least as long
-as that of the @code{ffi_cif}.
-
-To call a function using an initialized @code{ffi_cif}, use the
-@code{ffi_call} function:
-
-@findex ffi_call
-@defun void ffi_call (ffi_cif *@var{cif}, void *@var{fn}, void *@var{rvalue}, void **@var{avalues})
-This calls the function @var{fn} according to the description given in
-@var{cif}. @var{cif} must have already been prepared using
-@code{ffi_prep_cif}.
-
-@var{rvalue} is a pointer to a chunk of memory that will hold the
-result of the function call. This must be large enough to hold the
-result, no smaller than the system register size (generally 32 or 64
-bits), and must be suitably aligned; it is the caller's responsibility
-to ensure this. If @var{cif} declares that the function returns
-@code{void} (using @code{ffi_type_void}), then @var{rvalue} is
-ignored.
-
-@var{rvalue} may also be @code{NULL}, in which case the call is
-performed and the return value is discarded. This works for any
-return type, including structures returned in memory; @code{libffi}
-supplies internal scratch space for the callee when needed.
-
-In most situations, @code{libffi} will handle promotion according to
-the ABI. However, for historical reasons, there is a special case
-with return values that must be handled by your code. In particular,
-for integral (not @code{struct}) types that are narrower than the
-system register size, the return value will be widened by
-@code{libffi}. @code{libffi} provides a type, @code{ffi_arg}, that
-can be used as the return type. For example, if the CIF was defined
-with a return type of @code{char}, @code{libffi} will try to store a
-full @code{ffi_arg} into the return value.
-
-@var{avalues} is a vector of @code{void *} pointers that point to the
-memory locations holding the argument values for a call. If @var{cif}
-declares that the function has no arguments (i.e., @var{nargs} was 0),
-then @var{avalues} is ignored. @code{ffi_call} does not modify the
-vector or the argument values it points to, so both may be reused for
-subsequent calls.
-
-Note that while the return value must be register-sized, arguments
-should exactly match their declared type. For example, if an argument
-is a @code{short}, then the entry in @var{avalues} should point to an
-object declared as @code{short}; but if the return type is
-@code{short}, then @var{rvalue} should point to an object declared as
-a larger type -- usually @code{ffi_arg}.
-@end defun
-
-@findex ffi_get_version
-@defun {const char *} ffi_get_version (void)
-Returns the library version as a string. This string is also
-available at build time as the macro @code{FFI_VERSION_STRING}.
-@end defun
-
-@findex ffi_get_version_number
-@defun {unsigned long} ffi_get_version_number (void)
-Returns the library version as an unsigned long value where
-version ``x.y.z'' is represented as the number x*10000+y*100+z.
-This number is also available at build time as the macro
-@code{FFI_VERSION_NUMBER}.
-@end defun
-
-@findex ffi_get_default_abi
-@defun {unsigned int} ffi_get_default_abi (void)
-Return the value of @code{FFI_DEFAULT_ABI}.
-@end defun
-
-@findex ffi_get_closure_size
-@defun {size_t} ffi_get_closure_size (void)
-Return @code{sizeof(ffi_closure)}.
-@end defun
-
-@node Simple Example
-@section Simple Example
-
-Here is a trivial example that calls @code{puts} a few times.
-
-@example
-#include <stdio.h>
-#include <ffi.h>
-
-int main()
-@{
- ffi_cif cif;
- ffi_type *args[1];
- void *values[1];
- char *s;
- ffi_arg rc;
-
- /* Initialize the argument info vectors */
- args[0] = &ffi_type_pointer;
- values[0] = &s;
-
- /* Initialize the cif */
- if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_sint, args) == FFI_OK)
- @{
- s = "Hello World!";
- ffi_call(&cif, (void(*)())puts, &rc, values);
- /* rc now holds the result of the call to puts */
-
- /* values holds a pointer to the function's arg, so to
- call puts() again all we need to do is change the
- value of s */
- s = "This is cool!";
- ffi_call(&cif, (void(*)())puts, &rc, values);
- @}
-
- return 0;
-@}
-@end example
-
-
-@node Types
-@section Types
-
-@menu
-* Primitive Types:: Built-in types.
-* Structures:: Structure types.
-* Size and Alignment:: Size and alignment of types.
-* Arrays Unions Enums:: Arrays, unions, and enumerations.
-* Type Example:: Structure type example.
-* Complex:: Complex types.
-* Complex Type Example:: Complex type example.
-* Vector Types:: Vector (SIMD) types.
-@end menu
-
-@node Primitive Types
-@subsection Primitive Types
-
-@code{Libffi} provides a number of built-in type descriptors that can
-be used to describe argument and return types:
-
-@table @code
-@item ffi_type_void
-@tindex ffi_type_void
-The type @code{void}. This cannot be used for argument types, only
-for return values.
-
-@item ffi_type_uint8
-@tindex ffi_type_uint8
-An unsigned, 8-bit integer type.
-
-@item ffi_type_sint8
-@tindex ffi_type_sint8
-A signed, 8-bit integer type.
-
-@item ffi_type_uint16
-@tindex ffi_type_uint16
-An unsigned, 16-bit integer type.
-
-@item ffi_type_sint16
-@tindex ffi_type_sint16
-A signed, 16-bit integer type.
-
-@item ffi_type_uint32
-@tindex ffi_type_uint32
-An unsigned, 32-bit integer type.
-
-@item ffi_type_sint32
-@tindex ffi_type_sint32
-A signed, 32-bit integer type.
-
-@item ffi_type_uint64
-@tindex ffi_type_uint64
-An unsigned, 64-bit integer type.
-
-@item ffi_type_sint64
-@tindex ffi_type_sint64
-A signed, 64-bit integer type.
-
-@item ffi_type_float
-@tindex ffi_type_float
-The C @code{float} type.
-
-@item ffi_type_double
-@tindex ffi_type_double
-The C @code{double} type.
-
-@item ffi_type_uchar
-@tindex ffi_type_uchar
-The C @code{unsigned char} type.
-
-@item ffi_type_schar
-@tindex ffi_type_schar
-The C @code{signed char} type. (Note that there is not an exact
-equivalent to the C @code{char} type in @code{libffi}; ordinarily you
-should either use @code{ffi_type_schar} or @code{ffi_type_uchar}
-depending on whether @code{char} is signed.)
-
-@item ffi_type_ushort
-@tindex ffi_type_ushort
-The C @code{unsigned short} type.
-
-@item ffi_type_sshort
-@tindex ffi_type_sshort
-The C @code{short} type.
-
-@item ffi_type_uint
-@tindex ffi_type_uint
-The C @code{unsigned int} type.
-
-@item ffi_type_sint
-@tindex ffi_type_sint
-The C @code{int} type.
-
-@item ffi_type_ulong
-@tindex ffi_type_ulong
-The C @code{unsigned long} type.
-
-@item ffi_type_slong
-@tindex ffi_type_slong
-The C @code{long} type.
-
-@item ffi_type_longdouble
-@tindex ffi_type_longdouble
-On platforms that have a C @code{long double} type, this is defined.
-On other platforms, it is not.
-
-@item ffi_type_pointer
-@tindex ffi_type_pointer
-A generic @code{void *} pointer. You should use this for all
-pointers, regardless of their real type.
-
-@item ffi_type_complex_float
-@tindex ffi_type_complex_float
-The C @code{_Complex float} type.
-
-@item ffi_type_complex_double
-@tindex ffi_type_complex_double
-The C @code{_Complex double} type.
-
-@item ffi_type_complex_longdouble
-@tindex ffi_type_complex_longdouble
-The C @code{_Complex long double} type.
-On platforms that have a C @code{long double} type, this is defined.
-On other platforms, it is not.
-@end table
-
-Each of these is of type @code{ffi_type}, so you must take the address
-when passing to @code{ffi_prep_cif}.
-
-
-@node Structures
-@subsection Structures
-
-@code{libffi} is perfectly happy passing structures back and forth.
-You must first describe the structure to @code{libffi} by creating a
-new @code{ffi_type} object for it.
-
-@tindex ffi_type
-@deftp {Data type} ffi_type
-The @code{ffi_type} has the following members:
-@table @code
-@item size_t size
-This is set by @code{libffi}; you should initialize it to zero.
-
-@item unsigned short alignment
-This is set by @code{libffi}; you should initialize it to zero.
-
-@item unsigned short type
-For a structure, this should be set to @code{FFI_TYPE_STRUCT}.
-
-@item ffi_type **elements
-This is a @samp{NULL}-terminated array of pointers to @code{ffi_type}
-objects. There is one element per field of the struct.
-
-Note that @code{libffi} has no special support for bit-fields. You
-must manage these manually.
-@end table
-@end deftp
-
-The @code{size} and @code{alignment} fields will be filled in by
-@code{ffi_prep_cif} or @code{ffi_prep_cif_var}, as needed.
-
-@node Size and Alignment
-@subsection Size and Alignment
-
-@code{libffi} will set the @code{size} and @code{alignment} fields of
-an @code{ffi_type} object for you. It does so using its knowledge of
-the ABI.
-
-You might expect that you can simply read these fields for a type that
-has been laid out by @code{libffi}. However, there are some caveats.
-
-@itemize @bullet
-@item
-The size or alignment of some of the built-in types may vary depending
-on the chosen ABI.
-
-@item
-The size and alignment of a new structure type will not be set by
-@code{libffi} until it has been passed to @code{ffi_prep_cif} or
-@code{ffi_get_struct_offsets}.
-
-@item
-A structure type cannot be shared across ABIs. Instead each ABI needs
-its own copy of the structure type.
-@end itemize
-
-So, before examining these fields, it is safest to pass the
-@code{ffi_type} object to @code{ffi_prep_cif} or
-@code{ffi_get_struct_offsets} first. This function will do all the
-needed setup.
-
-@example
-ffi_type *desired_type;
-ffi_abi desired_abi;
-@dots{}
-ffi_cif cif;
-if (ffi_prep_cif (&cif, desired_abi, 0, desired_type, NULL) == FFI_OK)
- @{
- size_t size = desired_type->size;
- unsigned short alignment = desired_type->alignment;
- @}
-@end example
-
-@code{libffi} also provides a way to get the offsets of the members of
-a structure.
-
-@findex ffi_get_struct_offsets
-@defun ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type, size_t *offsets)
-Compute the offset of each element of the given structure type.
-@var{abi} is the ABI to use; this is needed because in some cases the
-layout depends on the ABI.
-
-@var{offsets} is an out parameter. The caller is responsible for
-providing enough space for all the results to be written -- one
-element per element type in @var{struct_type}. If @var{offsets} is
-@code{NULL}, then the type will be laid out but not otherwise
-modified. This can be useful for accessing the type's size or layout,
-as mentioned above.
-
-This function returns @code{FFI_OK} on success; @code{FFI_BAD_ABI} if
-@var{abi} is invalid; or @code{FFI_BAD_TYPEDEF} if @var{struct_type}
-is invalid in some way. Note that only @code{FFI_STRUCT} types are
-valid here.
-@end defun
-
-@node Arrays Unions Enums
-@subsection Arrays, Unions, and Enumerations
-
-@subsubsection Arrays
-
-@code{libffi} does not have direct support for arrays or unions.
-However, they can be emulated using structures.
-
-To emulate an array, simply create an @code{ffi_type} using
-@code{FFI_TYPE_STRUCT} with as many members as there are elements in
-the array.
-
-@example
-ffi_type array_type;
-ffi_type **elements
-int i;
-
-elements = malloc ((n + 1) * sizeof (ffi_type *));
-for (i = 0; i < n; ++i)
- elements[i] = array_element_type;
-elements[n] = NULL;
-
-array_type.size = array_type.alignment = 0;
-array_type.type = FFI_TYPE_STRUCT;
-array_type.elements = elements;
-@end example
-
-Note that arrays cannot be passed or returned by value in C --
-structure types created like this should only be used to refer to
-members of real @code{FFI_TYPE_STRUCT} objects.
-
-Some ABIs classify array fields differently from structurally identical
-structure fields. Because @code{ffi_type} has no separate array tag, this
-emulation cannot express that distinction. On those targets, passing or
-returning an enclosing structure containing an emulated array by value is
-not supported.
-
-However, a phony array type like this will not cause any errors from
-@code{libffi} if you use it as an argument or return type. This may
-be confusing.
-
-@subsubsection Unions
-
-A union can also be emulated using @code{FFI_TYPE_STRUCT}. In this
-case, however, you must make sure that the size and alignment match
-the real requirements of the union.
-
-One simple way to do this is to ensue that each element type is laid
-out. Then, give the new structure type a single element; the size of
-the largest element; and the largest alignment seen as well.
-
-This example uses the @code{ffi_prep_cif} trick to ensure that each
-element type is laid out.
-
-@example
-ffi_abi desired_abi;
-ffi_type union_type;
-ffi_type **union_elements;
-
-int i;
-ffi_type element_types[2];
-
-element_types[1] = NULL;
-
-union_type.size = union_type.alignment = 0;
-union_type.type = FFI_TYPE_STRUCT;
-union_type.elements = element_types;
-
-for (i = 0; union_elements[i]; ++i)
- @{
- ffi_cif cif;
- if (ffi_prep_cif (&cif, desired_abi, 0, union_elements[i], NULL) == FFI_OK)
- @{
- if (union_elements[i]->size > union_type.size)
- @{
- union_type.size = union_elements[i];
- size = union_elements[i]->size;
- @}
- if (union_elements[i]->alignment > union_type.alignment)
- union_type.alignment = union_elements[i]->alignment;
- @}
- @}
-@end example
-
-@subsubsection Enumerations
-
-@code{libffi} does not have any special support for C @code{enum}s.
-Although any given @code{enum} is implemented using a specific
-underlying integral type, exactly which type will be used cannot be
-determined by @code{libffi} -- it may depend on the values in the
-enumeration or on compiler flags such as @option{-fshort-enums}.
-@xref{Structures unions enumerations and bit-fields implementation, , , gcc},
-for more information about how GCC handles enumerations.
-
-@node Type Example
-@subsection Type Example
-
-The following example initializes a @code{ffi_type} object
-representing the @code{tm} struct from Linux's @file{time.h}.
-
-Here is how the struct is defined:
-
-@example
-struct tm @{
- int tm_sec;
- int tm_min;
- int tm_hour;
- int tm_mday;
- int tm_mon;
- int tm_year;
- int tm_wday;
- int tm_yday;
- int tm_isdst;
- /* Those are for future use. */
- long int __tm_gmtoff__;
- __const char *__tm_zone__;
-@};
-@end example
-
-Here is the corresponding code to describe this struct to
-@code{libffi}:
-
-@example
- @{
- ffi_type tm_type;
- ffi_type *tm_type_elements[12];
- int i;
-
- tm_type.size = tm_type.alignment = 0;
- tm_type.type = FFI_TYPE_STRUCT;
- tm_type.elements = tm_type_elements;
-
- for (i = 0; i < 9; i++)
- tm_type_elements[i] = &ffi_type_sint;
-
- tm_type_elements[9] = &ffi_type_slong;
- tm_type_elements[10] = &ffi_type_pointer;
- tm_type_elements[11] = NULL;
-
- /* tm_type can now be used to represent tm argument types and
- return types for ffi_prep_cif() */
- @}
-@end example
-
-@node Complex
-@subsection Complex Types
-
-@code{libffi} supports the complex types defined by the C99
-standard (@code{_Complex float}, @code{_Complex double} and
-@code{_Complex long double} with the built-in type descriptors
-@code{ffi_type_complex_float}, @code{ffi_type_complex_double} and
-@code{ffi_type_complex_longdouble}.
-
-Custom complex types like @code{_Complex int} can also be used.
-An @code{ffi_type} object has to be defined to describe the
-complex type to @code{libffi}.
-
-@tindex ffi_type
-@deftp {Data type} ffi_type
-@table @code
-@item size_t size
-This must be manually set to the size of the complex type.
-
-@item unsigned short alignment
-This must be manually set to the alignment of the complex type.
-
-@item unsigned short type
-For a complex type, this must be set to @code{FFI_TYPE_COMPLEX}.
-
-@item ffi_type **elements
-
-This is a @samp{NULL}-terminated array of pointers to
-@code{ffi_type} objects. The first element is set to the
-@code{ffi_type} of the complex's base type. The second element
-must be set to @code{NULL}.
-@end table
-@end deftp
-
-The section @ref{Complex Type Example} shows a way to determine
-the @code{size} and @code{alignment} members in a platform
-independent way.
-
-For platforms that have no complex support in @code{libffi} yet,
-the functions @code{ffi_prep_cif} and @code{ffi_prep_args} abort
-the program if they encounter a complex type.
-
-@node Complex Type Example
-@subsection Complex Type Example
-
-This example demonstrates how to use complex types:
-
-@example
-#include <stdio.h>
-#include <ffi.h>
-#include <complex.h>
-
-void complex_fn(_Complex float cf,
- _Complex double cd,
- _Complex long double cld)
-@{
- printf("cf=%f+%fi\ncd=%f+%fi\ncld=%f+%fi\n",
- (float)creal (cf), (float)cimag (cf),
- (float)creal (cd), (float)cimag (cd),
- (float)creal (cld), (float)cimag (cld));
-@}
-
-int main()
-@{
- ffi_cif cif;
- ffi_type *args[3];
- void *values[3];
- _Complex float cf;
- _Complex double cd;
- _Complex long double cld;
-
- /* Initialize the argument info vectors */
- args[0] = &ffi_type_complex_float;
- args[1] = &ffi_type_complex_double;
- args[2] = &ffi_type_complex_longdouble;
- values[0] = &cf;
- values[1] = &cd;
- values[2] = &cld;
-
- /* Initialize the cif */
- if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
- &ffi_type_void, args) == FFI_OK)
- @{
- cf = 1.0 + 20.0 * I;
- cd = 300.0 + 4000.0 * I;
- cld = 50000.0 + 600000.0 * I;
- /* Call the function */
- ffi_call(&cif, (void (*)(void))complex_fn, 0, values);
- @}
-
- return 0;
-@}
-@end example
-
-This is an example for defining a custom complex type descriptor
-for compilers that support them:
-
-@example
-/*
- * This macro can be used to define new complex type descriptors
- * in a platform independent way.
- *
- * name: Name of the new descriptor is ffi_type_complex_<name>.
- * type: The C base type of the complex type.
- */
-#define FFI_COMPLEX_TYPEDEF(name, type, ffitype) \
- static ffi_type *ffi_elements_complex_##name [2] = @{ \
- (ffi_type *)(&ffitype), NULL \
- @}; \
- struct struct_align_complex_##name @{ \
- char c; \
- _Complex type x; \
- @}; \
- ffi_type ffi_type_complex_##name = @{ \
- sizeof(_Complex type), \
- offsetof(struct struct_align_complex_##name, x), \
- FFI_TYPE_COMPLEX, \
- (ffi_type **)ffi_elements_complex_##name \
- @}
-
-/* Define new complex type descriptors using the macro: */
-/* ffi_type_complex_sint */
-FFI_COMPLEX_TYPEDEF(sint, int, ffi_type_sint);
-/* ffi_type_complex_uchar */
-FFI_COMPLEX_TYPEDEF(uchar, unsigned char, ffi_type_uint8);
-@end example
-
-The new type descriptors can then be used like one of the built-in
-type descriptors in the previous example.
-
-@node Vector Types
-@subsection Vector Types
-
-@code{libffi} can marshal vector (SIMD) types --- the values produced
-by GCC's @code{__attribute__((vector_size (N)))} and Clang's
-@code{ext_vector_type} --- on the platforms listed in the support table
-below. A vector is described just like a structure, except that every
-element pointer refers to the @emph{same} fundamental scalar type and the
-number of elements is the number of vector lanes.
-
-@tindex ffi_type
-@deftp {Data type} ffi_type
-@table @code
-@item size_t size
-This must be set to @code{0}. @code{libffi} computes the storage size
-(see below) from the element type and lane count.
-
-@item unsigned short alignment
-This must be set to @code{0}. @code{libffi} computes the alignment.
-
-@item unsigned short type
-For a vector type, this must be set to @code{FFI_TYPE_VECTOR}.
-
-@item ffi_type **elements
-This is a @samp{NULL}-terminated array of pointers to @code{ffi_type}
-objects. Every entry must point to the same scalar element type, and the
-number of entries is the vector's lane count @math{N} (@math{N >= 1}). The
-element type must be one of @code{ffi_type_float}, @code{ffi_type_double},
-or a fixed-width integer (@code{ffi_type_uint8} through
-@code{ffi_type_sint64}); @code{long double} and aggregate element types are
-not permitted.
-@end table
-@end deftp
-
-@subsubheading Computed layout
-
-Because the caller leaves @code{size} and @code{alignment} at @code{0},
-@code{libffi} derives them so that applications need not encode
-compiler- or platform-specific rules:
-
-@itemize @bullet
-@item
-@code{size} is @math{lane\_size \times N} rounded @emph{up} to the next
-power of two. This matches Clang's @code{ext_vector_type} storage --- for
-example a three-lane @code{float} vector occupies 16 bytes and a three-lane
-@code{double} vector occupies 32 bytes. GCC's @code{vector_size} already
-requires power-of-two byte totals, so the rule is identical there.
-
-@item
-@code{alignment} is @code{min(size, 16)}.
-@end itemize
-
-If the element list is heterogeneous, empty, or uses a disallowed element
-type, @code{ffi_prep_cif} returns @code{FFI_BAD_TYPEDEF}.
-
-@subsubheading psABI framing
-
-At the call boundary the platform's processor-specific ABI (AAPCS64 on
-AArch64, the System V x86-64 psABI on x86-64) decides how a vector is
-passed and returned, independently of which compiler produced it. The
-historical divergence between GCC's @code{vector_size} and Clang's
-@code{ext_vector_type} concerns only in-memory @emph{layout} (notably the
-padding of odd-lane vectors such as @code{float3}); the power-of-two size
-rule above pins that layout down, so a value marshalled by @code{libffi}
-matches what a natively compiled caller or callee expects.
-
-@subsubheading Per-port support
-
-@multitable @columnfractions .28 .72
-@headitem Port @tab Vector support
-@item AArch64 (AAPCS64)
-@tab 8- and 16-byte vectors in a single V/Q register; homogeneous vector
-aggregates (structs of up to four identical 8- or 16-byte vectors) in
-consecutive V/Q registers. A bare vector larger than 16 bytes (for
-example a 32-byte @code{double4}) has no short-vector register class and is
-passed and returned in memory, exactly as AAPCS64 and current compilers do.
-@item x86-64 (System V psABI)
-@tab 8- and 16-byte vectors in an SSE register (@code{%xmm0} for returns).
-A bare vector larger than 16 bytes needs @code{%ymm}/@code{%zmm} register
-handling that this port does not yet implement, so @code{ffi_prep_cif}
-returns @code{FFI_BAD_TYPEDEF} for it.
-@item Other ports
-@tab Not supported: @code{ffi_prep_cif} returns @code{FFI_BAD_TYPEDEF} for
-any signature that mentions a vector type, including one nested inside a
-struct.
-@end multitable
-
-@node Multiple ABIs
-@section Multiple ABIs
-
-A given platform may provide multiple different ABIs at once. For
-instance, the x86 platform has both @samp{stdcall} and @samp{fastcall}
-functions.
-
-@code{libffi} provides some support for this. However, this is
-necessarily platform-specific.
-
-@c FIXME: document the platforms
-
-@node Reusable Call Plans
-@section Reusable Call Plans
-
-When the same signature is called many times -- as language bindings
-typically do -- you can build a @dfn{call plan} once and reuse it, so
-that each call avoids the work @code{ffi_call} would otherwise repeat
-on every invocation. A plan is an opaque, caller-owned object built
-from a prepared @code{ffi_cif}.
-
-@findex ffi_call_plan_alloc
-@defun {ffi_call_plan *} ffi_call_plan_alloc (ffi_cif *@var{cif})
-Builds and returns a reusable plan for the signature described by
-@var{cif}, which must already have been prepared with
-@code{ffi_prep_cif}. The plan does not copy @var{cif}; @var{cif} must
-remain valid for as long as the plan is used.
-
-Returns @code{NULL} only when memory cannot be allocated. A signature
-for which no accelerated path exists is still valid: the returned plan
-simply falls back to @code{ffi_call} when it is invoked.
-@end defun
-
-@findex ffi_call_plan_invoke
-@defun void ffi_call_plan_invoke (ffi_call_plan *@var{plan}, void *@var{fn}, void *@var{rvalue}, void **@var{avalues})
-Calls @var{fn} using @var{plan}. The @var{fn}, @var{rvalue}, and
-@var{avalues} arguments have exactly the same meaning as for
-@code{ffi_call} (@pxref{The Basics}), including the rule that integral
-return values narrower than a register are widened to @code{ffi_arg}.
-
-A plan is immutable once built, so a single plan may be invoked
-concurrently from multiple threads without additional locking.
-@end defun
-
-@findex ffi_call_plan_free
-@defun void ffi_call_plan_free (ffi_call_plan *@var{plan})
-Releases a plan returned by @code{ffi_call_plan_alloc}. Passing
-@code{NULL} is harmless. The @code{ffi_cif} the plan was built from is
-not affected.
-@end defun
-
-@findex ffi_call_plan_size
-@defun size_t ffi_call_plan_size (ffi_call_plan *@var{plan})
-Returns the total number of bytes @code{libffi} allocated for @var{plan},
-including any internal argument-placement data it owns. Returns zero when
-@var{plan} is @code{NULL}. The result does not include the
-@code{ffi_cif}, which the caller owns. This is intended for embedders that
-account for the memory held by long-lived plans and would otherwise have to
-guess at the size of an opaque type.
-@end defun
-
-@node The Closure API
-@section The Closure API
-
-@code{libffi} also provides a way to write a generic function -- a
-function that can accept and decode any combination of arguments.
-This can be useful when writing an interpreter, or to provide wrappers
-for arbitrary functions.
-
-This facility is called the @dfn{closure API}. Closures are not
-supported on all platforms; you can check the @code{FFI_CLOSURES}
-define to determine whether they are supported on the current
-platform.
-@cindex closures
-@cindex closure API
-@findex FFI_CLOSURES
-
-Because closures work by assembling a tiny function at runtime, they
-require special allocation on platforms that have a non-executable
-heap. Memory management for closures is handled by a pair of
-functions:
-
-@findex ffi_closure_alloc
-@defun void *ffi_closure_alloc (size_t @var{size}, void **@var{code})
-Allocate a chunk of memory holding @var{size} bytes. This returns a
-pointer to the writable address, and sets *@var{code} to the
-corresponding executable address.
-
-@var{size} should be sufficient to hold a @code{ffi_closure} object.
-@end defun
-
-@findex ffi_closure_free
-@defun void ffi_closure_free (void *@var{writable})
-Free memory allocated using @code{ffi_closure_alloc}. The argument is
-the writable address that was returned.
-
-It is not safe to free a closure while it may still be invoked, including
-from within the closure's own callback (that is, you must not free a closure
-from the function it dispatches to while that call is in progress). Doing so
-frees the executable trampoline that is still in use. The caller is
-responsible for ensuring no thread is, or can begin, calling the closure
-before it is freed.
-@end defun
-
-Once you have allocated the memory for a closure, you must construct a
-@code{ffi_cif} describing the function call. Finally you can prepare
-the closure function:
-
-@findex ffi_prep_closure_loc
-@defun ffi_status ffi_prep_closure_loc (ffi_closure *@var{closure}, ffi_cif *@var{cif}, void (*@var{fun}) (ffi_cif *@var{cif}, void *@var{ret}, void **@var{args}, void *@var{user_data}), void *@var{user_data}, void *@var{codeloc})
-Prepare a closure function. The arguments to
-@code{ffi_prep_closure_loc} are:
-
-@table @var
-@item closure
-The address of a @code{ffi_closure} object; this is the writable
-address returned by @code{ffi_closure_alloc}.
-
-@item cif
-The @code{ffi_cif} describing the function parameters. Note that this
-object, and the types to which it refers, must be kept alive until the
-closure itself is freed.
-
-@item user_data
-An arbitrary datum that is passed, uninterpreted, to your closure
-function.
-
-@item codeloc
-The executable address returned by @code{ffi_closure_alloc}.
-
-@item fun
-The function which will be called when the closure is invoked. It is
-called with the arguments:
-
-@table @var
-@item cif
-The @code{ffi_cif} passed to @code{ffi_prep_closure_loc}.
-
-@item ret
-A pointer to the memory used for the function's return value.
-
-If the function is declared as returning @code{void}, then this value
-is garbage and should not be used.
-
-Otherwise, @var{fun} must fill the object to which this points,
-following the same special promotion behavior as @code{ffi_call}.
-That is, in most cases, @var{ret} points to an object of exactly the
-size of the type specified when @var{cif} was constructed. However,
-integral types narrower than the system register size are widened. In
-these cases your program may assume that @var{ret} points to an
-@code{ffi_arg} object.
-
-@item args
-A vector of pointers to memory holding the arguments to the function.
-
-@item user_data
-The same @var{user_data} that was passed to
-@code{ffi_prep_closure_loc}.
-@end table
-@end table
-
-@code{ffi_prep_closure_loc} will return @code{FFI_OK} if everything
-went ok, and one of the other @code{ffi_status} values on error.
-
-After calling @code{ffi_prep_closure_loc}, you can cast @var{codeloc}
-to the appropriate pointer-to-function type.
-@end defun
-
-You may see old code referring to @code{ffi_prep_closure}. This
-function is deprecated, as it cannot handle the need for separate
-writable and executable addresses.
-
-@node Closure Example
-@section Closure Example
-
-A trivial example that creates a new @code{puts} by binding
-@code{fputs} with @code{stdout}.
-
-@example
-#include <stdio.h>
-#include <ffi.h>
-
-/* Acts like puts with the file given at time of enclosure. */
-void puts_binding(ffi_cif *cif, void *ret, void* args[],
- void *stream)
-@{
- *(ffi_arg *)ret = fputs(*(char **)args[0], (FILE *)stream);
-@}
-
-typedef int (*puts_t)(char *);
-
-int main()
-@{
- ffi_cif cif;
- ffi_type *args[1];
- ffi_closure *closure;
-
- void *bound_puts;
- int rc;
-
- /* Allocate closure and bound_puts */
- closure = ffi_closure_alloc(sizeof(ffi_closure), &bound_puts);
-
- if (closure)
- @{
- /* Initialize the argument info vectors */
- args[0] = &ffi_type_pointer;
-
- /* Initialize the cif */
- if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_sint, args) == FFI_OK)
- @{
- /* Initialize the closure, setting stream to stdout */
- if (ffi_prep_closure_loc(closure, &cif, puts_binding,
- stdout, bound_puts) == FFI_OK)
- @{
- rc = ((puts_t)bound_puts)("Hello World!");
- /* rc now holds the result of the call to fputs */
- @}
- @}
- @}
-
- /* Deallocate both closure, and bound_puts */
- ffi_closure_free(closure);
-
- return 0;
-@}
-
-@end example
-
-@node Thread Safety
-@section Thread Safety
-
-@code{libffi} is not completely thread-safe. However, many parts are,
-and if you follow some simple rules, you can use it safely in a
-multi-threaded program.
-
-@itemize @bullet
-@item
-@code{ffi_prep_cif} may modify the @code{ffi_type} objects passed to
-it. It is best to ensure that only a single thread prepares a given
-@code{ffi_cif} at a time.
-
-@item
-On some platforms, @code{ffi_prep_cif} may modify the size and
-alignment of some types, depending on the chosen ABI. On these
-platforms, if you switch between ABIs, you must ensure that there is
-only one call to @code{ffi_prep_cif} at a time.
-
-Currently the only affected platform is PowerPC and the only affected
-type is @code{long double}.
-@end itemize
-
-@node Memory Usage
-@chapter Memory Usage
-
-Note that memory allocated by @code{ffi_closure_alloc} and freed by
-@code{ffi_closure_free} does not come from the same general pool of
-memory that @code{malloc} and @code{free} use. To accomodate security
-settings, @code{libffi} may aquire memory, for example, by mapping
-temporary files into multiple places in the address space (once to
-write out the closure, a second to execute it). The search follows
-this list, using the first that works:
-
-@itemize @bullet
-
-@item
-A anonymous mapping (i.e. not file-backed)
-
-@item
-@code{memfd_create()}, if the kernel supports it.
-
-@item
-A file created in the directory referenced by the environment variable
-@code{LIBFFI_TMPDIR}.
-
-@item
-Likewise for the environment variable @code{TMPDIR}.
-
-@item
-A file created in @code{/tmp}.
-
-@item
-A file created in @code{/var/tmp}.
-
-@item
-A file created in @code{/dev/shm}.
-
-@item
-A file created in the user's home directory (@code{$HOME}).
-
-@item
-A file created in any directory listed in @code{/etc/mtab}.
-
-@item
-A file created in any directory listed in @code{/proc/mounts}.
-
-@end itemize
-
-If security settings prohibit using any of these for closures,
-@code{ffi_closure_alloc} will fail.
-
-@node Missing Features
-@chapter Missing Features
-
-@code{libffi} is missing a few features. We welcome patches to add
-support for these.
-
-@itemize @bullet
-@item
-Variadic closures.
-
-@item
-There is no support for bit fields in structures.
-
-@item
-The ``raw'' API is undocumented.
-@c anything else?
-
-@item
-The Go API is undocumented.
-@end itemize
-
-@node Index
-@unnumbered Index
-
-@printindex cp
-
-@bye
diff --git a/deps/libffi/doc/mdate-sh b/deps/libffi/doc/mdate-sh
deleted file mode 100755
index 22396e40679..00000000000
--- a/deps/libffi/doc/mdate-sh
+++ /dev/null
@@ -1,227 +0,0 @@
-#!/bin/sh
-# Get modification time of a file or directory, or value of
-# $SOURCE_DATE_EPOCH, and pretty-print it, formatted like 1 January 2000.
-
-scriptversion=2025-06-25.21; # UTC
-
-# Copyright (C) 1995-2025 Free Software Foundation, Inc.
-# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
-#
-# This program 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, or (at your option)
-# any later version.
-#
-# This program 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, see <https://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-fi
-
-case $1 in
- '')
- echo "$0: No file. Try '$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: mdate-sh [--help] [--version] FILE
-
-Pretty-print the modification day of FILE, in the format:
-1 January 1970
-
-Report bugs to <bug-automake@gnu.org>.
-GNU Automake home page: <https://www.gnu.org/software/automake/>.
-General help using GNU software: <https://www.gnu.org/gethelp/>.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "mdate-sh (GNU Automake) $scriptversion"
- exit $?
- ;;
-esac
-
-# Warn if more than one file given.
-if test $# -ne 1; then
- echo "$0: warning: multiple files given, using first: $*" >&2
-fi
-
-error ()
-{
- echo "$0: $1" >&2
- exit 1
-}
-
-# set $month ("January") and $nummonth (1) given arg MON ("Jan").
-mon_to_month ()
-{
- case $1 in
- Jan) month=January; nummonth=1;;
- Feb) month=February; nummonth=2;;
- Mar) month=March; nummonth=3;;
- Apr) month=April; nummonth=4;;
- May) month=May; nummonth=5;;
- Jun) month=June; nummonth=6;;
- Jul) month=July; nummonth=7;;
- Aug) month=August; nummonth=8;;
- Sep) month=September; nummonth=9;;
- Oct) month=October; nummonth=10;;
- Nov) month=November; nummonth=11;;
- Dec) month=December; nummonth=12;;
- esac
-}
-
-# Prevent date giving response in another language.
-LANG=C
-export LANG
-LC_ALL=C
-export LC_ALL
-LC_TIME=C
-export LC_TIME
-
-# Use UTC to get reproducible result.
-TZ=UTC0
-export TZ
-
-#
-# GNU ls changes its time format in response to the TIME_STYLE
-# variable. Since we cannot assume 'unset' works, revert this
-# variable to its documented default.
-if test "${TIME_STYLE+set}" = set; then
- TIME_STYLE=posix-long-iso
- export TIME_STYLE
-fi
-
-save_arg1=$1
-
-# Find out how to get the extended ls output of a file or directory.
-if ls -L /dev/null 1>/dev/null 2>&1; then
- ls_command='ls -L -l -d'
-else
- ls_command='ls -l -d'
-fi
-# Avoid user/group names that might have spaces, when possible.
-if ls -n /dev/null 1>/dev/null 2>&1; then
- ls_command="$ls_command -n"
-fi
-
-# A 'ls -l' line looks as follows on OS/2.
-# drwxrwx--- 0 Aug 11 2001 foo
-# This differs from Unix, which adds ownership information.
-# drwxrwx--- 2 root root 4096 Aug 11 2001 foo
-#
-# To find the date, we split the line on spaces and iterate on words
-# until we find a month. This cannot work with files whose owner is a
-# user named "Jan", or "Feb", etc. However, it's unlikely that '/'
-# will be owned by a user whose name is a month. So we first look at
-# the extended ls output of the root directory to decide how many
-# words should be skipped to get the date.
-
-# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
-set x`$ls_command /`
-
-# Find which argument is the month.
-month=
-command=
-until test $month
-do
- test $# -gt 0 || error "failed parsing '$ls_command /' output"
- shift
- # Add another shift to the command.
- command="$command shift;"
- mon_to_month $1
-done
-
-test -n "$month" || error "failed parsing '$ls_command /' output"
-
-# Get the extended ls output of the file or directory.
-set dummy x`eval "$ls_command \"\\\$save_arg1\""`
-
-# Remove all preceding arguments
-eval $command
-
-# Because of the dummy argument above, month is in $2.
-#
-# On a POSIX system, we should have
-# $# = 5
-# $1 = file size
-# $2 = month
-# $3 = day
-# $4 = year or time
-# $5 = filename
-#
-# On Darwin 7.7.0 and 7.6.0, we have
-# $# = 4
-# $1 = day
-# $2 = month
-# $3 = year or time
-# $4 = filename
-
-# Get the month.
-mon_to_month $2
-
-case $3 in
- ???*) day=$1;;
- *) day=$3; shift;;
-esac
-
-# Here we have to deal with the problem that the ls output gives either
-# the time of day or the year.
-case $3 in
- *:*) set `date`; eval year=\$$#
- case $2 in
- Jan) nummonthtod=1;;
- Feb) nummonthtod=2;;
- Mar) nummonthtod=3;;
- Apr) nummonthtod=4;;
- May) nummonthtod=5;;
- Jun) nummonthtod=6;;
- Jul) nummonthtod=7;;
- Aug) nummonthtod=8;;
- Sep) nummonthtod=9;;
- Oct) nummonthtod=10;;
- Nov) nummonthtod=11;;
- Dec) nummonthtod=12;;
- esac
- # For the first six months of the year the time notation can also
- # be used for files modified in the last year.
- if (expr $nummonth \> $nummonthtod) >/dev/null;
- then
- year=`expr $year - 1`
- fi;;
- *) year=$3;;
-esac
-
-# The result.
-echo $day $month $year
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'before-save-hook 'time-stamp nil t)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%Y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC0"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/deps/libffi/doc/stamp-vti b/deps/libffi/doc/stamp-vti
deleted file mode 100644
index c9adde9c03f..00000000000
--- a/deps/libffi/doc/stamp-vti
+++ /dev/null
@@ -1,4 +0,0 @@
-@set UPDATED 14 November 2026
-@set UPDATED-MONTH November 2026
-@set EDITION 3.8.1
-@set VERSION 3.8.1
diff --git a/deps/libffi/doc/texinfo.tex b/deps/libffi/doc/texinfo.tex
deleted file mode 100755
index 5d2f174ee9b..00000000000
--- a/deps/libffi/doc/texinfo.tex
+++ /dev/null
@@ -1,12354 +0,0 @@
-% texinfo.tex -- TeX macros to handle Texinfo files.
-%
-% Load plain if necessary, i.e., if running under initex.
-\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
-%
-\def\texinfoversion{2025-10-25.20}
-%
-% Copyright 1985, 1986, 1988, 1990-2025 Free Software Foundation, Inc.
-%
-% This texinfo.tex file 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 3 of the
-% License, or (at your option) any later version.
-%
-% This texinfo.tex file 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, see <https://www.gnu.org/licenses/>.
-%
-% As a special exception, when this file is read by TeX when processing
-% a Texinfo source document, you may use the result without
-% restriction. This Exception is an additional permission under section 7
-% of the GNU General Public License, version 3 ("GPLv3").
-%
-% Please try the latest version of texinfo.tex before submitting bug
-% reports; you can get the latest version from:
-% https://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
-% https://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
-% https://www.gnu.org/software/texinfo/ (the Texinfo home page)
-% The texinfo.tex in any given distribution could well be out
-% of date, so if that's what you're using, please check.
-%
-% Send bug reports to bug-texinfo@gnu.org. Please include a
-% complete document in each bug report with which we can reproduce the
-% problem. Patches are, of course, greatly appreciated.
-%
-% To process a Texinfo manual with TeX, it's most reliable to use the
-% texi2dvi shell script that comes with the distribution. For a simple
-% manual foo.texi, however, you can get away with this:
-% tex foo.texi
-% texindex foo.??
-% tex foo.texi
-% tex foo.texi
-% dvips foo.dvi -o # or whatever; this makes foo.ps.
-% The extra TeX runs get the cross-reference information correct.
-% Sometimes one run after texindex suffices, and sometimes you need more
-% than two; texi2dvi does it as many times as necessary.
-%
-% It is possible to adapt texinfo.tex for other languages, to some
-% extent. You can get the existing language-specific files from the
-% full Texinfo distribution.
-%
-% The GNU Texinfo home page is https://www.gnu.org/software/texinfo.
-
-
-\message{Loading texinfo [version \texinfoversion]:}
-
-% LaTeX's \typeout. This ensures that the messages it is used for
-% are identical in format to the corresponding ones from latex/pdflatex.
-\def\typeout{\immediate\write17}%
-
-\chardef\other=12
-
-% We never want plain's \outer definition of \+ in Texinfo.
-% For @tex, we can use \tabalign.
-\let\+ = \relax
-
-% Save some plain tex macros whose names we will redefine.
-\let\ptexb=\b
-\let\ptexbullet=\bullet
-\let\ptexc=\c
-\let\ptexcomma=\,
-\let\ptexdot=\.
-\let\ptexdots=\dots
-\let\ptexend=\end
-\let\ptexequiv=\equiv
-\let\ptexexclam=\!
-\let\ptexfootnote=\footnote
-\let\ptexgtr=>
-\let\ptexhat=^
-\let\ptexi=\i
-\let\ptexindent=\indent
-\let\ptexinsert=\insert
-\let\ptexlbrace=\{
-\let\ptexless=<
-\let\ptexnewwrite\newwrite
-\let\ptexnoindent=\noindent
-\let\ptexplus=+
-\let\ptexraggedright=\raggedright
-\let\ptexrbrace=\}
-\let\ptexslash=\/
-\let\ptexsp=\sp
-\let\ptexstar=\*
-\let\ptexsup=\sup
-\let\ptext=\t
-\let\ptextop=\top
-{\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
-
-% If this character appears in an error message or help string, it
-% starts a new line in the output.
-\newlinechar = `^^J
-
-% Use TeX 3.0's \inputlineno to get the line number, for better error
-% messages, but if we're using an old version of TeX, don't do anything.
-%
-\ifx\inputlineno\thisisundefined
- \let\linenumber = \empty % Pre-3.0.
-\else
- \def\linenumber{l.\the\inputlineno:\space}
-\fi
-
-% Set up fixed words for English if not already set.
-\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
-\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
-\ifx\putworderror\undefined \gdef\putworderror{error}\fi
-\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
-\ifx\putwordin\undefined \gdef\putwordin{in}\fi
-\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
-\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
-\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
-\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
-\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
-\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
-\ifx\putwordof\undefined \gdef\putwordof{of}\fi
-\ifx\putwordon\undefined \gdef\putwordon{on}\fi
-\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
-\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
-\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
-\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
-\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
-\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
-\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
-%
-\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
-\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
-\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
-\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
-\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
-\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
-\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
-\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
-\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
-\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
-\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
-\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
-%
-\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
-\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
-\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
-\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
-\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
-
-% Give the space character the catcode for a space.
-\def\spaceisspace{\catcode`\ =10\relax}
-
-% Used to ignore an active newline that may appear immediately after
-% a macro name.
-{\catcode13=\active \gdef\ignoreactivenewline{\let^^M\empty}}
-
-\chardef\dashChar = `\-
-\chardef\slashChar = `\/
-\chardef\underChar = `\_
-
-% Ignore a token.
-%
-\def\gobble#1{}
-
-% The following is used inside several \edef's.
-\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
-
-% Hyphenation fixes.
-\hyphenation{
- Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
- ap-pen-dix bit-map bit-maps
- data-base data-bases eshell fall-ing half-way long-est man-u-script
- man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
- par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
- spell-ing spell-ings
- stand-alone strong-est time-stamp time-stamps which-ever white-space
- wide-spread wrap-around
-}
-
-% Sometimes it is convenient to have everything in the transcript file
-% and nothing on the terminal. We don't just call \tracingall here,
-% since that produces some useless output on the terminal. We also make
-% some effort to order the tracing commands to reduce output in the log
-% file; cf. trace.sty in LaTeX.
-%
-\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
-\def\loggingall{%
- \tracingstats2
- \tracingpages1
- \tracinglostchars2 % 2 gives us more in etex
- \tracingparagraphs1
- \tracingoutput1
- \tracingmacros2
- \tracingrestores1
- \showboxbreadth\maxdimen \showboxdepth\maxdimen
- \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
- \tracingscantokens1
- \tracingifs1
- \tracinggroups1
- \tracingnesting2
- \tracingassigns1
- \fi
- \tracingcommands3 % 3 gives us more in etex
- \errorcontextlines16
-}%
-
-% @errormsg{MSG}. Do the index-like expansions on MSG, but if things
-% aren't perfect, it's not the end of the world, being an error message,
-% after all.
-%
-\def\errormsg{\begingroup \indexnofonts \doerrormsg}
-\def\doerrormsg#1{\errmessage{#1}}
-
-% add check for \lastpenalty to plain's definitions. If the last thing
-% we did was a \nobreak, we don't want to insert more space.
-%
-\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
- \removelastskip\penalty-50\smallskip\fi\fi}
-\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
- \removelastskip\penalty-100\medskip\fi\fi}
-\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
- \removelastskip\penalty-200\bigskip\fi\fi}
-
-% Output routine
-%
-
-% For a final copy, take out the rectangles
-% that mark overfull boxes (in case you have decided
-% that the text looks ok even though it passes the margin).
-%
-\def\finalout{\overfullrule=0pt }
-
-% Output a mark which sets \thischapter, \thissection and \thiscolor.
-% We dump everything together because we only have one kind of mark.
-% This works because we only use \botmark / \topmark, not \firstmark.
-%
-% A mark contains a subexpression of the \ifcase ... \fi construct.
-% \get*marks macros below extract the needed part using \ifcase.
-%
-% Another complication is to let the user choose whether \thischapter
-% (\thissection) refers to the chapter (section) in effect at the top
-% of a page, or that at the bottom of a page.
-
-% \domark is called twice inside \chapmacro, to add one
-% mark before the section break, and one after.
-% In the second call \prevchapterdefs is the same as \currentchapterdefs,
-% and \prevsectiondefs is the same as \currentsectiondefs.
-% Then if the page is not broken at the mark, some of the previous
-% section appears on the page, and we can get the name of this section
-% from \firstmark for @everyheadingmarks top.
-% @everyheadingmarks bottom uses \botmark.
-%
-% See page 260 of The TeXbook.
-\def\domark{%
- \toks0=\expandafter{\currentchapterdefs}%
- \toks2=\expandafter{\currentsectiondefs}%
- \toks4=\expandafter{\prevchapterdefs}%
- \toks6=\expandafter{\prevsectiondefs}%
- \toks8=\expandafter{\currentcolordefs}%
- \mark{%
- \the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top
- \noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom
- \noexpand\else \the\toks8 % 2: color marks
- }%
-}
-
-% \gettopheadingmarks, \getbottomheadingmarks,
-% \getcolormarks - extract needed part of mark.
-%
-% \topmark doesn't work for the very first chapter (after the title
-% page or the contents), so we use \firstmark there -- this gets us
-% the mark with the chapter defs, unless the user sneaks in, e.g.,
-% @setcolor (or @url etc.) between @contents and the very first @chapter.
-\def\gettopheadingmarks{%
- \ifcase0\the\savedtopmark\fi
- \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
-}
-\def\getbottomheadingmarks{\ifcase1\botmark\fi}
-\def\getcolormarks{\ifcase2\the\savedtopmark\fi}
-
-% Avoid "undefined control sequence" errors.
-\def\currentchapterdefs{}
-\def\currentsectiondefs{}
-\def\prevchapterdefs{}
-\def\prevsectiondefs{}
-\def\currentcolordefs{}
-
-% Margin to add to right of even pages, to left of odd pages.
-\newdimen\bindingoffset
-\newdimen\normaloffset
-\newdimen\txipagewidth \newdimen\txipageheight
-
-% Main output routine.
-%
-\chardef\PAGE = 255
-\newtoks\defaultoutput
-\defaultoutput = {\savetopmark\onepageout{\pagecontents\PAGE}}
-\output=\expandafter{\the\defaultoutput}
-
-\newbox\headlinebox
-\newbox\footlinebox
-
-% When outputting the double column layout for indices, an output routine
-% is run several times, hiding the original value of \topmark. Hence, save
-% \topmark at the beginning.
-%
-\newtoks\savedtopmark
-\newif\iftopmarksaved
-\topmarksavedtrue
-\def\savetopmark{%
- \iftopmarksaved\else
- \global\savedtopmark=\expandafter{\topmark}%
- \global\topmarksavedtrue
- \fi
-}
-
-% \onepageout takes a vbox as an argument.
-% \shipout a vbox for a single page, adding an optional header, footer
-% and footnote. This also causes index entries for this page to be written
-% to the auxiliary files.
-%
-\def\onepageout#1{%
- \hoffset=\normaloffset
- %
- \ifodd\pageno \advance\hoffset by \bindingoffset
- \else \advance\hoffset by -\bindingoffset\fi
- %
- \checkchapterpage
- %
- % Make the heading and footing. \makeheadline and \makefootline
- % use the contents of \headline and \footline.
- \def\commonheadfootline{\let\hsize=\txipagewidth \texinfochars}
- \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
- \global\setbox\headlinebox = \vbox{\commonheadfootline \makeheadline}%
- \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
- \global\setbox\footlinebox = \vbox{\commonheadfootline \makefootline}%
- %
- {%
- % Set context for writing to auxiliary files like index files.
- % Have to do this stuff outside the \shipout because we want it to
- % take effect in \write's, yet the group defined by the \vbox ends
- % before the \shipout runs.
- %
- \atdummies % don't expand commands in the output.
- \turnoffactive
- \shipout\vbox{%
- % Do this early so pdf references go to the beginning of the page.
- \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
- %
- \unvbox\headlinebox
- \pagebody{#1}%
- \ifdim\ht\footlinebox > 0pt
- % Only leave this space if the footline is nonempty.
- % (We lessened \vsize for it in \oddfootingyyy.)
- % The \baselineskip=24pt in plain's \makefootline has no effect.
- \vskip 24pt
- \unvbox\footlinebox
- \fi
- %
- }%
- }%
- \global\topmarksavedfalse
- \advancepageno
- \ifnum\outputpenalty>-20000 \else\dosupereject\fi
-}
-
-\newinsert\margin \dimen\margin=\maxdimen
-
-% Main part of page, including any footnotes
-\def\pagebody#1{\vbox to\txipageheight{\boxmaxdepth=\maxdepth #1}}
-{\catcode`\@ =11
-\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
-% marginal hacks, juha@viisa.uucp (Juha Takala)
-\ifvoid\margin\else % marginal info is present
- \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
-\dimen@=\dp#1\relax \unvbox#1\relax
-\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
-\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
-}
-
-% Check if we are on the first page of a chapter. Used for printing headings.
-\newif\ifchapterpage
-\def\checkchapterpage{%
- % Get the chapter that was current at the end of the last page
- \ifcase1\the\savedtopmark\fi
- \let\prevchaptername\thischaptername
- %
- \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
- \let\curchaptername\thischaptername
- %
- \ifx\curchaptername\prevchaptername
- \chapterpagefalse
- \else
- \chapterpagetrue
- \fi
-}
-
-% Argument parsing
-
-% Parse an argument, then pass it to #1. The argument is the rest of
-% the input line (except we remove a trailing comment). #1 should be a
-% macro which expects an ordinary undelimited TeX argument.
-% For example, \def\foo{\parsearg\fooxxx}.
-%
-\def\parsearg{\parseargusing{}}
-\def\parseargusing#1#2{%
- \def\argtorun{#2}%
- \begingroup
- \obeylines
- \spaceisspace
- #1%
- \parseargline\empty% Insert the \empty token, see \finishparsearg below.
-}
-
-{\obeylines %
- \gdef\parseargline#1^^M{%
- \endgroup % End of the group started in \parsearg.
- \argremovecomment #1\comment\ArgTerm%
- }%
-}
-
-% First remove any @comment, then any @c comment. Pass the result on to
-% \argremovespace.
-\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
-\def\argremovec#1\c#2\ArgTerm{\argremovespace#1$ $\ArgTerm}
-% \argremovec might leave us with trailing space, though; e.g.,
-% @end itemize @c foo
-% Note that the argument cannot contain the TeX $, as its catcode is
-% changed to \other when Texinfo source is read.
-\def\argremovespace#1 $#2\ArgTerm{\finishparsearg#1$\ArgTerm}
-
-% If a _delimited_ argument is enclosed in braces, they get stripped; so
-% to get _exactly_ the rest of the line, we had to prevent such situation.
-% We prepended an \empty token at the very beginning and we expand it
-% just before passing the control to \next.
-% (But first, we have to remove the remaining $ or two.)
-\def\finishparsearg#1$#2\ArgTerm{\expandafter\argtorun\expandafter{#1}}
-
-
-% \parseargdef - define a command taking an argument on the line
-%
-% \parseargdef\foo{...}
-% is roughly equivalent to
-% \def\foo{\parsearg\Xfoo}
-% \def\Xfoo#1{...}
-\def\parseargdef#1{%
- \expandafter \doparseargdef \csname\string#1\endcsname #1%
-}
-\def\doparseargdef#1#2{%
- \def#2{\parsearg#1}%
- \def#1##1%
-}
-
-% Several utility definitions with active space:
-{
- \obeyspaces
- \gdef\obeyedspace{ }
-
- % Make each space character in the input produce a normal interword
- % space in the output. Don't allow a line break at this space, as this
- % is used only in environments like @example, where each line of input
- % should produce a line of output anyway.
- %
- \gdef\sepspaces{\obeyspaces\let =\tie}
-
- % If an index command is used in an @example environment, any spaces
- % therein should become regular spaces in the raw index file, not the
- % expansion of \tie (\leavevmode \penalty \@M \ ).
- \gdef\unsepspaces{\let =\space}
-}
-
-
-\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
-
-% Define the framework for environments in texinfo.tex. It's used like this:
-%
-% \envdef\foo{...}
-% \def\Efoo{...}
-%
-% \envdef inserts \begingroup before the actual body; @end calls
-% \Efoo then closes the group with \endgroup. \envdef also
-% defines \thisenv, so the current environment is known; @end checks
-% whether the environment name matches. The \checkenv macro can also be
-% used to check whether the current environment is the one expected.
-%
-% Non-false conditionals (@iftex, @ifset) don't fit into this, so they
-% are not treated as environments; they don't open a group. (The
-% implementation of @end takes care not to call \endgroup in this
-% special case.)
-
-
-% At run-time, environments start with this:
-\def\startenvironment#1{\begingroup\def\thisenv{#1}}
-% initialize
-\let\thisenv\empty
-
-% ... but they get defined via ``\envdef\foo{...}'':
-\long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
-\long\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
-
-% Check whether we're in the right environment:
-\def\checkenv#1{%
- \def\temp{#1}%
- \ifx\thisenv\temp
- \else
- \badenverr
- \fi
-}
-
-% Environment mismatch, #1 expected:
-\def\badenverr{%
- \errhelp = \EMsimple
- \errmessage{This command can appear only \inenvironment\temp,
- not \inenvironment\thisenv}%
-}
-\def\inenvironment#1{%
- \ifx#1\empty
- outside of any environment%
- \else
- in environment \expandafter\string#1%
- \fi
-}
-
-
-% @end foo calls \checkenv and executes the definition of \Efoo.
-\parseargdef\end{%
- \if 1\csname iscond.#1\endcsname
- \else
- % The general wording of \badenverr may not be ideal.
- \expandafter\checkenv\csname#1\endcsname
- \csname E#1\endcsname
- \endgroup
- \fi
-}
-
-\newhelp\EMsimple{Press RETURN to continue.}
-
-
-% Be sure we're in horizontal mode when doing a tie, since we make space
-% equivalent to this in @example-like environments. Otherwise, a space
-% at the beginning of a line will start with \penalty -- and
-% since \penalty is valid in vertical mode, we'd end up putting the
-% penalty on the vertical list instead of in the new paragraph.
-{\catcode`@ = 11
- % Avoid using \@M directly, because that causes trouble
- % if the definition is written into an index file.
- \global\let\tiepenalty = \@M
- \gdef\tie{\leavevmode\penalty\tiepenalty\ }
-}
-
-% @: forces normal size whitespace following.
-\def\:{\spacefactor=1000 }
-
-% @* forces a line break.
-\def\*{\unskip\hfil\break\hbox{}\ignorespaces}
-
-% @/ allows a line break.
-\let\/=\allowbreak
-
-% @- allows explicit insertion of hyphenation points
-\def\-{\discretionary{\normaldash}{}{}}%
-
-% @. is an end-of-sentence period.
-\def\.{.\spacefactor=\endofsentencespacefactor\space}
-
-% @! is an end-of-sentence bang.
-\def\!{!\spacefactor=\endofsentencespacefactor\space}
-
-% @? is an end-of-sentence query.
-\def\?{?\spacefactor=\endofsentencespacefactor\space}
-
-% @w prevents a word break. Without the \leavevmode, @w at the
-% beginning of a paragraph, when TeX is still in vertical mode, would
-% produce a whole line of output instead of starting the paragraph.
-\def\w#1{\leavevmode\hbox{#1}}
-
-% @group ... @end group forces ... to be all on one page, by enclosing
-% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
-% to keep its height that of a normal line. According to the rules for
-% \topskip (p.114 of the TeXbook), the glue inserted is
-% max (\topskip - \ht (first item), 0). If that height is large,
-% therefore, no glue is inserted, and the space between the headline and
-% the text is small, which looks bad.
-%
-% Another complication is that the group might be very large. This can
-% cause the glue on the previous page to be unduly stretched, because it
-% does not have much material. In this case, it's better to add an
-% explicit \vfill so that the extra space is at the bottom. The
-% threshold for doing this is if the group is more than \vfilllimit
-% percent of a page (\vfilllimit can be changed inside of @tex).
-%
-\newbox\groupbox
-\def\vfilllimit{0.7}
-%
-\envdef\group{%
- \ifnum\catcode`\^^M=\active \else
- \errhelp = \groupinvalidhelp
- \errmessage{@group invalid in context where filling is enabled}%
- \fi
- \startsavinginserts
- %
- \setbox\groupbox = \vtop\bgroup
- % Do @comment since we are called inside an environment such as
- % @example, where each end-of-line in the input causes an
- % end-of-line in the output. We don't want the end-of-line after
- % the `@group' to put extra space in the output. Since @group
- % should appear on a line by itself (according to the Texinfo
- % manual), we don't worry about eating any user text.
- \comment
-}
-%
-% The \vtop produces a box with normal height and large depth; thus, TeX puts
-% \baselineskip glue before it, and (when the next line of text is done)
-% \lineskip glue after it. Thus, space below is not quite equal to space
-% above. But it's pretty close.
-\def\Egroup{%
- % To get correct interline space between the last line of the group
- % and the first line afterwards, we have to propagate \prevdepth.
- \endgraf % Not \par, as it may have been set to \lisppar.
- \global\dimen1 = \prevdepth
- \egroup % End the \vtop.
- \addgroupbox
- \prevdepth = \dimen1
- \checkinserts
-}
-
-\def\addgroupbox{
- % \dimen0 is the vertical size of the group's box.
- \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
- % \dimen2 is how much space is left on the page (more or less).
- \dimen2 = \txipageheight \advance\dimen2 by -\pagetotal
- % if the group doesn't fit on the current page, and it's a big big
- % group, force a page break.
- \ifdim \dimen0 > \dimen2
- \ifdim \pagetotal < \vfilllimit\txipageheight
- \page
- \fi
- \fi
- \box\groupbox
-}
-
-%
-% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
-% message, so this ends up printing `@group can only ...'.
-%
-\newhelp\groupinvalidhelp{%
-group can only be used in environments such as @example,^^J%
-where each line of input produces a line of output.}
-
-% @need space-in-mils
-% forces a page break if there is not space-in-mils remaining.
-
-\newdimen\mil \mil=0.001in
-
-\parseargdef\need{%
- % Ensure vertical mode, so we don't make a big box in the middle of a
- % paragraph.
- \par
- %
- % If the @need value is less than one line space, it's useless.
- \dimen0 = #1\mil
- \dimen2 = \ht\strutbox
- \advance\dimen2 by \dp\strutbox
- \ifdim\dimen0 > \dimen2
- % This is similar to the 'needspace' module in LaTeX.
- % The first penalty allows a break if the end of the page is
- % not too far away. Following penalties and skips are discarded.
- % Otherwise, require at least \dimen0 of vertical space.
- %
- % (We used to use a \vtop to reserve space, but this had spacing issues
- % when followed by a section heading, as it was not a "discardable item".
- % This also has the benefit of providing glue before the page break if
- % there isn't enough space.)
- \vskip0pt plus \dimen0
- \penalty-100
- \vskip0pt plus -\dimen0
- \vskip \dimen0
- \penalty9999
- \vskip -\dimen0
- \penalty0\relax % this hides the above glue from \safewhatsit and \dobreak
- \fi
-}
-
-% @br forces paragraph break (and is undocumented).
-
-\let\br = \par
-
-% @page forces the start of a new page.
-%
-\def\page{\par\vfill\supereject}
-
-% @exdent text....
-% outputs text on separate line in roman font, starting at standard page margin
-
-% This records the amount of indent in the innermost environment.
-% That's how much \exdent should take out.
-\newskip\exdentamount
-
-% This defn is used inside fill environments such as @defun.
-\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
-
-% This defn is used inside nofill environments such as @example.
-\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
- \leftline{\hskip\leftskip{\rm#1}}}}
-
-% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
-% paragraph. For more general purposes, use the \margin insertion
-% class. WHICH is `l' or `r'. Not documented, written for gawk manual.
-%
-\newskip\inmarginspacing \inmarginspacing=1cm
-\def\strutdepth{\dp\strutbox}
-%
-\def\doinmargin#1#2{\strut\vadjust{%
- \nobreak
- \kern-\strutdepth
- \vtop to \strutdepth{%
- \baselineskip=\strutdepth
- \vss
- % if you have multiple lines of stuff to put here, you'll need to
- % make the vbox yourself of the appropriate size.
- \ifx#1l%
- \llap{\ignorespaces #2\hskip\inmarginspacing}%
- \else
- \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
- \fi
- \null
- }%
-}}
-\def\inleftmargin{\doinmargin l}
-\def\inrightmargin{\doinmargin r}
-%
-% @inmargin{TEXT [, RIGHT-TEXT]}
-% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
-% else use TEXT for both).
-%
-\def\inmargin#1{\parseinmargin #1,,\finish}
-\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
- \setbox0 = \hbox{\ignorespaces #2}%
- \ifdim\wd0 > 0pt
- \def\lefttext{#1}% have both texts
- \def\righttext{#2}%
- \else
- \def\lefttext{#1}% have only one text
- \def\righttext{#1}%
- \fi
- %
- \ifodd\pageno
- \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
- \else
- \def\temp{\inleftmargin\lefttext}%
- \fi
- \temp
-}
-
-% @include FILE -- \input text of FILE.
-%
-\def\include{\parseargusing\filenamecatcodes\includezzz}
-\def\includezzz#1{%
- \pushthisfilestack
- \def\thisfile{#1}%
- {%
- \makevalueexpandable % we want to expand any @value in FILE.
- \turnoffactive % and allow special characters in the expansion
- \indexnofonts % Allow `@@' and other weird things in file names.
- \wlog{texinfo.tex: doing @include of #1^^J}%
- \edef\temp{\noexpand\input #1 }%
- %
- % This trickery is to read FILE outside of a group, in case it makes
- % definitions, etc.
- \expandafter
- }\temp
- \popthisfilestack
-}
-\def\filenamecatcodes{%
- \catcode`\\=\other
- \catcode`~=\other
- \catcode`^=\other
- \catcode`_=\other
- \catcode`|=\other
- \catcode`<=\other
- \catcode`>=\other
- \catcode`+=\other
- \catcode`-=\other
- \catcode`\`=\other
- \catcode`\'=\other
-}
-
-\def\pushthisfilestack{%
- \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
-}
-\def\pushthisfilestackX{%
- \expandafter\pushthisfilestackY\thisfile\StackTerm
-}
-\def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
- \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
-}
-
-\def\popthisfilestack{\errthisfilestackempty}
-\def\errthisfilestackempty{\errmessage{Internal error:
- the stack of filenames is empty.}}
-%
-\def\thisfile{}
-
-% @center line
-% outputs that line, centered.
-%
-\parseargdef\center{%
- \ifhmode
- \let\centersub\centerH
- \else
- \let\centersub\centerV
- \fi
- \centersub{\hfil \ignorespaces#1\unskip \hfil}%
- \let\centersub\relax % don't let the definition persist, just in case
-}
-\def\centerH#1{{%
- \hfil\break
- \advance\hsize by -\leftskip
- \advance\hsize by -\rightskip
- \line{#1}%
- \break
-}}
-%
-\newcount\centerpenalty
-\def\centerV#1{%
- % The idea here is the same as in \startdefun, \cartouche, etc.: if
- % @center is the first thing after a section heading, we need to wipe
- % out the negative parskip inserted by \sectionheading, but still
- % prevent a page break here.
- \centerpenalty = \lastpenalty
- \ifnum\centerpenalty>10000 \vskip\parskip \fi
- \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
- \line{\kern\leftskip #1\kern\rightskip}%
-}
-
-% @sp n outputs n lines of vertical space
-%
-\parseargdef\sp{\vskip #1\baselineskip}
-
-% @comment ...line which is ignored...
-% @c is the same as @comment
-% @ignore ... @end ignore is another way to write a comment
-
-
-\def\c{\begingroup \catcode`\^^M=\active%
-\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
-\cxxx}
-{\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}}
-%
-\let\comment\c
-
-% @paragraphindent NCHARS
-% We'll use ems for NCHARS, close enough.
-% NCHARS can also be the word `asis' or `none'.
-% We cannot feasibly implement @paragraphindent asis, though.
-%
-\def\asisword{asis} % no translation, these are keywords
-\def\noneword{none}
-%
-\parseargdef\paragraphindent{%
- \def\temp{#1}%
- \ifx\temp\asisword
- \else
- \ifx\temp\noneword
- \defaultparindent = 0pt
- \else
- \defaultparindent = #1em
- \fi
- \fi
- \parindent = \defaultparindent
-}
-
-% @exampleindent NCHARS
-% We'll use ems for NCHARS like @paragraphindent.
-% It seems @exampleindent asis isn't necessary, but
-% I preserve it to make it similar to @paragraphindent.
-\parseargdef\exampleindent{%
- \def\temp{#1}%
- \ifx\temp\asisword
- \else
- \ifx\temp\noneword
- \lispnarrowing = 0pt
- \else
- \lispnarrowing = #1em
- \fi
- \fi
-}
-
-% @firstparagraphindent WORD
-% If WORD is `none', then suppress indentation of the first paragraph
-% after a section heading. If WORD is `insert', then do indent at such
-% paragraphs.
-%
-% The paragraph indentation is suppressed or not by calling
-% \suppressfirstparagraphindent, which the sectioning commands do.
-% We switch the definition of this back and forth according to WORD.
-% By default, we suppress indentation.
-%
-\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
-\def\insertword{insert}
-%
-\parseargdef\firstparagraphindent{%
- \def\temp{#1}%
- \ifx\temp\noneword
- \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
- \else\ifx\temp\insertword
- \let\suppressfirstparagraphindent = \relax
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @firstparagraphindent option `\temp'}%
- \fi\fi
-}
-
-% Here is how we actually suppress indentation. Redefine \everypar to
-% \kern backwards by \parindent, and then reset itself to empty.
-%
-% We also make \indent itself not actually do anything until the next
-% paragraph.
-%
-\gdef\dosuppressfirstparagraphindent{%
- \gdef\indent {\restorefirstparagraphindent \indent}%
- \gdef\noindent{\restorefirstparagraphindent \noindent}%
- \global\everypar = {\kern -\parindent \restorefirstparagraphindent}%
-}
-%
-\gdef\restorefirstparagraphindent{%
- \global\let\indent = \ptexindent
- \global\let\noindent = \ptexnoindent
- \global\everypar = {}%
-}
-
-% leave vertical mode without cancelling any first paragraph indent
-\gdef\imageindent{%
- \toks0=\everypar
- \everypar={}%
- \ptexnoindent
- \global\everypar=\toks0
-}
-
-
-% @refill is a no-op.
-\let\refill=\relax
-
-% @setfilename INFO-FILENAME - ignored
-\let\setfilename=\comment
-
-% @bye.
-\outer\def\bye{%
- \chappager\pagelabels
- % possibly set in \printindex
- \ifx\byeerror\relax\else\errmessage{\byeerror}\fi
- \tracingstats=1\ptexend}
-
-% set in \donoderef below, but we need to define this here so that
-% conditionals balance inside the large \ifpdf ... \fi blocks below.
-\newif\ifnodeseen
-\nodeseenfalse
-
-\message{pdf,}
-% adobe `portable' document format
-\newcount\tempnum
-\newcount\lnkcount
-\newtoks\filename
-\newcount\filenamelength
-\newcount\pgn
-\newtoks\toksA
-\newtoks\toksB
-\newtoks\toksC
-\newtoks\toksD
-\newbox\boxA
-\newbox\boxB
-\newcount\countA
-\newif\ifpdf
-\newif\ifpdfmakepagedest
-
-% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
-% can be set). So we test for \relax and 0 as well as being undefined.
-\ifx\pdfoutput\thisisundefined
-\else
- \ifx\pdfoutput\relax
- \else
- \ifcase\pdfoutput
- \else
- \pdftrue
- \fi
- \fi
-\fi
-
-\newif\ifxetex
-\ifx\XeTeXrevision\thisisundefined\else
- \xetextrue
-\fi
-
-\newif\ifluatex
-\ifx\luatexversion\thisisundefined\else
- \luatextrue
- \ifnum\luatexversion>84
- \pdftrue
- \fi
-\fi
-
-\newif\ifpdforxetex
-\ifpdf
- \pdforxetextrue
-\fi
-\ifxetex
- \pdforxetextrue
-\fi
-
-
-
-% Whether to use non-ASCII bytes in internal link targets. Presently this
-% is almost always on.
-\newif\iftxiuseunicodedestname
-\txiuseunicodedestnametrue
-
-%
-% For LuaTeX
-%
-
-\ifluatex
- % Use Unicode destination names
- \txiuseunicodedestnametrue
- % Escape PDF strings with converting UTF-16 from UTF-8
- \begingroup
- \catcode`\%=12
- \directlua{
- function UTF16oct(str)
- tex.sprint(string.char(0x5c) .. '376' .. string.char(0x5c) .. '377')
- for c in string.utfvalues(str) do
- if c < 0x10000 then
- tex.sprint(
- string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
- string.char(0x5c) .. string.char(0x25) .. '03o',
- math.floor(c / 256), math.floor(c % 256)))
- else
- c = c - 0x10000
- local c_hi = c / 1024 + 0xd800
- local c_lo = c % 1024 + 0xdc00
- tex.sprint(
- string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
- string.char(0x5c) .. string.char(0x25) .. '03o' ..
- string.char(0x5c) .. string.char(0x25) .. '03o' ..
- string.char(0x5c) .. string.char(0x25) .. '03o',
- math.floor(c_hi / 256), math.floor(c_hi % 256),
- math.floor(c_lo / 256), math.floor(c_lo % 256)))
- end
- end
- end
- }
- \endgroup
- \def\pdfescapestrutfsixteen#1{\directlua{UTF16oct('\luaescapestring{#1}')}}
- % Escape PDF strings without converting
- \begingroup
- \directlua{
- function PDFescstr(str)
- for c in string.bytes(str) do
- if c <= 0x20 or c >= 0x80 or c == 0x28 or c == 0x29 or c == 0x5c then
- tex.sprint(-2,
- string.format(string.char(0x5c) .. string.char(0x25) .. '03o',
- c))
- else
- tex.sprint(-2, string.char(c))
- end
- end
- end
- }
- % The -2 in the arguments here gives all the input to TeX catcode 12
- % (other) or 10 (space), preventing undefined control sequence errors. See
- % https://lists.gnu.org/archive/html/bug-texinfo/2019-08/msg00031.html
- %
- \endgroup
- \def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}}
- \ifpdf
- % For LuaTeX >= 0.85
- \def\pdfdest{\pdfextension dest}
- \let\pdfoutput\outputmode
- \def\pdfliteral{\pdfextension literal}
- \def\pdfcatalog{\pdfextension catalog}
- \def\pdftexversion{\numexpr\pdffeedback version\relax}
- \let\pdfximage\saveimageresource
- \let\pdfrefximage\useimageresource
- \let\pdflastximage\lastsavedimageresourceindex
- \def\pdfendlink{\pdfextension endlink\relax}
- \def\pdfoutline{\pdfextension outline}
- \def\pdfstartlink{\pdfextension startlink}
- \def\pdffontattr{\pdfextension fontattr}
- \def\pdfobj{\pdfextension obj}
- \def\pdflastobj{\numexpr\pdffeedback lastobj\relax}
- \let\pdfpagewidth\pagewidth
- \let\pdfpageheight\pageheight
- \edef\pdfhorigin{\pdfvariable horigin}
- \edef\pdfvorigin{\pdfvariable vorigin}
- \fi
-\fi
-
-
-% Output page labels information.
-% See PDF reference v.1.7 p.594, section 8.3.1.
-% Page label ranges must be increasing.
-\ifpdf
-\def\pagelabels{%
- \def\title{0 << /P (T-) /S /D >>}%
- %
- % support @contents at very end of document
- \ifnum\contentsendcount=\pagecount
- \ifnum\arabiccount<\romancount
- \pdfcatalog{/PageLabels << /Nums
- [\title
- \the\arabiccount << /S /D >>
- \the\romancount << /S /r >>
- ] >> }\relax
- \fi
- % no contents in document
- \else\ifnum\contentsendcount=0
- \pdfcatalog{/PageLabels << /Nums
- [\title
- \the\arabiccount << /S /D >>
- ] >> }\relax
- \else
- \pdfcatalog{/PageLabels << /Nums
- [\title
- \the\romancount << /S /r >>
- \the\contentsendcount << /S /D >>
- ] >> }\relax
- \fi\fi
-}
-\else
- \let\pagelabels\relax
-\fi
-
-\newcount\pagecount \pagecount=0
-\newcount\romancount \romancount=0
-\newcount\arabiccount \arabiccount=0
-\newcount\contentsendcount \contentsendcount=0
-
-\ifpdf
- \let\ptxadvancepageno\advancepageno
- \def\advancepageno{%
- \ptxadvancepageno\global\advance\pagecount by 1
- }
-\fi
-
-
-% PDF uses PostScript string constants for the names of xref targets,
-% for display in the outlines, and in other places. Thus, we have to
-% double any backslashes. Otherwise, a name like "\node" will be
-% interpreted as a newline (\n), followed by o, d, e. Not good.
-%
-% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
-% related messages. The final outcome is that it is up to the TeX user
-% to double the backslashes and otherwise make the string valid, so
-% that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to
-% do this reliably, so we use it.
-
-% #1 is a control sequence in which to do the replacements,
-% which we \xdef.
-\def\txiescapepdf#1{%
- \ifx\pdfescapestring\thisisundefined
- % No primitive available; should we give a warning or log?
- % Many times it won't matter.
- \xdef#1{#1}%
- \else
- % The expandable \pdfescapestring primitive escapes parentheses,
- % backslashes, and other special chars.
- \xdef#1{\pdfescapestring{#1}}%
- \fi
-}
-\def\txiescapepdfutfsixteen#1{%
- \ifx\pdfescapestrutfsixteen\thisisundefined
- % No UTF-16 converting macro available.
- \txiescapepdf{#1}%
- \else
- \xdef#1{\pdfescapestrutfsixteen{#1}}%
- \fi
-}
-
-\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
-with PDF output, and none of those formats could be found. (.eps cannot
-be supported due to the design of the PDF format; use regular TeX (DVI
-output) for that.)}
-
-% definitions for pdftex or luatex with pdf output
-\ifpdf
- % Strings in PDF outlines can either be ASCII, or encoded in UTF-16BE
- % with BOM. Unfortunately there is no simple way with pdftex to output
- % UTF-16, so we have to do some quite convoluted expansion games if we
- % find the string contains a non-ASCII codepoint if we want these to
- % display correctly. We generated the UTF-16 sequences in
- % \DeclareUnicodeCharacter and we access them here.
- %
- \def\defpdfoutlinetextunicode#1{%
- \def\pdfoutlinetext{#1}%
- %
- % Make UTF-8 sequences expand to UTF-16 definitions.
- \passthroughcharsfalse \utfbytespdftrue
- \utfviiidefinedwarningfalse
- %
- % Completely expand, eliminating any control sequences such as \code,
- % leaving only possibly \utfbytes.
- \let\utfbytes\relax
- \pdfaccentliterals
- \xdef\pdfoutlinetextchecked{#1}%
- \checkutfbytes
- }%
- % Check if \utfbytes occurs in expansion.
- \def\checkutfbytes{%
- \expandafter\checkutfbytesz\pdfoutlinetextchecked\utfbytes\finish
- }%
- \def\checkutfbytesz#1\utfbytes#2\finish{%
- \def\after{#2}%
- \ifx\after\empty
- % No further action needed. Output ASCII string as-is, as converting
- % to UTF-16 is somewhat slow (and uses more space).
- \global\let\pdfoutlinetext\pdfoutlinetextchecked
- \else
- \passthroughcharstrue % pass UTF-8 sequences unaltered
- \xdef\pdfoutlinetext{\pdfoutlinetext}%
- \expandafter\expandutfsixteen\expandafter{\pdfoutlinetext}\pdfoutlinetext
- \fi
- }%
- %
- \catcode2=1 % begin-group character
- \catcode3=2 % end-group character
- %
- % argument should be pure UTF-8 with no control sequences. convert to
- % UTF-16BE by inserting null bytes before bytes < 128 and expanding
- % UTF-8 multibyte sequences to saved UTF-16BE sequences.
- \def\expandutfsixteen#1#2{%
- \bgroup \asciitounicode
- \passthroughcharsfalse
- \let\utfbytes\asis
- %
- % for Byte Order Mark (BOM)
- \catcode"FE=12
- \catcode"FF=12
- %
- % we want to treat { and } in #1 as any other ASCII bytes. however,
- % we need grouping characters for \scantokens and definitions/assignments,
- % so define alternative grouping characters using control characters
- % that are unlikely to occur.
- % this does not affect 0x02 or 0x03 bytes arising from expansion as
- % these are tokens with different catcodes.
- \catcode"02=1 % begin-group character
- \catcode"03=2 % end-group character
- %
- \expandafter\xdef\expandafter#2\scantokens{%
- ^^02^^fe^^ff#1^^03}%
- % NB we need \scantokens to provide both the open and close group tokens
- % for \xdef otherwise there is an e-TeX error "File ended while
- % scanning definition of..."
- % NB \scantokens is a e-TeX command which is assumed to be provided by
- % pdfTeX.
- %
- \egroup
- }%
- %
- \catcode2=12 \catcode3=12 % defaults
- %
- % Color support
- %
- % rg sets the color for filling (usual text, etc.);
- % RG sets the color for stroking (thin rules, e.g., normal _'s).
- \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}}
- %
- % PDF outline support
- %
- \pdfcatalog{/PageMode /UseOutlines}
- %
- % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
- \def\dopdfimage#1#2#3{%
- \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
- \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
- %
- % pdftex (and the PDF format) support .pdf, .png, .jpg (among
- % others). Let's try in that order, PDF first since if
- % someone has a scalable image, presumably better to use that than a
- % bitmap.
- \let\pdfimgext=\empty
- \begingroup
- \openin 1 #1.pdf \ifeof 1
- \openin 1 #1.PDF \ifeof 1
- \openin 1 #1.png \ifeof 1
- \openin 1 #1.jpg \ifeof 1
- \openin 1 #1.jpeg \ifeof 1
- \openin 1 #1.JPG \ifeof 1
- \errhelp = \nopdfimagehelp
- \errmessage{Could not find image file #1 for pdf}%
- \else \gdef\pdfimgext{JPG}%
- \fi
- \else \gdef\pdfimgext{jpeg}%
- \fi
- \else \gdef\pdfimgext{jpg}%
- \fi
- \else \gdef\pdfimgext{png}%
- \fi
- \else \gdef\pdfimgext{PDF}%
- \fi
- \else \gdef\pdfimgext{pdf}%
- \fi
- \closein 1
- \endgroup
- %
- % without \immediate, ancient pdftex seg faults when the same image is
- % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
- \ifnum\pdftexversion < 14
- \immediate\pdfimage
- \else
- \immediate\pdfximage
- \fi
- \ifdim \wd0 >0pt width \pdfimagewidth \fi
- \ifdim \wd2 >0pt height \pdfimageheight \fi
- \ifnum\pdftexversion<13
- #1.\pdfimgext
- \else
- {#1.\pdfimgext}%
- \fi
- \ifnum\pdftexversion < 14 \else
- \pdfrefximage \pdflastximage
- \fi}
- %
- \def\setpdfdestname#1{{%
- % We have to set dummies so commands such as @code, and characters
- % such as \, aren't expanded when present in a section title.
- \indexnofonts
- \makevalueexpandable
- \turnoffactive
- \iftxiuseunicodedestname
- \ifx \declaredencoding \latone
- % Pass through Latin-1 characters.
- % LuaTeX with byte wise I/O converts Latin-1 characters to Unicode.
- \else
- \ifx \declaredencoding \utfeight
- % Pass through Unicode characters.
- \else
- % Use ASCII approximations in destination names.
- \passthroughcharsfalse
- \fi
- \fi
- \else
- % Use ASCII approximations in destination names.
- \passthroughcharsfalse
- \fi
- \def\pdfdestname{#1}%
- \txiescapepdf\pdfdestname
- }}
- %
- \def\setpdfoutlinetext#1{{%
- \indexnofonts
- \makevalueexpandable
- \turnoffactive
- \ifx \declaredencoding \latone
- % The PDF format can use an extended form of Latin-1 in bookmark
- % strings. See Appendix D of the PDF Reference, Sixth Edition, for
- % the "PDFDocEncoding".
- \passthroughcharstrue
- % Pass through Latin-1 characters.
- % LuaTeX: Convert to Unicode
- % pdfTeX: Use Latin-1 as PDFDocEncoding
- \def\pdfoutlinetext{#1}%
- \else
- \ifx \declaredencoding \utfeight
- \ifluatex
- % For LuaTeX with UTF-8.
- % Pass through Unicode characters for title texts.
- \passthroughcharstrue
- \pdfaccentliterals
- \xdef\pdfoutlinetext{#1}%
- \else
- % For pdfTeX with UTF-8.
- \defpdfoutlinetextunicode{#1}%
- \fi
- \else
- % For non-Latin-1 or non-UTF-8 encodings.
- % Use ASCII approximations.
- \passthroughcharsfalse
- \def\pdfoutlinetext{#1}%
- \fi
- \fi
- % LuaTeX: Convert to UTF-16
- % pdfTeX: Use Latin-1 as PDFDocEncoding
- \txiescapepdfutfsixteen\pdfoutlinetext
- }}
- %
- \def\pdfmkdest#1{%
- \setpdfdestname{#1}%
- \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
- }
- %
- % Adding outlines to PDF; macros for calculating structure of outlines
- % come from Petr Olsak
- \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
- \else \csname#1\endcsname \fi}
- \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
- \advance\tempnum by 1
- \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
- %
- % #1 is the section text, which is what will be displayed in the
- % outline by the pdf viewer. #2 is the pdf expression for the number
- % of subentries (or empty, for subsubsections). #3 is the node text,
- % which might be empty if this toc entry had no corresponding node.
- % #4 is the page number
- %
- \def\dopdfoutline#1#2#3#4{%
- % Generate a link to the node text if that exists; else, use the
- % page number. We could generate a destination for the section
- % text in the case where a section has no node, but it doesn't
- % seem worth the trouble, since most documents are normally structured.
- \setpdfoutlinetext{#1}
- \setpdfdestname{#3}
- \ifx\pdfdestname\empty
- \def\pdfdestname{#4}%
- \fi
- %
- \pdfoutline goto name{\pdfdestname}#2{\pdfoutlinetext}%
- }
- %
- \def\pdfmakeoutlines{%
- \begingroup
- % Read toc silently, to get counts of subentries for \pdfoutline.
- \def\partentry##1##2##3##4{}% ignore parts in the outlines
- \def\numchapentry##1##2##3##4{%
- \def\thischapnum{##2}%
- \def\thissecnum{0}%
- \def\thissubsecnum{0}%
- \def\indexlastsec{chap\thischapnum}%
- }%
- \def\numsecentry##1##2##3##4{%
- \advancenumber{chap\thischapnum}%
- \def\thissecnum{##2}%
- \def\thissubsecnum{0}%
- \def\indexlastsec{sec\thissecnum}%
- }%
- \def\numsubsecentry##1##2##3##4{%
- \advancenumber{sec\thissecnum}%
- \def\thissubsecnum{##2}%
- \def\indexlastsec{subsec\thissecnum}%
- }%
- \def\numsubsubsecentry##1##2##3##4{%
- \advancenumber{subsec\thissubsecnum}%
- }%
- \def\thischapnum{0}%
- \def\thissecnum{0}%
- \def\thissubsecnum{0}%
- \let\indexlastsec\empty
- %
- % Index initials are subsidiary to whatever sectioning command just
- % occurred, usually @appendix or @chapter but occasionally a lower level.
- \def\idxinitialentry##1##2##3##4{%
- \expandafter\advancenumber\expandafter{\indexlastsec}%
- }%
- % use \def rather than \let here because we redefine \chapentry et
- % al. a second time, below.
- \def\appentry{\numchapentry}%
- \def\appsecentry{\numsecentry}%
- \def\appsubsecentry{\numsubsecentry}%
- \def\appsubsubsecentry{\numsubsubsecentry}%
- \def\unnchapentry{\numchapentry}%
- \def\unnsecentry{\numsecentry}%
- \def\unnsubsecentry{\numsubsecentry}%
- \def\unnsubsubsecentry{\numsubsubsecentry}%
- %
- \readdatafile{toc}%
- %
- % Read toc second time, this time actually producing the outlines.
- % The `-' means take the \expnumber as the absolute number of
- % subentries, which we calculated on our first read of the .toc above.
- %
- % We use the node names as the destinations.
- %
- % Currently we prefix the section name with the section number
- % for chapter and appendix headings only in order to avoid too much
- % horizontal space being required in the PDF viewer.
- \def\numchapentry##1##2##3##4{%
- \dopdfoutline{##2 ##1}{count-\expnumber{chap##2}}{##3}{##4}}%
- \def\unnchapentry##1##2##3##4{%
- \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
- \def\numsecentry##1##2##3##4{%
- \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
- \def\numsubsecentry##1##2##3##4{%
- \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
- \def\numsubsubsecentry##1##2##3##4{% count is always zero
- \dopdfoutline{##1}{}{##3}{##4}}%
- \def\idxinitialentry##1##2##3##4{%
- \dopdfoutline{##1}{}{idx.##1.##2}{##4}}%
- %
- \ifnodeseen\else \dopdfoutlinecontents \fi % for @contents at beginning
- \setupdatafile
- % We can have normal brace characters in the PDF outlines, unlike
- % Texinfo index files. So set that up.
- \def\{{\lbracecharliteral}%
- \def\}{\rbracecharliteral}%
- \catcode`\\=\active \otherbackslash
- \input \tocreadfilename\relax
- \ifnodeseen \dopdfoutlinecontents \fi % for @contents at end
- \endgroup
- }
- \def\dopdfoutlinecontents{%
- \expandafter\dopdfoutline\expandafter{\putwordTOC}{}{txi.CONTENTS}{}%
- }
- {\catcode`[=1 \catcode`]=2
- \catcode`{=\other \catcode`}=\other
- \gdef\lbracecharliteral[{]%
- \gdef\rbracecharliteral[}]%
- ]
- %
- \def\skipspaces#1{\def\PP{#1}\def\D{|}%
- \ifx\PP\D\let\nextsp\relax
- \else\let\nextsp\skipspaces
- \addtokens{\filename}{\PP}%
- \advance\filenamelength by 1
- \fi
- \nextsp}
- \def\getfilename#1{%
- \filenamelength=0
- % If we don't expand the argument now, \skipspaces will get
- % snagged on things like "@value{foo}".
- \edef\temp{#1}%
- \expandafter\skipspaces\temp|\relax
- }
- \ifnum\pdftexversion < 14
- \let \startlink \pdfannotlink
- \else
- \let \startlink \pdfstartlink
- \fi
- \def\pdfmakeurl#1{%
- \startlink attr{/Border [0 0 0]}%
- user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
- }%
- \def\endlink{\setcolor{\maincolor}\pdfendlink}
- %
- \def\pdflink#1{\pdflinkpage{#1}{#1}}%
- \def\pdflinkpage#1#2{%
- \startlink attr{/Border [0 0 0]} goto name{#1}
- \setcolor{\linkcolor}#2\endlink}
-\else
- % non-pdf mode
- \let\pdfmkdest = \gobble
- \let\pdfurl = \gobble
- \let\endlink = \relax
- \let\setcolor = \gobble
- \let\pdfsetcolor = \gobble
- \let\pdfmakeoutlines = \relax
-\fi
-
-%
-% For XeTeX
-%
-\ifxetex
- %
- % XeTeX version check
- %
- \ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.99996}>-1
- % TeX Live 2016 contains XeTeX 0.99996 and xdvipdfmx 20160307.
- % It can use the `dvipdfmx:config' special (from TeX Live SVN r40941).
- % For avoiding PDF destination name replacement, we use this special
- % instead of xdvipdfmx's command line option `-C 0x0010'.
- \special{dvipdfmx:config C 0x0010}
- % XeTeX 0.99995+ comes with xdvipdfmx 20160307+.
- % It can handle Unicode destination names for PDF.
- \txiuseunicodedestnametrue
- \else
- % XeTeX < 0.99996 (TeX Live < 2016) cannot use the
- % `dvipdfmx:config' special.
- % So for avoiding PDF destination name replacement,
- % xdvipdfmx's command line option `-C 0x0010' is necessary.
- %
- % XeTeX < 0.99995 can not handle Unicode destination names for PDF
- % because xdvipdfmx 20150315 has a UTF-16 conversion issue.
- % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753).
- \txiuseunicodedestnamefalse
- \fi
- %
- % Color support
- \def\pdfsetcolor#1{\special{pdf:scolor [#1]}}
- %
- % PDF outline support
- %
- % Emulate pdfTeX primitive
- \def\pdfdest name#1 xyz{%
- \special{pdf:dest (#1) [@thispage /XYZ @xpos @ypos null]}%
- }
- %
- \def\setpdfdestname#1{{%
- % We have to set dummies so commands such as @code, and characters
- % such as \, aren't expanded when present in a section title.
- \indexnofonts
- \makevalueexpandable
- \turnoffactive
- \iftxiuseunicodedestname
- % Pass through Unicode characters.
- \else
- % Use ASCII approximations in destination names.
- \passthroughcharsfalse
- \fi
- \def\pdfdestname{#1}%
- \txiescapepdf\pdfdestname
- }}
- %
- \def\setpdfoutlinetext#1{{%
- \turnoffactive
- % Always use Unicode characters in title texts.
- \def\pdfoutlinetext{#1}%
- % For XeTeX, xdvipdfmx converts to UTF-16.
- % So we do not convert.
- \txiescapepdf\pdfoutlinetext
- }}
- %
- \def\pdfmkdest#1{%
- \setpdfdestname{#1}%
- \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
- }
- %
- \def\dopdfoutline#1#2#3#4{%
- \setpdfoutlinetext{#1}
- \setpdfdestname{#3}
- \ifx\pdfdestname\empty
- \def\pdfdestname{#4}%
- \fi
- %
- \special{pdf:out [-] #2 << /Title (\pdfoutlinetext) /A
- << /S /GoTo /D (\pdfdestname) >> >> }%
- }
- %
- \def\pdfmakeoutlines{%
- \begingroup
- % For XeTeX, counts of subentries are not necessary.
- % Therefore, we read toc only once.
- %
- % We use node names as destinations.
- %
- % Currently we prefix the section name with the section number
- % for chapter and appendix headings only in order to avoid too much
- % horizontal space being required in the PDF viewer.
- \def\partentry##1##2##3##4{}% ignore parts in the outlines
- \def\numchapentry##1##2##3##4{%
- \dopdfoutline{##2 ##1}{1}{##3}{##4}%
- \def\indexseclevel{2}}%
- \def\numsecentry##1##2##3##4{%
- \dopdfoutline{##1}{2}{##3}{##4}%
- \def\indexseclevel{3}}%
- \def\numsubsecentry##1##2##3##4{%
- \dopdfoutline{##1}{3}{##3}{##4}%
- \def\indexseclevel{4}}%
- \def\numsubsubsecentry##1##2##3##4{%
- \dopdfoutline{##1}{4}{##3}{##4}%
- \def\indexseclevel{5}}%
- %
- \def\idxinitialentry##1##2##3##4{%
- \dopdfoutline{##1}{\indexseclevel}{idx.##1.##2}{##4}}%
- %
- \let\appentry\numchapentry%
- \let\appsecentry\numsecentry%
- \let\appsubsecentry\numsubsecentry%
- \let\appsubsubsecentry\numsubsubsecentry%
- \def\unnchapentry##1##2##3##4{%
- \dopdfoutline{##1}{1}{##3}{##4}}%
- \let\unnsecentry\numsecentry%
- \let\unnsubsecentry\numsubsecentry%
- \let\unnsubsubsecentry\numsubsubsecentry%
- %
- % For XeTeX, xdvipdfmx converts strings to UTF-16.
- % Therefore, the encoding and the language may not be considered.
- %
- \indexnofonts
- \pdfaccentliterals
- \ifnodeseen\else \dopdfoutlinecontents \fi % for @contents at beginning
- %
- \setupdatafile
- % We can have normal brace characters in the PDF outlines, unlike
- % Texinfo index files. So set that up.
- \def\{{\lbracecharliteral}%
- \def\}{\rbracecharliteral}%
- \catcode`\\=\active \otherbackslash
- \xetexpreauxfile
- \input \tocreadfilename\relax
- \xetexpostauxfile
- \ifnodeseen \dopdfoutlinecontents \fi % for @contents at end
- \endgroup
- }
- \def\dopdfoutlinecontents{%
- \expandafter\dopdfoutline\expandafter
- {\putwordTOC}{1}{txi.CONTENTS}{txi.CONTENTS}%
- }
- {\catcode`[=1 \catcode`]=2
- \catcode`{=\other \catcode`}=\other
- \gdef\lbracecharliteral[{]%
- \gdef\rbracecharliteral[}]%
- ]
-
- \special{pdf:docview << /PageMode /UseOutlines >> }
- % ``\special{pdf:tounicode ...}'' is not necessary
- % because xdvipdfmx converts strings from UTF-8 to UTF-16 without it.
- % However, due to a UTF-16 conversion issue of xdvipdfmx 20150315,
- % ``\special{pdf:dest ...}'' cannot handle non-ASCII strings.
- % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753).
- %
- \def\skipspaces#1{\def\PP{#1}\def\D{|}%
- \ifx\PP\D\let\nextsp\relax
- \else\let\nextsp\skipspaces
- \addtokens{\filename}{\PP}%
- \advance\filenamelength by 1
- \fi
- \nextsp}
- \def\getfilename#1{%
- \filenamelength=0
- % If we don't expand the argument now, \skipspaces will get
- % snagged on things like "@value{foo}".
- \edef\temp{#1}%
- \expandafter\skipspaces\temp|\relax
- }
- \def\pdfmakeurl#1{%
- \special{pdf:bann << /Border [0 0 0]
- /Subtype /Link /A << /S /URI /URI (#1) >> >>}%
- }
- \def\endlink{\setcolor{\maincolor}\special{pdf:eann}}
- \def\pdflink#1{\pdflinkpage{#1}{#1}}%
- \def\pdflinkpage#1#2{%
- \special{pdf:bann << /Border [0 0 0]
- /Type /Annot /Subtype /Link /A << /S /GoTo /D (#1) >> >>}%
- \setcolor{\linkcolor}#2\endlink}
- %
- %
- % @image support
- %
- % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
- \def\doxeteximage#1#2#3{%
- \def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
- \def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
- %
- % XeTeX (and the PDF format) supports .pdf, .png, .jpg (among
- % others). Let's try in that order, PDF first since if
- % someone has a scalable image, presumably better to use that than a
- % bitmap.
- \let\xeteximgext=\empty
- \begingroup
- \openin 1 #1.pdf \ifeof 1
- \openin 1 #1.PDF \ifeof 1
- \openin 1 #1.png \ifeof 1
- \openin 1 #1.jpg \ifeof 1
- \openin 1 #1.jpeg \ifeof 1
- \openin 1 #1.JPG \ifeof 1
- \errmessage{Could not find image file #1 for XeTeX}%
- \else \gdef\xeteximgext{JPG}%
- \fi
- \else \gdef\xeteximgext{jpeg}%
- \fi
- \else \gdef\xeteximgext{jpg}%
- \fi
- \else \gdef\xeteximgext{png}%
- \fi
- \else \gdef\xeteximgext{PDF}%
- \fi
- \else \gdef\xeteximgext{pdf}%
- \fi
- \closein 1
- \endgroup
- %
- % Putting an \hbox around the image can prevent an over-long line
- % after the image.
- \hbox\bgroup
- \def\xetexpdfext{pdf}%
- \ifx\xeteximgext\xetexpdfext
- \XeTeXpdffile "#1".\xeteximgext ""
- \else
- \def\xetexpdfext{PDF}%
- \ifx\xeteximgext\xetexpdfext
- \XeTeXpdffile "#1".\xeteximgext ""
- \else
- \XeTeXpicfile "#1".\xeteximgext ""
- \fi
- \fi
- \ifdim \wd0 >0pt width \xeteximagewidth \fi
- \ifdim \wd2 >0pt height \xeteximageheight \fi \relax
- \egroup
- }
-\fi
-
-% common definitions and code for pdftex, luatex and xetex
-\ifpdforxetex
- % The dark red here is dark enough to print on paper as
- % nearly black, but still distinguishable for online viewing. We use
- % black by default, though.
- \def\rgbDarkRed{0.50 0.09 0.12}
- \def\rgbBlack{0 0 0}
- %
- % Set color, and create a mark which defines \thiscolor accordingly,
- % so that \makeheadline knows which color to restore.
- \def\curcolor{0 0 0}%
- \def\setcolor#1{%
- \ifx#1\curcolor\else
- \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
- \domark
- \pdfsetcolor{#1}%
- \xdef\curcolor{#1}%
- \fi
- }
- %
- \let\maincolor\rgbBlack
- \pdfsetcolor{\maincolor}
- \edef\thiscolor{\maincolor}
- \def\currentcolordefs{}
- %
- \def\makefootline{%
- \baselineskip24pt
- \line{\pdfsetcolor{\maincolor}\the\footline}%
- }
- %
- \def\makeheadline{%
- \vbox to 0pt{%
- \vskip-22.5pt
- \line{%
- \vbox to8.5pt{}%
- % Extract \thiscolor definition from the marks.
- \getcolormarks
- % Typeset the headline with \maincolor, then restore the color.
- \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
- }%
- \vss
- }%
- \nointerlineskip
- }
- %
- % by default, use black for everything.
- \def\urlcolor{\rgbBlack}
- \let\linkcolor\rgbBlack
- %
- % make a live url in pdf output.
- \def\pdfurl#1{%
- \begingroup
- % it seems we really need yet another set of dummies; have not
- % tried to figure out what each command should do in the context
- % of @url. for now, just make @/ a no-op, that's the only one
- % people have actually reported a problem with.
- %
- \normalturnoffactive
- \def\@{@}%
- \let\/=\empty
- \makevalueexpandable
- % do we want to go so far as to use \indexnofonts instead of just
- % special-casing \var here?
- \def\var##1{##1}%
- %
- \leavevmode\setcolor{\urlcolor}%
- \pdfmakeurl{#1}%
- \endgroup}
- %
- % \pdfgettoks - Surround page numbers in #1 with @pdflink. #1 may
- % be a simple number, or a list of numbers in the case of an index
- % entry.
- \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
- \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
- \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
- \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
- \def\maketoks{%
- \expandafter\poptoks\the\toksA|ENDTOKS|\relax
- \ifx\first0\adn0
- \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
- \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
- \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
- \else
- \ifnum0=\countA\else\makelink\fi
- \ifx\first.\let\next=\done\else
- \let\next=\maketoks
- \addtokens{\toksB}{\the\toksD}
- \ifx\first,\addtokens{\toksB}{\space}\fi
- \fi
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
- \next}
- \def\makelink{\addtokens{\toksB}%
- {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
- \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
-\fi
-
-\ifpdforxetex
- % for pdftex.
- {\catcode`^^cc=13
- \gdef\pdfaccentliteralsutfviii{%
- % For PDF outline only. Unicode combining accents follow the
- % character they modify. Note we need at least the first byte
- % of the UTF-8 sequences to have an active catcode to allow the
- % definitions to do their magic.
- \def\"##1{##1^^cc^^88}% U+0308
- \def\'##1{##1^^cc^^81}% U+0301
- \def\,##1{##1^^cc^^a7}% U+0327
- \def\=##1{##1^^cc^^85}% U+0305
- \def\^##1{##1^^cc^^82}% U+0302
- \def\`##1{##1^^cc^^80}% U+0300
- \def\~##1{##1^^cc^^83}% U+0303
- \def\dotaccent##1{##1^^cc^^87}% U+0307
- \def\H##1{##1^^cc^^8b}% U+030B
- \def\ogonek##1{##1^^cc^^a8}% U+0328
- \def\ringaccent##1{##1^^cc^^8a}% U+030A
- \def\u##1{##1^^cc^^8c}% U+0306
- \def\ubaraccent##1{##1^^cc^^b1}% U+0331
- \def\udotaccent##1{##1^^cc^^a3}% U+0323
- \def\v##1{##1^^cc^^8c}% U+030C
- % this definition of @tieaccent will only work with exactly two characters
- % in argument as we need to insert the combining character between them.
- \def\tieaccent##1{\tieaccentz##1}%
- \def\tieaccentz##1##2{##1^^cd^^a1##2} % U+0361
- }}%
- %
- % for xetex and luatex, which both support extended ^^^^ escapes and
- % process the Unicode codepoint as a single token.
- \gdef\pdfaccentliteralsnative{%
- \def\"##1{##1^^^^0308}%
- \def\'##1{##1^^^^0301}%
- \def\,##1{##1^^^^0327}%
- \def\=##1{##1^^^^0305}%
- \def\^##1{##1^^^^0302}%
- \def\`##1{##1^^^^0300}%
- \def\~##1{##1^^^^0303}%
- \def\dotaccent##1{##1^^^^0307}%
- \def\H##1{##1^^^^030b}%
- \def\ogonek##1{##1^^^^0328}%
- \def\ringaccent##1{##1^^^^030a}%
- \def\u##1{##1^^^^0306}%
- \def\ubaraccent##1{##1^^^^0331}%
- \def\udotaccent##1{##1^^^^0323}%
- \def\v##1{##1^^^^030c}%
- \def\tieaccent##1{\tieaccentz##1}%
- \def\tieaccentz##1##2{##1^^^^0361##2} % U+0361
- }%
- %
- % use the appropriate definition
- \ifluatex
- \let\pdfaccentliterals\pdfaccentliteralsnative
- \else
- \ifxetex
- \let\pdfaccentliterals\pdfaccentliteralsnative
- \else
- \let\pdfaccentliterals\pdfaccentliteralsutfviii
- \fi
- \fi
-\fi
-
-%
-\message{fonts,}
-
-% Set the baselineskip to #1, and the lineskip and strut size
-% correspondingly. There is no deep meaning behind these magic numbers
-% used as factors; they just match (closely enough) what Knuth defined.
-%
-\def\lineskipfactor{.08333}
-\def\strutheightpercent{.70833}
-\def\strutdepthpercent {.29167}
-%
-% can get a sort of poor man's double spacing by redefining this.
-\def\baselinefactor{1}
-%
-\newdimen\textleading
-\def\setleading#1{%
- \dimen0 = #1\relax
- \normalbaselineskip = \baselinefactor\dimen0
- \normallineskip = \lineskipfactor\normalbaselineskip
- \normalbaselines
- \setbox\strutbox =\hbox{%
- \vrule width0pt height\strutheightpercent\baselineskip
- depth \strutdepthpercent \baselineskip
- }%
-}
-
-% PDF CMaps. See also LaTeX's t1.cmap.
-%
-% do nothing with this by default.
-\expandafter\let\csname cmapOT1\endcsname\gobble
-\expandafter\let\csname cmapOT1IT\endcsname\gobble
-\expandafter\let\csname cmapOT1TT\endcsname\gobble
-
-% if we are producing pdf, and we have \pdffontattr, then define cmaps.
-% (\pdffontattr was introduced many years ago, but people still run
-% older pdftex's; it's easy to conditionalize, so we do.)
-\ifpdf \ifx\pdffontattr\thisisundefined \else
- \begingroup
- \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
- \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
-%%DocumentNeededResources: ProcSet (CIDInit)
-%%IncludeResource: ProcSet (CIDInit)
-%%BeginResource: CMap (TeX-OT1-0)
-%%Title: (TeX-OT1-0 TeX OT1 0)
-%%Version: 1.000
-%%EndComments
-/CIDInit /ProcSet findresource begin
-12 dict begin
-begincmap
-/CIDSystemInfo
-<< /Registry (TeX)
-/Ordering (OT1)
-/Supplement 0
->> def
-/CMapName /TeX-OT1-0 def
-/CMapType 2 def
-1 begincodespacerange
-<00> <7F>
-endcodespacerange
-8 beginbfrange
-<00> <01> <0393>
-<09> <0A> <03A8>
-<23> <26> <0023>
-<28> <3B> <0028>
-<3F> <5B> <003F>
-<5D> <5E> <005D>
-<61> <7A> <0061>
-<7B> <7C> <2013>
-endbfrange
-40 beginbfchar
-<02> <0398>
-<03> <039B>
-<04> <039E>
-<05> <03A0>
-<06> <03A3>
-<07> <03D2>
-<08> <03A6>
-<0B> <00660066>
-<0C> <00660069>
-<0D> <0066006C>
-<0E> <006600660069>
-<0F> <00660066006C>
-<10> <0131>
-<11> <0237>
-<12> <0060>
-<13> <00B4>
-<14> <02C7>
-<15> <02D8>
-<16> <00AF>
-<17> <02DA>
-<18> <00B8>
-<19> <00DF>
-<1A> <00E6>
-<1B> <0153>
-<1C> <00F8>
-<1D> <00C6>
-<1E> <0152>
-<1F> <00D8>
-<21> <0021>
-<22> <201D>
-<27> <2019>
-<3C> <00A1>
-<3D> <003D>
-<3E> <00BF>
-<5C> <201C>
-<5F> <02D9>
-<60> <2018>
-<7D> <02DD>
-<7E> <007E>
-<7F> <00A8>
-endbfchar
-endcmap
-CMapName currentdict /CMap defineresource pop
-end
-end
-%%EndResource
-%%EOF
- }\endgroup
- \expandafter\edef\csname cmapOT1\endcsname#1{%
- \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
- }%
-%
-% \cmapOT1IT
- \begingroup
- \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
- \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
-%%DocumentNeededResources: ProcSet (CIDInit)
-%%IncludeResource: ProcSet (CIDInit)
-%%BeginResource: CMap (TeX-OT1IT-0)
-%%Title: (TeX-OT1IT-0 TeX OT1IT 0)
-%%Version: 1.000
-%%EndComments
-/CIDInit /ProcSet findresource begin
-12 dict begin
-begincmap
-/CIDSystemInfo
-<< /Registry (TeX)
-/Ordering (OT1IT)
-/Supplement 0
->> def
-/CMapName /TeX-OT1IT-0 def
-/CMapType 2 def
-1 begincodespacerange
-<00> <7F>
-endcodespacerange
-8 beginbfrange
-<00> <01> <0393>
-<09> <0A> <03A8>
-<25> <26> <0025>
-<28> <3B> <0028>
-<3F> <5B> <003F>
-<5D> <5E> <005D>
-<61> <7A> <0061>
-<7B> <7C> <2013>
-endbfrange
-42 beginbfchar
-<02> <0398>
-<03> <039B>
-<04> <039E>
-<05> <03A0>
-<06> <03A3>
-<07> <03D2>
-<08> <03A6>
-<0B> <00660066>
-<0C> <00660069>
-<0D> <0066006C>
-<0E> <006600660069>
-<0F> <00660066006C>
-<10> <0131>
-<11> <0237>
-<12> <0060>
-<13> <00B4>
-<14> <02C7>
-<15> <02D8>
-<16> <00AF>
-<17> <02DA>
-<18> <00B8>
-<19> <00DF>
-<1A> <00E6>
-<1B> <0153>
-<1C> <00F8>
-<1D> <00C6>
-<1E> <0152>
-<1F> <00D8>
-<21> <0021>
-<22> <201D>
-<23> <0023>
-<24> <00A3>
-<27> <2019>
-<3C> <00A1>
-<3D> <003D>
-<3E> <00BF>
-<5C> <201C>
-<5F> <02D9>
-<60> <2018>
-<7D> <02DD>
-<7E> <007E>
-<7F> <00A8>
-endbfchar
-endcmap
-CMapName currentdict /CMap defineresource pop
-end
-end
-%%EndResource
-%%EOF
- }\endgroup
- \expandafter\edef\csname cmapOT1IT\endcsname#1{%
- \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
- }%
-%
-% \cmapOT1TT
- \begingroup
- \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
- \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
-%%DocumentNeededResources: ProcSet (CIDInit)
-%%IncludeResource: ProcSet (CIDInit)
-%%BeginResource: CMap (TeX-OT1TT-0)
-%%Title: (TeX-OT1TT-0 TeX OT1TT 0)
-%%Version: 1.000
-%%EndComments
-/CIDInit /ProcSet findresource begin
-12 dict begin
-begincmap
-/CIDSystemInfo
-<< /Registry (TeX)
-/Ordering (OT1TT)
-/Supplement 0
->> def
-/CMapName /TeX-OT1TT-0 def
-/CMapType 2 def
-1 begincodespacerange
-<00> <7F>
-endcodespacerange
-5 beginbfrange
-<00> <01> <0393>
-<09> <0A> <03A8>
-<21> <26> <0021>
-<28> <5F> <0028>
-<61> <7E> <0061>
-endbfrange
-32 beginbfchar
-<02> <0398>
-<03> <039B>
-<04> <039E>
-<05> <03A0>
-<06> <03A3>
-<07> <03D2>
-<08> <03A6>
-<0B> <2191>
-<0C> <2193>
-<0D> <0027>
-<0E> <00A1>
-<0F> <00BF>
-<10> <0131>
-<11> <0237>
-<12> <0060>
-<13> <00B4>
-<14> <02C7>
-<15> <02D8>
-<16> <00AF>
-<17> <02DA>
-<18> <00B8>
-<19> <00DF>
-<1A> <00E6>
-<1B> <0153>
-<1C> <00F8>
-<1D> <00C6>
-<1E> <0152>
-<1F> <00D8>
-<20> <2423>
-<27> <2019>
-<60> <2018>
-<7F> <00A8>
-endbfchar
-endcmap
-CMapName currentdict /CMap defineresource pop
-end
-end
-%%EndResource
-%%EOF
- }\endgroup
- \expandafter\edef\csname cmapOT1TT\endcsname#1{%
- \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
- }%
-\fi\fi
-%
-% This is what gets called when #5 of \setfont is empty.
-\let\cmap\gobble
-%
-% (end of cmaps)
-
-
-% Set the font macro #1 to the font named \fontprefix#2.
-% #3 is the font's design size, #4 is a scale factor, #5 is the CMap
-% encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
-% Example:
-% #1 = \textrm
-% #2 = \rmshape
-% #3 = 10
-% #4 = \mainmagstep
-% #5 = OT1
-%
-\def\setfont#1#2#3#4#5{%
- \font#1=\fontprefix#2#3 scaled #4
- \csname cmap#5\endcsname#1%
- \ifx#2\ttshape\hyphenchar#1=-1 \fi
- \ifx#2\ttbshape\hyphenchar#1=-1 \fi
- \ifx#2\ttslshape\hyphenchar#1=-1 \fi
-}
-
-% Use cm as the default font prefix.
-% To specify the font prefix, you must define \fontprefix
-% before you read in texinfo.tex.
-\ifx\fontprefix\thisisundefined
-\def\fontprefix{cm}
-\fi
-% Support font families that don't use the same naming scheme as CM.
-\def\rmshape{r}
-\def\rmbshape{bx} % where the normal face is bold
-\def\bfshape{b}
-\def\bxshape{bx}
-\def\ttshape{tt}
-\def\ttbshape{tt}
-\def\ttslshape{sltt}
-\def\itshape{ti}
-\def\itbshape{bxti}
-\def\slshape{sl}
-\def\slbshape{bxsl}
-\def\sfshape{ss}
-\def\sfbshape{ss}
-\def\scshape{csc}
-\def\scbshape{csc}
-
-% Definitions for a main text size of 11pt. (The default in Texinfo.)
-%
-\def\definetextfontsizexi{%
-% Text fonts (11.2pt, magstep1).
-\def\textnominalsize{11pt}
-\edef\mainmagstep{\magstephalf}
-\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
-\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
-\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
-\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
-\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
-\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
-\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
-\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
-\font\texti=cmmi10 scaled \mainmagstep
-\font\textsy=cmsy10 scaled \mainmagstep
-\def\textecsize{1095}
-
-% A few fonts for @defun names and args.
-\setfont\defbf\bfshape{10}{\magstep1}{OT1}
-\setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
-\setfont\defsl\slshape{10}{\magstep1}{OT1}
-\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
-\def\df{\let\ttfont=\deftt \let\bffont = \defbf
-\let\ttslfont=\defttsl \let\slfont=\defsl \bf}
-
-% Fonts for indices, footnotes, small examples (9pt).
-\def\smallnominalsize{9pt}
-\setfont\smallrm\rmshape{9}{1000}{OT1}
-\setfont\smalltt\ttshape{9}{1000}{OT1TT}
-\setfont\smallbf\bfshape{10}{900}{OT1}
-\setfont\smallit\itshape{9}{1000}{OT1IT}
-\setfont\smallsl\slshape{9}{1000}{OT1}
-\setfont\smallsf\sfshape{9}{1000}{OT1}
-\setfont\smallsc\scshape{10}{900}{OT1}
-\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
-\font\smalli=cmmi9
-\font\smallsy=cmsy9
-\def\smallecsize{0900}
-
-% Fonts for small examples (8pt).
-\def\smallernominalsize{8pt}
-\setfont\smallerrm\rmshape{8}{1000}{OT1}
-\setfont\smallertt\ttshape{8}{1000}{OT1TT}
-\setfont\smallerbf\bfshape{10}{800}{OT1}
-\setfont\smallerit\itshape{8}{1000}{OT1IT}
-\setfont\smallersl\slshape{8}{1000}{OT1}
-\setfont\smallersf\sfshape{8}{1000}{OT1}
-\setfont\smallersc\scshape{10}{800}{OT1}
-\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
-\font\smalleri=cmmi8
-\font\smallersy=cmsy8
-\def\smallerecsize{0800}
-
-% Fonts for math mode superscripts (7pt).
-\def\sevennominalsize{7pt}
-\setfont\sevenrm\rmshape{7}{1000}{OT1}
-\setfont\seventt\ttshape{10}{700}{OT1TT}
-\setfont\sevenbf\bfshape{10}{700}{OT1}
-\setfont\sevenit\itshape{7}{1000}{OT1IT}
-\setfont\sevensl\slshape{10}{700}{OT1}
-\setfont\sevensf\sfshape{10}{700}{OT1}
-\setfont\sevensc\scshape{10}{700}{OT1}
-\setfont\seventtsl\ttslshape{10}{700}{OT1TT}
-\font\seveni=cmmi7
-\font\sevensy=cmsy7
-\def\sevenecsize{0700}
-
-% Fonts for title page (20.4pt):
-\def\titlenominalsize{20pt}
-\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
-\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
-\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
-\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
-\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
-\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
-\let\titlebf=\titlerm
-\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
-\font\titlei=cmmi12 scaled \magstep3
-\font\titlesy=cmsy10 scaled \magstep4
-\def\titleecsize{2074}
-
-% Chapter (and unnumbered) fonts (17.28pt).
-\def\chapnominalsize{17pt}
-\setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
-\setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
-\setfont\chapsl\slbshape{10}{\magstep3}{OT1}
-\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
-\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
-\setfont\chapsf\sfbshape{17}{1000}{OT1}
-\let\chapbf=\chaprm
-\setfont\chapsc\scbshape{10}{\magstep3}{OT1}
-\font\chapi=cmmi12 scaled \magstep2
-\font\chapsy=cmsy10 scaled \magstep3
-\def\chapecsize{1728}
-
-% Section fonts (14.4pt).
-\def\secnominalsize{14pt}
-\setfont\secrm\rmbshape{12}{\magstep1}{OT1}
-\setfont\secrmnotbold\rmshape{12}{\magstep1}{OT1}
-\setfont\secit\itbshape{10}{\magstep2}{OT1IT}
-\setfont\secsl\slbshape{10}{\magstep2}{OT1}
-\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
-\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
-\setfont\secsf\sfbshape{12}{\magstep1}{OT1}
-\let\secbf\secrm
-\setfont\secsc\scbshape{10}{\magstep2}{OT1}
-\font\seci=cmmi12 scaled \magstep1
-\font\secsy=cmsy10 scaled \magstep2
-\def\sececsize{1440}
-
-% Subsection fonts (13.15pt).
-\def\ssecnominalsize{13pt}
-\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
-\setfont\ssecit\itbshape{10}{1315}{OT1IT}
-\setfont\ssecsl\slbshape{10}{1315}{OT1}
-\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
-\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
-\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
-\let\ssecbf\ssecrm
-\setfont\ssecsc\scbshape{10}{1315}{OT1}
-\font\sseci=cmmi12 scaled \magstephalf
-\font\ssecsy=cmsy10 scaled 1315
-\def\ssececsize{1200}
-
-% Reduced fonts for @acronym in text (10pt).
-\def\reducednominalsize{10pt}
-\setfont\reducedrm\rmshape{10}{1000}{OT1}
-\setfont\reducedtt\ttshape{10}{1000}{OT1TT}
-\setfont\reducedbf\bfshape{10}{1000}{OT1}
-\setfont\reducedit\itshape{10}{1000}{OT1IT}
-\setfont\reducedsl\slshape{10}{1000}{OT1}
-\setfont\reducedsf\sfshape{10}{1000}{OT1}
-\setfont\reducedsc\scshape{10}{1000}{OT1}
-\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
-\font\reducedi=cmmi10
-\font\reducedsy=cmsy10
-\def\reducedecsize{1000}
-
-\textleading = 13.2pt % line spacing for 11pt CM
-\textfonts % reset the current fonts
-\rm
-} % end of 11pt text font size definitions, \definetextfontsizexi
-
-
-% Definitions to make the main text be 10pt Computer Modern, with
-% section, chapter, etc., sizes following suit. This is for the GNU
-% Press printing of the Emacs 22 manual. Maybe other manuals in the
-% future. Used with @smallbook, which sets the leading to 12pt.
-%
-\def\definetextfontsizex{%
-% Text fonts (10pt).
-\def\textnominalsize{10pt}
-\edef\mainmagstep{1000}
-\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
-\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
-\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
-\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
-\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
-\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
-\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
-\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
-\font\texti=cmmi10 scaled \mainmagstep
-\font\textsy=cmsy10 scaled \mainmagstep
-\def\textecsize{1000}
-
-% A few fonts for @defun names and args.
-\setfont\defbf\bfshape{10}{\magstephalf}{OT1}
-\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
-\setfont\defsl\slshape{10}{\magstephalf}{OT1}
-\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
-\def\df{\let\ttfont=\deftt \let\bffont = \defbf
-\let\slfont=\defsl \let\ttslfont=\defttsl \bf}
-
-% Fonts for indices, footnotes, small examples (9pt).
-\def\smallnominalsize{9pt}
-\setfont\smallrm\rmshape{9}{1000}{OT1}
-\setfont\smalltt\ttshape{9}{1000}{OT1TT}
-\setfont\smallbf\bfshape{10}{900}{OT1}
-\setfont\smallit\itshape{9}{1000}{OT1IT}
-\setfont\smallsl\slshape{9}{1000}{OT1}
-\setfont\smallsf\sfshape{9}{1000}{OT1}
-\setfont\smallsc\scshape{10}{900}{OT1}
-\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
-\font\smalli=cmmi9
-\font\smallsy=cmsy9
-\def\smallecsize{0900}
-
-% Fonts for small examples (8pt).
-\def\smallernominalsize{8pt}
-\setfont\smallerrm\rmshape{8}{1000}{OT1}
-\setfont\smallertt\ttshape{8}{1000}{OT1TT}
-\setfont\smallerbf\bfshape{10}{800}{OT1}
-\setfont\smallerit\itshape{8}{1000}{OT1IT}
-\setfont\smallersl\slshape{8}{1000}{OT1}
-\setfont\smallersf\sfshape{8}{1000}{OT1}
-\setfont\smallersc\scshape{10}{800}{OT1}
-\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
-\font\smalleri=cmmi8
-\font\smallersy=cmsy8
-\def\smallerecsize{0800}
-
-% Fonts for math mode superscripts (7pt).
-\def\sevennominalsize{7pt}
-\setfont\sevenrm\rmshape{7}{1000}{OT1}
-\setfont\seventt\ttshape{10}{700}{OT1TT}
-\setfont\sevenbf\bfshape{10}{700}{OT1}
-\setfont\sevenit\itshape{7}{1000}{OT1IT}
-\setfont\sevensl\slshape{10}{700}{OT1}
-\setfont\sevensf\sfshape{10}{700}{OT1}
-\setfont\sevensc\scshape{10}{700}{OT1}
-\setfont\seventtsl\ttslshape{10}{700}{OT1TT}
-\font\seveni=cmmi7
-\font\sevensy=cmsy7
-\def\sevenecsize{0700}
-
-% Fonts for title page (20.4pt):
-\def\titlenominalsize{20pt}
-\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
-\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
-\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
-\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
-\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
-\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
-\let\titlebf=\titlerm
-\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
-\font\titlei=cmmi12 scaled \magstep3
-\font\titlesy=cmsy10 scaled \magstep4
-\def\titleecsize{2074}
-
-% Chapter fonts (14.4pt).
-\def\chapnominalsize{14pt}
-\setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
-\setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
-\setfont\chapsl\slbshape{10}{\magstep2}{OT1}
-\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
-\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
-\setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
-\let\chapbf\chaprm
-\setfont\chapsc\scbshape{10}{\magstep2}{OT1}
-\font\chapi=cmmi12 scaled \magstep1
-\font\chapsy=cmsy10 scaled \magstep2
-\def\chapecsize{1440}
-
-% Section fonts (12pt).
-\def\secnominalsize{12pt}
-\setfont\secrm\rmbshape{12}{1000}{OT1}
-\setfont\secit\itbshape{10}{\magstep1}{OT1IT}
-\setfont\secsl\slbshape{10}{\magstep1}{OT1}
-\setfont\sectt\ttbshape{12}{1000}{OT1TT}
-\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
-\setfont\secsf\sfbshape{12}{1000}{OT1}
-\let\secbf\secrm
-\setfont\secsc\scbshape{10}{\magstep1}{OT1}
-\font\seci=cmmi12
-\font\secsy=cmsy10 scaled \magstep1
-\def\sececsize{1200}
-
-% Subsection fonts (10pt).
-\def\ssecnominalsize{10pt}
-\setfont\ssecrm\rmbshape{10}{1000}{OT1}
-\setfont\ssecit\itbshape{10}{1000}{OT1IT}
-\setfont\ssecsl\slbshape{10}{1000}{OT1}
-\setfont\ssectt\ttbshape{10}{1000}{OT1TT}
-\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
-\setfont\ssecsf\sfbshape{10}{1000}{OT1}
-\let\ssecbf\ssecrm
-\setfont\ssecsc\scbshape{10}{1000}{OT1}
-\font\sseci=cmmi10
-\font\ssecsy=cmsy10
-\def\ssececsize{1000}
-
-% Reduced fonts for @acronym in text (9pt).
-\def\reducednominalsize{9pt}
-\setfont\reducedrm\rmshape{9}{1000}{OT1}
-\setfont\reducedtt\ttshape{9}{1000}{OT1TT}
-\setfont\reducedbf\bfshape{10}{900}{OT1}
-\setfont\reducedit\itshape{9}{1000}{OT1IT}
-\setfont\reducedsl\slshape{9}{1000}{OT1}
-\setfont\reducedsf\sfshape{9}{1000}{OT1}
-\setfont\reducedsc\scshape{10}{900}{OT1}
-\setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
-\font\reducedi=cmmi9
-\font\reducedsy=cmsy9
-\def\reducedecsize{0900}
-
-\divide\parskip by 2 % reduce space between paragraphs
-\textleading = 12pt % line spacing for 10pt CM
-\textfonts % reset the current fonts
-\rm
-} % end of 10pt text font size definitions, \definetextfontsizex
-
-% Fonts for short table of contents.
-\setfont\shortcontrm\rmshape{12}{1000}{OT1}
-\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
-\setfont\shortcontsl\slshape{12}{1000}{OT1}
-\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
-
-
-% We provide the user-level command
-% @fonttextsize 10
-% (or 11) to redefine the text font size. pt is assumed.
-%
-\def\xiword{11}
-\def\xword{10}
-\def\xwordpt{10pt}
-%
-\parseargdef\fonttextsize{%
- \def\textsizearg{#1}%
- %\wlog{doing @fonttextsize \textsizearg}%
- %
- % Set \globaldefs so that documents can use this inside @tex, since
- % makeinfo 4.8 does not support it, but we need it nonetheless.
- %
- \begingroup \globaldefs=1
- \ifx\textsizearg\xword \definetextfontsizex
- \else \ifx\textsizearg\xiword \definetextfontsizexi
- \else
- \errhelp=\EMsimple
- \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
- \fi\fi
- \endgroup
-}
-
-%
-% Change the current font style to #1, remembering it in \curfontstyle.
-% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
-% italics, not bold italics.
-%
-\def\setfontstyle#1{%
- \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
- \csname #1font\endcsname % change the current font
-}
-
-\def\rm{\fam=0 \setfontstyle{rm}}
-\def\it{\fam=\itfam \setfontstyle{it}}
-\def\sl{\fam=\slfam \setfontstyle{sl}}
-\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
-\def\tt{\fam=\ttfam \setfontstyle{tt}}
-
-% Texinfo sort of supports the sans serif font style, which plain TeX does not.
-% So we set up a \sf.
-\newfam\sffam
-\def\sf{\fam=\sffam \setfontstyle{sf}}
-
-% We don't need math for this font style.
-\def\ttsl{\setfontstyle{ttsl}}
-
-
-% In order for the font changes to affect most math symbols and letters,
-% we have to define the \textfont of the standard families.
-% We don't bother to reset \scriptscriptfont; awaiting user need.
-%
-\def\resetmathfonts{%
- \textfont0=\rmfont \textfont1=\ifont \textfont2=\syfont
- \textfont\itfam=\itfont \textfont\slfam=\slfont \textfont\bffam=\bffont
- \textfont\ttfam=\ttfont \textfont\sffam=\sffont
- %
- % Fonts for superscript. Note that the 7pt fonts are used regardless
- % of the current font size.
- \scriptfont0=\sevenrm \scriptfont1=\seveni \scriptfont2=\sevensy
- \scriptfont\itfam=\sevenit \scriptfont\slfam=\sevensl
- \scriptfont\bffam=\sevenbf \scriptfont\ttfam=\seventt
- \scriptfont\sffam=\sevensf
-}
-
-
-
-% \defineassignfonts{SIZE} -
-% Define sequence \assignfontsSIZE, which switches between font sizes
-% by redefining the meanings of \STYLEfont. (Just \STYLE additionally sets
-% the current \fam for math mode.)
-%
-\def\defineassignfonts#1{%
- \expandafter\edef\csname assignfonts#1\endcsname{%
- \let\noexpand\rmfont\csname #1rm\endcsname
- \let\noexpand\itfont\csname #1it\endcsname
- \let\noexpand\slfont\csname #1sl\endcsname
- \let\noexpand\bffont\csname #1bf\endcsname
- \let\noexpand\ttfont\csname #1tt\endcsname
- \let\noexpand\smallcaps\csname #1sc\endcsname
- \let\noexpand\sffont \csname #1sf\endcsname
- \let\noexpand\ifont \csname #1i\endcsname
- \let\noexpand\syfont \csname #1sy\endcsname
- \let\noexpand\ttslfont\csname #1ttsl\endcsname
- }
-}
-
-\def\assignfonts#1{%
- \csname assignfonts#1\endcsname
-}
-
-\newif\ifrmisbold
-
-% Select smaller font size with the current style. Used to change font size
-% in, e.g., the LaTeX logo and acronyms. If we are using bold fonts for
-% normal roman text, also use bold fonts for roman text in the smaller size.
-\def\switchtolllsize{%
- \expandafter\assignfonts\expandafter{\lllsize}%
- \ifrmisbold
- \let\rmfont\bffont
- \fi
- \csname\curfontstyle\endcsname
-}%
-
-\def\switchtolsize{%
- \expandafter\assignfonts\expandafter{\lsize}%
- \ifrmisbold
- \let\rmfont\bffont
- \fi
- \csname\curfontstyle\endcsname
-}%
-
-% Define the font-changing commands (all called \...fonts).
-% Each font-changing command also sets the names \lsize (one size lower)
-% and \lllsize (three sizes lower). These relative commands are used
-% in, e.g., the LaTeX logo and acronyms.
-%
-% Note: The fonts used for \ifont are for "math italics" (\itfont is for
-% italics in regular text). \syfont is also used in math mode only.
-%
-\def\definefontsetatsize#1#2#3#4#5{%
- \defineassignfonts{#1}%
-\expandafter\def\csname #1fonts\endcsname{%
- \def\curfontsize{#1}%
- \def\lsize{#2}\def\lllsize{#3}%
- \csname rmisbold#5\endcsname
- \csname assignfonts#1\endcsname
- \resetmathfonts
- \setleading{#4}%
-}}
-
-\definefontsetatsize{text} {reduced}{smaller}{\textleading}{false}
-\definefontsetatsize{title} {chap} {subsec} {27pt} {true}
-\definefontsetatsize{chap} {sec} {text} {19pt} {true}
-\definefontsetatsize{sec} {subsec} {reduced}{17pt} {true}
-\definefontsetatsize{ssec} {text} {small} {15pt} {true}
-\definefontsetatsize{reduced}{small} {smaller}{10.5pt}{false}
-\definefontsetatsize{small} {smaller}{smaller}{10.5pt}{false}
-\definefontsetatsize{smaller}{smaller}{smaller}{9.5pt} {false}
-
-\def\titlefont#1{{\titlefonts\rm #1}}
-\let\subsecfonts = \ssecfonts
-\let\subsubsecfonts = \ssecfonts
-
-% Define these just so they can be easily changed for other fonts.
-\def\angleleft{$\langle$}
-\def\angleright{$\rangle$}
-
-% Set the fonts to use with the @small... environments.
-\let\smallexamplefonts = \smallfonts
-
-% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
-% can fit this many characters:
-% 8.5x11=86 smallbook=72 a4=90 a5=69
-% If we use \scriptfonts (8pt), then we can fit this many characters:
-% 8.5x11=90+ smallbook=80 a4=90+ a5=77
-% For me, subjectively, the few extra characters that fit aren't worth
-% the additional smallness of 8pt. So I'm making the default 9pt.
-%
-% By the way, for comparison, here's what fits with @example (10pt):
-% 8.5x11=71 smallbook=60 a4=75 a5=58
-% --karl, 24jan03.
-
-% Set up the default fonts, so we can use them for creating boxes.
-%
-\definetextfontsizexi
-
-
-% Check if we are currently using a typewriter font. Since all the
-% Computer Modern typewriter fonts have zero interword stretch (and
-% shrink), and it is reasonable to expect all typewriter fonts to have
-% this property, we can check that font parameter. #1 is what to
-% print if we are indeed using \tt; #2 is what to print otherwise.
-\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
-
-% Same as above, but check for italic font. Actually this also catches
-% non-italic slanted fonts since it is impossible to distinguish them from
-% italic fonts. But since this is only used by $ and it uses \sl anyway
-% this is not a problem.
-\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
-
-
-% Check if internal flag is clear, i.e. has not been @set.
-\def\ifflagclear#1#2#3{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- #2\else#3\fi
-}
-
-{
-\catcode`\'=\active
-\catcode`\`=\active
-
-\gdef\setcodequotes{\let`\codequoteleft \let'\codequoteright}
-\gdef\setregularquotes{\let`\lq \let'\rq}
-}
-\setregularquotes
-
-% output for ' in @code
-% in tt font hex 0D (undirected) or 27 (curly right quote)
-%
-\def\codequoteright{%
- \ifusingtt
- {\ifflagclear{txicodequoteundirected}%
- {\ifflagclear{codequoteundirected}%
- {'}%
- {\char"0D }}%
- {\char"0D }}%
- {'}%
-}
-
-% output for ` in @code
-% in tt font hex 12 (grave accent) or 60 (curly left quote)
-% \relax disables Spanish ligatures ?` and !` of \tt font.
-%
-\def\codequoteleft{%
- \ifusingtt
- {\ifflagclear{txicodequotebacktick}%
- {\ifflagclear{codequotebacktick}%
- {\relax`}%
- {\char"12 }}%
- {\char"12 }}%
- {\relax`}%
-}
-
-% Commands to set the quote options.
-%
-\parseargdef\codequoteundirected{%
- \def\temp{#1}%
- \ifx\temp\onword
- \expandafter\let\csname SETtxicodequoteundirected\endcsname
- = t%
- \else\ifx\temp\offword
- \expandafter\let\csname SETtxicodequoteundirected\endcsname
- = \relax
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
- \fi\fi
-}
-
-\parseargdef\codequotebacktick{%
- \def\temp{#1}%
- \ifx\temp\onword
- \expandafter\let\csname SETtxicodequotebacktick\endcsname
- = t%
- \else\ifx\temp\offword
- \expandafter\let\csname SETtxicodequotebacktick\endcsname
- = \relax
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
- \fi\fi
-}
-
-% Turn them on by default
-\let\SETtxicodequoteundirected = t
-\let\SETtxicodequotebacktick = t
-
-
-% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
-\def\noligaturesquoteleft{\relax\lq}
-
-% Count depth in font-changes, for error checks
-\newcount\fontdepth \fontdepth=0
-
-% Font commands.
-
-% #1 is the font command (\sl or \it), #2 is the text to slant.
-% If we are in a monospaced environment, however, 1) always use \ttsl,
-% and 2) do not add an italic correction.
-\def\dosmartslant#1#2{%
- \ifusingtt
- {{\ttsl #2}\let\next=\relax}%
- {\def\next{{#1#2}\smartitaliccorrection}}%
- \next
-}
-\def\smartslanted{\dosmartslant\sl}
-\def\smartitalic{\dosmartslant\it}
-
-% Output an italic correction unless the following character is such as
-% not to need one.
-\def\smartitaliccorrection{\futurelet\next\smartitaliccorrectionx}
-\def\smartitaliccorrectionx{%
- \ifx\next,%
- \else\ifx\next-%
- \else\ifx\next.%
- \else\ifx\next\.%
- \else\ifx\next\comma%
- \else\ptexslash
- \fi\fi\fi\fi\fi
- \aftersmartic
-}
-
-% @cite unconditionally uses \sl with \smartitaliccorrection.
-\def\cite#1{{\sl #1}\smartitaliccorrection}
-
-% By default, use ttsl font for @var when used in code context.
-% To unconditionally use \sl for @var, @clear txicodevaristt. This
-% gives consistency for parameter names whether they are in @def,
-% @table @code or a regular paragraph.
-\def\aftersmartic{}
-\def\var#1{%
- \let\saveaftersmartic = \aftersmartic
- \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
- % The \null is to reset \spacefactor.
- %
- \ifflagclear{txicodevaristt}%
- {\def\varnext{{{\sl #1}}\smartitaliccorrection}}%
- {\def\varnext{\smartslanted{#1}}}%
- \varnext
-}
-
-\def\SETtxicodevaristt{}% @set txicodevaristt
-
-\let\i=\smartitalic
-\let\slanted=\smartslanted
-\let\dfn=\smartslanted
-\let\emph=\smartitalic
-
-% @r for roman font, used for code comment
-\def\r#1{{%
- \usenormaldash % get --, --- ligatures even if in @code
- \defcharsdefault % in case on def line
- \rm #1}}
-{\catcode`-=\active \gdef\usenormaldash{\let-\normaldash}}
-
-% @sc, undocumented @ii.
-\def\sc#1{{\smallcaps#1}} % smallcaps font
-\def\ii#1{{\it #1}} % italic font
-
-% @b, explicit bold. Also @strong.
-\def\b#1{{\bf \defcharsdefault #1}}
-\let\strong=\b
-
-% @sansserif, explicit sans.
-\def\sansserif#1{{\sf #1}}
-
-\newif\iffrenchspacing
-\frenchspacingfalse
-
-% Set sfcode to normal for the chars that usually have another value.
-% Can't use plain's \frenchspacing because it uses the `\x notation, and
-% sometimes \x has an active definition that messes things up.
-%
-\catcode`@=11
- \def\plainfrenchspacing{%
- \iffrenchspacing\else
- \frenchspacingtrue
- \sfcode`\.=\@m \sfcode`\?=\@m \sfcode`\!=\@m
- \sfcode`\:=\@m \sfcode`\;=\@m \sfcode`\,=\@m
- \def\endofsentencespacefactor{1000}% for @. and friends
- \fi
- }
- \def\plainnonfrenchspacing{%
- \iffrenchspacing
- \frenchspacingfalse
- \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
- \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
- \def\endofsentencespacefactor{3000}% for @. and friends
- \fi
- }
-\catcode`@=\other
-\def\endofsentencespacefactor{3000}% default
-
-% @frenchspacing on|off says whether to put extra space after punctuation.
-%
-\def\onword{on}
-\def\offword{off}
-%
-\let\frenchspacingsetting\plainnonfrenchspacing % used in output routine
-\parseargdef\frenchspacing{%
- \def\temp{#1}%
- \ifx\temp\onword \let\frenchspacingsetting\plainfrenchspacing
- \else\ifx\temp\offword \let\frenchspacingsetting\plainnonfrenchspacing
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
- \fi\fi
- \frenchspacingsetting
-}
-
-
-% @t, explicit typewriter.
-\def\t#1{%
- {\tt \defcharsdefault \plainfrenchspacing #1}%
- \null
-}
-
-% @samp.
-\def\samp#1{{\setcodequotes\lq\tclose{#1}\rq\null}}
-
-% @indicateurl is \samp, that is, with quotes.
-\let\indicateurl=\samp
-
-% @code (and similar) prints in typewriter, but with spaces the same
-% size as normal in the surrounding text, without hyphenation, etc.
-% This is a subroutine for that.
-\def\tclose#1{%
- {%
- % Change normal interword space to be same as for the current font.
- \spaceskip = \fontdimen2\font
- %
- % Switch to typewriter.
- \tt
- %
- % `\ ' produces the large typewriter interword space.
- \def\ {{\spaceskip = 0pt{} }}%
- %
- \plainfrenchspacing
- #1%
- }%
- \null % reset spacefactor to 1000
-}
-
-% This is for LuaTeX: It is not sufficient to disable hyphenation at
-% explicit dashes by setting `\hyphenchar` to -1.
-\def\dashnobreak{%
- \normaldash
- \penalty 10000 }
-
-% We must turn on hyphenation at `-' and `_' in @code.
-% Otherwise, it is too hard to avoid overfull hboxes
-% in the Emacs manual, the Library manual, etc.
-% We explicitly allow hyphenation at these characters
-% using \discretionary.
-%
-% Hyphenation at - and hyphenation within words was turned off
-% by default for the tt fonts using the \hyphenchar parameter of TeX.
-{
- \catcode`\-=\active \catcode`\_=\active
- \catcode`\'=\active \catcode`\`=\active
- \global\let'=\rq \global\let`=\lq % default definitions
- %
- \global\def\code{\begingroup
- \setcodequotes
- \catcode\dashChar=\active \catcode\underChar=\active
- \ifallowcodebreaks
- \let-\codedash
- \let_\codeunder
- \else
- \let-\dashnobreak
- \let_\realunder
- \fi
- \codex
- }
- %
- \gdef\codedash{\futurelet\next\codedashfinish}
- \gdef\codedashfinish{%
- \normaldash % always output the dash character itself.
- %
- % Now, output a discretionary to allow a line break, unless
- % (a) the next character is a -, or
- % (b) the preceding character is a -, or
- % (c) we are at the start of the string.
- % In both cases (b) and (c), \codedashnobreak should be set to \codedash.
- %
- % E.g., given --posix, we do not want to allow a break after either -.
- % Given --foo-bar, we do want to allow a break between the - and the b.
- \ifx\next\codedash \else
- \ifx\codedashnobreak\codedash
- \else \discretionary{}{}{}\fi
- \fi
- % we need the space after the = for the case when \next itself is a
- % space token; it would get swallowed otherwise. As in @code{- a}.
- \global\let\codedashnobreak= \next
- }
-}
-\def\normaldash{-}
-%
-\def\codex #1{\tclose{%
- % Given -foo (with a single dash), we do not want to allow a break
- % after the -. \codedashnobreak is set to the first character in
- % @code.
- \futurelet\codedashnobreak\relax
- #1%
-}\endgroup}
-
-\def\codeunder{%
- % this is all so @math{@code{var_name}+1} can work. In math mode, _
- % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
- % will therefore expand the active definition of _, which is us
- % (inside @code that is), therefore an endless loop.
- \ifusingtt{\ifmmode
- \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
- \else\normalunderscore \fi
- \discretionary{}{}{}}%
- {\_}%
-}
-
-% An additional complication: the above will allow breaks after, e.g.,
-% each of the four underscores in __typeof__. This is bad.
-% @allowcodebreaks provides a document-level way to turn breaking at -
-% and _ on and off.
-%
-\newif\ifallowcodebreaks \allowcodebreakstrue
-
-\def\keywordtrue{true}
-\def\keywordfalse{false}
-
-\parseargdef\allowcodebreaks{%
- \def\txiarg{#1}%
- \ifx\txiarg\keywordtrue
- \allowcodebreakstrue
- \else\ifx\txiarg\keywordfalse
- \allowcodebreaksfalse
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
- \fi\fi
-}
-
-% For @command, @env, @file, @option quotes seem unnecessary,
-% so use \code rather than \samp.
-\let\command=\code
-\let\env=\code
-\let\file=\code
-\let\option=\code
-
-% @uref (abbreviation for `urlref') aka @url takes an optional
-% (comma-separated) second argument specifying the text to display and
-% an optional third arg as text to display instead of (rather than in
-% addition to) the url itself. First (mandatory) arg is the url.
-
-% TeX-only option to allow changing PDF output to show only the second
-% arg (if given), and not the url (which is then just the link target).
-\newif\ifurefurlonlylink
-
-% The default \pretolerance setting stops the penalty inserted in
-% \urefallowbreak being a discouragement to line breaking. Set it to
-% a negative value for this paragraph only. Hopefully this does not
-% conflict with redefinitions of \par done elsewhere.
-\def\nopretolerance{%
-\pretolerance=-1
-\def\par{\endgraf\pretolerance=100 \let\par\endgraf}%
-}
-
-% The main macro is \urefbreak, which allows breaking at expected
-% places within the url.
-\def\urefbreak{\nopretolerance \begingroup \urefcatcodes \dourefbreak}
-\let\uref=\urefbreak
-%
-\def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
-\def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
- \unsepspaces
- \pdfurl{#1}%
- \setbox0 = \hbox{\ignorespaces #3}%
- \ifdim\wd0 > 0pt
- \unhbox0 % third arg given, show only that
- \else
- \setbox0 = \hbox{\ignorespaces #2}% look for second arg
- \ifdim\wd0 > 0pt
- \ifpdf
- % For pdfTeX and LuaTeX
- \ifurefurlonlylink
- % PDF plus option to not display url, show just arg
- \unhbox0
- \else
- % PDF, normally display both arg and url for consistency,
- % visibility, if the pdf is eventually used to print, etc.
- \unhbox0\ (\urefcode{#1})%
- \fi
- \else
- \ifxetex
- % For XeTeX
- \ifurefurlonlylink
- % PDF plus option to not display url, show just arg
- \unhbox0
- \else
- % PDF, normally display both arg and url for consistency,
- % visibility, if the pdf is eventually used to print, etc.
- \unhbox0\ (\urefcode{#1})%
- \fi
- \else
- \unhbox0\ (\urefcode{#1})% DVI, always show arg and url
- \fi
- \fi
- \else
- \urefcode{#1}% only url given, so show it
- \fi
- \fi
- \endlink
-\endgroup}
-
-% Allow line breaks around only a few characters (only).
-\def\urefcatcodes{%
- \catcode`\&=\active \catcode`\.=\active
- \catcode`\#=\active \catcode`\?=\active
- \catcode`\/=\active
-}
-{
- \urefcatcodes
- %
- \global\def\urefcode{\begingroup
- \setcodequotes
- \urefcatcodes
- \let&\urefcodeamp
- \let.\urefcodedot
- \let#\urefcodehash
- \let?\urefcodequest
- \let/\urefcodeslash
- \codex
- }
- %
- % By default, they are just regular characters.
- \global\def&{\normalamp}
- \global\def.{\normaldot}
- \global\def#{\normalhash}
- \global\def?{\normalquest}
- \global\def/{\normalslash}
-}
-
-\def\urefcodeamp{\urefprebreak \&\urefpostbreak}
-\def\urefcodedot{\urefprebreak .\urefpostbreak}
-\def\urefcodehash{\urefprebreak \#\urefpostbreak}
-\def\urefcodequest{\urefprebreak ?\urefpostbreak}
-\def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
-{
- \catcode`\/=\active
- \global\def\urefcodeslashfinish{%
- \urefprebreak \slashChar
- % Allow line break only after the final / in a sequence of
- % slashes, to avoid line break between the slashes in http://.
- \ifx\next/\else \urefpostbreak \fi
- }
-}
-
-% By default we'll break after the special characters, but some people like to
-% break before the special chars, so allow that. Also allow no breaking at
-% all, for manual control.
-%
-\parseargdef\urefbreakstyle{%
- \def\txiarg{#1}%
- \ifx\txiarg\wordnone
- \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
- \else\ifx\txiarg\wordbefore
- \def\urefprebreak{\urefallowbreak}\def\urefpostbreak{\nobreak}
- \else\ifx\txiarg\wordafter
- \def\urefprebreak{\nobreak}\def\urefpostbreak{\urefallowbreak}
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
- \fi\fi\fi
-}
-\def\wordafter{after}
-\def\wordbefore{before}
-\def\wordnone{none}
-
-% Allow a ragged right output to aid breaking long URL's. There can
-% be a break at the \allowbreak with no extra glue (if the existing stretch in
-% the line is sufficient), a break at the \penalty with extra glue added
-% at the end of the line, or no break at all here.
-% Changing the value of the penalty and/or the amount of stretch affects how
-% preferable one choice is over the other.
-% Check test cases in doc/texinfo-tex-test.texi before making any changes.
-\def\urefallowbreak{%
- \penalty0\relax
- \hskip 0pt plus 3 em\relax
- \penalty1000\relax
- \hskip 0pt plus -3 em\relax
-}
-
-\urefbreakstyle after
-
-% @url synonym for @uref, since that's how everyone uses it.
-%
-\let\url=\uref
-
-% rms does not like angle brackets --karl, 17may97.
-% So now @email is just like @uref, unless we are pdf.
-%
-%\def\email#1{\angleleft{\tt #1}\angleright}
-\ifpdforxetex
- \def\email#1{\doemail#1,,\finish}
- \def\doemail#1,#2,#3\finish{\begingroup
- \unsepspaces
- \pdfurl{mailto:#1}%
- \setbox0 = \hbox{\ignorespaces #2}%
- \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
- \endlink
- \endgroup}
-\else
- \let\email=\uref
-\fi
-
-% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
-% `example' (@kbd uses ttsl only inside of @example and friends),
-% or `code' (@kbd uses normal tty font always).
-\parseargdef\kbdinputstyle{%
- \def\txiarg{#1}%
- \ifx\txiarg\worddistinct
- \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
- \else\ifx\txiarg\wordexample
- \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
- \else\ifx\txiarg\wordcode
- \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
- \fi\fi\fi
-}
-\def\worddistinct{distinct}
-\def\wordexample{example}
-\def\wordcode{code}
-
-% Default is `distinct'.
-\kbdinputstyle distinct
-
-\def\kbd#1{%
- \tclose{\kbdfont\setcodequotes#1}%
-}
-
-% definition of @key that produces a lozenge. Doesn't adjust to text size.
-%\setfont\keyrm\rmshape{8}{1000}{OT1}
-%\font\keysy=cmsy9
-%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
-% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
-% \vbox{\hrule\kern-0.4pt
-% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
-% \kern-0.4pt\hrule}%
-% \kern-.06em\raise0.4pt\hbox{\angleright}}}}
-
-% definition of @key with no lozenge.
-%
-\def\key#1{{\setregularquotes \tt #1}\null}
-
-% @clicksequence{File @click{} Open ...}
-\def\clicksequence#1{\begingroup #1\endgroup}
-
-% @clickstyle @arrow (by default)
-\parseargdef\clickstyle{\def\click{#1}}
-\def\click{\arrow}
-
-% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
-% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
-%
-\def\dmn#1{\thinspace #1}
-
-% @acronym for "FBI", "NATO", and the like.
-% We print this one point size smaller, since it's intended for
-% all-uppercase.
-%
-\def\acronym#1{\doacronym #1,,\finish}
-\def\doacronym#1,#2,#3\finish{%
- {\switchtolsize #1}%
- \def\temp{#2}%
- \ifx\temp\empty \else
- \space ({\unsepspaces \ignorespaces \temp \unskip})%
- \fi
- \null % reset \spacefactor=1000
-}
-
-% @abbr for "Comput. J." and the like.
-% No font change, but don't do end-of-sentence spacing.
-%
-\def\abbr#1{\doabbr #1,,\finish}
-\def\doabbr#1,#2,#3\finish{%
- {\plainfrenchspacing #1}%
- \def\temp{#2}%
- \ifx\temp\empty \else
- \space ({\unsepspaces \ignorespaces \temp \unskip})%
- \fi
- \null % reset \spacefactor=1000
-}
-
-% @asis just yields its argument. Used with @table, for example.
-%
-\def\asis#1{#1}
-
-% @math outputs its argument in math mode.
-%
-% One complication: _ usually means subscripts, but it could also mean
-% an actual _ character, as in @math{@var{some_variable} + 1}. So make
-% _ active, and distinguish by seeing if the current family is \slfam,
-% which is what @var uses.
-{
- \catcode`\_ = \active
- \gdef\mathunderscore{%
- \catcode`\_=\active
- \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
- }
-}
-% Another complication: we want \\ (and @\) to output a math (or tt) \.
-% FYI, plain.tex uses \\ as a temporary control sequence (for no
-% particular reason), but this is not advertised and we don't care.
-%
-% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
-\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
-%
-\def\math{%
- \ifmmode\else % only go into math if not in math mode already
- \tex
- \mathunderscore
- \let\\ = \mathbackslash
- \mathactive
- % make the texinfo accent commands work in math mode
- \let\"=\ddot
- \let\'=\acute
- \let\==\bar
- \let\^=\hat
- \let\`=\grave
- \let\u=\breve
- \let\v=\check
- \let\~=\tilde
- \let\dotaccent=\dot
- % have to provide another name for sup operator
- \let\mathopsup=\sup
- $\expandafter\finishmath\fi
-}
-\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
-
-% Some active characters (such as <) are spaced differently in math.
-% We have to reset their definitions in case the @math was an argument
-% to a command which sets the catcodes (such as @item or @section).
-%
-{
- \catcode`^ = \active
- \catcode`< = \active
- \catcode`> = \active
- \catcode`+ = \active
- \catcode`' = \active
- \gdef\mathactive{%
- \let^ = \ptexhat
- \let< = \ptexless
- \let> = \ptexgtr
- \let+ = \ptexplus
- \let' = \ptexquoteright
- }
-}
-
-% for @sub and @sup, if in math mode, just do a normal sub/superscript.
-% If in text, use math to place as sub/superscript, but switch
-% into text mode, with smaller fonts. This is a different font than the
-% one used for real math sub/superscripts (8pt vs. 7pt), but let's not
-% fix it (significant additions to font machinery) until someone notices.
-%
-\def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi}
-\def\finishsub#1{$\sb{\hbox{\switchtolllsize #1}}$}%
-%
-\def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi}
-\def\finishsup#1{$\ptexsp{\hbox{\switchtolllsize #1}}$}%
-
-% provide this command from LaTeX as it is very common
-\def\frac#1#2{{{#1}\over{#2}}}
-
-% @displaymath.
-% \globaldefs is needed to recognize the end lines in \tex and
-% \end tex. Set \thisenv as @end displaymath is seen before @end tex.
-{\obeylines
-\globaldefs=1
-\envdef\displaymath{%
-\tex%
-\def\thisenv{\displaymath}%
-\begingroup\let\end\displaymathend%
-$$%
-}
-
-\def\displaymathend{$$\endgroup\end}%
-
-\def\Edisplaymath{%
-\def\thisenv{\tex}%
-\end tex
-}}
-
-
-% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
-% Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
-% except specified as a normal braced arg, so no newlines to worry about.
-%
-\def\outfmtnametex{tex}
-%
-\long\def\inlinefmt#1{\doinlinefmt #1,\finish}
-\long\def\doinlinefmt#1,#2,\finish{%
- \def\inlinefmtname{#1}%
- \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
-}
-%
-% @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if
-% FMTNAME is tex, else ELSE-TEXT.
-\long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish}
-\long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{%
- \def\inlinefmtname{#1}%
- \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi
-}
-%
-% For raw, must switch into @tex before parsing the argument, to avoid
-% setting catcodes prematurely. Doing it this way means that, for
-% example, @inlineraw{html, foo{bar} gets a parse error instead of being
-% ignored. But this isn't important because if people want a literal
-% *right* brace they would have to use a command anyway, so they may as
-% well use a command to get a left brace too. We could re-use the
-% delimiter character idea from \verb, but it seems like overkill.
-%
-\long\def\inlineraw{\tex \doinlineraw}
-\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
-\def\doinlinerawtwo#1,#2,\finish{%
- \def\inlinerawname{#1}%
- \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
- \endgroup % close group opened by \tex.
-}
-
-% @inlineifset{VAR, TEXT} expands TEXT if VAR is @set.
-%
-\long\def\inlineifset#1{\doinlineifset #1,\finish}
-\long\def\doinlineifset#1,#2,\finish{%
- \def\inlinevarname{#1}%
- \expandafter\ifx\csname SET\inlinevarname\endcsname\relax
- \else\ignorespaces#2\fi
-}
-
-% @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set.
-%
-\long\def\inlineifclear#1{\doinlineifclear #1,\finish}
-\long\def\doinlineifclear#1,#2,\finish{%
- \def\inlinevarname{#1}%
- \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi
-}
-
-
-\message{glyphs,}
-% and logos.
-
-% @@ prints an @, as does @atchar{}.
-\def\@{\char64 }
-\let\atchar=\@
-
-% @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
-\def\lbracechar{{\ifusingtt{\char123}{\ensuremath\lbrace}}}
-\def\rbracechar{{\ifusingtt{\char125}{\ensuremath\rbrace}}}
-\let\{=\lbracechar
-\let\}=\rbracechar
-
-% @comma{} to avoid , parsing problems.
-\let\comma = ,
-
-% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
-% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
-\let\, = \ptexc
-\let\dotaccent = \ptexdot
-\def\ringaccent#1{{\accent23 #1}}
-\let\tieaccent = \ptext
-\let\ubaraccent = \ptexb
-\let\udotaccent = \d
-
-% Other special characters: @questiondown @exclamdown @ordf @ordm
-% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
-\def\questiondown{?`}
-\def\exclamdown{!`}
-\def\ordf{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{a}}}
-\def\ordm{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{o}}}
-
-% Dotless i and dotless j, used for accents.
-\def\imacro{i}
-\def\jmacro{j}
-\def\dotless#1{%
- \def\temp{#1}%
- \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
- \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
- \else \errmessage{@dotless can be used only with i or j}%
- \fi\fi
-}
-
-% The \TeX{} logo, as in plain, but resetting the spacing so that a
-% period following counts as ending a sentence. (Idea found in latex.)
-%
-\edef\TeX{\TeX \spacefactor=1000 }
-
-% @LaTeX{} logo. Not quite the same results as the definition in
-% latex.ltx, since we use a different font for the raised A; it's most
-% convenient for us to use an explicitly smaller font, rather than using
-% the \scriptstyle font (since we don't reset \scriptstyle and
-% \scriptscriptstyle).
-%
-\def\LaTeX{%
- L\kern-.36em
- {\setbox0=\hbox{T}%
- \vbox to \ht0{\hbox{%
- \ifx\textnominalsize\xwordpt
- % for 10pt running text, lllsize (8pt) is too small for the A in LaTeX.
- % Revert to plain's \scriptsize, which is 7pt.
- \count255=\the\fam $\fam\count255 \scriptstyle A$%
- \else
- \ifx\curfontsize\smallword
- % For footnotes and indices
- \count255=\the\fam $\fam\count255 \scriptstyle A$%
- \else
- % For 11pt, we can use our lllsize.
- \switchtolllsize A%
- \fi
- \fi
- }%
- \vss
- }}%
- \kern-.15em
- \TeX
-}
-\def\smallword{small}
-
-% Some math mode symbols. Define \ensuremath to switch into math mode
-% unless we are already there. Expansion tricks may not be needed here,
-% but safer, and can't hurt.
-\def\ensuremath{\ifmmode \expandafter\asis \else\expandafter\ensuredmath \fi}
-\def\ensuredmath#1{$\relax#1$}
-%
-\def\bullet{\ensuremath\ptexbullet}
-\def\geq{\ensuremath\ge}
-\def\leq{\ensuremath\le}
-\def\minus{\ensuremath-}
-
-% @dots{} outputs an ellipsis using the current font.
-% We do .5em per period so that it has the same spacing in the cm
-% typewriter fonts as three actual period characters; on the other hand,
-% in other typewriter fonts three periods are wider than 1.5em. So do
-% whichever is larger.
-%
-\def\dots{%
- \leavevmode
- \setbox0=\hbox{...}% get width of three periods
- \ifdim\wd0 > 1.5em
- \dimen0 = \wd0
- \else
- \dimen0 = 1.5em
- \fi
- \hbox to \dimen0{%
- \hskip 0pt plus.25fil
- .\hskip 0pt plus1fil
- .\hskip 0pt plus1fil
- .\hskip 0pt plus.5fil
- }%
-}
-
-% @enddots{} is an end-of-sentence ellipsis.
-%
-\def\enddots{%
- \dots
- \spacefactor=\endofsentencespacefactor
-}
-
-% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
-%
-% Since these characters are used in examples, they should be an even number of
-% \tt widths. Each \tt character is 1en, so two makes it 1em.
-%
-\def\point{$\star$}
-\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
-\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
-\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
-\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
-\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
-
-% The @error{} command.
-% Adapted from the TeXbook's \boxit.
-%
-\newbox\errorbox
-%
-{\ttfont \global\dimen0 = 3em}% Width of the box.
-\dimen2 = .55pt % Thickness of rules
-% The text. (`r' is open on the right, `e' somewhat less so on the left.)
-\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
-%
-\setbox\errorbox=\hbox to \dimen0{\hfil
- \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
- \advance\hsize by -2\dimen2 % Rules.
- \vbox{%
- \hrule height\dimen2
- \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
- \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
- \kern3pt\vrule width\dimen2}% Space to right.
- \hrule height\dimen2}
- \hfil}
-%
-\def\error{\leavevmode\lower.7ex\copy\errorbox}
-
-% @pounds{} is a sterling sign, which Knuth put in the CM italic font.
-%
-\def\pounds{{\ifusingtt{\ecfont\char"BF}{\it\$}}}
-
-% @euro{} comes from a separate font, depending on the current style.
-% We use the free feym* fonts from the eurosym package by Henrik
-% Theiling, which support regular, slanted, bold and bold slanted (and
-% "outlined" (blackboard board, sort of) versions, which we don't need).
-% It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
-%
-% Although only regular is the truly official Euro symbol, we ignore
-% that. The Euro is designed to be slightly taller than the regular
-% font height.
-%
-% feymr - regular
-% feymo - slanted
-% feybr - bold
-% feybo - bold slanted
-%
-% There is no good (free) typewriter version, to my knowledge.
-% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
-% Hmm.
-%
-% Also doesn't work in math. Do we need to do math with euro symbols?
-% Hope not.
-%
-%
-\def\euro{{\eurofont e}}
-\def\eurofont{%
- % We set the font at each command, rather than predefining it in
- % \textfonts and the other font-switching commands, so that
- % installations which never need the symbol don't have to have the
- % font installed.
- %
- % There is only one designed size (nominal 10pt), so we always scale
- % that to the current nominal size.
- %
- % By the way, simply using "at 1em" works for cmr10 and the like, but
- % does not work for cmbx10 and other extended/shrunken fonts.
- %
- \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
- %
- \ifx\curfontstyle\bfstylename
- % bold:
- \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
- \else
- % regular:
- \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
- \fi
- \thiseurofont
-}
-
-% Glyphs from the EC fonts. We don't use \let for the aliases, because
-% sometimes we redefine the original macro, and the alias should reflect
-% the redefinition.
-%
-% Use LaTeX names for the Icelandic letters.
-\def\DH{{\ecfont \char"D0}} % Eth
-\def\dh{{\ecfont \char"F0}} % eth
-\def\TH{{\ecfont \char"DE}} % Thorn
-\def\th{{\ecfont \char"FE}} % thorn
-%
-\def\guillemetleft{{\ecfont \char"13}}
-\def\guillemotleft{\guillemetleft}
-\def\guillemetright{{\ecfont \char"14}}
-\def\guillemotright{\guillemetright}
-\def\guilsinglleft{{\ecfont \char"0E}}
-\def\guilsinglright{{\ecfont \char"0F}}
-\def\quotedblbase{{\ecfont \char"12}}
-\def\quotesinglbase{{\ecfont \char"0D}}
-%
-\def\L{{\ecfont \char"8A}} % L with stroke
-\def\l{{\ecfont \char"AA}} % l with stroke
-%
-% This positioning is not perfect (see the ogonek LaTeX package), but
-% we have the precomposed glyphs for the most common cases. We put the
-% tests to use those glyphs in the single \ogonek macro so we have fewer
-% dummy definitions to worry about for index entries, etc.
-%
-% ogonek is also used with other letters in Lithuanian (IOU), but using
-% the precomposed glyphs for those is not so easy since they aren't in
-% the same EC font.
-\def\ogonek#1{{%
- \def\temp{#1}%
- \ifx\temp\macrocharA\Aogonek
- \else\ifx\temp\macrochara\aogonek
- \else\ifx\temp\macrocharE\Eogonek
- \else\ifx\temp\macrochare\eogonek
- \else
- \ecfont \setbox0=\hbox{#1}%
- \ifdim\ht0=1ex\accent"0C #1%
- \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
- \fi
- \fi\fi\fi\fi
- }%
-}
-\def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
-\def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
-\def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
-\def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
-%
-% Use the European Computer Modern fonts (cm-super in outline format)
-% for non-CM glyphs. That is ec* for regular text and tc* for the text
-% companion symbols (LaTeX TS1 encoding). Both are part of the ec
-% package and follow the same conventions.
-%
-\def\ecfont{\etcfont{e}}
-\def\tcfont{\etcfont{t}}
-%
-\def\etcfont#1{%
- % We can't distinguish serif/sans and italic/slanted, but this
- % is used for crude hacks anyway (like adding French and German
- % quotes to documents typeset with CM, where we lose kerning), so
- % hopefully nobody will notice/care.
- \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
- \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
- \ifusingtt
- % typewriter:
- {\font\thisecfont = #1ctt\ecsize \space at \nominalsize}%
- % else
- {\ifx\curfontstyle\bfstylename
- \etcfontbold{#1}%
- \else
- \ifrmisbold
- \etcfontbold{#1}%
- \else
- % regular:
- \font\thisecfont = #1c\ifusingit{ti}{rm}\ecsize \space
- at \nominalsize
- \fi
- \fi}%
- \thisecfont
-}
-
-\def\etcfontbold#1{%
- % bold:
- \font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize
-}
-
-% @registeredsymbol - R in a circle. The font for the R should really
-% be smaller yet, but lllsize is the best we can do for now.
-% Adapted from the plain.tex definition of \copyright.
-%
-\def\registeredsymbol{%
- $^{{\ooalign{\hfil\raise.07ex\hbox{\switchtolllsize R}%
- \hfil\crcr\Orb}}%
- }$%
-}
-
-% @textdegree - the normal degrees sign.
-%
-\def\textdegree{%
- \ifmmode ^\circ
- \else {\tcfont \char 176}%
- \fi}
-
-% Laurent Siebenmann reports \Orb undefined with:
-% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
-% so we'll define it if necessary.
-%
-\ifx\Orb\thisisundefined
-\def\Orb{\mathhexbox20D}
-\fi
-
-% Quotes.
-\chardef\quoteleft=`\`
-\chardef\quoteright=`\'
-
-% only change font for tt for correct kerning and to avoid using
-% \ecfont unless necessary.
-\def\quotedblleft{%
- \ifusingtt{{\ecfont\char"10}}{{\char"5C}}%
-}
-
-\def\quotedblright{%
- \ifusingtt{{\ecfont\char"11}}{{\char`\"}}%
-}
-
-
-\message{page headings,}
-
-\newskip\titlepagetopglue \titlepagetopglue = 1.5in
-\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
-
-% First the title page. Must do @settitle before @titlepage.
-\newif\ifseenauthor
-\newif\iffinishedtitlepage
-
-% @setcontentsaftertitlepage used to do an implicit @contents or
-% @shortcontents after @end titlepage, but it is now obsolete.
-\def\setcontentsaftertitlepage{%
- \errmessage{@setcontentsaftertitlepage has been removed as a Texinfo
- command; move your @contents command if you want the contents
- after the title page.}}%
-\def\setshortcontentsaftertitlepage{%
- \errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo
- command; move your @shortcontents and @contents commands if you
- want the contents after the title page.}}%
-
-\parseargdef\shorttitlepage{%
- {\headingsoff \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
- \endgroup\page\hbox{}\page}\pageone}
-
-\envdef\titlepage{%
- % Open one extra group, as we want to close it in the middle of \Etitlepage.
- \begingroup
- \parindent=0pt \textfonts
- \headingsoff
- % Leave some space at the very top of the page.
- \vglue\titlepagetopglue
- % No rule at page bottom unless we print one at the top with @title.
- \finishedtitlepagetrue
- %
- % Most title ``pages'' are actually two pages long, with space
- % at the top of the second. We don't want the ragged left on the second.
- \let\oldpage = \page
- \def\page{%
- \iffinishedtitlepage\else
- \finishtitlepage
- \fi
- \let\page = \oldpage
- \page
- \null
- }%
-}
-
-\def\Etitlepage{%
- \iffinishedtitlepage\else
- \finishtitlepage
- \fi
- % It is important to do the page break before ending the group,
- % because the headline and footline are only empty inside the group.
- % If we use the new definition of \page, we always get a blank page
- % after the title page, which we certainly don't want.
- \oldpage
- \pageone
- \endgroup
- %
-}
-
-\def\finishtitlepage{%
- \ifseenauthor \vskip4pt \else \vskip 0pt plus 1filll \fi
- \hrule height 2pt width \hsize
- \vskip\titlepagebottomglue
- \finishedtitlepagetrue
-}
-
-% Settings used for typesetting titles: no hyphenation, no indentation,
-% don't worry much about spacing, ragged right. This should be used
-% inside a \vbox, and fonts need to be set appropriately first. \par should
-% be specified before the end of the \vbox, since a vbox is a group.
-%
-\def\raggedtitlesettings{%
- \rm
- \hyphenpenalty=10000
- \parindent=0pt
- \tolerance=5000
- \ptexraggedright
-}
-
-% Macros to be used within @titlepage:
-
-\let\subtitlerm=\rmfont
-\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
-
-\let\savedtitle\empty
-\let\savedsubtitlegroup\empty
-\let\savedauthorgroup\empty
-
-\parseargdef\title{%
- \expandafter\ifx\thisenv\documentinfo
- \gdef\savedtitle{#1}%
- \else
- \checkenv\titlepage
- \vbox{\titlefonts \raggedtitlesettings #1\par}%
- % print a rule at the page bottom also.
- \finishedtitlepagefalse
- \vskip4pt \hrule height 4pt width \hsize \vskip4pt
- \fi
-}
-
-\parseargdef\subtitle{%
- \expandafter\ifx\thisenv\documentinfo
- \ifx\savedsubtitlegroup\empty
- \gdef\savedsubtitlegroup{\savedsubtitle{#1}}%
- \else
- \expandafter\gdef\expandafter\savedsubtitlegroup\expandafter{%
- \savedsubtitlegroup\savedsubtitle{#1}}%
- \fi
- \else
- \checkenv\titlepage
- {\subtitlefont \rightline{#1}}%
- \fi
-}
-
-% @author should come last, but may come many times.
-% It can also be used inside @quotation.
-%
-\parseargdef\author{%
- \expandafter\ifx\thisenv\documentinfo
- \ifx\savedauthorgroup\empty
- \gdef\savedauthorgroup{\savedauthor{#1}}%
- \else
- \expandafter\gdef\expandafter\savedauthorgroup\expandafter{%
- \savedauthorgroup\savedauthor{#1}}%
- \fi
- \else
- \def\temp{\quotation}%
- \ifx\thisenv\temp
- \def\quotationauthor{#1}% printed in \Equotation.
- \else
- \checkenv\titlepage
- \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
- {\secfonts\rm \leftline{#1}}%
- \fi
- \fi
-}
-
-% @maketitle
-{\obeylines
-\gdef\maketitle{%
-\titlepage
-\ifx\savedtitle\empty\else
- \title \savedtitle
- \ifx\savedsubtitlegroup\empty\else
- \savedsubtitlegroup
-\fi\fi
-\ifx\savedauthorgroup\empty\else
- \savedauthorgroup
-\fi
-% start verso page if either copying or publication text is given
-\ifx\copyingtext\relax
- \ifx\publicationtext\relax\else
- \page \vskip 0pt plus 1filll
- \fi
-\else
- \page \vskip 0pt plus 1filll
-\fi
-\ifx\publicationtext\relax\else
- \insertpublication
- \sp 1
-\fi
-\ifx\copyingtext\relax\else
- \insertcopying
-\fi
-\end titlepage
-}
-
-% \savedauthor{#1}, called with braces. output an @author line.
-\gdef\savedauthor#1{%
-\author#1
-}
-
-% \savedsubtitle{#1}, called with braces. output a @subtitle line.
-\gdef\savedsubtitle#1{%
-\subtitle#1
-}
-} % \obeylines
-
-% @documentinfo block
-\envdef\documentinfo{%
-}
-\def\Edocumentinfo{}%
-
-
-% Set up page headings and footings.
-
-\let\thispage=\folio
-
-\newtoks\evenheadline % headline on even pages
-\newtoks\oddheadline % headline on odd pages
-\newtoks\evenchapheadline% headline on even pages with a new chapter
-\newtoks\oddchapheadline % headline on odd pages with a new chapter
-\newtoks\evenfootline % footline on even pages
-\newtoks\oddfootline % footline on odd pages
-
-% Now make \makeheadline and \makefootline in Plain TeX use those variables
-\headline={{\textfonts\rm\frenchspacingsetting
- \ifchapterpage
- \ifodd\pageno\the\oddchapheadline\else\the\evenchapheadline\fi
- \else
- \ifodd\pageno\the\oddheadline\else\the\evenheadline\fi
- \fi}}
-
-\footline={{\textfonts\rm\frenchspacingsetting
- \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}%
- \HEADINGShook}
-\let\HEADINGShook=\relax
-
-% Commands to set those variables.
-% For example, this is what @headings on does
-% @evenheading @thistitle|@thispage|@thischapter
-% @oddheading @thischapter|@thispage|@thistitle
-% @evenfooting @thisfile||
-% @oddfooting ||@thisfile
-
-
-\def\evenheading{\parsearg\evenheadingxxx}
-\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
-\def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
- \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
- \global\evenchapheadline=\evenheadline}
-
-\def\oddheading{\parsearg\oddheadingxxx}
-\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
-\def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
- \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}%
- \global\oddchapheadline=\oddheadline}
-
-\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
-
-\def\evenfooting{\parsearg\evenfootingxxx}
-\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
-\def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
-\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\def\oddfooting{\parsearg\oddfootingxxx}
-\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
-\def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
- \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
- %
- % Leave some space for the footline. Hopefully ok to assume
- % @evenfooting will not be used by itself.
- \global\advance\txipageheight by -12pt
- \global\advance\vsize by -12pt
-}
-
-\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
-
-% @evenheadingmarks top \thischapter <- chapter at the top of a page
-% @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
-%
-% The same set of arguments for:
-%
-% @oddheadingmarks
-% @evenfootingmarks
-% @oddfootingmarks
-% @everyheadingmarks
-% @everyfootingmarks
-
-% These define \getoddheadingmarks, \getevenheadingmarks,
-% \getoddfootingmarks, and \getevenfootingmarks, each to one of
-% \gettopheadingmarks, \getbottomheadingmarks.
-%
-\def\evenheadingmarks{\headingmarks{even}{heading}}
-\def\oddheadingmarks{\headingmarks{odd}{heading}}
-\def\evenfootingmarks{\headingmarks{even}{footing}}
-\def\oddfootingmarks{\headingmarks{odd}{footing}}
-\parseargdef\everyheadingmarks{\headingmarks{even}{heading}{#1}
- \headingmarks{odd}{heading}{#1} }
-\parseargdef\everyfootingmarks{\headingmarks{even}{footing}{#1}
- \headingmarks{odd}{footing}{#1} }
-% #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
-\def\headingmarks#1#2#3 {%
- \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
- \global\expandafter\let\csname get#1#2marks\endcsname \temp
-}
-
-\everyheadingmarks bottom
-\everyfootingmarks bottom
-
-% @headings double turns headings on for double-sided printing.
-% @headings single turns headings on for single-sided printing.
-% @headings off turns them off.
-% @headings on same as @headings double, retained for compatibility.
-% @headings after turns on double-sided headings after this page.
-% @headings doubleafter turns on double-sided headings after this page.
-% @headings singleafter turns on single-sided headings after this page.
-% By default, they are off at the start of a document,
-% and turned `on' after @end titlepage.
-
-\parseargdef\headings{\csname HEADINGS#1\endcsname}
-
-\def\headingsoff{% non-global headings elimination
- \evenheadline={\hfil}\evenfootline={\hfil}\evenchapheadline={\hfil}%
- \oddheadline={\hfil}\oddfootline={\hfil}\oddchapheadline={\hfil}%
-}
-
-\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
-
-% Set the page number to 1.
-\def\pageone{
- \global\pageno=1
- \global\arabiccount = \pagecount
-}
-
-\let\contentsalignmacro = \chappager
-
-% \def\HEADINGSon{\HEADINGSdouble} % defined by \CHAPPAGon
-
-% For double-sided printing, put current file name in lower left corner,
-% chapter name on inside top of right hand pages, document
-% title on inside top of left hand pages, and page numbers on outside top
-% edge of all pages.
-\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdouble}
-\let\HEADINGSdoubleafter=\HEADINGSafter
-\def\HEADINGSdouble{%
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\folio\hfil\thistitle}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\evenchapheadline={\line{\folio\hfil\thistitle}}
-\global\oddchapheadline={\line{\hfil\folio}}
-\global\let\contentsalignmacro = \chapoddpage
-}
-
-% For single-sided printing, chapter title goes across top left of page,
-% page number on top right.
-\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsingle}
-\def\HEADINGSsingle{%
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\thischapter\hfil\folio}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\evenchapheadline={\line{\hfil\folio}}
-\global\oddchapheadline={\line{\hfil\folio}}
-\global\let\contentsalignmacro = \chappager
-}
-
-% for @setchapternewpage off
-\def\HEADINGSsinglechapoff{%
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\thischapter\hfil\folio}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\evenchapheadline=\evenheadline
-\global\oddchapheadline=\oddheadline
-\global\let\contentsalignmacro = \chappager
-}
-
-% Subroutines used in generating headings
-% This produces Day Month Year style of output.
-% Only define if not already defined, in case a txi-??.tex file has set
-% up a different format (e.g., txi-cs.tex does this).
-\ifx\today\thisisundefined
-\def\today{%
- \number\day\space
- \ifcase\month
- \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
- \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
- \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
- \fi
- \space\number\year}
-\fi
-
-% @settitle line... specifies the title of the document, for headings.
-% It generates no output of its own.
-\def\thistitle{\putwordNoTitle}
-\def\settitle{\parsearg{\gdef\thistitle}}
-
-
-\message{tables,}
-% Tables -- @table, @ftable, @vtable, @item(x).
-
-% default indentation of table text
-\newdimen\tableindent \tableindent=.8in
-% default indentation of @itemize and @enumerate text
-\newdimen\itemindent \itemindent=.3in
-% margin between end of table item and start of table text.
-\newdimen\itemmargin \itemmargin=.1in
-
-% used internally for \itemindent minus \itemmargin
-\newdimen\itemmax
-
-% Note @table, @ftable, and @vtable define @item, @itemx, etc., with
-% these defs.
-% They also define \itemindex
-% to index the item name in whatever manner is desired (perhaps none).
-
-\newif\ifitemxneedsnegativevskip
-
-\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
-
-\def\internalBitem{\smallbreak \parsearg\itemzzz}
-\def\internalBitemx{\itemxpar \parsearg\itemzzz}
-
-\def\itemzzz #1{\begingroup %
- \advance\hsize by -\rightskip
- \advance\hsize by -\tableindent
- \setbox0=\hbox{\itemindicate{#1}}%
- \itemindex{#1}%
- \nobreak % This prevents a break before @itemx.
- %
- % If the item text does not fit in the space we have, put it on a line
- % by itself, and do not allow a page break either before or after that
- % line. We do not start a paragraph here because then if the next
- % command is, e.g., @kindex, the whatsit would get put into the
- % horizontal list on a line by itself, resulting in extra blank space.
- \ifdim \wd0>\itemmax
- %
- % Make this a paragraph so we get the \parskip glue and wrapping,
- % but leave it ragged-right.
- \begingroup
- \advance\leftskip by-\tableindent
- \advance\hsize by\tableindent
- \advance\rightskip by0pt plus1fil\relax
- \leavevmode\unhbox0\par
- \endgroup
- %
- % We're going to be starting a paragraph, but we don't want the
- % \parskip glue -- logically it's part of the @item we just started.
- \nobreak \vskip-\parskip
- %
- % Stop a page break at the \parskip glue coming up. However, if
- % what follows is an environment such as @example, there will be no
- % \parskip glue; then the negative vskip we just inserted would
- % cause the example and the item to crash together. So we use this
- % bizarre value of 10001 as a signal to \aboveenvbreak to insert
- % \parskip glue after all. Section titles are handled this way also.
- %
- \penalty 10001
- \endgroup
- \itemxneedsnegativevskipfalse
- \else
- % The item text fits into the space. Start a paragraph, so that the
- % following text (if any) will end up on the same line.
- \noindent
- % Do this with kerns and \unhbox so that if there is a footnote in
- % the item text, it can migrate to the main vertical list and
- % eventually be printed.
- \nobreak\kern-\tableindent
- \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
- \unhbox0
- \nobreak\kern\dimen0
- \endgroup
- \itemxneedsnegativevskiptrue
- \fi
-}
-
-\def\item{\errmessage{@item while not in a list environment}}
-\def\itemx{\errmessage{@itemx while not in a list environment}}
-
-% @table, @ftable, @vtable.
-\envdef\table{%
- \let\itemindex\gobble
- \tablecheck{table}%
-}
-\envdef\ftable{%
- \def\itemindex ##1{\doind {fn}{\code{##1}}}%
- \tablecheck{ftable}%
-}
-\envdef\vtable{%
- \def\itemindex ##1{\doind {vr}{\code{##1}}}%
- \tablecheck{vtable}%
-}
-\def\tablecheck#1{%
- \ifnum \the\catcode`\^^M=\active
- \endgroup
- \errmessage{This command won't work in this context; perhaps the problem is
- that we are \inenvironment\thisenv}%
- \def\next{\doignore{#1}}%
- \else
- \let\next\tablex
- \fi
- \next
-}
-\def\tablex#1{%
- \def\itemindicate{#1}%
- \parsearg\tabley
-}
-\def\tabley#1{%
- {%
- \makevalueexpandable
- \edef\temp{\noexpand\tablez #1\space\space\space}%
- \expandafter
- }\temp \endtablez
-}
-\def\tablez #1 #2 #3 #4\endtablez{%
- \aboveenvbreak
- \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
- \ifnum 0#2>0 \tableindent=#2\mil \fi
- \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
- \itemmax=\tableindent
- \advance \itemmax by -\itemmargin
- \advance \leftskip by \tableindent
- \exdentamount=\tableindent
- \parindent = 0pt
- \parskip = \smallskipamount
- \ifdim \parskip=0pt \parskip=2pt \fi
- \let\item = \internalBitem
- \let\itemx = \internalBitemx
-}
-\def\Etable{\endgraf\afterenvbreak}
-\let\Eftable\Etable
-\let\Evtable\Etable
-\let\Eitemize\Etable
-\let\Eenumerate\Etable
-
-% This is the counter used by @enumerate, which is really @itemize
-
-\newcount \itemno
-
-\envdef\itemize{\parsearg\doitemize}
-
-\def\doitemize#1{%
- \aboveenvbreak
- \itemmax=\itemindent
- \advance\itemmax by -\itemmargin
- \advance\leftskip by \itemindent
- \exdentamount=\itemindent
- \parindent=0pt
- \parskip=\smallskipamount
- \ifdim\parskip=0pt \parskip=2pt \fi
- %
- % Try typesetting the item mark so that if the document erroneously says
- % something like @itemize @samp (intending @table), there's an error
- % right away at the @itemize. It's not the best error message in the
- % world, but it's better than leaving it to the @item. This means if
- % the user wants an empty mark, they have to say @w{} not just @w.
- \def\itemcontents{#1}%
- \setbox0 = \hbox{\itemcontents}%
- %
- % @itemize with no arg is equivalent to @itemize @bullet.
- \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
- %
- \let\item=\itemizeitem
-}
-
-% Definition of @item while inside @itemize and @enumerate.
-%
-\def\itemizeitem{%
- \advance\itemno by 1 % for enumerations
- {\let\par=\endgraf \smallbreak}% reasonable place to break
- {%
- % If the document has an @itemize directly after a section title, a
- % \nobreak will be last on the list, and \sectionheading will have
- % done a \vskip-\parskip. In that case, we don't want to zero
- % parskip, or the item text will crash with the heading. On the
- % other hand, when there is normal text preceding the item (as there
- % usually is), we do want to zero parskip, or there would be too much
- % space. In that case, we won't have a \nobreak before. At least
- % that's the theory.
- \ifnum\lastpenalty<10000 \parskip=0in \fi
- \noindent
- \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
- %
- \ifinner\else
- \vadjust{\penalty 1200}% not good to break after first line of item.
- \fi
- % We can be in inner vertical mode in a footnote, although an
- % @itemize looks awful there.
- }%
- \flushcr
-}
-
-% \splitoff TOKENS\endmark defines \first to be the first token in
-% TOKENS, and \rest to be the remainder.
-%
-\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
-
-% Allow an optional argument of an uppercase letter, lowercase letter,
-% or number, to specify the first label in the enumerated list. No
-% argument is the same as `1'.
-%
-\envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
-\def\enumeratey #1 #2\endenumeratey{%
- % If we were given no argument, pretend we were given `1'.
- \def\thearg{#1}%
- \ifx\thearg\empty \def\thearg{1}\fi
- %
- % Detect if the argument is a single token. If so, it might be a
- % letter. Otherwise, the only valid thing it can be is a number.
- % (We will always have one token, because of the test we just made.
- % This is a good thing, since \splitoff doesn't work given nothing at
- % all -- the first parameter is undelimited.)
- \expandafter\splitoff\thearg\endmark
- \ifx\rest\empty
- % Only one token in the argument. It could still be anything.
- % A ``lowercase letter'' is one whose \lccode is nonzero.
- % An ``uppercase letter'' is one whose \lccode is both nonzero, and
- % not equal to itself.
- % Otherwise, we assume it's a number.
- %
- % We need the \relax at the end of the \ifnum lines to stop TeX from
- % continuing to look for a <number>.
- %
- \ifnum\lccode\expandafter`\thearg=0\relax
- \numericenumerate % a number (we hope)
- \else
- % It's a letter.
- \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
- \lowercaseenumerate % lowercase letter
- \else
- \uppercaseenumerate % uppercase letter
- \fi
- \fi
- \else
- % Multiple tokens in the argument. We hope it's a number.
- \numericenumerate
- \fi
-}
-
-% An @enumerate whose labels are integers. The starting integer is
-% given in \thearg.
-%
-\def\numericenumerate{%
- \itemno = \thearg
- \startenumeration{\the\itemno}%
-}
-
-% The starting (lowercase) letter is in \thearg.
-\def\lowercaseenumerate{%
- \itemno = \expandafter`\thearg
- \startenumeration{%
- % Be sure we're not beyond the end of the alphabet.
- \ifnum\itemno=0
- \errmessage{No more lowercase letters in @enumerate; get a bigger
- alphabet}%
- \fi
- \char\lccode\itemno
- }%
-}
-
-% The starting (uppercase) letter is in \thearg.
-\def\uppercaseenumerate{%
- \itemno = \expandafter`\thearg
- \startenumeration{%
- % Be sure we're not beyond the end of the alphabet.
- \ifnum\itemno=0
- \errmessage{No more uppercase letters in @enumerate; get a bigger
- alphabet}
- \fi
- \char\uccode\itemno
- }%
-}
-
-% Call \doitemize, adding a period to the first argument and supplying the
-% common last two arguments. Also subtract one from the initial value in
-% \itemno, since @item increments \itemno.
-%
-\def\startenumeration#1{%
- \advance\itemno by -1
- \doitemize{#1.}\flushcr
-}
-
-
-% @multitable macros
-
-% Macros used to set up halign preamble:
-%
-\let\endsetuptable\relax
-\def\xendsetuptable{\endsetuptable}
-\let\columnfractions\relax
-\def\xcolumnfractions{\columnfractions}
-\newif\ifsetpercent
-
-% #1 is the @columnfraction, usually a decimal number like .5, but might
-% be just 1. We just use it, whatever it is.
-%
-\def\pickupwholefraction#1 {%
- \global\advance\colcount by 1
- \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
- \setuptable
-}
-
-\newcount\colcount
-\def\setuptable#1{%
- \def\firstarg{#1}%
- \ifx\firstarg\xendsetuptable
- \let\go = \relax
- \else
- \ifx\firstarg\xcolumnfractions
- \global\setpercenttrue
- \else
- \ifsetpercent
- \let\go\pickupwholefraction
- \else
- \global\advance\colcount by 1
- \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
- % separator; typically that is always in the input, anyway.
- \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
- \fi
- \fi
- \ifx\go\pickupwholefraction
- % Put the argument back for the \pickupwholefraction call, so
- % we'll always have a period there to be parsed.
- \def\go{\pickupwholefraction#1}%
- \else
- \let\go = \setuptable
- \fi%
- \fi
- \go
-}
-
-% @headitem starts a heading row, which we typeset in bold. Assignments
-% have to be global since we are inside the implicit group of an
-% alignment entry. \everycr below resets \everytab so we don't have to
-% undo it ourselves.
-\def\headitemfont{\b}% for people to use in the template row; not changeable
-\def\headitem{%
- \crcr % must appear first
- \gdef\headitemcrhook{\nobreak}% attempt to avoid page break after headings
- \global\everytab={\bf}% can't use \headitemfont since the parsing differs
- \the\everytab % for the first item
-}%
-%
-% default for tables with no headings.
-\let\headitemcrhook=\relax
-%
-\def\tab{\checkenv\multitable &\the\everytab}%
-
-\newtoks\everytab % insert after every tab.
-%
-\envdef\multitable{%
- \vskip\parskip
- \startsavinginserts
- %
- % @item within a multitable starts a normal row.
- % We use \def instead of \let so that if one of the multitable entries
- % contains an @itemize, we don't choke on the \item (seen as \crcr aka
- % \endtemplate) expanding \doitemize.
- \def\item{\crcr}%
- %
- \tolerance=9500
- \hbadness=9500
- \parskip=0pt
- \parindent=6pt
- \overfullrule=0pt
- \global\colcount=0
- %
- \everycr = {%
- \noalign{%
- \global\everytab={}% Reset from possible headitem.
- \global\colcount=0 % Reset the column counter.
- %
- % Check for saved footnotes, etc.:
- \checkinserts
- %
- % Perhaps a \nobreak, then reset:
- \headitemcrhook
- \global\let\headitemcrhook=\relax
- }%
- }%
- %
- \parsearg\domultitable
-}
-\def\domultitable#1{%
- % To parse everything between @multitable and @item:
- \setuptable#1 \endsetuptable
- %
- % This preamble sets up a generic column definition, which will
- % be used as many times as user calls for columns.
- % \vtop will set a single line and will also let text wrap and
- % continue for many paragraphs if desired.
- \halign\bgroup &%
- \global\advance\colcount by 1
- \strut
- \vtop{%
- \advance\hsize by -1\leftskip
- % Find the correct column width
- \hsize=\expandafter\csname col\the\colcount\endcsname
- %
- \advance\rightskip by -1\rightskip % Zero leaving only any stretch
- \ifnum\colcount=1
- \advance\hsize by\leftskip % Add indent of surrounding text
- \else
- % In order to keep entries from bumping into each other.
- \leftskip=12pt
- \ifsetpercent \else
- % If a template has been used
- \advance\hsize by \leftskip
- \fi
- \fi
- \noindent\ignorespaces##\unskip\strut
- }\cr
-}
-\def\Emultitable{%
- \crcr
- \egroup % end the \halign
- \global\setpercentfalse
-}
-
-
-\message{conditionals,}
-
-% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotlatex, @ifnotplaintext,
-% @ifnotxml always succeed. They currently do nothing; we don't
-% attempt to check whether the conditionals are properly nested. But we
-% have to remember that they are conditionals, so that @end doesn't
-% attempt to close an environment group.
-%
-\def\makecond#1{%
- \expandafter\let\csname #1\endcsname = \relax
- \expandafter\let\csname iscond.#1\endcsname = 1
-}
-\makecond{iftex}
-\makecond{ifnotdocbook}
-\makecond{ifnothtml}
-\makecond{ifnotinfo}
-\makecond{ifnotlatex}
-\makecond{ifnotplaintext}
-\makecond{ifnotxml}
-
-% Ignore @ignore, @ifhtml, @ifinfo, and the like.
-%
-\def\direntry{\doignore{direntry}}
-\def\documentdescription{\doignore{documentdescription}}
-\def\docbook{\doignore{docbook}}
-\def\html{\doignore{html}}
-\def\ifdocbook{\doignore{ifdocbook}}
-\def\ifhtml{\doignore{ifhtml}}
-\def\ifinfo{\doignore{ifinfo}}
-\def\iflatex{\doignore{iflatex}}
-\def\ifnottex{\doignore{ifnottex}}
-\def\ifplaintext{\doignore{ifplaintext}}
-\def\ifxml{\doignore{ifxml}}
-\def\ignore{\doignore{ignore}}
-\def\latex{\doignore{latex}}
-\def\menu{\doignore{menu}}
-\def\xml{\doignore{xml}}
-
-% Ignore text until a line `@end #1', keeping track of nested conditionals.
-%
-% A count to remember the depth of nesting.
-\newcount\doignorecount
-
-\def\doignore#1{\begingroup
- % Scan in ``verbatim'' mode:
- \obeylines
- \catcode`\@ = \other
- \catcode`\{ = \other
- \catcode`\} = \other
- %
- % Make sure that spaces turn into tokens that match what \doignoretext wants.
- \spaceisspace
- %
- % Count number of #1's that we've seen.
- \doignorecount = 0
- %
- % Swallow text until we reach the matching `@end #1'.
- \dodoignore{#1}%
-}
-
-{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
- \obeylines %
- %
- \gdef\dodoignore#1{%
- % #1 contains the command name as a string, e.g., `ifinfo'.
- %
- % Define a command to find the next `@end #1'.
- \long\def\doignoretext##1^^M@end #1{%
- \doignoretextyyy##1^^M@#1\_STOP_}%
- %
- % And this command to find another #1 command, at the beginning of a
- % line. (Otherwise, we would consider a line `@c @ifset', for
- % example, to count as an @ifset for nesting.)
- \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
- %
- % And now expand that command.
- \doignoretext ^^M%
- }%
-}
-
-\def\doignoreyyy#1{%
- \def\temp{#1}%
- \ifx\temp\empty % Nothing found.
- \let\next\doignoretextzzz
- \else % Found a nested condition, ...
- \advance\doignorecount by 1
- \let\next\doignoretextyyy % ..., look for another.
- % If we're here, #1 ends with ^^M\ifinfo (for example).
- \fi
- \next #1% the token \_STOP_ is present just after this macro.
-}
-
-% We have to swallow the remaining "\_STOP_".
-%
-\def\doignoretextzzz#1{%
- \ifnum\doignorecount = 0 % We have just found the outermost @end.
- \let\next\enddoignore
- \else % Still inside a nested condition.
- \advance\doignorecount by -1
- \let\next\doignoretext % Look for the next @end.
- \fi
- \next
-}
-
-% Finish off ignored text.
-{ \obeylines%
- % Ignore anything after the last `@end #1'; this matters in verbatim
- % environments, where otherwise the newline after an ignored conditional
- % would result in a blank line in the output.
- \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
-}
-
-
-% @set VAR sets the variable VAR to an empty value.
-% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
-%
-% Since we want to separate VAR from REST-OF-LINE (which might be
-% empty), we can't just use \parsearg; we have to insert a space of our
-% own to delimit the rest of the line, and then take it out again if we
-% didn't need it.
-% We rely on the fact that \parsearg sets \catcode`\ =10.
-%
-\parseargdef\set{\setyyy#1 \endsetyyy}
-\def\setyyy#1 #2\endsetyyy{%
- {%
- \makevalueexpandable
- \def\temp{#2}%
- \edef\next{\gdef\makecsname{SET#1}}%
- \ifx\temp\empty
- \next{}%
- \else
- \setzzz#2\endsetzzz
- \fi
- }%
-}
-% Remove the trailing space \setxxx inserted.
-\def\setzzz#1 \endsetzzz{\next{#1}}
-
-% @clear VAR clears (i.e., unsets) the variable VAR.
-%
-\parseargdef\clear{%
- {%
- \makevalueexpandable
- \global\expandafter\let\csname SET#1\endcsname=\relax
- }%
-}
-
-% @value{foo} gets the text saved in variable foo.
-\def\value{\begingroup\makevalueexpandable\valuexxx}
-\def\valuexxx#1{\expandablevalue{#1}\endgroup}
-{
- \catcode`\-=\active \catcode`\_=\active
- %
- \gdef\makevalueexpandable{%
- \let\value = \expandablevalue
- % We don't want these characters active, ...
- \catcode`\-=\other \catcode`\_=\other
- % ..., but we might end up with active ones in the argument if
- % we're called from @code, as @code{@value{foo-bar_}}, though.
- % So \let them to their normal equivalents.
- \let-\normaldash \let_\normalunderscore
- }
-}
-
-\def\expandablevalue#1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- {[No value for ``#1'']}%
- \message{Variable `#1', used in @value, is not set.}%
- \else
- \csname SET#1\endcsname
- \fi
-}
-
-% Like \expandablevalue, but completely expandable (the \message in the
-% definition above operates at the execution level of TeX). Used when
-% writing to auxiliary files, due to the expansion that \write does.
-% If flag is undefined, pass through an unexpanded @value command: maybe it
-% will be set by the time it is read back in.
-%
-% NB flag names containing - or _ may not work here.
-\def\dummyvalue#1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- \string\value{#1}%
- \else
- \csname SET#1\endcsname
- \fi
-}
-
-% Used for @value's in index entries to form the sort key: expand the @value
-% if possible, otherwise sort late.
-\def\indexnofontsvalue#1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- ZZZZZZZ%
- \else
- \csname SET#1\endcsname
- \fi
-}
-
-% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
-% with @set.
-%
-% To get the special treatment we need for `@end ifset,' we call
-% \makecond and then redefine.
-%
-\makecond{ifset}
-\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
-\def\doifset#1#2{%
- {%
- \makevalueexpandable
- \let\next=\empty
- \expandafter\ifx\csname SET#2\endcsname\relax
- #1% If not set, redefine \next.
- \fi
- \expandafter
- }\next
-}
-\def\ifsetfail{\doignore{ifset}}
-
-% @ifclear VAR ... @end executes the `...' iff VAR has never been
-% defined with @set, or has been undefined with @clear.
-%
-% The `\else' inside the `\doifset' parameter is a trick to reuse the
-% above code: if the variable is not set, do nothing, if it is set,
-% then redefine \next to \ifclearfail.
-%
-\makecond{ifclear}
-\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
-\def\ifclearfail{\doignore{ifclear}}
-
-% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
-% without the @) is in fact defined. We can only feasibly check at the
-% TeX level, so something like `mathcode' is going to considered
-% defined even though it is not a Texinfo command.
-%
-\makecond{ifcommanddefined}
-\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
-%
-\def\doifcmddefined#1#2{{%
- \makevalueexpandable
- \let\next=\empty
- \expandafter\ifx\csname #2\endcsname\relax
- #1% If not defined, \let\next as above.
- \fi
- \expandafter
- }\next
-}
-\def\ifcmddefinedfail{\doignore{ifcommanddefined}}
-
-% @ifcommandnotdefined CMD ... handled similar to @ifclear above.
-\makecond{ifcommandnotdefined}
-\def\ifcommandnotdefined{%
- \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
-\def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
-
-% Set the `txicommandconditionals' variable, so documents have a way to
-% test if the @ifcommand...defined conditionals are available.
-\set txicommandconditionals
-
-% @dircategory CATEGORY -- specify a category of the dir file
-% which this file should belong to. Ignore this in TeX.
-\let\dircategory=\comment
-
-% @defininfoenclose.
-\let\definfoenclose=\comment
-
-
-\message{indexing,}
-% Index generation facilities
-
-% Define \newwrite to be identical to plain tex's \newwrite
-% except not \outer, so it can be used within macros and \if's.
-\edef\newwrite{\makecsname{ptexnewwrite}}
-
-% \newindex {IX} defines an index named IX.
-% It automatically defines \IXindex such that
-% \IXindex ...rest of line... puts an entry in the index IX.
-% It also defines \IXindfile to be the number of the output channel for
-% the file that accumulates this index. The file's extension is IX.
-%
-\def\newindex#1{%
- \expandafter\chardef\csname#1indfile\endcsname=0
- \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
- \noexpand\doindex{#1}}
-}
-
-% @defindex foo == \newindex{foo}
-%
-\def\defindex{\parsearg\newindex}
-
-% Define @defcodeindex, like @defindex except put all entries in @code.
-%
-\def\defcodeindex{\parsearg\newcodeindex}
-%
-\def\newcodeindex#1{%
- \expandafter\chardef\csname#1indfile\endcsname=0
- \expandafter\xdef\csname#1index\endcsname{%
- \noexpand\docodeindex{#1}}%
-}
-
-% The default indices:
-\newindex{cp}% concepts,
-\newcodeindex{fn}% functions,
-\newcodeindex{vr}% variables,
-\newcodeindex{tp}% types,
-\newcodeindex{ky}% keys
-\newcodeindex{pg}% and programs.
-
-
-% @synindex foo bar makes index foo feed into index bar.
-% Do this instead of @defindex foo if you don't want it as a separate index.
-%
-% @syncodeindex foo bar similar, but put all entries made for index foo
-% inside @code.
-%
-\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
-\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
-
-% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
-% #3 the target index (bar).
-\def\dosynindex#1#2#3{%
- \requireopenindexfile{#3}%
- % redefine \fooindfile:
- \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
- \expandafter\let\csname#2indfile\endcsname=\temp
- % redefine \fooindex:
- \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
-}
-
-% Define \doindex, the driver for all index macros.
-% Argument #1 is generated by the calling \fooindex macro,
-% and it is the two-letter name of the index.
-
-\def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx}
-\def\doindexxxx #1{\doind{\indexname}{#1}}
-
-% like the previous two, but they put @code around the argument.
-\def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx}
-\def\docodeindexxxx #1{\docind{\indexname}{#1}}
-
-
-% \definedummyword defines \#1 as \string\#1\space, thus effectively
-% preventing its expansion. This is used only for control words,
-% not control letters, because the \space would be incorrect for
-% control characters, but is needed to separate the control word
-% from whatever follows.
-%
-% These can be used both for control words that take an argument and
-% those that do not. If it is followed by {arg} in the input, then
-% that will dutifully get written to the index (or wherever).
-%
-% For control letters, we have \definedummyletter, which omits the
-% space.
-%
-\def\definedummyword #1{\def#1{\string#1\space}}%
-\def\definedummyletter#1{\def#1{\string#1}}%
-
-% Used for the aux, toc and index files to prevent expansion of Texinfo
-% commands. Most of the commands are controlled through the
-% \ifdummies conditional.
-%
-\def\atdummies{%
- \dummiestrue
- %
- \definedummyletter\@%
- \definedummyletter\ %
- \definedummyletter\{%
- \definedummyletter\}%
- \definedummyletter\&%
- %
- \definedummyletter\_%
- \definedummyletter\-%
- %
- \definedummyword\subentry
- %
- % We want to disable all macros so that they are not expanded by \write.
- \let\commondummyword\definedummyword
- \macrolist
- \let\value\dummyvalue
- %
- \turnoffactive
-}
-
-\newif\ifdummies
-\newif\ifindexnofonts
-
-\def\commondummyletter#1{%
- \expandafter\let\csname\string#1:impl\endcsname#1%
- \edef#1{%
- \noexpand\ifindexnofonts
- % empty expansion
- \noexpand\else
- \noexpand\ifdummies\string#1%
- \noexpand\else
- \noexpand\jumptwofi % dispose of the \fi
- \expandafter\noexpand\csname\string#1:impl\endcsname
- \noexpand\fi
- \noexpand\fi}%
-}
-
-\def\commondummyaccent#1{%
- \expandafter\let\csname\string#1:impl\endcsname#1%
- \edef#1{%
- \noexpand\ifindexnofonts
- \noexpand\expandafter % dispose of \else ... \fi
- \noexpand\asis
- \noexpand\else
- \noexpand\ifdummies\string#1%
- \noexpand\else
- \noexpand\jumptwofi % dispose of the \fi
- \expandafter\noexpand\csname\string#1:impl\endcsname
- \noexpand\fi
- \noexpand\fi}%
-}
-
-% Like \commondummyaccent but add a \space at the end of the dummy expansion
-% #2 is the expansion used for \indexnofonts. #2 is always followed by
-% \asis to remove a pair of following braces.
-\def\commondummyword#1#2{%
- \expandafter\let\csname\string#1:impl\endcsname#1%
- \expandafter\def\csname\string#1:ixnf\endcsname{#2\asis}%
- \edef#1{%
- \noexpand\ifindexnofonts
- \noexpand\expandafter % dispose of \else ... \fi
- \expandafter\noexpand\csname\string#1:ixnf\endcsname
- \noexpand\else
- \noexpand\ifdummies\string#1\space
- \noexpand\else
- \noexpand\jumptwofi % dispose of the \fi \fi
- \expandafter\noexpand\csname\string#1:impl\endcsname
- \noexpand\fi
- \noexpand\fi}%
-}
-\def\jumptwofi#1\fi\fi{\fi\fi#1}
-
-% For \atdummies and \indexnofonts. \atdummies sets
-% \dummiestrue and \indexnofonts sets \indexnofontstrue.
-\def\definedummies{
- % @-sign is always an escape character when reading auxiliary files
- \escapechar = `\@
- %
- \commondummyletter\!%
- \commondummyaccent\"%
- \commondummyaccent\'%
- \commondummyletter\*%
- \commondummyaccent\,%
- \commondummyletter\.%
- \commondummyletter\/%
- \commondummyletter\:%
- \commondummyaccent\=%
- \commondummyletter\?%
- \commondummyaccent\^%
- \commondummyaccent\`%
- \commondummyaccent\~%
- %
- % Control letters and accents.
- \commondummyword\u {}%
- \commondummyword\v {}%
- \commondummyword\H {}%
- \commondummyword\dotaccent {}%
- \commondummyword\ogonek {}%
- \commondummyword\ringaccent {}%
- \commondummyword\tieaccent {}%
- \commondummyword\ubaraccent {}%
- \commondummyword\udotaccent {}%
- \commondummyword\dotless {}%
- %
- % Texinfo font commands.
- \commondummyword\b {}%
- \commondummyword\i {}%
- \commondummyword\r {}%
- \commondummyword\sansserif {}%
- \commondummyword\sc {}%
- \commondummyword\slanted {}%
- \commondummyword\t {}%
- %
- % Commands that take arguments.
- \commondummyword\abbr {}%
- \commondummyword\acronym {}%
- \commondummyword\anchor {}%
- \commondummyword\cite {}%
- \commondummyword\code {}%
- \commondummyword\command {}%
- \commondummyword\dfn {}%
- \commondummyword\dmn {}%
- \commondummyword\email {}%
- \commondummyword\emph {}%
- \commondummyword\env {}%
- \commondummyword\file {}%
- \commondummyword\image {}%
- \commondummyword\indicateurl{}%
- \commondummyword\inforef {}%
- \commondummyword\kbd {}%
- \commondummyword\key {}%
- \commondummyword\link {}%
- \commondummyword\math {}%
- \commondummyword\option {}%
- \commondummyword\pxref {}%
- \commondummyword\ref {}%
- \commondummyword\samp {}%
- \commondummyword\strong {}%
- \commondummyword\tie {}%
- \commondummyword\U {}%
- \commondummyword\uref {}%
- \commondummyword\url {}%
- \commondummyword\var {}%
- \commondummyword\verb {}%
- \commondummyword\w {}%
- \commondummyword\xref {}%
- %
- \commondummyword\AA {AA}%
- \commondummyword\AE {AE}%
- \commondummyword\DH {DZZ}%
- \commondummyword\L {L}%
- \commondummyword\O {O}%
- \commondummyword\OE {OE}%
- \commondummyword\TH {TH}%
- \commondummyword\aa {aa}%
- \commondummyword\ae {ae}%
- \commondummyword\dh {dzz}%
- \commondummyword\exclamdown {!}%
- \commondummyword\l {l}%
- \commondummyword\o {o}%
- \commondummyword\oe {oe}%
- \commondummyword\ordf {a}%
- \commondummyword\ordm {o}%
- \commondummyword\questiondown {?}%
- \commondummyword\ss {ss}%
- \commondummyword\th {th}%
- %
- \commondummyword\LaTeX {LaTeX}%
- \commondummyword\TeX {TeX}%
- %
- % Assorted special characters.
- \commondummyword\ampchar {\normalamp}%
- \commondummyword\atchar {\@}%
- \commondummyword\arrow {->}%
- \commondummyword\backslashchar {\realbackslash}%
- \commondummyword\bullet {bullet}%
- \commondummyword\comma {,}%
- \commondummyword\copyright {copyright}%
- \commondummyword\dots {...}%
- \commondummyword\enddots {...}%
- \commondummyword\entrybreak {}%
- \commondummyword\equiv {===}%
- \commondummyword\error {error}%
- \commondummyword\euro {euro}%
- \commondummyword\expansion {==>}%
- \commondummyword\geq {>=}%
- \commondummyword\guillemetleft {<<}%
- \commondummyword\guillemetright {>>}%
- \commondummyword\guilsinglleft {<}%
- \commondummyword\guilsinglright {>}%
- \commondummyword\lbracechar {\{}%
- \commondummyword\leq {<=}%
- \commondummyword\mathopsup {sup}%
- \commondummyword\minus {-}%
- \commondummyword\pounds {pounds}%
- \commondummyword\point {.}%
- \commondummyword\print {-|}%
- \commondummyword\quotedblbase {"}%
- \commondummyword\quotedblleft {"}%
- \commondummyword\quotedblright {"}%
- \commondummyword\quoteleft {`}%
- \commondummyword\quoteright {'}%
- \commondummyword\quotesinglbase {,}%
- \commondummyword\rbracechar {\}}%
- \commondummyword\registeredsymbol {R}%
- \commondummyword\result {=>}%
- \commondummyword\sub {}%
- \commondummyword\sup {}%
- \commondummyword\textdegree {o}%
-}
-
-\let\indexlbrace\relax
-\let\indexrbrace\relax
-\let\indexatchar\relax
-\let\indexbackslash\relax
-
-{\catcode`\@=0
-\catcode`\\=13
- @gdef@backslashdisappear{@def\{}}
-}
-
-{
-\catcode`\<=13
-\catcode`\-=13
-\catcode`\`=13
- \gdef\indexnonalnumdisappear{%
- \ifflagclear{txiindexlquoteignore}{}{%
- % @set txiindexlquoteignore makes us ignore left quotes in the sort term.
- % (Introduced for FSFS 2nd ed.)
- \let`=\empty
- }%
- %
- \ifflagclear{txiindexbackslashignore}{}{%
- \backslashdisappear
- }%
- \ifflagclear{txiindexhyphenignore}{}{%
- \def-{}%
- }%
- \ifflagclear{txiindexlessthanignore}{}{%
- \def<{}%
- }%
- \ifflagclear{txiindexatsignignore}{}{%
- \def\@{}%
- }%
- }
-
- \gdef\indexnonalnumreappear{%
- \let-\normaldash
- \let<\normalless
- }
-}
-
-
-% \indexnofonts is used when outputting the strings to sort the index
-% by, and when constructing control sequence names. It eliminates all
-% control sequences and just writes whatever the best ASCII sort string
-% would be for a given command (usually its argument).
-%
-\def\indexnofonts{%
- \indexnofontstrue
- %
- \def\ { }%
- \def\@{@}%
- \def\_{\normalunderscore}%
- \def\-{}% @- shouldn't affect sorting
- %
- \uccode`\1=`\{ \uppercase{\def\{{1}}%
- \uccode`\1=`\} \uppercase{\def\}{1}}%
- \def\lbracechar##1{\{}%
- \def\rbracechar##1{\}}%
- %
- %
- % We need to get rid of all macros, leaving only the arguments (if present).
- % Of course this is not nearly correct, but it is the best we can do for now.
- %
- % Since macro invocations are followed by braces, we can just redefine them
- % to take a single TeX argument. The case of a macro invocation that
- % goes to end-of-line is not handled.
- %
- \def\commondummyword##1{\let##1\asis}%
- \macrolist
- \let\value\indexnofontsvalue
-}
-
-
-
-
-% #1 is the index name, #2 is the entry text.
-\def\doind#1#2{%
- \iflinks
- {%
- %
- \requireopenindexfile{#1}%
- \edef\writeto{\csname#1indfile\endcsname}%
- %
- \def\indextext{#2}%
- \safewhatsit\doindwrite
- }%
- \fi
-}
-
-% Same as \doind, but for code indices
-\def\docind#1#2{%
- \iflinks
- {%
- %
- \requireopenindexfile{#1}%
- \edef\writeto{\csname#1indfile\endcsname}%
- %
- \def\indextext{#2}%
- \safewhatsit\docindwrite
- }%
- \fi
-}
-
-% Check if an index file has been opened, and if not, open it.
-\def\requireopenindexfile#1{%
-\ifnum\csname #1indfile\endcsname=0
- \expandafter\newwrite \csname#1indfile\endcsname
- \edef\suffix{#1}%
- % A .fls suffix would conflict with the file extension for the output
- % of -recorder, so use .f1s instead.
- \ifx\suffix\indexisfl\def\suffix{f1}\fi
- % Open the file
- \immediate\openout\csname#1indfile\endcsname \jobname.\suffix
- % Using \immediate above here prevents an object entering into the current
- % box, which could confound checks such as those in \safewhatsit for
- % preceding skips.
- \typeout{Writing index file \jobname.\suffix}%
-\fi}
-\def\indexisfl{fl}
-
-% Definition for writing index entry sort key.
-{
-\catcode`\-=13
-\gdef\indexwritesortas{%
- \begingroup
- \indexnonalnumreappear
- \indexwritesortasxxx}
-\gdef\indexwritesortasxxx#1{%
- \xdef\indexsortkey{#1}\endgroup}
-}
-
-\def\indexwriteseealso#1{
- \gdef\pagenumbertext{\string\seealso{#1}}%
-}
-\def\indexwriteseeentry#1{
- \gdef\pagenumbertext{\string\seeentry{#1}}%
-}
-
-% The default definitions
-\def\sortas#1{}%
-\def\seealso#1{\i{\putwordSeeAlso}\ #1}% for sorted index file only
-\def\putwordSeeAlso{See also}
-\def\seeentry#1{\i{\putwordSee}\ #1}% for sorted index file only
-
-
-% Given index entry text like "aaa @subentry bbb @sortas{ZZZ}":
-% * Set \bracedtext to "{aaa}{bbb}"
-% * Set \fullindexsortkey to "aaa @subentry ZZZ"
-% * If @seealso occurs, set \pagenumbertext
-%
-\def\splitindexentry#1{%
- \gdef\fullindexsortkey{}%
- \xdef\bracedtext{}%
- \def\sep{}%
- \def\seealso##1{}%
- \def\seeentry##1{}%
- \expandafter\doindexsegment#1\subentry\finish\subentry
-}
-
-% append the results from the next segment
-\def\doindexsegment#1\subentry{%
- \def\segment{#1}%
- \ifx\segment\isfinish
- \else
- %
- % Fully expand the segment, throwing away any @sortas directives, and
- % trim spaces.
- \edef\trimmed{\segment}%
- \edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
- \ifincodeindex
- \edef\trimmed{\noexpand\code{\trimmed}}%
- \fi
- %
- \xdef\bracedtext{\bracedtext{\trimmed}}%
- %
- % Get the string to sort by. Process the segment with all
- % font commands turned off.
- \bgroup
- \let\sortas\indexwritesortas
- \let\seealso\indexwriteseealso
- \let\seeentry\indexwriteseeentry
- \indexnofonts
- % The braces around the commands are recognized by texindex.
- \def\lbracechar{{\string\indexlbrace}}%
- \def\rbracechar{{\string\indexrbrace}}%
- \let\{=\lbracechar
- \let\}=\rbracechar
- \def\@{{\string\indexatchar}}%
- \def\atchar##1{\@}%
- \def\backslashchar{{\string\indexbackslash}}%
- \uccode`\~=`\\ \uppercase{\let~\backslashchar}%
- %
- \let\indexsortkey\empty
- \global\let\pagenumbertext\empty
- % Execute the segment and throw away the typeset output. This executes
- % any @sortas or @seealso commands in this segment.
- \setbox\dummybox = \hbox{\segment}%
- \ifx\indexsortkey\empty{%
- \indexnonalnumdisappear
- \xdef\trimmed{\segment}%
- \xdef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
- \xdef\indexsortkey{\trimmed}%
- \ifx\indexsortkey\empty
- \message{Empty index sort key near line \the\inputlineno}%
- \xdef\indexsortkey{ }%
- \fi
- }\fi
- %
- % Append to \fullindexsortkey.
- \edef\tmp{\gdef\noexpand\fullindexsortkey{%
- \fullindexsortkey\sep\indexsortkey}}%
- \tmp
- \egroup
- \def\sep{\subentry}%
- %
- \expandafter\doindexsegment
- \fi
-}
-\def\isfinish{\finish}%
-\newbox\dummybox % used above
-
-\let\subentry\relax
-
-% Use \ instead of @ in index files. To support old texi2dvi and texindex.
-% This works without changing the escape character used in the toc or aux
-% files because the index entries are fully expanded here, and \string uses
-% the current value of \escapechar.
-\def\escapeisbackslash{\escapechar=`\\}
-
-% Uncomment to use \ in index files by default. Old texi2dvi (before 2019)
-% didn't support @ as the escape character (as it checked for "\entry" in
-% the files, and not "@entry").
-% In the future we can remove this flag and simplify the code for
-% index files and backslashes, once the support is no longer likely to be
-% useful.
-%
-% \set txiindexescapeisbackslash
-
-% Write the entry in \indextext to the index file.
-%
-
-\newif\ifincodeindex
-\def\doindwrite{\incodeindexfalse\doindwritex}
-\def\docindwrite{\incodeindextrue\doindwritex}
-
-\def\doindwritex{%
- \maybemarginindex
- %
- \atdummies
- %
- \ifflagclear{txiindexescapeisbackslash}{}{\escapeisbackslash}%
- %
- % For texindex which always views { and } as separators.
- \def\{{\lbracechar{}}%
- \def\}{\rbracechar{}}%
- \uccode`\~=`\\ \uppercase{\def~{\backslashchar{}}}%
- %
- % Split the entry into primary entry and any subentries, and get the index
- % sort key.
- \splitindexentry\indextext
- %
- % Set up the complete index entry, with both the sort key and
- % the original text, including any font commands. We write
- % three arguments to \entry to the .?? file (four in the
- % subentry case), texindex reduces to two when writing the .??s
- % sorted result.
- %
- \edef\temp{%
- \write\writeto{%
- \string\entry{\fullindexsortkey}%
- {\ifx\pagenumbertext\empty\noexpand\folio\else\pagenumbertext\fi}%
- \bracedtext}%
- }%
- \temp
-}
-
-% Put the index entry in the margin if desired (undocumented).
-\def\maybemarginindex{%
- \ifx\SETmarginindex\relax\else
- \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \relax\indextext}}%
- \fi
-}
-\let\SETmarginindex=\relax
-
-
-% Take care of unwanted page breaks/skips around a whatsit:
-%
-% If a skip is the last thing on the list now, preserve it
-% by backing up by \lastskip, doing the \write, then inserting
-% the skip again. Otherwise, the whatsit generated by the
-% \write or \pdfdest will make \lastskip zero. The result is that
-% sequences like this:
-% @end defun
-% @tindex whatever
-% @defun ...
-% will have extra space inserted, because the \medbreak in the
-% start of the @defun won't see the skip inserted by the @end of
-% the previous defun.
-%
-% But don't do any of this if we're not in vertical mode. We
-% don't want to do a \vskip and prematurely end a paragraph.
-%
-% Avoid page breaks due to these extra skips, too.
-%
-% But wait, there is a catch there:
-% We'll have to check whether \lastskip is zero skip. \ifdim is not
-% sufficient for this purpose, as it ignores stretch and shrink parts
-% of the skip. The only way seems to be to check the textual
-% representation of the skip.
-%
-% The following is almost like \def\zeroskipmacro{0.0pt} except that
-% the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
-%
-\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
-%
-\newskip\whatsitskip
-\newcount\whatsitpenalty
-%
-% ..., ready, GO:
-%
-\def\safewhatsit#1{\ifhmode
- #1%
- \else
- % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
- \whatsitskip = \lastskip
- \edef\lastskipmacro{\the\lastskip}%
- \whatsitpenalty = \lastpenalty
- %
- % If \lastskip is nonzero, that means the last item was a
- % skip. And since a skip is discardable, that means this
- % -\whatsitskip glue we're inserting is preceded by a
- % non-discardable item, therefore it is not a potential
- % breakpoint, therefore no \nobreak needed.
- \ifx\lastskipmacro\zeroskipmacro
- \else
- \vskip-\whatsitskip
- \fi
- %
- #1%
- %
- \ifx\lastskipmacro\zeroskipmacro
- % If \lastskip was zero, perhaps the last item was a penalty, and
- % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
- % to re-insert the same penalty (values >10000 are used for various
- % signals); since we just inserted a non-discardable item, any
- % following glue (such as a \parskip) would be a breakpoint. For example:
- % @deffn deffn-whatever
- % @vindex index-whatever
- % Description.
- % would allow a break between the index-whatever whatsit
- % and the "Description." paragraph.
- \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
- \else
- % On the other hand, if we had a nonzero \lastskip,
- % this make-up glue would be preceded by a non-discardable item
- % (the whatsit from the \write), so we must insert a \nobreak.
- \nobreak\vskip\whatsitskip
- \fi
-\fi}
-
-% The index entry written in the file actually looks like
-% \entry {sortstring}{page}{topic}
-% or
-% \entry {sortstring}{page}{topic}{subtopic}
-% The texindex program reads in these files and writes files
-% containing these kinds of lines:
-% \initial {c}
-% before the first topic whose initial is c
-% \entry {topic}{pagelist}
-% for a topic that is used without subtopics
-% \primary {topic}
-% \entry {topic}{}
-% for the beginning of a topic that is used with subtopics
-% \secondary {subtopic}{pagelist}
-% for each subtopic.
-% \secondary {subtopic}{}
-% for a subtopic with sub-subtopics
-% \tertiary {subtopic}{subsubtopic}{pagelist}
-% for each sub-subtopic.
-
-% Define the user-accessible indexing commands
-% @findex, @vindex, @kindex, @cindex.
-
-\def\findex {\fnindex}
-\def\kindex {\kyindex}
-\def\cindex {\cpindex}
-\def\vindex {\vrindex}
-\def\tindex {\tpindex}
-\def\pindex {\pgindex}
-
-% Define the macros used in formatting output of the sorted index material.
-
-% @printindex causes a particular index (the ??s file) to get printed.
-% It does not print any chapter heading (usually an @unnumbered).
-%
-\parseargdef\printindex{\begingroup
- \dobreak \chapheadingskip{10000}%
- %
- \smallfonts \rm
- \tolerance = 9500
- \plainfrenchspacing
- \everypar = {}% don't want the \kern\-parindent from indentation suppression.
- \let\entry\indexentry
- \ifxetex\xetexpreauxfile\fi
- %
- % See comment in \requireopenindexfile.
- \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi
- %
- % See if the index file exists and is nonempty.
- \openin 1 \jobname.\indexname s
- \ifeof 1
- % \enddoublecolumns gets confused if there is no text in the index,
- % and it loses the chapter title and the aux file entries for the
- % index. The easiest way to prevent this problem is to make sure
- % there is some text.
- \putwordIndexNonexistent
- \typeout{No file \jobname.\indexname s.}%
- \else
- % If the index file exists but is empty, then \openin leaves \ifeof
- % false. We have to make TeX try to read something from the file, so
- % it can discover if there is anything in it.
- \read 1 to \thisline
- \ifeof 1
- \putwordIndexIsEmpty
- \else
- \expandafter\printindexzz\thisline\relax\relax\finish%
- \fi
- \fi
- \closein 1
- \ifxetex\xetexpostauxfile\fi
-\endgroup}
-
-% Checked in @bye
-\let\byeerror\relax
-
-% If the index file starts with a backslash, forgo reading the index
-% file altogether. If somebody upgrades texinfo.tex they may still have
-% old index files using \ as the escape character. Reading this would
-% at best lead to typesetting garbage, at worst a TeX syntax error.
-\def\printindexzz#1#2\finish{%
- \ifflagclear{txiindexescapeisbackslash}{%
- \uccode`\~=`\\ \uppercase{\if\noexpand~}\noexpand#1
- \ifflagclear{txiskipindexfileswithbackslash}{%
- % Delay the error message until the very end to give a chance
- % for the whole index to be output as input for texindex.
- \global\def\byeerror{%
-ERROR: A sorted index file in an obsolete format was skipped.
-To fix this problem, please upgrade your version of 'texi2dvi'
-or 'texi2pdf' to that at <https://ftp.gnu.org/gnu/texinfo>.
-If you are using an old version of 'texindex' (part of the Texinfo
-distribution), you may also need to upgrade to a newer version (at least 6.0).
-You may be able to typeset the index if you run
-'texindex \jobname.\indexname' yourself.
-You could also try setting the 'txiindexescapeisbackslash' flag by
-running a command like
-'texi2dvi -t "@set txiindexescapeisbackslash" \jobname.texi'. If you do
-this, Texinfo will try to use index files in the old format.
-If you continue to have problems, deleting the index files and starting again
-might help (with 'rm \jobname.?? \jobname.??s')%
-}%
- }{%
- (Skipped sorted index file in obsolete format)
- }%
- \else
- \begindoublecolumns
- \ifxetex\xetexpreauxfile\fi
- \input \jobname.\indexname s
- \ifxetex\xetexpostauxfile\fi
- \enddoublecolumns
- \fi
- }{%
- \begindoublecolumns
- \catcode`\\=0\relax
- %
- % Make @ an escape character to give macros a chance to work. This
- % should work because we (hopefully) don't otherwise use @ in index files.
- %\catcode`\@=12\relax
- \catcode`\@=0\relax
- \ifxetex\xetexpreauxfile\fi
- \input \jobname.\indexname s
- \ifxetex\xetexpostauxfile\fi
- \enddoublecolumns
- }%
-}
-
-\def\indexentry#1#2{%
- \let\entrypagetarget\empty
- \ifpdforxetex
- % only link the index text to the page if no comma appears in the
- % list of pages, i.e. there is only one page
- \checkpagelistcomma{#2}\pagelistcomma
- \expandafter\ifcase\pagelistcomma
- \def\entrypagetarget{#2}%
- \fi
- \fi%
- \entryinternal{#1}{#2}%
-}
-
-\def\checkpagelistcomma#1#2{%
- \checkpagelistcommaxx#2#1,\finish
-}
-\def\checkpagelistcommaxx#1#2,#3\finish{%
- \def\tmp{#3}%
- \ifx\tmp\empty
- \def#1{0\relax}
- \else
- \def#1{1\relax}
- \fi
-}
-
-
-% These macros are used by the sorted index file itself.
-% Change them to control the appearance of the index.
-
-{\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13
-\catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13
-\catcode`\$=3
-\gdef\initialglyphs{%
- % special control sequences used in the index sort key
- \let\indexlbrace\{%
- \let\indexrbrace\}%
- \let\indexatchar\@%
- \def\indexbackslash{\math{\backslash}}%
- %
- % Some changes for non-alphabetic characters. Using the glyphs from the
- % math fonts looks more consistent than the typewriter font used elsewhere
- % for these characters.
- \uccode`\~=`\\ \uppercase{\def~{\math{\backslash}}}
- %
- % In case @\ is used for backslash
- \uppercase{\let\\=~}
- % Can't get bold backslash so don't use bold forward slash
- \catcode`\/=13
- \def/{{\secrmnotbold \normalslash}}%
- \def-{{\normaldash\normaldash}}% en dash `--'
- \def^{{\chapbf \normalcaret}}%
- \def~{{\chapbf \normaltilde}}%
- \def\_{%
- \leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }%
- \def|{$\vert$}%
- \def<{$\less$}%
- \def>{$\gtr$}%
- \def+{$\normalplus$}%
-}}
-
-\def\initial{%
- \bgroup
- \initialx
-}
-
-\def\initialx#1{%
- % Remove any glue we may have, we'll be inserting our own.
- \removelastskip
- %
- % We like breaks before the index initials, so insert a bonus.
- % The glue before the bonus allows a little bit of space at the
- % bottom of a column to reduce an increase in inter-line spacing.
- \nobreak
- \vskip 0pt plus 5\baselineskip
- \penalty -300
- \vskip 0pt plus -5\baselineskip
- %
- % Typeset the initial. Making this add up to a whole number of
- % baselineskips increases the chance of the dots lining up from column
- % to column. It still won't often be perfect, because of the stretch
- % we need before each entry, but it's better.
- %
- % No shrink because it confuses \balancecolumns.
- \vskip 1.67\baselineskip plus 1\baselineskip
- \doindexinitialentry{#1}%
- \initialglyphs
- \leftline{%
- \secfonts \kern-0.05em \secbf #1}%
- % \secfonts is inside the argument of \leftline so that the change of
- % \baselineskip will not affect any glue inserted before the vbox that
- % \leftline creates.
- % Do our best not to break after the initial.
- \nobreak
- \vskip .33\baselineskip plus .1\baselineskip
- \egroup % \initialglyphs
-}
-
-\def\doindexinitialentry#1{%
- \ifpdforxetex
- \global\advance\idxinitialno by 1
- \def\indexlbrace{\{}%
- \def\indexrbrace{\}}%
- \def\indexbackslash{\realbackslash}%
- \def\indexatchar{\@}%
- \writetocentry{idxinitial}{\asis #1}{IDX\the\idxinitialno}%
- % The @asis removes a pair of braces around e.g. {@indexatchar} that
- % are output by texindex.
- %
- \pdfmkdest{idx.\asis #1.IDX\the\idxinitialno}%
- \fi
-}
-
-% No listing in TOC
-\def\idxinitialentry#1#2#3#4{}
-
-% For index initials.
-\newcount\idxinitialno \idxinitialno=1
-
-
-\newdimen\entryrightmargin
-\entryrightmargin=0pt
-
-% amount to indent subsequent lines in an entry when it spans more than
-% one line.
-\newdimen\entrycontskip
-\entrycontskip=1em
-
-% for PDF output, whether to make the text of the entry a link to the section.
-% set for @contents and @shortcontents.
-\newif\iflinkentrytext
-
-% \entryinternal typesets a paragraph consisting of the text (#1), dot
-% leaders, and then page number (#2) flushed to the right margin. It is
-% used for index and table of contents entries. The paragraph is indented
-% by \leftskip.
-% For PDF output, if \linkentrytexttrue and \tocnodetarget is set, link text
-% to the referenced node. Else if \entrypagetarget is set, link text to the
-% page.
-\def\entryinternal{%
- \begingroup
- %
- % Start a new paragraph if necessary, so our assignments below can't
- % affect previous text.
- \par
- %
- % No extra space above this paragraph.
- \parskip = 0in
- %
- % When reading the text of entry, convert explicit line breaks
- % from @* into spaces. The user might give these in long section
- % titles, for instance.
- \def\*{\unskip\space\ignorespaces}%
- \def\entrybreak{\hfil\break}% An undocumented command
- %
- % Swallow the left brace of the text (first parameter):
- \afterassignment\doentry
- \let\temp =
-}
-\def\entrybreak{\unskip\space\ignorespaces}%
-\def\doentry{%
- % Save the text of the entry in \boxA
- \global\setbox\boxA=\hbox\bgroup
- \bgroup % Instead of the swallowed brace.
- \noindent
- \aftergroup\finishentry
- % And now comes the text of the entry.
- % Not absorbing as a macro argument reduces the chance of problems
- % with catcodes occurring.
-}
-{\catcode`\@=11
-% #1 is the page number
-\gdef\finishentry#1{%
- \egroup % end \boxA
- \dimen@ = \wd\boxA % Length of text of entry
- % add any leaders and page number to \boxA.
- \global\setbox\boxA=\hbox\bgroup
- \ifpdforxetex
- \iflinkentrytext
- \ifx\tocnodetarget\empty
- \unhbox\boxA
- \else
- \startxreflink{\tocnodetarget}{}%
- \unhbox\boxA
- \endlink
- \fi
- \else
- \ifx\entrypagetarget\empty
- \unhbox\boxA
- \else
- \pdflinkpage{\entrypagetarget}{\unhbox\boxA}%
- \fi
- \fi
- \else
- \unhbox\boxA
- \fi
- %
- % Get the width of the page numbers, and only use
- % leaders if they are present.
- \global\setbox\boxB = \hbox{#1}%
- \ifdim\wd\boxB = 0pt
- \null\nobreak\hfill\ %
- \else
- %
- \null\nobreak\indexdotfill % Have leaders before the page number.
- %
- \hskip\skip\thinshrinkable
- \ifpdforxetex
- \ifx\tocnodetarget\empty
- \pdfgettoks#1.%
- \the\toksA
- \else
- % Should just be a single page number in toc
- \startxreflink{\tocnodetarget}{}%
- #1\endlink
- \fi
- \else
- #1%
- \fi
- \fi
- \egroup % end \boxA
- %
- % now output
- \ifdim\wd\boxB = 0pt
- \noindent\unhbox\boxA\par
- \nobreak
- \else\bgroup
- % We want the text of the entries to be aligned to the left, and the
- % page numbers to be aligned to the right.
- %
- \parindent = 0pt
- \advance\leftskip by 0pt plus 1fil
- \advance\leftskip by 0pt plus -1fill
- \rightskip = 0pt plus -1fil
- \advance\rightskip by 0pt plus 1fill
- % Cause last line, which could consist of page numbers on their own
- % if the list of page numbers is long, to be aligned to the right.
- \parfillskip=0pt plus -1fill
- %
- \advance\rightskip by \entryrightmargin
- %
- \dimen@ii = \hsize
- \advance\dimen@ii by -1\leftskip
- \advance\dimen@ii by -1\entryrightmargin
- \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line
- \ifdim\dimen@ > 0.8\dimen@ii % due to long index text
- \advance\leftskip by 0pt plus 1fill % ragged right
- %
- % Indent all lines but the first one.
- \advance\leftskip by \entrycontskip
- \advance\parindent by -\entrycontskip
- \fi\fi
- \indent % start paragraph
- \unhbox\boxA
- %
- % Do not prefer a separate line ending with a hyphen to fewer lines.
- \finalhyphendemerits = 0
- %
- % Word spacing - no stretch
- \spaceskip=\fontdimen2\font minus \fontdimen4\font
- %
- \linepenalty=1000 % Discourage line breaks.
- \hyphenpenalty=5000 % Discourage hyphenation.
- %
- \par % format the paragraph
- \egroup % The \vbox
- \fi
- \endgroup
-}}
-
-\newskip\thinshrinkable
-\skip\thinshrinkable=.15em minus .15em
-
-% Like plain.tex's \dotfill, except uses up at least 0.5 em.
-% The filll stretch here overpowers both the fil and fill stretch to push
-% the page number to the right.
-\def\indexdotfill{\cleaders
- \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 0.5em plus 1filll}
-
-\def\primary #1{\line{#1\hfil}}
-
-\def\secondary{\indententry{0.5cm}}
-\def\tertiary{\indententry{1cm}}
-
-\def\indententry#1#2#3{%
- \bgroup
- \leftskip=#1
- \entry{#2}{#3}%
- \egroup
-}
-
-% Define two-column mode, which we use to typeset indexes.
-% Adapted from the TeXbook, page 416, which is to say,
-% the manmac.tex format used to print the TeXbook itself.
-\catcode`\@=11 % private names
-
-\newbox\partialpage
-\newdimen\doublecolumnhsize
-
-\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
- % If not much space left on page, start a new page.
- \ifdim\pagetotal>0.8\vsize\vfill\eject\fi
- %
- % Grab any single-column material above us.
- \output = {%
- \savetopmark
- %
- \global\setbox\partialpage = \vbox{%
- % Unvbox the main output page.
- \unvbox\PAGE
- \kern-\topskip \kern\baselineskip
- }%
- }%
- \eject % run that output routine to set \partialpage
- %
- % Use the double-column output routine for subsequent pages.
- \output = {\doublecolumnout}%
- %
- % Change the page size parameters. We could do this once outside this
- % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
- % format, but then we repeat the same computation. Repeating a couple
- % of assignments once per index is clearly meaningless for the
- % execution time, so we may as well do it in one place.
- %
- % First we halve the line length, less a little for the gutter between
- % the columns. We compute the gutter based on the line length, so it
- % changes automatically with the paper format. The magic constant
- % below is chosen so that the gutter has the same value (well, +-<1pt)
- % as it did when we hard-coded it.
- %
- % We put the result in a separate register, \doublecolumnhsize, so we
- % can restore it in \pagesofar, after \hsize itself has (potentially)
- % been clobbered.
- %
- \doublecolumnhsize = \hsize
- \advance\doublecolumnhsize by -.04154\hsize
- \divide\doublecolumnhsize by 2
- \hsize = \doublecolumnhsize
- %
- % Get the available space for the double columns -- the normal
- % (undoubled) page height minus any material left over from the
- % previous page.
- \advance\vsize by -\ht\partialpage
- \vsize = 2\vsize
- %
- % For the benefit of balancing columns
- \advance\baselineskip by 0pt plus 0.5pt
-}
-
-% The double-column output routine for all double-column pages except
-% the last, which is done by \balancecolumns.
-%
-\def\doublecolumnout{%
- %
- \savetopmark
- \splittopskip=\topskip \splitmaxdepth=\maxdepth
- \dimen@ = \vsize
- \divide\dimen@ by 2
- %
- % box0 will be the left-hand column, box2 the right.
- \setbox0=\vsplit\PAGE to\dimen@ \setbox2=\vsplit\PAGE to\dimen@
- \global\advance\vsize by 2\ht\partialpage
- \onepageout\pagesofar % empty except for the first time we are called
- \unvbox\PAGE
- \penalty\outputpenalty
-}
-%
-% Re-output the contents of the output page -- any previous material,
-% followed by the two boxes we just split, in box0 and box2.
-\def\pagesofar{%
- \unvbox\partialpage
- %
- \hsize = \doublecolumnhsize
- \wd0=\hsize \wd2=\hsize
- \hbox to\txipagewidth{\box0\hfil\box2}%
-}
-
-
-% Finished with double columns.
-\def\enddoublecolumns{%
- % The following penalty ensures that the page builder is exercised
- % _before_ we change the output routine. This is necessary in the
- % following situation:
- %
- % The last section of the index consists only of a single entry.
- % Before this section, \pagetotal is less than \pagegoal, so no
- % break occurs before the last section starts. However, the last
- % section, consisting of \initial and the single \entry, does not
- % fit on the page and has to be broken off. Without the following
- % penalty the page builder will not be exercised until \eject
- % below, and by that time we'll already have changed the output
- % routine to the \balancecolumns version, so the next-to-last
- % double-column page will be processed with \balancecolumns, which
- % is wrong: The two columns will go to the main vertical list, with
- % the broken-off section in the recent contributions. As soon as
- % the output routine finishes, TeX starts reconsidering the page
- % break. The two columns and the broken-off section both fit on the
- % page, because the two columns now take up only half of the page
- % goal. When TeX sees \eject from below which follows the final
- % section, it invokes the new output routine that we've set after
- % \balancecolumns below; \onepageout will try to fit the two columns
- % and the final section into the vbox of \txipageheight (see
- % \pagebody), causing an overfull box.
- %
- % Note that glue won't work here, because glue does not exercise the
- % page builder, unlike penalties (see The TeXbook, pp. 280-281).
- \penalty0
- %
- \output = {%
- % Split the last of the double-column material.
- \savetopmark
- \balancecolumns
- }%
- \eject % call the \output just set
- \ifdim\pagetotal=0pt
- % Having called \balancecolumns once, we do not
- % want to call it again. Therefore, reset \output to its normal
- % definition right away.
- \global\output=\expandafter{\the\defaultoutput}
- %
- \endgroup % started in \begindoublecolumns
- % Leave the double-column material on the current page, no automatic
- % page break.
- \box\balancedcolumns
- %
- % \pagegoal was set to the doubled \vsize above, since we restarted
- % the current page. We're now back to normal single-column
- % typesetting, so reset \pagegoal to the normal \vsize.
- \global\vsize = \txipageheight %
- \pagegoal = \txipageheight %
- \else
- % We had some left-over material. This might happen when \doublecolumnout
- % is called in \balancecolumns. Try again.
- \expandafter\enddoublecolumns
- \fi
-}
-\newbox\balancedcolumns
-\setbox\balancedcolumns=\vbox{shouldnt see this}%
-%
-% Only called for the last of the double column material. \doublecolumnout
-% does the others.
-\def\balancecolumns{%
- \setbox0 = \vbox{\unvbox\PAGE}% like \box255 but more efficient, see p.120.
- \dimen@ = \ht0
- \ifdim\dimen@<7\baselineskip
- % Don't split a short final column in two.
- \setbox2=\vbox{}%
- \global\setbox\balancedcolumns=\vbox{\pagesofar}%
- \else
- % double the leading vertical space
- \advance\dimen@ by \topskip
- \advance\dimen@ by-\baselineskip
- \divide\dimen@ by 2 % target to split to
- \dimen@ii = \dimen@
- \splittopskip = \topskip
- % Loop until left column is at least as high as the right column.
- {%
- \vbadness = 10000
- \loop
- \global\setbox3 = \copy0
- \global\setbox1 = \vsplit3 to \dimen@
- \ifdim\ht1<\ht3
- \global\advance\dimen@ by 1pt
- \repeat
- }%
- % Now the left column is in box 1, and the right column in box 3.
- %
- % Check whether the left column has come out higher than the page itself.
- % (Note that we have doubled \vsize for the double columns, so
- % the actual height of the page is 0.5\vsize).
- \ifdim2\ht1>\vsize
- % It appears that we have been called upon to balance too much material.
- % Output some of it with \doublecolumnout, leaving the rest on the page.
- \setbox\PAGE=\box0
- \doublecolumnout
- \else
- % Compare the heights of the two columns.
- \ifdim4\ht1>5\ht3
- % Column heights are too different, so don't make their bottoms
- % flush with each other.
- \setbox2=\vbox to \ht1 {\unvbox3\vfill}%
- \setbox0=\vbox to \ht1 {\unvbox1\vfill}%
- \else
- % Make column bottoms flush with each other.
- \setbox2=\vbox to\ht1{\unvbox3\unskip}%
- \setbox0=\vbox to\ht1{\unvbox1\unskip}%
- \fi
- \global\setbox\balancedcolumns=\vbox{\pagesofar}%
- \fi
- \fi
- %
-}
-\catcode`\@ = \other
-
-
-\message{sectioning,}
-% Chapters, sections, etc.
-
-% Let's start with @part.
-\parseargdef\part{\partzzz{#1}}
-\def\partzzz#1{%
- \chapoddpage
- \null
- \vskip.3\vsize % move it down on the page a bit
- \begingroup
- \noindent \titlefonts\rm #1\par % the text
- \let\lastnode=\empty % no node to associate with
- \writetocentry{part}{#1}{}% but put it in the toc
- \headingsoff % no headline or footline on the part page
- % This outputs a mark at the end of the page that clears \thischapter
- % and \thissection, as is done in \startcontents.
- \let\pchapsepmacro\relax
- \chapmacro{}{Yomitfromtoc}{}%
- \chapoddpage
- \endgroup
-}
-
-% \unnumberedno is an oxymoron. But we count the unnumbered
-% sections so that we can refer to them unambiguously in the pdf
-% outlines by their "section number". We avoid collisions with chapter
-% numbers by starting them at 10000. (If a document ever has 10000
-% chapters, we're in trouble anyway, I'm sure.)
-\newcount\unnumberedno \unnumberedno = 10000
-\newcount\chapno
-\newcount\secno \secno=0
-\newcount\subsecno \subsecno=0
-\newcount\subsubsecno \subsubsecno=0
-
-% This counter is funny since it counts through charcodes of letters A, B, ...
-\newcount\appendixno \appendixno = `\@
-%
-% \def\appendixletter{\char\the\appendixno}
-% We do the following ugly conditional instead of the above simple
-% construct for the sake of pdftex, which needs the actual
-% letter in the expansion, not just typeset.
-%
-\def\appendixletter{%
- \ifnum\appendixno=`A A%
- \else\ifnum\appendixno=`B B%
- \else\ifnum\appendixno=`C C%
- \else\ifnum\appendixno=`D D%
- \else\ifnum\appendixno=`E E%
- \else\ifnum\appendixno=`F F%
- \else\ifnum\appendixno=`G G%
- \else\ifnum\appendixno=`H H%
- \else\ifnum\appendixno=`I I%
- \else\ifnum\appendixno=`J J%
- \else\ifnum\appendixno=`K K%
- \else\ifnum\appendixno=`L L%
- \else\ifnum\appendixno=`M M%
- \else\ifnum\appendixno=`N N%
- \else\ifnum\appendixno=`O O%
- \else\ifnum\appendixno=`P P%
- \else\ifnum\appendixno=`Q Q%
- \else\ifnum\appendixno=`R R%
- \else\ifnum\appendixno=`S S%
- \else\ifnum\appendixno=`T T%
- \else\ifnum\appendixno=`U U%
- \else\ifnum\appendixno=`V V%
- \else\ifnum\appendixno=`W W%
- \else\ifnum\appendixno=`X X%
- \else\ifnum\appendixno=`Y Y%
- \else\ifnum\appendixno=`Z Z%
- % The \the is necessary, despite appearances, because \appendixletter is
- % expanded while writing the .toc file. \char\appendixno is not
- % expandable, thus it is written literally, thus all appendixes come out
- % with the same letter (or @) in the toc without it.
- \else\char\the\appendixno
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
-
-% Each @chapter defines these (using marks) as the number+name, number
-% and name of the chapter. Page headings and footings can use
-% these. @section does likewise.
-\def\thischapter{}
-\def\thischapternum{}
-\def\thischaptername{}
-\def\thissection{}
-\def\thissectionnum{}
-\def\thissectionname{}
-
-\newcount\absseclevel % used to calculate proper heading level
-\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
-
-% @raisesections: treat @section as chapter, @subsection as section, etc.
-\def\raisesections{\global\advance\secbase by -1}
-
-% @lowersections: treat @chapter as section, @section as subsection, etc.
-\def\lowersections{\global\advance\secbase by 1}
-
-% we only have subsub.
-\chardef\maxseclevel = 3
-%
-% A numbered section within an unnumbered changes to unnumbered too.
-% To achieve this, remember the "biggest" unnum. sec. we are currently in:
-\chardef\unnlevel = \maxseclevel
-%
-% Trace whether the current chapter is an appendix or not:
-% \chapheadtype is "N" or "A", unnumbered chapters are ignored.
-\def\chapheadtype{N}
-
-% Choose a heading macro
-% #1 is heading type
-% #2 is heading level
-% #3 is text for heading
-\def\genhead#1#2#3{%
- % Compute the abs. sec. level:
- \absseclevel=#2
- \advance\absseclevel by \secbase
- % Make sure \absseclevel doesn't fall outside the range:
- \ifnum \absseclevel < 0
- \absseclevel = 0
- \else
- \ifnum \absseclevel > 3
- \absseclevel = 3
- \fi
- \fi
- % The heading type:
- \def\headtype{#1}%
- \if \headtype U%
- \ifnum \absseclevel < \unnlevel
- \chardef\unnlevel = \absseclevel
- \fi
- \else
- % Check for appendix sections:
- \ifnum \absseclevel = 0
- \edef\chapheadtype{\headtype}%
- \else
- \if \headtype A\if \chapheadtype N%
- \errmessage{@appendix... within a non-appendix chapter}%
- \fi\fi
- \fi
- % Check for numbered within unnumbered:
- \ifnum \absseclevel > \unnlevel
- \def\headtype{U}%
- \else
- \chardef\unnlevel = 3
- \fi
- \fi
- % Now print the heading:
- \if \headtype U%
- \ifcase\absseclevel
- \unnumberedzzz{#3}%
- \or \unnumberedseczzz{#3}%
- \or \unnumberedsubseczzz{#3}%
- \or \unnumberedsubsubseczzz{#3}%
- \fi
- \else
- \if \headtype A%
- \ifcase\absseclevel
- \appendixzzz{#3}%
- \or \appendixsectionzzz{#3}%
- \or \appendixsubseczzz{#3}%
- \or \appendixsubsubseczzz{#3}%
- \fi
- \else
- \ifcase\absseclevel
- \chapterzzz{#3}%
- \or \seczzz{#3}%
- \or \numberedsubseczzz{#3}%
- \or \numberedsubsubseczzz{#3}%
- \fi
- \fi
- \fi
- \suppressfirstparagraphindent
-}
-
-% an interface:
-\def\numhead{\genhead N}
-\def\apphead{\genhead A}
-\def\unnmhead{\genhead U}
-
-% @chapter, @appendix, @unnumbered. Increment top-level counter, reset
-% all lower-level sectioning counters to zero.
-%
-% Also set \chaplevelprefix, which we prepend to @float sequence numbers
-% (e.g., figures), q.v. By default (before any chapter), that is empty.
-\let\chaplevelprefix = \empty
-%
-\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
-\def\chapterzzz#1{%
- % section resetting is \global in case the chapter is in a group, such
- % as an @include file.
- \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
- \global\advance\chapno by 1
- %
- % Used for \float.
- \gdef\chaplevelprefix{\the\chapno.}%
- \resetallfloatnos
- %
- % \putwordChapter can contain complex things in translations.
- \toks0=\expandafter{\putwordChapter}%
- \message{\the\toks0 \space \the\chapno}%
- %
- % Write the actual heading.
- \chapmacro{#1}{Ynumbered}{\the\chapno}%
- %
- % So @section and the like are numbered underneath this chapter.
- \global\let\section = \numberedsec
- \global\let\subsection = \numberedsubsec
- \global\let\subsubsection = \numberedsubsubsec
-}
-
-\outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
-%
-\def\appendixzzz#1{%
- \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
- \global\advance\appendixno by 1
- \gdef\chaplevelprefix{\appendixletter.}%
- \resetallfloatnos
- %
- % \putwordAppendix can contain complex things in translations.
- \toks0=\expandafter{\putwordAppendix}%
- \message{\the\toks0 \space \appendixletter}%
- %
- \chapmacro{#1}{Yappendix}{\appendixletter}%
- %
- \global\let\section = \appendixsec
- \global\let\subsection = \appendixsubsec
- \global\let\subsubsection = \appendixsubsubsec
-}
-
-% normally unnmhead0 calls unnumberedzzz:
-\outer\parseargdef\unnumbered{\unnmhead0{#1}}
-\def\unnumberedzzz#1{%
- \global\advance\unnumberedno by 1
- %
- % Since an unnumbered has no number, no prefix for figures.
- \global\let\chaplevelprefix = \empty
- \resetallfloatnos
- %
- % This used to be simply \message{#1}, but TeX fully expands the
- % argument to \message. Therefore, if #1 contained @-commands, TeX
- % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
- % expanded @cite (which turns out to cause errors because \cite is meant
- % to be executed, not expanded).
- %
- % Anyway, we don't want the fully-expanded definition of @cite to appear
- % as a result of the \message, we just want `@cite' itself. We use
- % \the<toks register> to achieve this: TeX expands \the<toks> only once,
- % simply yielding the contents of <toks register>. (We also do this for
- % the toc entries.)
- \toks0 = {#1}%
- \message{(\the\toks0)}%
- %
- \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
- %
- \global\let\section = \unnumberedsec
- \global\let\subsection = \unnumberedsubsec
- \global\let\subsubsection = \unnumberedsubsubsec
-}
-
-% @centerchap is like @unnumbered, but the heading is centered.
-\outer\parseargdef\centerchap{%
- \let\centerparametersmaybe = \centerparameters
- \unnmhead0{#1}%
- \let\centerparametersmaybe = \relax
-}
-
-% @top is like @unnumbered.
-\let\top\unnumbered
-
-% Sections.
-%
-\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
-\def\seczzz#1{%
- \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
- \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
-}
-
-% normally calls appendixsectionzzz:
-\outer\parseargdef\appendixsection{\apphead1{#1}}
-\def\appendixsectionzzz#1{%
- \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
- \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
-}
-\let\appendixsec\appendixsection
-
-% normally calls unnumberedseczzz:
-\outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
-\def\unnumberedseczzz#1{%
- \global\advance\unnumberedno by 1
- \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno}%
-}
-
-% Subsections.
-%
-% normally calls numberedsubseczzz:
-\outer\parseargdef\numberedsubsec{\numhead2{#1}}
-\def\numberedsubseczzz#1{%
- \global\subsubsecno=0 \global\advance\subsecno by 1
- \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
-}
-
-% normally calls appendixsubseczzz:
-\outer\parseargdef\appendixsubsec{\apphead2{#1}}
-\def\appendixsubseczzz#1{%
- \global\subsubsecno=0 \global\advance\subsecno by 1
- \sectionheading{#1}{subsec}{Yappendix}%
- {\appendixletter.\the\secno.\the\subsecno}%
-}
-
-% normally calls unnumberedsubseczzz:
-\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
-\def\unnumberedsubseczzz#1{%
- \global\advance\unnumberedno by 1
- \sectionheading{#1}{subsec}{Ynothing}{\the\unnumberedno}%
-}
-
-% Subsubsections.
-%
-% normally numberedsubsubseczzz:
-\outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
-\def\numberedsubsubseczzz#1{%
- \global\advance\subsubsecno by 1
- \sectionheading{#1}{subsubsec}{Ynumbered}%
- {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
-}
-
-% normally appendixsubsubseczzz:
-\outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
-\def\appendixsubsubseczzz#1{%
- \global\advance\subsubsecno by 1
- \sectionheading{#1}{subsubsec}{Yappendix}%
- {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
-}
-
-% normally unnumberedsubsubseczzz:
-\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
-\def\unnumberedsubsubseczzz#1{%
- \global\advance\unnumberedno by 1
- \sectionheading{#1}{subsubsec}{Ynothing}{\the\unnumberedno}%
-}
-
-% These macros control what the section commands do, according
-% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
-% Define them by default for a numbered chapter.
-\let\section = \numberedsec
-\let\subsection = \numberedsubsec
-\let\subsubsection = \numberedsubsubsec
-
-% Define @majorheading, @heading and @subheading
-
-\def\majorheading{%
- {\advance\chapheadingskip by 10pt \chapbreak }%
- \parsearg\chapheadingzzz
-}
-
-\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
-\def\chapheadingzzz#1{%
- \vbox{\chapfonts \raggedtitlesettings #1\par}%
- \nobreak\bigskip \nobreak
- \suppressfirstparagraphindent
-}
-
-% @heading, @subheading, @subsubheading.
-\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
- \suppressfirstparagraphindent}
-\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
- \suppressfirstparagraphindent}
-\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
- \suppressfirstparagraphindent}
-
-% @xrefname - give text with printed name for linking to node and allow
-% referencing node, but do not print any heading.
-\parseargdef\xrefname{\donoderef{Yomitfromtoc}{#1}}%
-
-% These macros generate a chapter, section, etc. heading only
-% (including whitespace, linebreaking, etc. around it),
-% given all the information in convenient, parsed form.
-
-% Args are the skip and penalty (usually negative)
-\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
-
-% Parameter controlling skip before chapter headings (if needed)
-\newskip\chapheadingskip
-
-% Define plain chapter starts, and page on/off switching for it.
-\def\chapbreak{\dobreak \chapheadingskip {-4000}}
-
-% Start a new page
-\def\chappager{\par\vfill\supereject}
-
-% \chapoddpage - start on an odd page for a new chapter
-% Because \domark is called before \chapoddpage, the filler page will
-% get the headings for the next chapter, which is wrong. But we don't
-% care -- we just disable all headings on the filler page.
-\def\chapoddpage{%
- \chappager
- \ifodd\pageno \else
- \begingroup
- \headingsoff
- \null
- \chappager
- \endgroup
- \fi
-}
-
-\parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname\HEADINGSon}
-
-\def\CHAPPAGoff{%
-\global\let\contentsalignmacro = \chappager
-\global\let\pchapsepmacro=\chapbreak
-\global\def\HEADINGSon{\HEADINGSsinglechapoff}}
-
-\def\CHAPPAGon{%
-\global\let\contentsalignmacro = \chappager
-\global\let\pchapsepmacro=\chappager
-\global\def\HEADINGSon{\HEADINGSsingle}}
-
-\def\CHAPPAGodd{%
-\global\let\contentsalignmacro = \chapoddpage
-\global\let\pchapsepmacro=\chapoddpage
-\global\def\HEADINGSon{\HEADINGSdouble}}
-
-\setchapternewpage on
-
-% \chapmacro - Chapter opening.
-%
-% #1 is the text, #2 is the section type (Ynumbered, Ynothing,
-% Yappendix, Yomitfromtoc), #3 the chapter number.
-% Not used for @heading series.
-%
-% To test against our argument.
-\def\Ynothingkeyword{Ynothing}
-\def\Yappendixkeyword{Yappendix}
-\def\Yomitfromtockeyword{Yomitfromtoc}
-%
-%
-% Definitions for @thischapter. These can be overridden in translation
-% files.
-\def\thischapterAppendix{%
- \putwordAppendix{} \thischapternum: \thischaptername}
-
-\def\thischapterChapter{%
- \putwordChapter{} \thischapternum: \thischaptername}
-%
-%
-\def\chapmacro#1#2#3{%
- \expandafter\ifx\thisenv\titlepage\else
- \checkenv{}% chapters, etc., should not start inside an environment.
- \fi
- % Insert the first mark before the heading break (see notes for \domark).
- \let\prevchapterdefs=\currentchapterdefs
- \let\prevsectiondefs=\currentsectiondefs
- \gdef\currentsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
- \gdef\thissection{}}%
- %
- \def\temptype{#2}%
- \ifx\temptype\Ynothingkeyword
- \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
- \gdef\thischapter{\thischaptername}}%
- \else\ifx\temptype\Yomitfromtockeyword
- \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
- \gdef\thischapter{}}%
- \else\ifx\temptype\Yappendixkeyword
- \toks0={#1}%
- \xdef\currentchapterdefs{%
- \gdef\noexpand\thischaptername{\the\toks0}%
- \gdef\noexpand\thischapternum{\appendixletter}%
- \let\noexpand\thischapter\noexpand\thischapterAppendix
- }%
- \else
- \toks0={#1}%
- \xdef\currentchapterdefs{%
- \gdef\noexpand\thischaptername{\the\toks0}%
- \gdef\noexpand\thischapternum{\the\chapno}%
- \let\noexpand\thischapter\noexpand\thischapterChapter
- }%
- \fi\fi\fi
- %
- % Output the mark. Pass it through \safewhatsit, to take care of
- % the preceding space.
- \safewhatsit\domark
- %
- % Insert the chapter heading break.
- \pchapsepmacro
- %
- % Now the second mark, after the heading break. No break points
- % between here and the heading.
- \let\prevchapterdefs=\currentchapterdefs
- \let\prevsectiondefs=\currentsectiondefs
- \domark
- %
- {%
- \chapfonts \rm
- \let\footnote=\errfootnoteheading % give better error message
- %
- % Only insert the separating space if we have a chapter/appendix
- % number, and don't print the unnumbered ``number''.
- \ifx\temptype\Ynothingkeyword
- \setbox0 = \hbox{}%
- \def\toctype{unnchap}%
- \else\ifx\temptype\Yomitfromtockeyword
- \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
- \def\toctype{omit}%
- \else\ifx\temptype\Yappendixkeyword
- \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
- \def\toctype{app}%
- \else
- \setbox0 = \hbox{#3\enspace}%
- \def\toctype{numchap}%
- \fi\fi\fi
- %
- % Write the toc entry for this chapter. Must come before the
- % \donoderef, because we include the current node name in the toc
- % entry, and \donoderef resets it to empty.
- \writetocentry{\toctype}{#1}{#3}%
- %
- % For pdftex, we have to write out the node definition (aka, make
- % the pdfdest) after any page break, but before the actual text has
- % been typeset. If the destination for the pdf outline is after the
- % text, then jumping from the outline may wind up with the text not
- % being visible, for instance under high magnification.
- \donoderef{#2}{#1}%
- %
- % Typeset the actual heading.
- \nobreak % Avoid page breaks at the interline glue.
- \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
- \unhbox0 #1\par}%
- }%
- \nobreak\bigskip % no page break after a chapter title
- \nobreak
-}
-
-% @centerchap -- centered and unnumbered.
-\let\centerparametersmaybe = \relax
-\def\centerparameters{%
- \advance\rightskip by 3\rightskip
- \leftskip = \rightskip
- \parfillskip = 0pt
-}
-
-
-% Section titles. These macros combine the section number parts and
-% call the generic \sectionheading to do the printing.
-%
-\newskip\secheadingskip
-\def\secheadingbreak{\dobreak \secheadingskip{-1000}}
-
-% Subsection titles.
-\newskip\subsecheadingskip
-\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
-
-% Subsubsection titles.
-\def\subsubsecheadingskip{\subsecheadingskip}
-\def\subsubsecheadingbreak{\subsecheadingbreak}
-
-% Definition for @thissection. This can be overridden in translation
-% files.
-\def\thissectionDef{%
- \putwordSection{} \thissectionnum: \thissectionname}
-%
-
-
-% Print any size, any type, section title.
-%
-% #1 is the text of the title,
-% #2 is the section level (sec/subsec/subsubsec),
-% #3 is the section type (Ynumbered, Ynothing, Yappendix, Yomitfromtoc),
-% #4 is the section number.
-%
-\def\seckeyword{sec}
-%
-\def\sectionheading#1#2#3#4{%
- {%
- \def\sectionlevel{#2}%
- \def\temptype{#3}%
- %
- % It is ok for the @heading series commands to appear inside an
- % environment (it's been historically allowed, though the logic is
- % dubious), but not the others.
- \ifx\temptype\Yomitfromtockeyword\else
- \checkenv{}% non-@*heading should not be in an environment.
- \fi
- \let\footnote=\errfootnoteheading
- %
- % Switch to the right set of fonts.
- \csname #2fonts\endcsname \rm
- %
- % Insert first mark before the heading break (see notes for \domark).
- \let\prevsectiondefs=\currentsectiondefs
- \ifx\temptype\Ynothingkeyword
- \ifx\sectionlevel\seckeyword
- \gdef\currentsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
- \gdef\thissection{\thissectionname}}%
- \fi
- \else\ifx\temptype\Yomitfromtockeyword
- % Don't redefine \thissection.
- \else\ifx\temptype\Yappendixkeyword
- \ifx\sectionlevel\seckeyword
- \toks0={#1}%
- \xdef\currentsectiondefs{%
- \gdef\noexpand\thissectionname{\the\toks0}%
- \gdef\noexpand\thissectionnum{#4}%
- \let\noexpand\thissection\noexpand\thissectionDef
- }%
- \fi
- \else
- \ifx\sectionlevel\seckeyword
- \toks0={#1}%
- \xdef\currentsectiondefs{%
- \gdef\noexpand\thissectionname{\the\toks0}%
- \gdef\noexpand\thissectionnum{#4}%
- \let\noexpand\thissection\noexpand\thissectionDef
- }%
- \fi
- \fi\fi\fi
- %
- % Go into vertical mode. Usually we'll already be there, but we
- % don't want the following whatsit to end up in a preceding paragraph
- % if the document didn't happen to have a blank line.
- \par
- %
- % Output the mark. Pass it through \safewhatsit, to take care of
- % the preceding space.
- \safewhatsit\domark
- %
- % Insert space above the heading.
- \csname #2headingbreak\endcsname
- %
- % Now the second mark, after the heading break. No break points
- % between here and the heading.
- \global\let\prevsectiondefs=\currentsectiondefs
- \domark
- %
- % Only insert the space after the number if we have a section number.
- \ifx\temptype\Ynothingkeyword
- \setbox0 = \hbox{}%
- \def\toctype{unn}%
- \else\ifx\temptype\Yomitfromtockeyword
- % for @headings -- no section number, don't include in toc.
- \setbox0 = \hbox{}%
- \def\toctype{omit}%
- \let\sectionlevel=\empty
- \else\ifx\temptype\Yappendixkeyword
- \setbox0 = \hbox{#4\enspace}%
- \def\toctype{app}%
- \else
- \setbox0 = \hbox{#4\enspace}%
- \def\toctype{num}%
- \fi\fi\fi
- %
- % Write the toc entry (before \donoderef). See comments in \chapmacro.
- \writetocentry{\toctype\sectionlevel}{#1}{#4}%
- %
- % Write the node reference (= pdf destination for pdftex).
- % Again, see comments in \chapmacro.
- \donoderef{#3}{#1}%
- %
- % Interline glue will be inserted when the vbox is completed.
- % That glue will be a valid breakpoint for the page, since it'll be
- % preceded by a whatsit (usually from the \donoderef, or from the
- % \writetocentry if there was no node). We don't want to allow that
- % break, since then the whatsits could end up on page n while the
- % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
- \nobreak
- %
- % Output the actual section heading.
- \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
- \hangindent=\wd0 % zero if no section number
- \unhbox0 #1}%
- }%
- % Add extra space after the heading -- half of whatever came above it.
- % Don't allow stretch, though.
- \kern .5 \csname #2headingskip\endcsname
- %
- % Do not let the kern be a potential breakpoint, as it would be if it
- % was followed by glue.
- \nobreak
- %
- % We'll almost certainly start a paragraph next, so don't let that
- % glue accumulate. (Not a breakpoint because it's preceded by a
- % discardable item.) However, when a paragraph is not started next
- % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
- % or the negative glue will cause weirdly wrong output, typically
- % obscuring the section heading with something else.
- \vskip-\parskip
- %
- % This is so the last item on the main vertical list is a known
- % \penalty > 10000, so \startdefun, etc., can recognize the situation
- % and do the needful.
- \penalty 10001
-}
-
-
-\message{toc,}
-% Table of contents.
-\newwrite\tocfile
-
-% Write an entry to the toc file, opening it if necessary.
-% Called from @chapter, etc.
-%
-% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
-% We append the current node name (if any) and page number as additional
-% arguments for the \{chap,sec,...}entry macros which will eventually
-% read this. The node name is used in the pdf outlines as the
-% destination to jump to.
-%
-% We open the .toc file for writing here instead of at @setfilename (or
-% any other fixed time) so that @contents can be anywhere in the document.
-% But if #1 is `omit', then we don't do anything. This is used for the
-% table of contents chapter openings themselves.
-%
-\newif\iftocfileopened
-\def\omitkeyword{omit}%
-%
-\def\writetocentry#1#2#3{%
- \edef\writetoctype{#1}%
- \ifx\writetoctype\omitkeyword \else
- \iftocfileopened\else
- \immediate\openout\tocfile = \jobname.toc
- \global\tocfileopenedtrue
- \fi
- %
- \iflinks
- {\atdummies
- \edef\temp{%
- \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
- \temp
- }%
- \fi
- \fi
- %
- % Tell \shipout to create a pdf destination on each page, if we're
- % writing pdf. These are used in the table of contents. We can't
- % just write one on every page because the title pages are numbered
- % 1 and 2 (the page numbers aren't printed), and so are the first
- % two pages of the document. Thus, we'd have two destinations named
- % `1', and two named `2'.
- \ifpdforxetex
- \global\pdfmakepagedesttrue
- \fi
-}
-
-
-% These characters do not print properly in the Computer Modern roman
-% fonts, so we must take special care. This is more or less redundant
-% with the Texinfo input format setup at the end of this file.
-%
-\def\activecatcodes{%
- \catcode`\"=\active
- \catcode`\$=\active
- \catcode`\<=\active
- \catcode`\>=\active
- \catcode`\\=\active
- \catcode`\^=\active
- \catcode`\_=\active
- \catcode`\|=\active
- \catcode`\~=\active
-}
-
-
-% Read the toc file, which is essentially Texinfo input.
-\def\readtocfile{%
- \setupdatafile
- \activecatcodes
- \input \tocreadfilename
-}
-
-% process toc file to find the maximum width of the section numbers for
-% each chapter
-\def\findsecnowidths{%
- \begingroup
- \setupdatafile
- \activecatcodes
- \secentryfonts
- % Redefinitions
- \def\numchapentry##1##2##3##4{%
- \def\curchapname{secnowidth-##2}%
- \curchapmax=0pt
- }%
- \let\appentry\numchapentry
- %
- \def\numsecentry##1##2##3##4{%
- \def\cursecname{secnowidth-##2}%
- \cursecmax=0pt
- %
- \setbox0=\hbox{##2}%
- \ifdim\wd0>\curchapmax
- \curchapmax=\wd0
- \expandafter\xdef\csname\curchapname\endcsname{\the\wd0}%
- \fi
- }%
- \let\appsecentry\numsecentry
- %
- \def\numsubsecentry##1##2##3##4{%
- \def\curssecname{secnowidth-##2}%
- \curssecmax=0pt
- %
- \setbox0=\hbox{##2}%
- \ifdim\wd0>\cursecmax
- \cursecmax=\wd0
- \expandafter\xdef\csname\cursecname\endcsname{\the\wd0}%
- \fi
- }%
- \let\appsubsecentry\numsubsecentry
- %
- \def\numsubsubsecentry##1##2##3##4{%
- \setbox0=\hbox{##2}%
- \ifdim\wd0>\curssecmax
- \curssecmax=\wd0
- \expandafter\xdef\csname\curssecname\endcsname{\the\wd0}%
- \fi
- }%
- \let\appsubsubsecentry\numsubsubsecentry
- %
- % Discard any output by outputting to dummy vbox, in case the toc file
- % contains macros that we have not redefined above.
- \setbox\dummybox\vbox\bgroup
- \input \tocreadfilename\relax
- \egroup
- \endgroup
-}
-\newdimen\curchapmax
-\newdimen\cursecmax
-\newdimen\curssecmax
-
-
-% set #1 to the maximum section width for #2
-\def\retrievesecnowidth#1#2{%
- \expandafter\let\expandafter\savedsecnowidth \csname secnowidth-#2\endcsname
- \ifx\savedsecnowidth\relax
- #1=0pt
- \else
- #1=\savedsecnowidth
- \fi
-}
-\newdimen\secnowidthchap
-\secnowidthchap=0pt
-\newdimen\secnowidthsec
-\secnowidthsec=0pt
-\newdimen\secnowidthssec
-\secnowidthssec=0pt
-
-
-\newskip\contentsrightmargin \contentsrightmargin=1in
-\newcount\savepageno
-\newcount\lastnegativepageno \lastnegativepageno = -1
-
-% Prepare to read what we've written to \tocfile.
-%
-\def\startcontents#1#2{%
- % If @setchapternewpage on, and @headings double, the contents should
- % start on an odd page, unlike chapters.
- \contentsalignmacro
- \immediate\closeout\tocfile
- %
- #2%
- % Don't need to put `Contents' or `Short Contents' in the headline.
- % It is abundantly clear what they are.
- \chapmacro{#1}{Yomitfromtoc}{}%
- %
- \savepageno = \pageno
- \begingroup % Set up to handle contents files properly.
- \raggedbottom % Worry more about breakpoints than the bottom.
- \entryrightmargin=\contentsrightmargin % Don't use the full line length.
- %
- % Roman numerals for page numbers.
- \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
- \def\thistitle{}% no title in double-sided headings
- % Record where the Roman numerals started.
- \ifnum\romancount=0 \global\romancount=\pagecount \fi
- \linkentrytexttrue
-}
-
-% \raggedbottom in plain.tex hardcodes \topskip so override it
-\catcode`\@=11
-\def\raggedbottom{\advance\topskip by 0pt plus30pt \r@ggedbottomtrue}
-\catcode`\@=\other
-
-% redefined for the two-volume lispref. We always output on
-% \jobname.toc even if this is redefined.
-%
-\def\tocreadfilename{\jobname.toc}
-
-% Normal (long) toc.
-%
-\def\contents{%
- \startcontents{\putwordTOC}{\contentsmkdest}%
- \ifxetex\xetexpreauxfile\fi
- \penalty2 % mark beginning of contents
- \openin 1 \tocreadfilename\space
- \ifeof 1 \else
- \findsecnowidths
- \readtocfile
- \fi
- \vfill \eject
- \contentsalignmacro % in case @setchapternewpage odd is in effect
- \ifeof 1 \else
- \pdfmakeoutlines
- \fi
- \closein 1
- \ifxetex\xetexpostauxfile\fi
- \endgroup
- \contentsendroman
-}
-
-\def\contentsmkdest{%
- \pdfmkdest{txi.CONTENTS}%
-}
-
-% And just the chapters.
-\def\summarycontents{%
- \startcontents{\putwordShortTOC}{}%
- %
- \let\partentry = \shortpartentry
- \let\numchapentry = \shortchapentry
- \let\appentry = \shortchapentry
- \let\unnchapentry = \shortunnchapentry
- % We want a true roman here for the page numbers.
- \secfonts
- \let\rm=\shortcontrm \let\bf=\shortcontbf
- \let\sl=\shortcontsl \let\tt=\shortconttt
- \rm
- \hyphenpenalty = 10000
- \advance\baselineskip by 1pt % Open it up a little.
- \extrasecnoskip=0.4pt
- \def\numsecentry##1##2##3##4{}
- \let\appsecentry = \numsecentry
- \let\unnsecentry = \numsecentry
- \let\numsubsecentry = \numsecentry
- \let\appsubsecentry = \numsecentry
- \let\unnsubsecentry = \numsecentry
- \let\numsubsubsecentry = \numsecentry
- \let\appsubsubsecentry = \numsecentry
- \let\unnsubsubsecentry = \numsecentry
- \ifxetex\xetexpreauxfile\fi
- \openin 1 \tocreadfilename\space
- \ifeof 1 \else
- \readtocfile
- \fi
- \closein 1
- \ifxetex\xetexpostauxfile\fi
- \vfill \eject
- \contentsalignmacro % in case @setchapternewpage odd is in effect
- \endgroup
- \contentsendroman
-}
-\let\shortcontents = \summarycontents
-
-% Get ready to use Arabic numerals again
-\def\contentsendroman{%
- \lastnegativepageno = \pageno
- \global\pageno=1
- \contentsendcount = \pagecount
-}
-
-% Typeset the label for a chapter or appendix for the short contents.
-% The arg is, e.g., `A' for an appendix, or `3' for a chapter.
-%
-\def\shortchaplabel#1{%
- % This space should be enough, since a single number is .5em, and the
- % widest letter (M) is 1em, at least in the Computer Modern fonts.
- % But use \hss just in case.
- %
- % We'd like to right-justify chapter numbers, but that looks strange
- % with appendix letters. And right-justifying numbers and
- % left-justifying letters looks strange when there is less than 10
- % chapters. Have to read the whole toc once to know how many chapters
- % there are before deciding ...
- \hbox to 1em{#1\hss}%
-}
-
-% These macros generate individual entries in the table of contents,
-% and are read in from the *.toc file.
-%
-% The arguments are like:
-% \def\numchapentry#1#2#3#4
-% #1 - the chapter or section name.
-% #2 - section number
-% #3 - level of section (e.g "chap", "sec")
-% #4 - page number
-
-% Parts, in the main contents. Ignore the page number, which is
-% conventionally not printed.
-\def\partentry#1#2#3#4{%
- \ifnum\lastpenalty = 2
- % use less space if at very first entry of contents
- \vskip 1\baselineskip plus .33\baselineskip minus .25\baselineskip
- \else
- \vskip 2\baselineskip plus .66\baselineskip minus .5\baselineskip
- \fi
- % Add stretch and a bonus for breaking the page before the part heading.
- % This reduces the chance of the page being broken immediately after the
- % part heading, before a following chapter heading.
- \vskip 0pt plus 3\baselineskip
- \penalty-300
- \vskip 0pt plus -3\baselineskip
- \begingroup
- \secfonts \rm
- \entryinternal{#1}{}%
- \endgroup
- \afterpartentrytrue
-}
-\newif\ifafterpartentry
-%
-% Parts, in the short toc.
-\def\shortpartentry#1#2#3#4{%
- \penalty-300
- \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
- \tocentry{{\bf #1}}{}{}{}%
-}
-
-% Chapters, in the main contents.
-\def\numchapentry#1#2#3#4{%
- \retrievesecnowidth\secnowidthchap{#2}%
- \dochapentry{#1}{#2}{#3}{#4}%
-}
-
-% Chapters, in the short toc.
-\def\shortchapentry#1#2#3#4{%
- \tocentry{#1}{\shortchaplabel{#2}}{#3}{#4}%
-}
-
-% Appendices, in the main contents.
-% Need the word Appendix, and a fixed-size box.
-%
-\def\appendixbox#1{%
- % We use M since it's probably the widest letter.
- \setbox0 = \hbox{\putwordAppendix{} M}%
- \hbox to \wd0{\putwordAppendix{} #1\hss}}
-%
-\def\appentry#1#2#3#4{%
- \retrievesecnowidth\secnowidthchap{#2}%
- \dochapentry{\appendixbox{#2}\hskip.7em#1}{}{#3}{#4}%
-}
-
-% Unnumbered chapters.
-\def\unnchapentry#1#2#3#4{\dochapentry{#1}{}{#3}{#4}}
-\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{}{#3}{#4}}
-
-% Sections.
-\def\numsecentry#1#2#3#4{%
- \retrievesecnowidth\secnowidthsec{#2}%
- \dosecentry{#1}{#2}{#3}{#4}%
-}
-\let\appsecentry=\numsecentry
-\def\unnsecentry#1#2#3#4{%
- \retrievesecnowidth\secnowidthsec{#2}%
- \dosecentry{#1}{}{#3}{#4}%
-}
-
-% Subsections.
-\def\numsubsecentry#1#2#3#4{%
- \retrievesecnowidth\secnowidthssec{#2}%
- \dosubsecentry{#1}{#2}{#3}{#4}%
-}
-\let\appsubsecentry=\numsubsecentry
-\def\unnsubsecentry#1#2#3#4{%
- \retrievesecnowidth\secnowidthssec{#2}%
- \dosubsecentry{#1}{}{#3}{#4}%
-}
-
-% And subsubsections.
-\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#2}{#3}{#4}}
-\let\appsubsubsecentry=\numsubsubsecentry
-\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{}{#3}{#4}}
-
-% This parameter controls the indentation of the various levels.
-% Same as \defaultparindent.
-\newdimen\tocindent \tocindent = 15pt
-
-% Now for the actual typesetting. In all these, #1 is the text, #2 is
-% a section number if present, #3 is the node, and #4 is the page number.
-%
-% If the toc has to be broken over pages, we want it to be at chapters
-% if at all possible; hence the \penalty.
-\def\dochapentry#1#2#3#4{%
- \ifafterpartentry
- \afterpartentryfalse
- \penalty5000
- \else
- \penalty-300
- \fi
- \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
- \begingroup
- % Move the page numbers slightly to the right
- \advance\entryrightmargin by -0.05em
- \chapentryfonts
- \extrasecnoskip=0.4em % separate chapter number more
- \tocentry{#1}{#2}{#3}{#4}%
- \endgroup
- \nobreak\vskip .25\baselineskip plus.1\baselineskip
-}
-
-\def\dosecentry#1#2#3#4{\begingroup
- \secnowidth=\secnowidthchap
- \secentryfonts \leftskip=\tocindent
- \tocentry{#1}{#2}{#3}{#4}%
-\endgroup}
-
-\def\dosubsecentry#1#2#3#4{\begingroup
- \secnowidth=\secnowidthsec
- \subsecentryfonts \leftskip=2\tocindent
- \tocentry{#1}{#2}{#3}{#4}%
-\endgroup}
-
-\def\dosubsubsecentry#1#2#3#4{\begingroup
- \secnowidth=\secnowidthssec
- \subsubsecentryfonts \leftskip=3\tocindent
- \tocentry{#1}{#2}{#3}{#4}%
-\endgroup}
-
-% Used for the maximum width of a section number so we can align
-% section titles.
-\newdimen\secnowidth
-\secnowidth=0pt
-\newdimen\extrasecnoskip
-\extrasecnoskip=0pt
-
-\let\tocnodetarget\empty
-\let\entrypagetarget\empty
-
-% \tocentry{TITLE}{SEC NO}{NODE}{PAGE}
-%
-\def\tocentry#1#2#3#4{%
- \def\tocnodetarget{#3}%
- \def\secno{#2}%
- \ifx\empty\secno
- \entryinternal{#1}{#4}%
- \else
- \ifdim 0pt=\secnowidth
- \setbox0=\hbox{#2\hskip\labelspace\hskip\extrasecnoskip}%
- \else
- \advance\secnowidth by \labelspace
- \advance\secnowidth by \extrasecnoskip
- \setbox0=\hbox to \secnowidth{%
- #2\hskip\labelspace\hskip\extrasecnoskip\hfill}%
- \fi
- \entrycontskip=\wd0
- \entryinternal{\box0 #1}{#4}%
- \fi
-}
-\newdimen\labelspace
-\labelspace=0.6em
-
-\def\chapentryfonts{\secfonts \rm}
-\def\secentryfonts{\textfonts}
-\def\subsecentryfonts{\textfonts}
-\def\subsubsecentryfonts{\textfonts}
-
-
-\message{environments,}
-% @foo ... @end foo.
-
-% @tex ... @end tex escapes into raw TeX temporarily.
-% One exception: @ is still an escape character, so that @end tex works.
-% But \@ or @@ will get a plain @ character.
-
-\envdef\tex{%
- \setregularquotes
- \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
- \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
- \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
- \catcode `\%=14
- \catcode `\+=\other
- \catcode `\"=\other
- \catcode `\|=\other
- \catcode `\<=\other
- \catcode `\>=\other
- \catcode `\`=\other
- \catcode `\'=\other
- %
- % ' is active in math mode (mathcode"8000). So reset it, and all our
- % other math active characters (just in case), to plain's definitions.
- \mathactive
- %
- % Inverse of the list at the beginning of the file.
- \let\b=\ptexb
- \let\bullet=\ptexbullet
- \let\c=\ptexc
- \let\,=\ptexcomma
- \let\.=\ptexdot
- \let\dots=\ptexdots
- \let\equiv=\ptexequiv
- \let\!=\ptexexclam
- \let\i=\ptexi
- \let\indent=\ptexindent
- \let\noindent=\ptexnoindent
- \let\{=\ptexlbrace
- \let\+=\tabalign
- \let\}=\ptexrbrace
- \let\/=\ptexslash
- \let\sp=\ptexsp
- \let\*=\ptexstar
- %\let\sup=\ptexsup % do not redefine, we want @sup to work in math mode
- \let\t=\ptext
- \expandafter \let\csname top\endcsname=\ptextop % we've made it outer
- \let\frenchspacing=\plainfrenchspacing
- %
- \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
- \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
- \def\@{@}%
-}
-% There is no need to define \Etex.
-
-% Define @lisp ... @end lisp.
-% @lisp environment forms a group so it can rebind things,
-% including the definition of @end lisp (which normally is erroneous).
-
-% Amount to narrow the margins by for @lisp.
-\newskip\lispnarrowing \lispnarrowing=0.4in
-
-% This is the definition that ^^M gets inside @lisp, @example, and other
-% such environments. \null is better than a space, since it doesn't
-% have any width.
-\def\lisppar{\null\endgraf}
-
-% This space is always present above and below environments.
-\newskip\envskipamount \envskipamount = 0pt
-
-% Make spacing and below environment symmetrical. We use \parskip here
-% to help in doing that, since in @example-like environments \parskip
-% is reset to zero; thus the \afterenvbreak inserts no space -- but the
-% start of the next paragraph will insert \parskip.
-%
-\def\aboveenvbreak{{%
- % =10000 instead of <10000 because of a special case in \itemzzz and
- % \sectionheading, q.v.
- \ifnum \lastpenalty=10000 \else
- \advance\envskipamount by \parskip
- \endgraf
- \ifdim\lastskip<\envskipamount
- \removelastskip
- \ifnum\lastpenalty<10000
- % Penalize breaking before the environment, because preceding text
- % often leads into it.
- \penalty100
- \fi
- \vskip\envskipamount
- \fi
- \fi
-}}
-
-\def\afterenvbreak{{%
- % =10000 instead of <10000 because of a special case in \itemzzz and
- % \sectionheading, q.v.
- \ifnum \lastpenalty=10000 \else
- \advance\envskipamount by \parskip
- \endgraf
- \ifdim\lastskip<\envskipamount
- \removelastskip
- % it's not a good place to break if the last penalty was \nobreak
- % or better ...
- \ifnum\lastpenalty<10000 \penalty-50 \fi
- \vskip\envskipamount
- \fi
- \fi
-}}
-
-% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
-% also clear it, so that its embedded environments do the narrowing again.
-\let\nonarrowing=\relax
-
-% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
-% environment contents.
-
-%
-\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
-\def\ctr{{\hskip 6pt\circle\char'010}}
-\def\cbl{{\circle\char'012\hskip -6pt}}
-\def\cbr{{\hskip 6pt\circle\char'011}}
-\def\carttop{\hbox to \cartouter{\hskip\lskip
- \ctl\leaders\hrule height\circthick\hfil\ctr
- \hskip\rskip}}
-\def\cartbot{\hbox to \cartouter{\hskip\lskip
- \cbl\leaders\hrule height\circthick\hfil\cbr
- \hskip\rskip}}
-%
-\newskip\lskip\newskip\rskip
-
-% only require the font if @cartouche is actually used
-\def\cartouchefontdefs{%
- \font\circle=lcircle10\relax
- \circthick=\fontdimen8\circle
-}
-\newdimen\circthick
-\newdimen\cartouter\newdimen\cartinner
-\newskip\normbskip\newskip\normpskip\newskip\normlskip
-
-\envparseargdef\cartouche{%
- \cartouchefontdefs
- \ifhmode\par\fi % can't be in the midst of a paragraph.
- \startsavinginserts
- \lskip=\leftskip \rskip=\rightskip
- \leftskip=0pt\rightskip=0pt % we want these *outside*.
- %
- % Set paragraph width for text inside cartouche. There are
- % left and right margins of 3pt each plus two vrules 0.4pt each.
- \cartinner=\hsize \advance\cartinner by-\lskip
- \advance\cartinner by-\rskip
- \advance\cartinner by -6.8pt
- %
- % For drawing top and bottom of cartouche. Each corner char
- % adds 6pt and we take off the width of a rule to line up with the
- % right boundary perfectly.
- \cartouter=\hsize
- \advance\cartouter by 11.6pt
- %
- \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
- %
- % If this cartouche directly follows a sectioning command, we need the
- % \parskip glue (backspaced over by default) or the cartouche can
- % collide with the section heading.
- \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
- %
- \setbox\groupbox=\vtop\bgroup
- \baselineskip=0pt\parskip=0pt\lineskip=0pt
- \carttop
- \hbox\bgroup
- \hskip\lskip
- \vrule\kern3pt
- \vbox\bgroup
- \hsize=\cartinner
- \baselineskip=\normbskip
- \lineskip=\normlskip
- \parskip=\normpskip
- \def\arg{#1}%
- \ifx\arg\empty\else
- \centerV{\hfil \bf #1 \hfil}%
- \fi
- \kern3pt
- \vskip -\parskip
-}
-\def\Ecartouche{%
- \ifhmode\par\fi
- \kern3pt
- \egroup
- \kern3pt\vrule
- \hskip\rskip
- \egroup
- \cartbot
- \egroup
- \addgroupbox
- \checkinserts
-}
-
-
-% This macro is called at the beginning of all the @example variants,
-% inside a group.
-\newdimen\nonfillparindent
-\def\nonfillstart{%
- \aboveenvbreak
- \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy
- \sepspaces % Make spaces be word-separators rather than space tokens.
- \let\par = \lisppar % don't ignore blank lines
- \obeylines % each line of input is a line of output
- \parskip = 0pt
- % Turn off paragraph indentation but redefine \indent to emulate
- % the normal \indent.
- \nonfillparindent=\parindent
- \parindent = 0pt
- \let\indent\nonfillindent
- %
- \emergencystretch = 0pt % don't try to avoid overfull boxes
- \ifx\nonarrowing\relax
- \advance \leftskip by \lispnarrowing
- \exdentamount=\lispnarrowing
- \else
- \let\nonarrowing = \relax
- \fi
- \let\exdent=\nofillexdent
-}
-
-\begingroup
-\obeyspaces
-% We want to swallow spaces (but not other tokens) after the fake
-% @indent in our nonfill-environments, where spaces are normally
-% active and set to @tie, resulting in them not being ignored after
-% @indent.
-\gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
-\gdef\nonfillindentcheck{%
-\ifx\temp %
-\expandafter\nonfillindentgobble%
-\else%
-\leavevmode\nonfillindentbox%
-\fi%
-}%
-\endgroup
-\def\nonfillindentgobble#1{\nonfillindent}
-\def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
-
-% If you want all examples etc. small: @set dispenvsize small.
-% If you want even small examples the full size: @set dispenvsize nosmall.
-% This affects the following displayed environments:
-% @example, @display, @format, @lisp, @verbatim
-%
-\def\smallword{small}
-\def\nosmallword{nosmall}
-\let\SETdispenvsize\relax
-\def\setnormaldispenv{%
- \ifx\SETdispenvsize\smallword
- % end paragraph for sake of leading, in case document has no blank
- % line. This is redundant with what happens in \aboveenvbreak, but
- % we need to do it before changing the fonts, and it's inconvenient
- % to change the fonts afterward.
- \ifnum \lastpenalty=10000 \else \endgraf \fi
- \smallexamplefonts \rm
- \fi
-}
-\def\setsmalldispenv{%
- \ifx\SETdispenvsize\nosmallword
- \else
- \ifnum \lastpenalty=10000 \else \endgraf \fi
- \smallexamplefonts \rm
- \fi
-}
-
-% We often define two environments, @foo and @smallfoo.
-% Let's do it in one command. #1 is the env name, #2 the definition.
-\def\makedispenvdef#1#2{%
- \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
- \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
- \expandafter\let\csname E#1\endcsname \afterenvbreak
- \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
-}
-
-% Define two environment synonyms (#1 and #2) for an environment.
-\def\maketwodispenvdef#1#2#3{%
- \makedispenvdef{#1}{#3}%
- \makedispenvdef{#2}{#3}%
-}
-%
-% @lisp: indented, narrowed, typewriter font;
-% @example: same as @lisp.
-%
-% @smallexample and @smalllisp: use smaller fonts.
-% Originally contributed by Pavel@xerox.
-%
-\maketwodispenvdef{lisp}{example}{%
- \nonfillstart
- \tt\setcodequotes
- \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
- \parsearg\gobble
-}
-% @display/@smalldisplay: same as @lisp except keep current font.
-%
-\makedispenvdef{display}{%
- \nonfillstart
- \gobble
-}
-
-% @format/@smallformat: same as @display except don't narrow margins.
-%
-\makedispenvdef{format}{%
- \let\nonarrowing = t%
- \nonfillstart
- \gobble
-}
-
-% @flushleft: same as @format, but doesn't obey \SETdispenvsize.
-\envdef\flushleft{%
- \let\nonarrowing = t%
- \nonfillstart
- \gobble
-}
-\let\Eflushleft = \afterenvbreak
-
-% @flushright.
-%
-\envdef\flushright{%
- \let\nonarrowing = t%
- \nonfillstart
- \advance\leftskip by 0pt plus 1fill\relax
- \gobble
-}
-\let\Eflushright = \afterenvbreak
-
-
-% @raggedright does more-or-less normal line breaking but no right
-% justification. From plain.tex.
-\envdef\raggedright{%
- \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax
-}
-\let\Eraggedright\par
-
-
-% @quotation does normal linebreaking (hence we can't use \nonfillstart)
-% and narrows the margins. We keep \parskip nonzero in general, since
-% we're doing normal filling. So, when using \aboveenvbreak and
-% \afterenvbreak, temporarily make \parskip 0.
-%
-\makedispenvdef{quotation}{\quotationstart}
-%
-\def\quotationstart{%
- \indentedblockstart % same as \indentedblock, but increase right margin too.
- \ifx\nonarrowing\relax
- \advance\rightskip by \lispnarrowing
- \fi
- \parsearg\quotationlabel
-}
-
-% We have retained a nonzero parskip for the environment, since we're
-% doing normal filling.
-%
-\def\Equotation{%
- \par
- \ifx\quotationauthor\thisisundefined\else
- % indent a bit.
- \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
- \fi
- {\parskip=0pt \afterenvbreak}%
-}
-\def\Esmallquotation{\Equotation}
-
-% If we're given an argument, typeset it in bold with a colon after.
-\def\quotationlabel#1{%
- \def\temp{#1}%
- \ifx\temp\empty \else
- {\bf #1: }%
- \fi
-}
-
-% @indentedblock is like @quotation, but indents only on the left and
-% has no optional argument.
-%
-\makedispenvdef{indentedblock}{\indentedblockstart}
-%
-\def\indentedblockstart{%
- {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
- \parindent=0pt
- %
- % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
- \ifx\nonarrowing\relax
- \advance\leftskip by \lispnarrowing
- \exdentamount = \lispnarrowing
- \else
- \let\nonarrowing = \relax
- \fi
-}
-
-% Keep a nonzero parskip for the environment, since we're doing normal filling.
-%
-\def\Eindentedblock{%
- \par
- {\parskip=0pt \afterenvbreak}%
-}
-\def\Esmallindentedblock{\Eindentedblock}
-
-
-% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
-% If we want to allow any <char> as delimiter,
-% we need the curly braces so that makeinfo sees the @verb command, eg:
-% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
-%
-% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
-%
-% [Knuth] p.344; only we need to do the other characters Texinfo sets
-% active too. Otherwise, they get lost as the first character on a
-% verbatim line.
-\def\dospecials{%
- \do\ \do\\\do\{\do\}\do\$\do\&%
- \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
- \do\<\do\>\do\|\do\@\do+\do\"%
- % Don't do the quotes -- if we do, @set txicodequoteundirected and
- % @set txicodequotebacktick will not have effect on @verb and
- % @verbatim, and ?` and !` ligatures won't get disabled.
- %\do\`\do\'%
-}
-%
-% [Knuth] p. 380
-\def\uncatcodespecials{%
- \def\do##1{\catcode`##1=\other}\dospecials}
-%
-% Setup for the @verb command.
-%
-% Eight spaces for a tab
-\begingroup
- \catcode`\^^I=\active
- \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
-\endgroup
-%
-\def\setupverb{%
- \tt
- \def\par{\leavevmode\endgraf}%
- \parindent = 0pt
- \setcodequotes
- \tabeightspaces
- % Respect line breaks,
- % print special symbols as themselves, and
- % make each space count
- % must do in this order:
- \obeylines \uncatcodespecials \sepspaces
-}
-
-% Setup for the @verbatim environment
-%
-% Real tab expansion.
-\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
-%
-% We typeset each line of the verbatim in an \hbox, so we can handle
-% tabs.
-\newbox\verbbox
-\def\starttabbox{\setbox\verbbox=\hbox\bgroup}
-%
-\begingroup
- \catcode`\^^I=\active
- \gdef\tabexpand{%
- \catcode`\^^I=\active
- \def^^I{\leavevmode\egroup
- \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
- \divide\dimen\verbbox by\tabw
- \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
- \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
- \wd\verbbox=\dimen\verbbox
- \leavevmode\box\verbbox \starttabbox
- }%
- }
-\endgroup
-
-% start the verbatim environment.
-\def\setupverbatim{%
- \let\nonarrowing = t%
- \nonfillstart
- \tt % easiest (and conventionally used) font for verbatim
- \def\par{\egroup\leavevmode\box\verbbox\endgraf\starttabbox}%
- \tabexpand
- \setcodequotes
- % Respect line breaks,
- % print special symbols as themselves, and
- % make each space count.
- % Must do in this order:
- \obeylines \uncatcodespecials \sepspaces
-}
-
-% Do the @verb magic: verbatim text is quoted by unique
-% delimiter characters. Before first delimiter expect a
-% right brace, after last delimiter expect closing brace:
-%
-% \def\doverb'{'<char>#1<char>'}'{#1}
-%
-% [Knuth] p. 382; only eat outer {}
-\begingroup
- \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
- \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
-\endgroup
-%
-\def\verb{\begingroup\setupverb\doverb}
-%
-%
-% Do the @verbatim magic: define the macro \doverbatim so that
-% the (first) argument ends when '@end verbatim' is reached, ie:
-%
-% \def\doverbatim#1@end verbatim{#1}
-%
-% For Texinfo it's a lot easier than for LaTeX,
-% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
-% we need not redefine '\', '{' and '}'.
-%
-% Inspired by LaTeX's verbatim command set [latex.ltx]
-%
-\begingroup
- \catcode`\ =\active
- \obeylines %
- % ignore everything up to the first ^^M, that's the newline at the end
- % of the @verbatim input line itself. Otherwise we get an extra blank
- % line in the output.
- \xdef\doverbatim#1^^M#2@end verbatim{%
- \starttabbox#2\egroup\noexpand\end\gobble verbatim}%
- % We really want {...\end verbatim} in the body of the macro, but
- % without the active space; thus we have to use \xdef and \gobble.
- % The \egroup ends the \verbbox started at the end of the last line in
- % the block.
-\endgroup
-%
-\envdef\verbatim{%
- \setnormaldispenv\setupverbatim\doverbatim
-}
-\let\Everbatim = \afterenvbreak
-
-
-% @verbatiminclude FILE - insert text of file in verbatim environment.
-%
-\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
-%
-\def\doverbatiminclude#1{%
- {%
- \makevalueexpandable
- \setupverbatim
- {%
- \indexnofonts % Allow `@@' and other weird things in file names.
- \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
- \edef\tmp{\noexpand\input #1 }
- \expandafter
- }\expandafter\starttabbox\tmp\egroup
- \afterenvbreak
- }%
-}
-
-% @copying ... @end copying.
-% Save the text away for @insertcopying later.
-%
-% We save the uninterpreted tokens, rather than creating a box.
-% Saving the text in a box would be much easier, but then all the
-% typesetting commands (@smallbook, font changes, etc.) have to be done
-% beforehand -- and a) we want @copying to be done first in the source
-% file; b) letting users define the frontmatter in as flexible order as
-% possible is desirable.
-%
-\def\copying{\checkenv{}\begingroup\macrobodyctxt\docopying}
-{\catcode`\ =\other
-\gdef\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
-}
-\let\copyingtext\relax
-
-\def\insertcopying{%
- \begingroup
- \parindent = 0pt % paragraph indentation looks wrong on title page
- \scanexp\copyingtext
- \endgroup
-}
-
-\def\publication{\checkenv{}\begingroup\macrobodyctxt\dopublication}
-{\catcode`\ =\other
-\gdef\dopublication#1@end publication{\endgroup\def\publicationtext{#1}}
-}
-\let\publicationtext\relax
-
-\def\insertpublication{%
- \begingroup
- \parindent = 0pt % paragraph indentation looks wrong on title page
- \scanexp\publicationtext
- \endgroup
-}
-
-\message{defuns,}
-% @defun etc.
-
-\newskip\defbodyindent \defbodyindent=.4in
-\newskip\defargsindent \defargsindent=50pt
-\newskip\deflastargmargin \deflastargmargin=18pt
-\newcount\defunpenalty
-
-% Start the processing of @deffn:
-\def\startdefun{%
- \ifnum\lastpenalty<10000
- \medbreak
- \defunpenalty=10003 % Will keep this @deffn together with the
- % following @def command, see below.
- \else
- % If there are two @def commands in a row, we'll have a \nobreak,
- % which is there to keep the function description together with its
- % header. But if there's nothing but headers, we need to allow a
- % break somewhere. Check specifically for penalty 10002, inserted
- % by \printdefunline, instead of 10000, since the sectioning
- % commands also insert a nobreak penalty, and we don't want to allow
- % a break between a section heading and a defun.
- %
- % As a further refinement, we avoid "club" headers by signalling
- % with penalty of 10003 after the very first @deffn in the
- % sequence (see above), and penalty of 10002 after any following
- % @def command.
- \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
- %
- % Similarly, after a section heading, do not allow a break.
- % But do insert the glue.
- \medskip % preceded by discardable penalty, so not a breakpoint
- \fi
- %
- \parindent=0in
- \advance\leftskip by \defbodyindent
- \exdentamount=\defbodyindent
-}
-
-% Called as \printdefunline \deffooheader{text}
-%
-\def\printdefunline#1#2{%
- \begingroup
- \plainfrenchspacing
- % call \deffooheader:
- #1#2 \endheader
- % common ending:
- \interlinepenalty = 10000
- \advance\rightskip by 0pt plus 1fil\relax
- \endgraf
- \nobreak\vskip -\parskip
- \penalty\defunpenalty % signal to \startdefun and \deffoox
- % Some of the @defun-type tags do not enable magic parentheses,
- % rendering the following check redundant. But we don't optimize.
- \checkparencounts
- \endgroup
-}
-
-\def\Edefun{\endgraf\medbreak}
-
-% @defblock, @defline do not automatically create index entries
-\envdef\defblock{%
- \startdefun
-}
-\let\Edefblock\Edefun
-
-\def\defline{%
- \doingtypefnfalse
- \parseargusing\activeparens{\printdefunline\deflineheader}%
-}
-\def\deflineheader#1 #2 #3\endheader{%
- \printdefname{#1}{}{#2}\magicamp\defunargs{#3\unskip}%
-}
-
-\def\deftypeline{%
- \doingtypefntrue
- \parseargusing\activeparens{\printdefunline\deftypelineheader}%
-}
-\def\deftypelineheader#1 #2 #3 #4\endheader{%
- \printdefname{#1}{#2}{#3}\magicamp\defunargs{#4\unskip}%
-}
-
-% \makedefun{deffoo} (\deffooheader parameters) { (\deffooheader expansion) }
-%
-% Define \deffoo, \deffoox \Edeffoo and \deffooheader.
-\def\makedefun#1{%
- \expandafter\let\csname E#1\endcsname = \Edefun
- \edef\temp{\noexpand\domakedefun
- \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
- \temp
-}
-\def\domakedefun#1#2#3{%
- \envdef#1{%
- \startdefun
- \doingtypefnfalse % distinguish typed functions from all else
- \parseargusing\activeparens{\printdefunline#3}%
- }%
- \def#2{%
- % First, check whether we are in the right environment:
- \checkenv#1%
- %
- % As in \startdefun, allow line break if we have multiple x headers
- % in a row. It's not a great place, though.
- \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
- %
- \doingtypefnfalse % distinguish typed functions from all else
- \parseargusing\activeparens{\printdefunline#3}%
- }%
- \def#3% definition of \deffooheader follows
-}
-
-\newif\ifdoingtypefn % doing typed function?
-\newif\ifrettypeownline % typeset return type on its own line?
-
-% @deftypefnnewline on|off says whether the return type of typed functions
-% are printed on their own line. This affects @deftypefn, @deftypefun,
-% @deftypeop, and @deftypemethod.
-%
-\parseargdef\deftypefnnewline{%
- \def\temp{#1}%
- \ifx\temp\onword
- \expandafter\let\csname SETtxideftypefnnl\endcsname
- = \empty
- \else\ifx\temp\offword
- \expandafter\let\csname SETtxideftypefnnl\endcsname
- = \relax
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @txideftypefnnl value `\temp',
- must be on|off}%
- \fi\fi
-}
-
-% Untyped functions:
-
-% @deffn category name args
-\makedefun{deffn}#1 #2 #3\endheader{%
- \doind{fn}{\code{#2}}%
- \printdefname{#1}{}{#2}\magicamp\defunargs{#3\unskip}%
-}
-
-% @defop category class name args
-\makedefun{defop}#1 {\defopheaderx{#1\ \putwordon}}
-\def\defopheaderx#1#2 #3 #4\endheader{%
- \doind{fn}{\code{#3}\space\putwordon\ \code{#2}}%
- \printdefname{#1\ \code{#2}}{}{#3}\magicamp\defunargs{#4\unskip}%
-}
-
-% Typed functions:
-
-% @deftypefn category type name args
-\makedefun{deftypefn}#1 #2 #3 #4\endheader{%
- \doind{fn}{\code{#3}}%
- \doingtypefntrue
- \printdefname{#1}{#2}{#3}\defunargs{#4\unskip}%
-}
-
-% @deftypeop category class type name args
-\makedefun{deftypeop}#1 {\deftypeopheaderx{#1\ \putwordon}}
-\def\deftypeopheaderx#1#2 #3 #4 #5\endheader{%
- \doind{fn}{\code{#4}\space\putwordon\ \code{#1\ \code{#2}}}%
- \doingtypefntrue
- \printdefname{#1\ \code{#2}}{#3}{#4}\defunargs{#5\unskip}%
-}
-
-% Typed variables:
-
-% @deftypevr category type var args
-\makedefun{deftypevr}#1 #2 #3 #4\endheader{%
- \doind{vr}{\code{#3}}%
- \printdefname{#1}{#2}{#3}\defunargs{#4\unskip}%
-}
-
-% @deftypecv category class type var args
-\makedefun{deftypecv}#1 {\deftypecvheaderx{#1\ \putwordof}}
-\def\deftypecvheaderx#1#2 #3 #4 #5\endheader{%
- \doind{vr}{\code{#4}\space\putwordof\ \code{#2}}%
- \printdefname{#1\ \code{#2}}{#3}{#4}\defunargs{#5\unskip}%
-}
-
-% Untyped variables:
-
-% @defvr category var args
-\makedefun{defvr}#1 {\deftypevrheader{#1} {} }
-
-% @defcv category class var args
-\makedefun{defcv}#1 {\defcvheaderx{#1\ \putwordof}}
-\def\defcvheaderx#1#2 {\deftypecvheaderx{#1}#2 {} }
-
-% Types:
-
-% @deftp category name args
-\makedefun{deftp}#1 #2 #3\endheader{%
- \doind{tp}{\code{#2}}%
- \printdefname{#1}{}{#2}\defunargs{#3\unskip}%
-}
-
-% Remaining @defun-like shortcuts:
-\makedefun{defun}{\deffnheader{\putwordDeffunc} }
-\makedefun{defmac}{\deffnheader{\putwordDefmac} }
-\makedefun{defspec}{\deffnheader{\putwordDefspec} }
-\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
-\makedefun{defvar}{\defvrheader{\putwordDefvar} }
-\makedefun{defopt}{\defvrheader{\putwordDefopt} }
-\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
-\makedefun{defmethod}{\defopheaderx\putwordMethodon}
-\makedefun{deftypemethod}{\deftypeopheaderx\putwordMethodon}
-\makedefun{defivar}{\defcvheaderx\putwordInstanceVariableof}
-\makedefun{deftypeivar}{\deftypecvheaderx\putwordInstanceVariableof}
-
-% \printdefname, which formats the name of the @def (not the args).
-% #1 is the category, such as "Function".
-% #2 is the return type, if any.
-% #3 is the function name.
-%
-% We are followed by (but not passed) the arguments, if any.
-%
-\def\printdefname#1#2#3{%
- \par
- % Get the values of \leftskip and \rightskip as they were outside the @def...
- \advance\leftskip by -\defbodyindent
- %
- % Determine if we are typesetting the return type of a typed function
- % on a line by itself.
- \rettypeownlinefalse
- \ifdoingtypefn % doing a typed function specifically?
- % then check user option for putting return type on its own line:
- \ifflagclear{txideftypefnnl}{}{\rettypeownlinetrue}%
- \fi
- %
- % How we'll format the category name. Putting it in brackets helps
- % distinguish it from the body text that may end up on the next line
- % just below it.
- \def\temp{#1}%
- \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
- %
- % Figure out line sizes for the paragraph shape. We'll always have at
- % least two.
- \tempnum = 2
- %
- % The first line needs space for \box0; but if \rightskip is nonzero,
- % we need only space for the part of \box0 which exceeds it:
- \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
- %
- % If doing a return type on its own line, we'll have another line.
- \ifrettypeownline
- \advance\tempnum by 1
- \def\maybeshapeline{0in \hsize}%
- \else
- \def\maybeshapeline{}%
- \fi
- %
- % The continuations:
- \dimen2=\hsize \advance\dimen2 by -\defargsindent
- %
- % The final paragraph shape:
- \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
- %
- % Put the category name at the right margin.
- \noindent
- \hbox to 0pt{%
- \hfil\box0 \kern-\hsize
- % \hsize has to be shortened this way:
- \kern\leftskip
- % Intentionally do not respect \rightskip, since we need the space.
- }%
- %
- % Allow all lines to be underfull without complaint:
- \tolerance=10000 \hbadness=10000
- \exdentamount=\defbodyindent
- {%
- \def\^^M{}% for line continuation
- %
- % defun fonts. We use typewriter by default (used to be bold) because:
- % . we're printing identifiers, they should be in tt in principle.
- % . in languages with many accents, such as Czech or French, it's
- % common to leave accents off identifiers. The result looks ok in
- % tt, but exceedingly strange in rm.
- % . we don't want -- and --- to be treated as ligatures.
- % . this still does not fix the ?` and !` ligatures, but so far no
- % one has made identifiers using them :).
- \df \tt
- \def\temp{#2}% text of the return type
- \ifx\temp\empty\else
- \tclose{\temp}% typeset the return type
- \ifrettypeownline
- % put return type on its own line; prohibit line break following:
- \hfil\vadjust{\nobreak}\break
- \else
- \space % type on same line, so just followed by a space
- \fi
- \fi % no return type
- #3% output function name
- }%
- \ifflagclear{txidefnamenospace}{%
- {\rm\enskip}% hskip 0.5 em of \rmfont
- }{}%
- %
- \parenbrackglyphs
- % arguments will be output next, if any.
-}
-
-% Print arguments. Use slanted for @def*, typewriter for @deftype*.
-\def\defunargs#1{%
- \bgroup
- \def\^^M{}% for line continuation
- \df \ifdoingtypefn \tt \else \sl \fi
- \ifflagclear{txicodevaristt}{}%
- % use \ttsl for @var in both @def* and @deftype*.
- % the kern prevents an italic correction at end, which appears
- % too much for ttsl.
- {\def\var##1{{\setregularquotes \ttsl ##1\kern 0pt }}}%
- #1%
- \egroup
-}
-
-% We want ()&[] to print specially on the defun line.
-%
-\def\activeparens{%
- \catcode`\(=\active \catcode`\)=\active
- \catcode`\[=\active \catcode`\]=\active
- \catcode`\&=\active
-}
-
-% Make control sequences which act like normal parenthesis chars.
-\let\lparen = ( \let\rparen = )
-
-% Be sure that we always have a definition for `(', etc. For example,
-% if the fn name has parens in it, \parenbrackglyphs will not be in
-% effect yet, so TeX would otherwise complain about undefined control
-% sequence.
-{
- \activeparens
- \gdef\defcharsdefault{%
- \let(=\lparen \let)=\rparen
- \let[=\lbrack \let]=\rbrack
- \let& = \&%
- }
- \globaldefs=1 \defcharsdefault
-
- \gdef\parenbrackglyphs{\let(=\opnr\let)=\cpnr\let[=\lbrb\let]=\rbrb}
- \gdef\magicamp{\let&=\amprm}
-}
-\let\ampchar\&
-
-\def\amprm#1 {{\rm\ }}
-
-\newcount\parencount
-% opening and closing parentheses in roman font
-\def\opnr{%
- \ptexslash % italic correction
- \global\advance\parencount by 1
- {\sf(}%
-}
-\def\cpnr{%
- \ptexslash % italic correction
- {\sf)}%
- \global\advance\parencount by -1
-}
-
-\newcount\brackcount
-% left and right square brackets in bold font
-\def\lbrb{%
- \global\advance\brackcount by 1
- {\bf[}%
-}
-\def\rbrb{%
- {\bf]}%
- \global\advance\brackcount by -1
-}
-
-\def\checkparencounts{%
- \ifnum\parencount=0 \else \badparencount \fi
- \ifnum\brackcount=0 \else \badbrackcount \fi
-}
-% these should not use \errmessage; the glibc manual, at least, actually
-% has such constructs (when documenting function pointers).
-\def\badparencount{%
- \message{Warning: unbalanced parentheses in @def...}%
- \global\parencount=0
-}
-\def\badbrackcount{%
- \message{Warning: unbalanced square brackets in @def...}%
- \global\brackcount=0
-}
-
-
-\message{macros,}
-% @macro.
-
-% To do this right we need a feature of e-TeX, \scantokens,
-% which we arrange to emulate with a temporary file in ordinary TeX.
-\ifx\eTeXversion\thisisundefined
- \newwrite\macscribble
- \def\scantokens#1{%
- \toks0={#1}%
- \immediate\openout\macscribble=\jobname.tmp
- \immediate\write\macscribble{\the\toks0}%
- \immediate\closeout\macscribble
- \input \jobname.tmp
- }
-\fi
-
-% Used at the time of macro expansion.
-% Argument is macro body with arguments substituted
-\def\scanmacro#1{%
- \newlinechar`\^^M
- \def\xeatspaces##1{\eatleadingcrthen\eatspaces{##1}}%
- %
- % Process the macro body under the current catcode regime.
- \scantokens{#1@comment}%
- %
- % The \comment is to remove the \newlinechar added by \scantokens, and
- % can be noticed by \parsearg. Note \c isn't used because this means cedilla
- % in math mode.
-}
-
-% Used for copying and captions
-\def\scanexp#1{%
- \expandafter\scanmacro\expandafter{#1}%
-}
-
-\newcount\paramno % Count of parameters
-\newtoks\macname % Macro name
-\newif\ifrecursive % Is it recursive?
-
-% List of all defined macros in the form
-% \commondummyword\macro1\commondummyword\macro2...
-% Currently is also contains all @aliases; the list can be split
-% if there is a need.
-\def\macrolist{}
-
-% Add the macro to \macrolist
-\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
-\def\addtomacrolistxxx#1{%
- \toks0 = \expandafter{\macrolist\commondummyword#1}%
- \xdef\macrolist{\the\toks0}%
-}
-
-% Utility routines.
-% This does \let #1 = #2, with \csnames; that is,
-% \let \csname#1\endcsname = \csname#2\endcsname
-% (except of course we have to play expansion games).
-%
-\def\cslet#1#2{%
- \expandafter\let
- \csname#1\expandafter\endcsname
- \csname#2\endcsname
-}
-
-% Trim leading and trailing spaces off a string.
-% Concepts from aro-bend problem 15 (see CTAN).
-{\catcode`\@=11
-\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
-\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
-\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
-\def\unbrace#1{#1}
-\unbrace{\gdef\trim@@@ #1 } #2@{#1}
-}
-
-% Trim a single leading ^^M off a string, then call #1
-{\catcode`\^^M=\active \catcode`\Q=3%
-\gdef\eatleadingcrthen #1#2{\eatlcra #1Q#2Q^^MQ}%
-\gdef\eatlcra #1#2Q^^M{\eatlcrb #1#2Q}%
-\gdef\eatlcrb #1Q#2Q#3Q{#1{#2}}%
-}
-
-% Trim a single trailing ^^M off a string.
-{\catcode`\^^M=\other \catcode`\Q=3%
-\gdef\eatcr #1{\eatcra #1Q^^MQ}%
-\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
-\gdef\eatcrb#1Q#2Q{#1}%
-}
-
-% Macro bodies are absorbed as an argument in a context where
-% all characters are catcode 10, 11 or 12, except \ which is active
-% (as in normal texinfo). It is necessary to change the definition of \
-% to recognize macro arguments; this is the job of \mbodybackslash.
-%
-% Non-ASCII encodings make 8-bit characters active, so un-activate
-% them to avoid their expansion. Must do this non-globally, to
-% confine the change to the current group.
-%
-% It's necessary to have hard CRs when the macro is executed. This is
-% done by making ^^M (\endlinechar) catcode 12 when reading the macro
-% body, and then making it the \newlinechar in \scanmacro.
-%
-\def\scanctxt{% used as subroutine
- \catcode`\"=\other
- \catcode`\+=\other
- \catcode`\<=\other
- \catcode`\>=\other
- \catcode`\^=\other
- \catcode`\_=\other
- \catcode`\|=\other
- \catcode`\~=\other
- \catcode`\@=\other
- \catcode`\^^M=\other
- \catcode`\\=\active
- \passthroughcharstrue
-}
-
-\def\macrobodyctxt{% used for @macro definitions and @copying
- \scanctxt
- \catcode`\ =\other
- \catcode`\{=\other
- \catcode`\}=\other
-}
-
-% Used when scanning braced macro arguments. Note, however, that catcode
-% changes here are ineffectual if the macro invocation was nested inside
-% an argument to another Texinfo command.
-\def\macroargctxt{%
- \scanctxt
- \catcode`\ =\active
-}
-
-\def\macrolineargctxt{% used for whole-line arguments without braces
- \scanctxt
- \catcode`\{=\other
- \catcode`\}=\other
-}
-
-% \mbodybackslash is the definition of \ in @macro bodies.
-% It maps \foo\ => \csname macarg.foo\endcsname => #N
-% where N is the macro parameter number.
-% We define \csname macarg.\endcsname to be \realbackslash, so
-% \\ in macro replacement text gets you a backslash.
-%
-{\catcode`@=0 @catcode`@\=@active
- @gdef@usembodybackslash{@let\=@mbodybackslash}
- @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
-}
-\expandafter\def\csname macarg.\endcsname{\realbackslash}
-
-\def\margbackslash#1{\char`\#1 }
-
-\def\macro{\recursivefalse\parsearg\macroxxx}
-\def\rmacro{\recursivetrue\parsearg\macroxxx}
-
-\def\macroxxx#1{%
- \getargs{#1}% now \macname is the macname and \argl the arglist
- \ifx\argl\empty % no arguments
- \paramno=0\relax
- \else
- \expandafter\parsemargdef \argl;%
- \if\paramno>256\relax
- \ifx\eTeXversion\thisisundefined
- \errhelp = \EMsimple
- \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
- \fi
- \fi
- \fi
- \if1\csname ismacro.\the\macname\endcsname
- \message{Warning: redefining \the\macname}%
- \else
- \expandafter\ifx\csname \the\macname\endcsname \relax
- \else \errmessage{Macro name \the\macname\space already defined}\fi
- \global\cslet{macsave.\the\macname}{\the\macname}%
- \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
- \addtomacrolist{\the\macname}%
- \fi
- \begingroup \macrobodyctxt \usembodybackslash
- \ifrecursive \expandafter\parsermacbody
- \else \expandafter\parsemacbody
- \fi}
-
-\parseargdef\unmacro{%
- \if1\csname ismacro.#1\endcsname
- \global\cslet{#1}{macsave.#1}%
- \global\expandafter\let \csname ismacro.#1\endcsname=0%
- % Remove the macro name from \macrolist:
- \begingroup
- \expandafter\let\csname#1\endcsname \relax
- \let\commondummyword\unmacrodo
- \xdef\macrolist{\macrolist}%
- \endgroup
- \fi
-}
-
-% Called by \do from \dounmacro on each macro. The idea is to omit any
-% macro definitions that have been changed to \relax.
-%
-\def\unmacrodo#1{%
- \ifx #1\relax
- % remove this
- \else
- \noexpand\commondummyword \noexpand#1%
- \fi
-}
-
-% \getargs -- Parse the arguments to a @macro line. Set \macname to
-% the name of the macro, and \argl to the braced argument list.
-\def\getargs#1{\getargsxxx#1{}}
-\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
-\def\getmacname#1 #2\relax{\macname={#1}}
-\def\getmacargs#1{\def\argl{#1}}
-% This made use of the feature that if the last token of a
-% <parameter list> is #, then the preceding argument is delimited by
-% an opening brace, and that opening brace is not consumed.
-
-% Make @ a letter, so that we can make private-to-Texinfo macro names.
-\edef\texiatcatcode{\the\catcode`\@}
-\catcode `@=11\relax
-
-% Parse the optional {params} list to @macro or @rmacro.
-% Set \paramno to the number of arguments,
-% and \paramlist to a parameter text for the macro (e.g. #1,#2,#3 for a
-% three-param macro.) Define \macarg.BLAH for each BLAH in the params
-% list to some hook where the argument is to be expanded. If there are
-% less than 10 arguments that hook is to be replaced by ##N where N
-% is the position in that list, that is to say the macro arguments are to be
-% defined `a la TeX in the macro body.
-%
-% That gets used by \mbodybackslash (above).
-%
-% If there are 10 or more arguments, a different technique is used: see
-% \parsemmanyargdef@@.
-%
-\def\parsemargdef#1;{%
- \paramno=0\def\paramlist{}%
- \let\hash\relax
- % \hash is redefined to `#' later to get it into definitions
- \let\xeatspaces\relax
- \parsemargdefxxx#1,;,%
- \ifnum\paramno<10\relax\else
- \paramno0\relax
- \parsemmanyargdef@@#1,;,% 10 or more arguments
- \fi
-}
-\def\parsemargdefxxx#1,{%
- \if#1;\let\next=\relax
- \else \let\next=\parsemargdefxxx
- \advance\paramno by 1
- \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
- {\xeatspaces{\hash\the\paramno}}%
- \edef\paramlist{\paramlist\hash\the\paramno,}%
- \fi\next}
-
-% \parsemacbody, \parsermacbody
-%
-% Read recursive and nonrecursive macro bodies. (They're different since
-% rec and nonrec macros end differently.)
-%
-% We are in \macrobodyctxt, and the \xdef causes backslashes in the macro
-% body to be transformed.
-% Set \macrobody to the body of the macro, and call \macrodef.
-%
-\catcode `\@\texiatcatcode
-{\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{%
-\xdef\macrobody{\eatcr{#1}}\endgroup\macrodef}}%
-{\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{%
-\xdef\macrobody{\eatcr{#1}}\endgroup\macrodef}}%
-\catcode `\@=11\relax
-
-%%%%%%%%%%%%%% Code for > 10 arguments only %%%%%%%%%%%%%%%%%%
-
-% If there are 10 or more arguments, a different technique is used, where the
-% hook remains in the body, and when macro is to be expanded the body is
-% processed again to replace the arguments.
-%
-% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
-% argument N value and then \edef the body (nothing else will expand because of
-% the catcode regime under which the body was input).
-%
-% If you compile with TeX (not eTeX), and you have macros with 10 or more
-% arguments, no macro can have more than 256 arguments (else error).
-%
-% In case that there are 10 or more arguments we parse again the arguments
-% list to set new definitions for the \macarg.BLAH macros corresponding to
-% each BLAH argument. It was anyhow needed to parse already once this list
-% in order to count the arguments, and as macros with at most 9 arguments
-% are by far more frequent than macro with 10 or more arguments, defining
-% twice the \macarg.BLAH macros does not cost too much processing power.
-\def\parsemmanyargdef@@#1,{%
- \if#1;\let\next=\relax
- \else
- \let\next=\parsemmanyargdef@@
- \edef\tempb{\eatspaces{#1}}%
- \expandafter\def\expandafter\tempa
- \expandafter{\csname macarg.\tempb\endcsname}%
- % Note that we need some extra \noexpand\noexpand, this is because we
- % don't want \the to be expanded in the \parsermacbody as it uses an
- % \xdef .
- \expandafter\edef\tempa
- {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
- \advance\paramno by 1\relax
- \fi\next}
-
-
-\let\endargs@\relax
-\let\nil@\relax
-\def\nilm@{\nil@}%
-\long\def\nillm@{\nil@}%
-
-% This macro is expanded during the Texinfo macro expansion, not during its
-% definition. It gets all the arguments' values and assigns them to macros
-% macarg.ARGNAME
-%
-% #1 is the macro name
-% #2 is the list of argument names
-% #3 is the list of argument values
-\def\getargvals@#1#2#3{%
- \def\macargdeflist@{}%
- \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
- \def\paramlist{#2,\nil@}%
- \def\macroname{#1}%
- \begingroup
- \macroargctxt
- \def\argvaluelist{#3,\nil@}%
- \def\@tempa{#3}%
- \ifx\@tempa\empty
- \setemptyargvalues@
- \else
- \getargvals@@
- \fi
-}
-\def\getargvals@@{%
- \ifx\paramlist\nilm@
- % Some sanity check needed here that \argvaluelist is also empty.
- \ifx\argvaluelist\nillm@
- \else
- \errhelp = \EMsimple
- \errmessage{Too many arguments in macro `\macroname'!}%
- \fi
- \let\next\macargexpandinbody@
- \else
- \ifx\argvaluelist\nillm@
- % No more arguments values passed to macro. Set remaining named-arg
- % macros to empty.
- \let\next\setemptyargvalues@
- \else
- % pop current arg name into \@tempb
- \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
- \expandafter\@tempa\expandafter{\paramlist}%
- % pop current argument value into \@tempc
- \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
- \expandafter\@tempa\expandafter{\argvaluelist}%
- % Here \@tempb is the current arg name and \@tempc is the current arg value.
- % First place the new argument macro definition into \@tempd
- \expandafter\macname\expandafter{\@tempc}%
- \expandafter\let\csname macarg.\@tempb\endcsname\relax
- \expandafter\def\expandafter\@tempe\expandafter{%
- \csname macarg.\@tempb\endcsname}%
- \edef\@tempd{\long\def\@tempe{\the\macname}}%
- \push@\@tempd\macargdeflist@
- \let\next\getargvals@@
- \fi
- \fi
- \next
-}
-
-\def\push@#1#2{%
- \expandafter\expandafter\expandafter\def
- \expandafter\expandafter\expandafter#2%
- \expandafter\expandafter\expandafter{%
- \expandafter#1#2}%
-}
-
-% Replace arguments by their values in the macro body, and place the result
-% in macro \@tempa.
-%
-\def\macvalstoargs@{%
- % To do this we use the property that token registers that are \the'ed
- % within an \edef expand only once. So we are going to place all argument
- % values into respective token registers.
- %
- % First we save the token context, and initialize argument numbering.
- \begingroup
- \paramno0\relax
- % Then, for each argument number #N, we place the corresponding argument
- % value into a new token list register \toks#N
- \expandafter\putargsintokens@\saveparamlist@,;,%
- % Then, we expand the body so that argument are replaced by their
- % values. The trick for values not to be expanded themselves is that they
- % are within tokens and that tokens expand only once in an \edef .
- \edef\@tempc{\csname mac.\macroname .body\endcsname}%
- % Now we restore the token stack pointer to free the token list registers
- % which we have used, but we make sure that expanded body is saved after
- % group.
- \expandafter
- \endgroup
- \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
- }
-
-% Define the named-macro outside of this group and then close this group.
-%
-\def\macargexpandinbody@{%
- \expandafter
- \endgroup
- \macargdeflist@
- % First the replace in body the macro arguments by their values, the result
- % is in \@tempa .
- \macvalstoargs@
- % Then we point at the \norecurse or \gobble (for recursive) macro value
- % with \@tempb .
- \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
- % Depending on whether it is recursive or not, we need some tailing
- % \egroup .
- \ifx\@tempb\gobble
- \let\@tempc\relax
- \else
- \let\@tempc\egroup
- \fi
- % And now we do the real job:
- \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
- \@tempd
-}
-
-\def\putargsintokens@#1,{%
- \if#1;\let\next\relax
- \else
- \let\next\putargsintokens@
- % First we allocate the new token list register, and give it a temporary
- % alias \@tempb .
- \toksdef\@tempb\the\paramno
- % Then we place the argument value into that token list register.
- \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
- \expandafter\@tempb\expandafter{\@tempa}%
- \advance\paramno by 1\relax
- \fi
- \next
-}
-
-% Trailing missing arguments are set to empty.
-%
-\def\setemptyargvalues@{%
- \ifx\paramlist\nilm@
- \let\next\macargexpandinbody@
- \else
- \expandafter\setemptyargvaluesparser@\paramlist\endargs@
- \let\next\setemptyargvalues@
- \fi
- \next
-}
-
-\def\setemptyargvaluesparser@#1,#2\endargs@{%
- \expandafter\def\expandafter\@tempa\expandafter{%
- \expandafter\def\csname macarg.#1\endcsname{}}%
- \push@\@tempa\macargdeflist@
- \def\paramlist{#2}%
-}
-
-% #1 is the element target macro
-% #2 is the list macro
-% #3,#4\endargs@ is the list value
-\def\pop@#1#2#3,#4\endargs@{%
- \def#1{#3}%
- \def#2{#4}%
-}
-\long\def\longpop@#1#2#3,#4\endargs@{%
- \long\def#1{#3}%
- \long\def#2{#4}%
-}
-
-
-%%%%%%%%%%%%%% End of code for > 10 arguments %%%%%%%%%%%%%%%%%%
-
-
-% This defines a Texinfo @macro or @rmacro, called by \parsemacbody.
-% \macrobody has the body of the macro in it, with placeholders for
-% its parameters, looking like "\xeatspaces{\hash 1}".
-% \paramno is the number of parameters
-% \paramlist is a TeX parameter text, e.g. "#1,#2,#3,"
-% There are four cases: macros of zero, one, up to nine, and many arguments.
-% \xdef is used so that macro definitions will survive the file
-% they're defined in: @include reads the file inside a group.
-%
-\def\macrodef{%
- \let\hash=##% convert placeholders to macro parameter chars
- \ifnum\paramno=1
- \long\def\xeatspaces##1{##1}%
- % We don't use \xeatspaces for single-argument macros, because we
- % want to keep ends of lines. This definition removes \xeatspaces
- % when \macrobody is expanded below.
- \else
- \def\xeatspaces{\string\xeatspaces}%
- % This expands \xeatspaces as a sequence of character tokens, which
- % stops \scantokens inserting an extra space after the control sequence.
- \fi
- \ifcase\paramno
- % 0
- \expandafter\xdef\csname\the\macname\endcsname{%
- \begingroup
- \noexpand\spaceisspace
- \noexpand\ignoreactivenewline
- \noexpand\expandafter % skip any whitespace after the macro name.
- \expandafter\noexpand\csname\the\macname @@@\endcsname}%
- \expandafter\xdef\csname\the\macname @@@\endcsname{%
- \endgroup
- \noexpand\scanmacro{\macrobody}}%
- \or % 1
- \expandafter\xdef\csname\the\macname\endcsname{%
- \begingroup
- \noexpand\braceorline
- \expandafter\noexpand\csname\the\macname @@@\endcsname}%
- \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
- \endgroup
- \noexpand\scanmacro{\macrobody}%
- }%
- \else % at most 9
- \ifnum\paramno<10\relax
- % @MACNAME sets the context for reading the macro argument
- % @MACNAME@@ gets the argument, processes backslashes and appends a
- % comma.
- % @MACNAME@@@ removes braces surrounding the argument list.
- % @MACNAME@@@@ scans the macro body with arguments substituted.
- \expandafter\xdef\csname\the\macname\endcsname{%
- \begingroup
- \noexpand\expandafter % This \expandafter skip any spaces after the
- \noexpand\macroargctxt % macro before we change the catcode of space.
- \noexpand\expandafter
- \expandafter\noexpand\csname\the\macname @@\endcsname}%
- \expandafter\xdef\csname\the\macname @@\endcsname##1{%
- \noexpand\passargtomacro
- \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}%
- \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
- \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}%
- \expandaftergroup{\expandafter\xdef\csname\the\macname @@@@\endcsname}%
- \paramlist{%
- \endgroup\noexpand\scanmacro{\macrobody}}%
- \else % 10 or more:
- \expandafter\xdef\csname\the\macname\endcsname{%
- \noexpand\getargvals@{\the\macname}{\argl}%
- }%
- \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody
- \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
- \fi
- \fi}
-
-\catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes
-
-% utility definition to avoid excessive use of \expandafter. call
-% as \expandaftergroup{CONTENT}\WORD to expand \WORD exactly once and remove
-% braces around CONTENT.
-\def\expandaftergroup#1#2{%
- \expandafter\expandaftergroupx\expandafter{#2}{#1}%
-}
-\def\expandaftergroupx#1#2{%
- #2#1%
-}
-
-\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-{\catcode`\@=0 \catcode`\\=13 % We need to manipulate \ so use @ as escape
-@catcode`@_=11 % private names
-@catcode`@!=11 % used as argument separator
-
-% \passargtomacro#1#2 -
-% Call #1 with a list of tokens #2, with any doubled backslashes in #2
-% compressed to one.
-%
-% This implementation works by expansion, and not execution (so we cannot use
-% \def or similar). This reduces the risk of this failing in contexts where
-% complete expansion is done with no execution (for example, in writing out to
-% an auxiliary file for an index entry).
-%
-% State is kept in the input stream: the argument passed to
-% @look_ahead, @gobble_and_check_finish and @add_segment is
-%
-% THE_MACRO ARG_RESULT ! {PENDING_BS} NEXT_TOKEN (... rest of input)
-%
-% where:
-% THE_MACRO - name of the macro we want to call
-% ARG_RESULT - argument list we build to pass to that macro
-% PENDING_BS - either a backslash or nothing
-% NEXT_TOKEN - used to look ahead in the input stream to see what's coming next
-
-@gdef@passargtomacro#1#2{%
- @add_segment #1!{}@relax#2\@_finish\%
-}
-@gdef@_finish{@_finishx} @global@let@_finishx@relax
-
-% #1 - THE_MACRO ARG_RESULT
-% #2 - PENDING_BS
-% #3 - NEXT_TOKEN
-% #4 used to look ahead
-%
-% If the next token is not a backslash, process the rest of the argument;
-% otherwise, remove the next token.
-@gdef@look_ahead#1!#2#3#4{%
- @ifx#4\%
- @expandafter@gobble_and_check_finish
- @else
- @expandafter@add_segment
- @fi#1!{#2}#4#4%
-}
-
-% #1 - THE_MACRO ARG_RESULT
-% #2 - PENDING_BS
-% #3 - NEXT_TOKEN
-% #4 should be a backslash, which is gobbled.
-% #5 looks ahead
-%
-% Double backslash found. Add a single backslash, and look ahead.
-@gdef@gobble_and_check_finish#1!#2#3#4#5{%
- @add_segment#1\!{}#5#5%
-}
-
-@gdef@is_fi{@fi}
-
-% #1 - THE_MACRO ARG_RESULT
-% #2 - PENDING_BS
-% #3 - NEXT_TOKEN
-% #4 is input stream until next backslash
-%
-% Input stream is either at the start of the argument, or just after a
-% backslash sequence, either a lone backslash, or a doubled backslash.
-% NEXT_TOKEN contains the first token in the input stream: if it is \finish,
-% finish; otherwise, append to ARG_RESULT the segment of the argument up until
-% the next backslash. PENDING_BACKSLASH contains a backslash to represent
-% a backslash just before the start of the input stream that has not been
-% added to ARG_RESULT.
-@gdef@add_segment#1!#2#3#4\{%
-@ifx#3@_finish
- @call_the_macro#1!%
-@else
- % append the pending backslash to the result, followed by the next segment
- @expandafter@is_fi@look_ahead#1#2#4!{\}@fi
- % this @fi is discarded by @look_ahead.
- % we can't get rid of it with \expandafter because we don't know how
- % long #4 is.
-}
-
-% #1 - THE_MACRO
-% #2 - ARG_RESULT
-% #3 discards the res of the conditional in @add_segment, and @is_fi ends the
-% conditional.
-@gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}}
-
-}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-% \braceorline MAC is used for a one-argument macro MAC. It checks
-% whether the next non-whitespace character is a {. It sets the context
-% for reading the argument (slightly different in the two cases). Then,
-% to read the argument, in the whole-line case, it then calls the regular
-% \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC.
-%
-\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
-\def\braceorlinexxx{%
- \ifx\nchar\bgroup
- \macroargctxt
- \expandafter\passargtomacro
- \else
- \macrolineargctxt\expandafter\parsearg
- \fi \macnamexxx}
-
-
-% @linemacro
-
-\parseargdef\linemacro{%
- \getargs{#1}% now \macname is the macname and \argl the arglist
- \ifx\argl\empty
- \paramno=0
- \let\hash\relax
- \def\paramlist{\hash 1\endlinemacro}%
- \else
- \expandafter\linegetparamlist\argl;%
- \fi
- \begingroup \macrobodyctxt \usembodybackslash
- \parselinemacrobody
-}
-
-% Build up \paramlist which will be used as the parameter text for the macro.
-% At the end it will be like "#1 #2 #3\endlinemacro".
-\def\linegetparamlist#1;{%
- \paramno=0\def\paramlist{}%
- \let\hash\relax
- \linegetparamlistxxx#1,;,%
-}
-\def\linegetparamlistxxx#1,{%
- \if#1;\let\next=\linegetparamlistxxxx
- \else \let\next=\linegetparamlistxxx
- \advance\paramno by 1
- \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
- {\hash\the\paramno}%
- \edef\paramlist{\paramlist\hash\the\paramno\space}%
- \fi\next}
-\def\linegetparamlistxxxx{%
- \expandafter\fixparamlist\paramlist\fixparamlist
-}
-% Replace final space token
-\def\fixparamlist#1 \fixparamlist{%
- \def\paramlist{#1\endlinemacro}%
-}
-
-% Read the body of the macro, replacing backslash-surrounded variables
-%
-{\catcode`\ =\other\long\gdef\parselinemacrobody#1@end linemacro{%
-\xdef\macrobody{#1}%
-\endgroup
-\linemacrodef
-}}
-
-% Make the definition
-\def\linemacrodef{%
- \let\hash=##%
- \expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup
- \noexpand\parsearg
- \expandafter\noexpand\csname\the\macname @@\endcsname
- }
- \expandafter\xdef\csname\the\macname @@\endcsname##1{%
- \egroup
- \expandafter\noexpand
- \csname\the\macname @@@\endcsname##1\noexpand\endlinemacro
- }
- \expandaftergroup{\expandafter\xdef\csname\the\macname @@@\endcsname}%
- \paramlist{%
- \newlinechar=13 % split \macrobody into lines
- \noexpand\scantokens{\macrobody}%
- }
-}
-
-
-
-% @alias.
-% We need some trickery to remove the optional spaces around the equal
-% sign. Make them active and then expand them all to nothing.
-%
-\def\alias{\parseargusing\obeyspaces\aliasxxx}
-\def\aliasxxx #1{\aliasyyy#1\relax}
-\def\aliasyyy #1=#2\relax{%
- {%
- \expandafter\let\obeyedspace=\empty
- \addtomacrolist{#1}%
- \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
- }%
- \next
-}
-
-
-\message{cross references,}
-
-\newwrite\auxfile
-\newif\ifhavexrefs % True if xref values are known.
-\newif\ifwarnedxrefs % True if we warned once that they aren't known.
-
-% @inforef is relatively simple.
-\def\inforef #1{\inforefzzz #1,,,,**}
-\def\inforefzzz #1,#2,#3,#4**{%
- \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
- node \samp{\ignorespaces#1{}}}
-
-% @node's only job in TeX is to define \lastnode, which is used in
-% cross-references. The @node line might or might not have commas, and
-% might or might not have spaces before the first comma, like:
-% @node foo , bar , ...
-% We don't want such trailing spaces in the node name.
-%
-\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
-%
-% also remove a trailing comma, in case of something like this:
-% @node Help-Cross, , , Cross-refs
-\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
-\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}\omittopnode}
-
-% Used so that the @top node doesn't have to be wrapped in an @ifnottex
-% conditional.
-% \doignore goes to more effort to skip nested conditionals but we don't need
-% that here.
-\def\omittopnode{%
- \ifx\lastnode\wordTop
- \expandafter\ignorenode\fi
-}
-\def\wordTop{Top}
-
-% Until the next @node, @part or @bye command, divert output to a box that
-% is not output.
-\def\ignorenode{\setbox\dummybox\vbox\bgroup
-\def\part{\egroup\part}%
-\def\node{\egroup\node}%
-\ignorenodebye
-}
-
-{\let\bye\relax
-\gdef\ignorenodebye{\let\bye\ignorenodebyedef}
-\gdef\ignorenodebyedef{\egroup(`Top' node ignored)\bye}}
-% The redefinition of \bye here is because it is declared \outer
-
-\let\lastnode=\empty
-
-% Write a cross-reference definition for the current node. #1 is the
-% type (Ynumbered, Yappendix, Ynothing). #2 is the section title.
-%
-\def\donoderef#1#2{%
- \ifx\lastnode\empty\else
- \setref{\lastnode}{#1}{#2}%
- \global\let\lastnode=\empty
- \setnodeseenonce
- \fi
-}
-\def\setnodeseenonce{
- \global\nodeseentrue
- \let\setnodeseenonce\relax
-}
-
-% @nodedescription, @nodedescriptionblock - do nothing for TeX
-\parseargdef\nodedescription{}
-\def\nodedescriptionblock{\doignore{nodedescriptionblock}}
-
-
-% @anchor{NAME} -- define xref target at arbitrary point.
-%
-\newcount\savesfregister
-%
-\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
-\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
-\def\anchor#1{%
- \savesf \setref{#1}{Yanchor}{#1}\restoresf \ignorespaces
-}
-
-% @namedanchor{NAME, XREFNAME} -- define xref target at arbitrary point
-% with label text for cross-references to it.
-\def\namedanchor#1{\donamedanchor#1\finish}%
-\def\donamedanchor#1,#2\finish{%
- \savesf \setref{#1}{Yanchor}{\ignorespaces #2\unskip}\restoresf \ignorespaces
-}
-
-% \setref{NAME}{SNT}{TITLE} defines a cross-reference point NAME (a node
-% or an anchor), which consists of three parts:
-% 1) NAME-title - the current sectioning name
-% 2) NAME-snt - section number and type, passed as the SNT arg.
-% 3) NAME-pg - the page number.
-%
-% This is called from \donoderef, \anchor, and \dofloat. In the case of
-% floats, there is an additional part, which is not written here:
-% 4) NAME-lof - the text as it should appear in a @listoffloats.
-%
-\def\setref#1#2#3{%
- \pdfmkdest{#1}%
- \iflinks
- {%
- \requireauxfile
- \atdummies % preserve commands, but don't expand them
- % match definition in \xrdef, \refx, \xrefX.
- \def\value##1{##1}%
- \edef\writexrdef##1##2{%
- \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
- ##1}{##2}}% these are parameters of \writexrdef
- }%
- \toks0 = {#3}%
- \immediate \writexrdef{title}{\the\toks0 }%
- \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
- \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
- }%
- \fi
-}
-
-% @xrefautosectiontitle on|off says whether @section(ing) names are used
-% automatically in xrefs, if the third arg is not explicitly specified.
-% This was provided as a "secret" @set xref-automatic-section-title
-% variable, now it's official.
-%
-\parseargdef\xrefautomaticsectiontitle{%
- \def\temp{#1}%
- \ifx\temp\onword
- \expandafter\let\csname SETxref-automatic-section-title\endcsname
- = \empty
- \else\ifx\temp\offword
- \expandafter\let\csname SETxref-automatic-section-title\endcsname
- = \relax
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
- must be on|off}%
- \fi\fi
-}
-
-%
-% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
-% the node name, #2 the name of the Info cross-reference, #3 the printed
-% node name, #4 the name of the Info file, #5 the name of the printed
-% manual. All but the node name can be omitted.
-%
-\def\pxref{\putwordsee{} \xrefXX}
-\def\xref{\putwordSee{} \xrefXX}
-\def\ref{\xrefXX}
-
-\def\xrefXX#1{\def\xrefXXarg{#1}\futurelet\tokenafterxref\xrefXXX}
-\def\xrefXXX{\expandafter\xrefX\expandafter[\xrefXXarg,,,,,,,]}
-%
-\newbox\toprefbox
-\newbox\printedrefnamebox
-\newbox\infofilenamebox
-\newbox\printedmanualbox
-%
-\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
- \unsepspaces
- %
- \getprintedrefname{#1}{#3}{#5}%
- \def\infofilename{\ignorespaces #4}%
- \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
- %
- \startxreflink{#1}{#4}%
- \getrefx{#1-title}\Xthisreftitle
- %
- % Float references are printed completely differently: "Figure 1.2"
- % instead of "[somenode], p.3". \iffloat distinguishes them by
- % \Xthisreftitle being set to a magic string.
- \iffloat\Xthisreftitle
- % If the user specified the print name (third arg) to the ref,
- % print it instead of our usual "Figure 1.2".
- \ifdim\wd\printedrefnamebox = 0pt
- \refx{#1-snt}%
- \else
- \printedrefname
- \fi
- %
- % If the user also gave the printed manual name (fifth arg), append
- % "in MANUALNAME".
- \ifdim \wd\printedmanualbox > 0pt
- \space \putwordin{} \cite{\printedmanual}%
- \fi
- \else
- % node/anchor (non-float) references.
- %
- % If we use \unhbox to print the node names, TeX does not insert
- % empty discretionaries after hyphens, which means that it will not
- % find a line break at a hyphen in a node names. Since some manuals
- % are best written with fairly long node names, containing hyphens,
- % this is a loss. Therefore, we give the text of the node name
- % again, so it is as if TeX is seeing it for the first time.
- %
- \ifdim \wd\printedmanualbox > 0pt
- % Cross-manual reference with a printed manual name.
- %
- \crossmanualxref{\cite{\printedmanual\unskip}}%
- \else\ifdim \wd\infofilenamebox > 0pt
- % Cross-manual reference with only an info filename (arg 4), no
- % printed manual name (arg 5). This is essentially the same as
- % the case above; we output the filename, since we have nothing else.
- %
- \crossmanualxref{\code{\infofilename\unskip}}%
- \else
- % Reference within this manual.
- %
- % Only output a following space if the -snt ref is nonempty, as is
- % the case for @unnumbered and @anchor.
- \getrefx{#1-snt}\tmp
- \ifx\tmp\empty\else
- \ifx\tmp\Yanchor\else
- \tmp\space
- \fi
- \fi
- %
- % output the `[mynode]' via the macro below so it can be overridden.
- \xrefprintnodename\printedrefname
- %
- \ifflagclear{txiomitxrefpg}{%
- % We always want a comma
- ,%
- % output the `page 3'.
- \turnoffactive \putpageref{#1}%
- % Add a , if xref followed by a space
- \if\space\noexpand\tokenafterxref ,%
- \else\ifx\ \tokenafterxref ,% @TAB
- \else\ifx\*\tokenafterxref ,% @*
- \else\ifx\ \tokenafterxref ,% @SPACE
- \else\ifx\
- \tokenafterxref ,% @NL
- \else\ifx\tie\tokenafterxref ,% @tie
- \fi\fi\fi\fi\fi\fi
- }{}%
- \fi\fi
- \fi
- \endlink
-\endgroup}
-
-% \getprintedrefname{NODE}{LABEL}{MANUAL}
-% - set \printedrefname and \printedmanual
-%
-\def\getprintedrefname#1#2#3{%
- % Get args without leading/trailing spaces.
- \def\printedrefname{\ignorespaces #2}%
- \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
- %
- \def\printedmanual{\ignorespaces #3}%
- \setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
- %
- % If the printed reference name (arg #2) was not explicitly given in
- % the @xref, figure out what we want to use.
- \ifdim \wd\printedrefnamebox = 0pt
- % No printed node name was explicitly given.
- \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
- % Not auto section-title: use node name inside the square brackets.
- \def\printedrefname{\ignorespaces #1}%
- \else
- % Auto section-title: use chapter/section title inside
- % the square brackets if we have it.
- \ifdim \wd\printedmanualbox > 0pt
- % It is in another manual, so we don't have it; use node name.
- \def\printedrefname{\ignorespaces #1}%
- \else
- \ifhavexrefs
- % We (should) know the real title if we have the xref values.
- \def\printedrefname{\refx{#1-title}}%
- \else
- % Otherwise just copy the Info node name.
- \def\printedrefname{\ignorespaces #1}%
- \fi
- \fi
- \fi
- \fi
-}
-
-% \startxreflink{NODE}{FILE} - start link in pdf output.
-\def\startxreflink#1#2{%
- \ifpdforxetex
- % For pdfTeX and LuaTeX
- {\indexnofonts
- \makevalueexpandable
- \turnoffactive
- % This expands tokens, so do it after making catcode changes, so _
- % etc. don't get their TeX definitions. This ignores all spaces in
- % #2, including (wrongly) those in the middle of the filename.
- \getfilename{#2}%
- %
- % This (wrongly) does not take account of leading or trailing
- % spaces in #1, which should be ignored.
- \setpdfdestname{#1}%
- %
- \ifx\pdfdestname\empty
- \def\pdfdestname{Top}% no empty targets
- \fi
- %
- \leavevmode
- \ifpdf
- \startlink attr{/Border [0 0 0]}%
- \ifnum\filenamelength>0
- goto file{\the\filename.pdf} name{\pdfdestname}%
- \else
- goto name{\pdfdestname}%
- \fi
- \else % XeTeX
- \ifnum\filenamelength>0
- % With default settings,
- % XeTeX (xdvipdfmx) replaces link destination names with integers.
- % In this case, the replaced destination names of
- % remote PDFs are no longer known. In order to avoid a replacement,
- % you can use xdvipdfmx's command line option `-C 0x0010'.
- % If you use XeTeX 0.99996+ (TeX Live 2016+),
- % this command line option is no longer necessary
- % because we can use the `dvipdfmx:config' special.
- \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A
- << /S /GoToR /F (\the\filename.pdf) /D (\pdfdestname) >> >>}%
- \else
- \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A
- << /S /GoTo /D (\pdfdestname) >> >>}%
- \fi
- \fi
- }%
- \setcolor{\linkcolor}%
- \fi
-}
-
-% can be overridden in translation files
-\def\putpageref#1{%
- \space\putwordpage\tie\refx{#1-pg}}
-
-% Output a cross-manual xref to #1. Used just above (twice).
-%
-% Only include the text "Section ``foo'' in" if the foo is neither
-% missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
-% "see The Foo Manual", the idea being to refer to the whole manual.
-%
-% But, this being TeX, we can't easily compare our node name against the
-% string "Top" while ignoring the possible spaces before and after in
-% the input. By adding the arbitrary 7sp below, we make it much less
-% likely that a real node name would have the same width as "Top" (e.g.,
-% in a monospaced font). Hopefully it will never happen in practice.
-%
-% For the same basic reason, we retypeset the "Top" at every
-% reference, since the current font is indeterminate.
-%
-\def\crossmanualxref#1{%
- \setbox\toprefbox = \hbox{Top\kern7sp}%
- \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
- \ifdim \wd2 > 7sp % nonempty?
- \ifdim \wd2 = \wd\toprefbox \else % same as Top?
- \putwordSection{} ``\printedrefname'' \putwordin{}\space
- \fi
- \fi
- #1%
-}
-
-% This macro is called from \xrefX for the `[nodename]' part of xref
-% output. It's a separate macro only so it can be changed more easily,
-% since square brackets don't work well in some documents. Particularly
-% one that Bob is working on :).
-%
-\def\xrefprintnodename#1{[#1]}
-
-% @link{NODENAME, LABEL, MANUAL} - create a "plain" link, with no
-% page number. Not useful if printed on paper.
-%
-\def\link#1{\linkX[#1,,,]}
-\def\linkX[#1,#2,#3,#4]{%
- \begingroup
- \unsepspaces
- \getprintedrefname{#1}{#2}{#3}%
- \startxreflink{#1}{#3}%
- \printedrefname
- \endlink
- \endgroup
-}
-
-
-% Things referred to by \setref.
-%
-\def\Ynothing{}
-\def\Yomitfromtoc{}
-\def\Yanchor{\isanchor} \let\isanchor\relax
-\def\Ynumbered{%
- \ifnum\secno=0
- \putwordChapter@tie \the\chapno
- \else \ifnum\subsecno=0
- \putwordSection@tie \the\chapno.\the\secno
- \else \ifnum\subsubsecno=0
- \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
- \else
- \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
- \fi\fi\fi
-}
-\def\Yappendix{%
- \ifnum\secno=0
- \putwordAppendix@tie @char\the\appendixno{}%
- \else \ifnum\subsecno=0
- \putwordSection@tie @char\the\appendixno.\the\secno
- \else \ifnum\subsubsecno=0
- \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
- \else
- \putwordSection@tie
- @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
- \fi\fi\fi
-}
-
-% \refx{NAME} - reference a cross-reference string named NAME.
-\def\refx#1{%
- \getrefx{#1}\thisrefX
- \ifx\thisrefX\relax
- % If not defined, say something at least.
- \angleleft un\-de\-fined\angleright
- \iflinks
- \ifhavexrefs
- {\toks0 = {#1}% avoid expansion of possibly-complex value
- \message{\linenumber Undefined cross reference `\the\toks0'.}}%
- \else
- \ifwarnedxrefs\else
- \global\warnedxrefstrue
- \message{Cross reference values unknown; you must run TeX again.}%
- \fi
- \fi
- \fi
- \else
- % It's defined, so just use it.
- \thisrefX
- \fi
-}
-
-% Set #2 to xref string #1
-\def\getrefx#1#2{%
- \requireauxfile
- {%
- \indexnofonts
- \turnoffactive
- \def\value##1{##1}%
- \expandafter\global\expandafter\let\expandafter#2\csname XR#1\endcsname
- }%
-}
-
-% This is the macro invoked by entries in the aux file. Define a control
-% sequence for a cross-reference target (we prepend XR to the control sequence
-% name to avoid collisions). The value is the page number. If this is a float
-% type, we have more work to do.
-%
-\def\xrdef#1#2{%
- {% Expand the node or anchor name to remove control sequences.
- % \turnoffactive stops 8-bit characters being changed to commands
- % like @'e. \refx does the same to retrieve the value in the definition.
- \indexnofonts
- \turnoffactive
- \def\value##1{##1}%
- \xdef\safexrefname{#1}%
- }%
- %
- \bgroup
- \expandafter\gdef\csname XR\safexrefname\endcsname{#2}%
- \egroup
- % We put the \gdef inside a group to avoid the definitions building up on
- % TeX's save stack, which can cause it to run out of space for aux files with
- % thousands of lines. \gdef doesn't use the save stack, but \csname does
- % when it defines an unknown control sequence as \relax.
- %
- % Was that xref control sequence that we just defined for a float?
- \expandafter\iffloat\csname XR\safexrefname\endcsname
- % it was a float, and we have the (safe) float type in \iffloattype.
- \expandafter\let\expandafter\floatlist
- \csname floatlist\iffloattype\endcsname
- %
- % Is this the first time we've seen this float type?
- \expandafter\ifx\floatlist\relax
- \toks0 = {\do}% yes, so just \do
- \else
- % had it before, so preserve previous elements in list.
- \toks0 = \expandafter{\floatlist\do}%
- \fi
- %
- % Remember this xref in the control sequence \floatlistFLOATTYPE,
- % for later use in \listoffloats.
- \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
- {\safexrefname}}%
- \fi
- \ignorespaces % ignore ends of line in aux file
-}
-
-% If working on a large document in chapters, it is convenient to
-% be able to disable indexing, cross-referencing, and contents, for test runs.
-% This is done with @novalidate at the beginning of the file.
-%
-\newif\iflinks \linkstrue % by default we want the aux files.
-\let\novalidate = \linksfalse
-
-% Used when writing to the aux file, or when using data from it.
-\def\requireauxfile{%
- \iflinks
- \tryauxfile
- % Open the new aux file. TeX will close it automatically at exit.
- \immediate\openout\auxfile=\jobname.aux
- \fi
- \global\let\requireauxfile=\relax % Only do this once.
-}
-
-% Read the last existing aux file, if any. No error if none exists.
-%
-\def\tryauxfile{%
- \ifxetex\xetexpreauxfile\fi
- \openin 1 \jobname.aux
- \ifeof 1 \else
- \readdatafile{aux}%
- \global\havexrefstrue
- \fi
- \closein 1
- \ifxetex\xetexpostauxfile\fi
-}
-
-\def\setupdatafile{%
- \catcode`\^^@=\other
- \catcode`\^^A=\other
- \catcode`\^^B=\other
- \catcode`\^^C=\other
- \catcode`\^^D=\other
- \catcode`\^^E=\other
- \catcode`\^^F=\other
- \catcode`\^^G=\other
- \catcode`\^^H=\other
- \catcode`\^^K=\other
- \catcode`\^^L=\other
- \catcode`\^^N=\other
- \catcode`\^^P=\other
- \catcode`\^^Q=\other
- \catcode`\^^R=\other
- \catcode`\^^S=\other
- \catcode`\^^T=\other
- \catcode`\^^U=\other
- \catcode`\^^V=\other
- \catcode`\^^W=\other
- \catcode`\^^X=\other
- \catcode`\^^Z=\other
- \catcode`\^^[=\other
- \catcode`\^^\=\other
- \catcode`\^^]=\other
- \catcode`\^^^=\other
- \catcode`\^^_=\other
- \catcode`\^=\other
- %
- % Special characters. Should be turned off anyway, but...
- \catcode`\~=\other
- \catcode`\[=\other
- \catcode`\]=\other
- \catcode`\"=\other
- \catcode`\_=\active
- \catcode`\|=\active
- \catcode`\<=\active
- \catcode`\>=\active
- \catcode`\$=\other
- \catcode`\#=\other
- \catcode`\&=\other
- \catcode`\%=\other
- \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
- %
- \catcode`\\=\active
- %
- % @ is our escape character in .aux files, and we need braces.
- \catcode`\{=1
- \catcode`\}=2
- \catcode`\@=0
-}
-
-\def\readdatafile#1{%
-\begingroup
- \setupdatafile
- \input\jobname.#1
-\endgroup}
-
-
-\message{insertions,}
-% including footnotes.
-
-\newcount \footnoteno
-
-% The trailing space in the following definition for supereject is
-% vital for proper filling; pages come out unaligned when you do a
-% pagealignmacro call if that space before the closing brace is
-% removed. (Generally, numeric constants should always be followed by a
-% space to prevent strange expansion errors.)
-\def\supereject{\par\penalty -20000\footnoteno =0 }
-
-% @footnotestyle is meaningful for Info output only.
-\let\footnotestyle=\comment
-
-{\catcode `\@=11
-%
-% Auto-number footnotes. Otherwise like plain.
-\gdef\footnote{%
- \global\advance\footnoteno by \@ne
- %
- % Output for the footnote marker. If we are immediately after another
- % footnote, output a comma and small space first.
- \edef\thisfootno{$^{\ifnum\lastpenalty=3 ,\mskip 1mu \fi\the\footnoteno}$}%
- %
- % In case the footnote comes at the end of a sentence, preserve the
- % extra spacing after we do the footnote number.
- \let\@sf\empty
- \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
- %
- % Remove inadvertent blank space before typesetting the footnote number.
- \unskip
- %
- % \scriptspace is 0.5pt by default and gives excessive space before the
- % comma if we have multiple footnote markers in a row.
- \bgroup\scriptspace=0pt
- \thisfootno\@sf
- \egroup
- \dofootnote
-}%
-
-% marker for immediately after a footnote marker
-\gdef\footnoteendmarker{\penalty3 }
-
-% Do not require the footnote text as a parameter; otherwise, @ifset
-% (and anything else that uses \parseargline) fails inside footnotes
-% because the tokens are fixed when the footnote is read.
-%
-\gdef\dofootnote{%
- \insert\footins\bgroup
- \aftergroup\footnoteendmarker
- %
- % Nested footnotes are not supported in TeX, that would take a lot
- % more work. (\startsavinginserts does not suffice.)
- \let\footnote=\errfootnotenest
- %
- % We want to typeset this text as a normal paragraph, even if the
- % footnote reference occurs in (for example) a display environment.
- % So reset some parameters.
- \hsize=\txipagewidth
- \interlinepenalty\interfootnotelinepenalty
- \splittopskip\ht\strutbox % top baseline for broken footnotes
- \splitmaxdepth\dp\strutbox
- \floatingpenalty\@MM
- \leftskip\z@skip
- \rightskip\z@skip
- \spaceskip\z@skip
- \xspaceskip\z@skip
- \parindent\defaultparindent
- %
- \smallfonts \rm
- %
- % Because we use hanging indentation in footnotes, a @noindent appears
- % to exdent this text, so make it be a no-op. makeinfo does not use
- % hanging indentation so @noindent can still be needed within footnote
- % text after an @example or the like (not that this is good style).
- \let\noindent = \relax
- %
- % Hang the footnote text off the number. Use \everypar in case the
- % footnote extends for more than one paragraph.
- \everypar = {\hang}%
- \textindent{$^{\the\footnoteno}$}%
- %
- % Don't crash into the line above the footnote text. Since this
- % expands into a box, it must come within the paragraph, lest it
- % provide a place where TeX can split the footnote.
- \footstrut
- %
- % Eat opening brace and invoke rest of plain TeX footnote routine.
- \futurelet\next\fo@t
-}
-}%end \catcode `\@=11
-
-\def\errfootnotenest{%
- \errhelp=\EMsimple
- \errmessage{Nested footnotes not supported in texinfo.tex,
- even though they work in makeinfo; sorry}
-}
-
-\def\errfootnoteheading{%
- \errhelp=\EMsimple
- \errmessage{Footnotes in chapters, sections, etc., are not supported}
-}
-
-% In case a @footnote appears in a vbox, save the footnote text and create
-% the real \insert just after the vbox finished. Otherwise, the insertion
-% would be lost.
-% Similarly, if a @footnote appears inside an alignment, save the footnote
-% text to a box and make the \insert when a row of the table is finished.
-% And the same can be done for other insert classes. --kasal, 16nov03.
-%
-% Replace the \insert primitive by a cheating macro.
-% Deeper inside, just make sure that the saved insertions are not spilled
-% out prematurely.
-%
-\def\startsavinginserts{%
- \ifx \insert\ptexinsert
- \let\insert\saveinsert
- \else
- \let\checkinserts\relax
- \fi
-}
-
-% This \insert replacement works for both \insert\footins{foo} and
-% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
-%
-\def\saveinsert#1{%
- \edef\next{\noexpand\savetobox \makeSAVEname#1}%
- \afterassignment\next
- % swallow the left brace
- \let\temp =
-}
-\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
-\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
-
-\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
-
-\def\placesaveins#1{%
- \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
- {\box#1}%
-}
-
-% eat @SAVE -- beware, all of them have catcode \other:
-{
- \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
- \gdef\gobblesave @SAVE{}
-}
-
-% initialization:
-\def\newsaveins #1{%
- \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
- \next
-}
-\def\newsaveinsX #1{%
- \csname newbox\endcsname #1%
- \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
- \checksaveins #1}%
-}
-
-% initialize:
-\let\checkinserts\empty
-\newsaveins\footins
-\newsaveins\margin
-
-
-% @image. We use the macros from epsf.tex to support this.
-% If epsf.tex is not installed and @image is used, we complain.
-%
-% Check for and read epsf.tex up front. If we read it only at @image
-% time, we might be inside a group, and then its definitions would get
-% undone and the next image would fail.
-\openin 1 = epsf.tex
-\ifeof 1 \else
- % Do not bother showing banner with epsf.tex v2.7k (available in
- % doc/epsf.tex and on ctan).
- \def\epsfannounce{\toks0 = }%
- \input epsf.tex
-\fi
-\closein 1
-%
-% We will only complain once about lack of epsf.tex.
-\newif\ifwarnednoepsf
-\newhelp\noepsfhelp{epsf.tex must be installed for images to
- work. It is also included in the Texinfo distribution, or you can get
- it from https://ctan.org/texarchive/macros/texinfo/texinfo/doc/epsf.tex.}
-%
-\def\image#1{%
- \ifx\epsfbox\thisisundefined
- \ifwarnednoepsf \else
- \errhelp = \noepsfhelp
- \errmessage{epsf.tex not found, images will be ignored}%
- \global\warnednoepsftrue
- \fi
- \else
- \imagexxx #1,,,,,\finish
- \fi
-}
-
-% Approximate height of a line in the standard text font.
-\newdimen\capheight
-\setbox0=\vbox{\tenrm H}
-\capheight=\ht0
-
-%
-% Arguments to @image:
-% #1 is (mandatory) image filename; we tack on .eps extension.
-% #2 is (optional) width, #3 is (optional) height.
-% #4 is (ignored optional) html alt text.
-% #5 is (ignored optional) extension.
-% #6 is just the usual extra ignored arg for parsing stuff.
-\newif\ifimagevmode
-\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
- \catcode`\^^M = 5 % in case we're inside an example
- \normalturnoffactive % allow _ et al. in names
- \makevalueexpandable
- \ifvmode
- \imagevmodetrue
- \medskip
- % Usually we'll have text after the image which will insert
- % \parskip glue, so insert it here too to equalize the space
- % above and below.
- \vskip\parskip
- %
- % Place image in a \vtop for a top page margin that is (close to) correct,
- % as \topskip glue is relative to the first baseline.
- \vtop\bgroup \kern -\capheight \vskip-\parskip
- \fi
- %
- \ifx\centersub\centerV
- % For @center @image, enter vertical mode and add vertical space
- % Enter an extra \parskip because @center doesn't add space itself.
- \vbox\bgroup\vskip\parskip\medskip\vskip\parskip
- \else
- % Enter horizontal mode so that indentation from an enclosing
- % environment such as @quotation is respected.
- % However, if we're at the top level, we don't want the
- % normal paragraph indentation.
- \imageindent
- \fi
- %
- % Output the image.
- \ifpdf
- % For pdfTeX and LuaTeX <= 0.80
- \dopdfimage{#1}{#2}{#3}%
- \else
- \ifxetex
- \doxeteximage{#1}{#2}{#3}%
- \else
- % For epsf.tex
- % \epsfbox itself resets \epsf?size at each figure.
- \setbox0 = \hbox{\ignorespaces #2}%
- \ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
- \setbox0 = \hbox{\ignorespaces #3}%
- \ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
- \epsfbox{#1.eps}%
- \fi
- \fi
- %
- \ifimagevmode
- \egroup
- \medskip % space after a standalone image
- \fi
- \ifx\centersub\centerV % @center @image
- \medskip
- \egroup % close \vbox
- \fi
-\endgroup}
-
-
-% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
-% etc. We don't actually implement floating yet, we always include the
-% float "here". But it seemed the best name for the future.
-%
-\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
-
-% There may be a space before second and/or third parameter; delete it.
-\def\eatcommaspace#1, {#1,}
-
-% #1 is the optional FLOATTYPE, the text label for this float, typically
-% "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
-% this float will not be numbered and cannot be referred to.
-%
-% #2 is the optional xref label. Also must be present for the float to
-% be referable.
-%
-% #3 is the optional positioning argument; for now, it is ignored. It
-% will somehow specify the positions allowed to float to (here, top, bottom).
-%
-% We keep a separate counter for each FLOATTYPE, which we reset at each
-% chapter-level command.
-\let\resetallfloatnos=\empty
-%
-\def\dofloat#1,#2,#3,#4\finish{%
- \let\thiscaption=\empty
- \let\thisshortcaption=\empty
- %
- % don't lose footnotes inside @float.
- %
- % BEWARE: when the floats start float, we have to issue warning whenever an
- % insert appears inside a float which could possibly float. --kasal, 26may04
- %
- \startsavinginserts
- %
- % We can't be used inside a paragraph.
- \par
- %
- \vtop\bgroup
- \def\floattype{#1}%
- \def\floatlabel{#2}%
- \def\floatloc{#3}% we do nothing with this yet.
- %
- \ifx\floattype\empty
- \let\safefloattype=\empty
- \else
- {%
- % the floattype might have accents or other special characters,
- % but we need to use it in a control sequence name.
- \indexnofonts
- \turnoffactive
- \xdef\safefloattype{\floattype}%
- }%
- \fi
- %
- % If label is given but no type, we handle that as the empty type.
- \ifx\floatlabel\empty \else
- % We want each FLOATTYPE to be numbered separately (Figure 1,
- % Table 1, Figure 2, ...). (And if no label, no number.)
- %
- \expandafter\getfloatno\csname\safefloattype floatno\endcsname
- \global\advance\floatno by 1
- %
- {%
- % This magic value for the third argument of \setref is output as
- % the XREFLABEL-title value. \xrefX uses it to distinguish float
- % labels (which have a completely different output format) from
- % node and anchor labels. And \xrdef uses it to construct the
- % lists of floats.
- %
- \edef\tmp{\noexpand\setref{\noexpand\floatlabel}{Yfloat}%
- {\floatmagic=\safefloattype}}%
- \tmp
- }%
- \fi
- %
- % start with \parskip glue, I guess.
- \vskip\parskip
- %
- % Don't suppress indentation if a float happens to start a section.
- \restorefirstparagraphindent
-}
-
-% we have these possibilities:
-% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
-% @float Foo,lbl & no caption: Foo 1.1
-% @float Foo & @caption{Cap}: Foo: Cap
-% @float Foo & no caption: Foo
-% @float ,lbl & Caption{Cap}: 1.1: Cap
-% @float ,lbl & no caption: 1.1
-% @float & @caption{Cap}: Cap
-% @float & no caption:
-%
-\def\Efloat{%
- \let\floatident = \empty
- %
- % In all cases, if we have a float type, it comes first.
- \ifx\floattype\empty \else \def\floatident{\floattype}\fi
- %
- % If we have an xref label, the number comes next.
- \ifx\floatlabel\empty \else
- \ifx\floattype\empty \else % if also had float type, need tie first.
- \appendtomacro\floatident{\tie}%
- \fi
- % the number.
- \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
- \fi
- %
- % Start the printed caption with what we've constructed in
- % \floatident, but keep it separate; we need \floatident again.
- \let\captionline = \floatident
- %
- \ifx\thiscaption\empty \else
- \ifx\floatident\empty \else
- \appendtomacro\captionline{: }% had ident, so need a colon between
- \fi
- %
- % caption text.
- \appendtomacro\captionline{\scanexp\thiscaption}%
- \fi
- %
- % If we have anything to print, print it, with space before.
- % Eventually this needs to become an \insert.
- \ifx\captionline\empty \else
- \vskip.5\parskip
- \captionline
- %
- % Space below caption.
- \vskip\parskip
- \fi
- %
- % If have an xref label, write the list of floats info. Do this
- % after the caption, to avoid chance of it being a breakpoint.
- \ifx\floatlabel\empty \else
- % Write the text that goes in the lof to the aux file as
- % \floatlabel-lof. Besides \floatident, we include the short
- % caption if specified, else the full caption if specified, else nothing.
- {%
- \requireauxfile
- \atdummies
- %
- \ifx\thisshortcaption\empty
- \def\gtemp{\thiscaption}%
- \else
- \def\gtemp{\thisshortcaption}%
- \fi
- \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
- \ifx\gtemp\empty \else : \gtemp \fi}}%
- }%
- \fi
- \egroup % end of \vtop
- %
- \checkinserts
-}
-
-% Append the tokens #2 to the definition of macro #1, not expanding either.
-%
-\def\appendtomacro#1#2{%
- \expandafter\def\expandafter#1\expandafter{#1#2}%
-}
-
-% @caption, @shortcaption
-%
-\def\caption{\docaption\thiscaption}
-\def\shortcaption{\docaption\thisshortcaption}
-\def\docaption{\checkenv\float \bgroup\scanctxt\docaptionz}
-\def\docaptionz#1#2{\egroup \def#1{#2}}
-
-% The parameter is the control sequence identifying the counter we are
-% going to use. Create it if it doesn't exist and assign it to \floatno.
-\def\getfloatno#1{%
- \ifx#1\relax
- % Haven't seen this figure type before.
- \csname newcount\endcsname #1%
- %
- % Remember to reset this floatno at the next chap.
- \expandafter\gdef\expandafter\resetallfloatnos
- \expandafter{\resetallfloatnos #1=0 }%
- \fi
- \let\floatno#1%
-}
-
-% \setref calls this to get the XREFLABEL-snt value. We want an @xref
-% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
-% first read the @float command.
-%
-\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
-
-% Magic string used for the XREFLABEL-title value, so \xrefX can
-% distinguish floats from other xref types.
-\def\floatmagic{!!float!!}
-
-% #1 is the control sequence we are passed; we expand into a conditional
-% which is true if #1 represents a float ref. That is, the magic
-% value which we passed to \setref above.
-%
-\def\iffloat#1{\expandafter\doiffloat#1==\finish}
-%
-% #1 is (maybe) the \floatmagic string. If so, #2 will be the
-% (safe) float type for this float. We set \iffloattype to #2.
-%
-\def\doiffloat#1=#2=#3\finish{%
- \def\temp{#1}%
- \def\iffloattype{#2}%
- \ifx\temp\floatmagic
-}
-
-% @listoffloats FLOATTYPE - print a list of floats like a table of contents.
-%
-\parseargdef\listoffloats{%
- \def\floattype{#1}% floattype
- {%
- % the floattype might have accents or other special characters,
- % but we need to use it in a control sequence name.
- \indexnofonts
- \turnoffactive
- \xdef\safefloattype{\floattype}%
- }%
- %
- % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
- \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
- \ifhavexrefs
- % if the user said @listoffloats foo but never @float foo.
- \message{\linenumber No `\safefloattype' floats to list.}%
- \fi
- \else
- \begingroup
- \leftskip=\tocindent % indent these entries like a toc
- \let\do=\listoffloatsdo
- \csname floatlist\safefloattype\endcsname
- \endgroup
- \fi
-}
-
-% This is called on each entry in a list of floats. We're passed the
-% xref label, in the form LABEL-title, which is how we save it in the
-% aux file. We strip off the -title and look up \XRLABEL-lof, which
-% has the text we're supposed to typeset here.
-%
-% Figures without xref labels will not be included in the list (since
-% they won't appear in the aux file).
-%
-\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
-\def\listoffloatsdoentry#1-title\finish{{%
- % Can't fully expand XR#1-lof because it can contain anything. Just
- % pass the control sequence. On the other hand, XR#1-pg is just the
- % page number, and we want to fully expand that so we can get a link
- % in pdf output.
- \toksA = \expandafter{\csname XR#1-lof\endcsname}%
- %
- % use the same \entry macro we use to generate the TOC and index.
- \let\entry\entryinternal
- \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
- \writeentry
-}}
-
-
-\message{localization,}
-
-% For single-language documents, @documentlanguage is usually given very
-% early, just after @documentencoding. Single argument is the language
-% (de) or locale (de_DE) abbreviation.
-%
-{
- \catcode`\_ = \active
- \globaldefs=1
-\parseargdef\documentlanguage{%
- \tex % read txi-??.tex file in plain TeX.
- % Read the file by the name they passed if it exists.
- \let_ = \normalunderscore % normal _ character for filename test
- \openin 1 txi-#1.tex
- \ifeof 1
- \documentlanguagetrywithoutunderscore #1_\finish
- \else
- \globaldefs = 1 % everything in the txi-LL files needs to persist
- \input txi-#1.tex
- \fi
- \closein 1
- \endgroup % end raw TeX
-}
-%
-% If they passed de_DE, and txi-de_DE.tex doesn't exist,
-% try txi-de.tex.
-%
-\gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
- \openin 1 txi-#1.tex
- \ifeof 1
- \def\lang{#1}%
- \def\enword{en}%
- \ifx\lang\enword
- % for English only, keep on going rather than issuing a fatal error
- % message, as txi-en.tex likely doesn't contain any changes from the
- % defaults. note that this is a problem if we already loaded another
- % language file and want to switch back to English.
- \message{Cannot read language file txi-#1.tex}%
- \else
- \errhelp = \nolanghelp
- \errmessage{Cannot read language file txi-#1.tex}%
- \fi
- \else
- \globaldefs = 1 % everything in the txi-LL files needs to persist
- \input txi-#1.tex
- \fi
- \closein 1
-}
-}% end of special _ catcode
-%
-\newhelp\nolanghelp{The given language definition file cannot be found or
-is empty. Maybe you need to install it? Putting it in the current
-directory should work if nowhere else does.}
-
-% This macro is called from txi-??.tex files; the first argument is the
-% \language name to set (without the "\lang@" prefix), the second and
-% third args are \{left,right}hyphenmin.
-%
-% The language names to pass are determined when the format is built.
-% See the etex.log file created at that time, e.g.,
-% /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
-%
-% With TeX Live 2008, etex now includes hyphenation patterns for all
-% available languages. This means we can support hyphenation in
-% Texinfo, at least to some extent. (This still doesn't solve the
-% accented characters problem.)
-%
-\catcode`@=11
-\def\txisetlanguage#1#2#3{%
- % do not set the language if the name is undefined in the current TeX.
- \expandafter\ifx\csname lang@#1\endcsname \relax
- \message{no patterns for #1}%
- \else
- \global\language = \csname lang@#1\endcsname
- \fi
- % but there is no harm in adjusting the hyphenmin values regardless.
- \global\lefthyphenmin = #2\relax
- \global\righthyphenmin = #3\relax
-}
-
-% XeTeX and LuaTeX can handle Unicode natively.
-% Their default I/O uses UTF-8 sequences instead of a byte-wise operation.
-% Other TeX engines' I/O (pdfTeX, etc.) is byte-wise.
-%
-\newif\iftxinativeunicodecapable
-\newif\iftxiusebytewiseio
-
-\ifxetex
- \txinativeunicodecapabletrue
- \txiusebytewiseiofalse
-\else
- \ifluatex
- \txinativeunicodecapabletrue
- \txiusebytewiseiofalse
- \else
- \txinativeunicodecapablefalse
- \txiusebytewiseiotrue
- \fi
-\fi
-
-\let\xetexpreauxfile\relax
-\let\xetexpostauxfile\relax
-
-% Set I/O by bytes instead of UTF-8 sequence for XeTeX and LuaTex
-% for non-UTF-8 (byte-wise) encodings.
-%
-\def\setbytewiseio{%
- \ifxetex
- % For document root file
- \XeTeXinputencoding "bytes"
- %
- % Setting for subsequent files to be read with @include.
- \XeTeXdefaultencoding "bytes"
- %
- % Use UTF-8 for reading auxiliary index and TOC files, which are
- % always output in UTF-8 with XeTeX.
- \def\xetexpreauxfile{\XeTeXdefaultencoding "UTF-8"}%
- \def\xetexpostauxfile{\XeTeXdefaultencoding "bytes"}%
- \fi
-
- \ifluatex
- \directlua{
- local utf8_char, byte, gsub = unicode.utf8.char, string.byte, string.gsub
- local function convert_char (char)
- return utf8_char(byte(char))
- end
-
- local function convert_line (line)
- return gsub(line, ".", convert_char)
- end
-
- callback.register("process_input_buffer", convert_line)
-
- local function convert_line_out (line)
- local line_out = ""
- for c in string.utfvalues(line) do
- line_out = line_out .. string.char(c)
- end
- return line_out
- end
-
- callback.register("process_output_buffer", convert_line_out)
- }
- \fi
-
- \txiusebytewiseiotrue
-}
-
-
-% Helpers for encodings.
-% Set the catcode of characters 128 through 255 to the specified number.
-%
-\def\setnonasciicharscatcode#1{%
- \count255=128
- \loop\ifnum\count255<256
- \global\catcode\count255=#1\relax
- \advance\count255 by 1
- \repeat
-}
-
-\def\setnonasciicharscatcodenonglobal#1{%
- \count255=128
- \loop\ifnum\count255<256
- \catcode\count255=#1\relax
- \advance\count255 by 1
- \repeat
-}
-
-% @documentencoding sets the definition of non-ASCII characters
-% according to the specified encoding.
-%
-\def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz}
-\def\documentencodingzzz#1{%
- %
- % Encoding being declared for the document.
- \def\declaredencoding{\csname #1.enc\endcsname}%
- %
- % Supported encodings: names converted to tokens in order to be able
- % to compare them with \ifx.
- \def\ascii{\csname US-ASCII.enc\endcsname}%
- \def\latnine{\csname ISO-8859-15.enc\endcsname}%
- \def\latone{\csname ISO-8859-1.enc\endcsname}%
- \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
- \def\utfeight{\csname UTF-8.enc\endcsname}%
- %
- \ifx \declaredencoding \ascii
- \asciichardefs
- %
- \else \ifx \declaredencoding \lattwo
- \iftxinativeunicodecapable
- \setbytewiseio
- \fi
- \setnonasciicharscatcode\active
- \lattwochardefs
- %
- \else \ifx \declaredencoding \latone
- \iftxinativeunicodecapable
- \setbytewiseio
- \fi
- \setnonasciicharscatcode\active
- \latonechardefs
- %
- \else \ifx \declaredencoding \latnine
- \iftxinativeunicodecapable
- \setbytewiseio
- \fi
- \setnonasciicharscatcode\active
- \latninechardefs
- %
- \else \ifx \declaredencoding \utfeight
- \iftxinativeunicodecapable
- % For native Unicode handling (XeTeX and LuaTeX)
- \nativeunicodechardefs
- \else
- % For treating UTF-8 as byte sequences (TeX, eTeX and pdfTeX).
- % Since we already invoke \utfeightchardefs at the top level,
- % making non-ascii chars active is sufficient.
- \setnonasciicharscatcode\active
- \fi
- %
- \else
- \message{Ignoring unknown document encoding: #1.}%
- %
- \fi % utfeight
- \fi % latnine
- \fi % latone
- \fi % lattwo
- \fi % ascii
- %
- \ifxetex
- \ifx \declaredencoding \utfeight
- \else
- \ifx \declaredencoding \ascii
- \else
- \message{Warning: XeTeX with non-UTF-8 encodings cannot handle %
- non-ASCII characters in auxiliary files.}%
- \fi
- \fi
- \fi
-}
-
-% A message to be logged when using a character that isn't available
-% the default font encoding (OT1).
-%
-\def\missingcharmsg#1{\message{Character missing, sorry: #1.}}
-
-% Take account of \c (plain) vs. \, (Texinfo) difference.
-\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
-
-\def\gdefchar#1#2{%
-\gdef#1{%
- \ifpassthroughchars
- \string#1%
- \else
- #2%
- \fi
-}}
-
-\begingroup
-
-% Make non-ASCII characters active for defining the character definition
-% macros.
-\setnonasciicharscatcode\active
-
-% Latin1 (ISO-8859-1) character definitions.
-\gdef\latonechardefs{%
- \gdefchar^^a0{\tie}
- \gdefchar^^a1{\exclamdown}
- \gdefchar^^a2{{\tcfont \char162}} % cent
- \gdefchar^^a3{\pounds{}}
- \gdefchar^^a4{{\tcfont \char164}} % currency
- \gdefchar^^a5{{\tcfont \char165}} % yen
- \gdefchar^^a6{{\tcfont \char166}} % broken bar
- \gdefchar^^a7{\S}
- \gdefchar^^a8{\"{}}
- \gdefchar^^a9{\copyright{}}
- \gdefchar^^aa{\ordf}
- \gdefchar^^ab{\guillemetleft{}}
- \gdefchar^^ac{\ensuremath\lnot}
- \gdefchar^^ad{\-}
- \gdefchar^^ae{\registeredsymbol{}}
- \gdefchar^^af{\={}}
- %
- \gdefchar^^b0{\textdegree}
- \gdefchar^^b1{$\pm$}
- \gdefchar^^b2{$^2$}
- \gdefchar^^b3{$^3$}
- \gdefchar^^b4{\'{}}
- \gdefchar^^b5{$\mu$}
- \gdefchar^^b6{\P}
- \gdefchar^^b7{\ensuremath\cdot}
- \gdefchar^^b8{\cedilla\ }
- \gdefchar^^b9{$^1$}
- \gdefchar^^ba{\ordm}
- \gdefchar^^bb{\guillemetright{}}
- \gdefchar^^bc{$1\over4$}
- \gdefchar^^bd{$1\over2$}
- \gdefchar^^be{$3\over4$}
- \gdefchar^^bf{\questiondown}
- %
- \gdefchar^^c0{\`A}
- \gdefchar^^c1{\'A}
- \gdefchar^^c2{\^A}
- \gdefchar^^c3{\~A}
- \gdefchar^^c4{\"A}
- \gdefchar^^c5{\ringaccent A}
- \gdefchar^^c6{\AE}
- \gdefchar^^c7{\cedilla C}
- \gdefchar^^c8{\`E}
- \gdefchar^^c9{\'E}
- \gdefchar^^ca{\^E}
- \gdefchar^^cb{\"E}
- \gdefchar^^cc{\`I}
- \gdefchar^^cd{\'I}
- \gdefchar^^ce{\^I}
- \gdefchar^^cf{\"I}
- %
- \gdefchar^^d0{\DH}
- \gdefchar^^d1{\~N}
- \gdefchar^^d2{\`O}
- \gdefchar^^d3{\'O}
- \gdefchar^^d4{\^O}
- \gdefchar^^d5{\~O}
- \gdefchar^^d6{\"O}
- \gdefchar^^d7{$\times$}
- \gdefchar^^d8{\O}
- \gdefchar^^d9{\`U}
- \gdefchar^^da{\'U}
- \gdefchar^^db{\^U}
- \gdefchar^^dc{\"U}
- \gdefchar^^dd{\'Y}
- \gdefchar^^de{\TH}
- \gdefchar^^df{\ss}
- %
- \gdefchar^^e0{\`a}
- \gdefchar^^e1{\'a}
- \gdefchar^^e2{\^a}
- \gdefchar^^e3{\~a}
- \gdefchar^^e4{\"a}
- \gdefchar^^e5{\ringaccent a}
- \gdefchar^^e6{\ae}
- \gdefchar^^e7{\cedilla c}
- \gdefchar^^e8{\`e}
- \gdefchar^^e9{\'e}
- \gdefchar^^ea{\^e}
- \gdefchar^^eb{\"e}
- \gdefchar^^ec{\`{\dotless i}}
- \gdefchar^^ed{\'{\dotless i}}
- \gdefchar^^ee{\^{\dotless i}}
- \gdefchar^^ef{\"{\dotless i}}
- %
- \gdefchar^^f0{\dh}
- \gdefchar^^f1{\~n}
- \gdefchar^^f2{\`o}
- \gdefchar^^f3{\'o}
- \gdefchar^^f4{\^o}
- \gdefchar^^f5{\~o}
- \gdefchar^^f6{\"o}
- \gdefchar^^f7{$\div$}
- \gdefchar^^f8{\o}
- \gdefchar^^f9{\`u}
- \gdefchar^^fa{\'u}
- \gdefchar^^fb{\^u}
- \gdefchar^^fc{\"u}
- \gdefchar^^fd{\'y}
- \gdefchar^^fe{\th}
- \gdefchar^^ff{\"y}
-}
-
-% Latin9 (ISO-8859-15) encoding character definitions.
-\gdef\latninechardefs{%
- % Encoding is almost identical to Latin1.
- \latonechardefs
- %
- \gdefchar^^a4{\euro{}}
- \gdefchar^^a6{\v S}
- \gdefchar^^a8{\v s}
- \gdefchar^^b4{\v Z}
- \gdefchar^^b8{\v z}
- \gdefchar^^bc{\OE}
- \gdefchar^^bd{\oe}
- \gdefchar^^be{\"Y}
-}
-
-% Latin2 (ISO-8859-2) character definitions.
-\gdef\lattwochardefs{%
- \gdefchar^^a0{\tie}
- \gdefchar^^a1{\ogonek{A}}
- \gdefchar^^a2{\u{}}
- \gdefchar^^a3{\L}
- \gdefchar^^a4{\missingcharmsg{CURRENCY SIGN}}
- \gdefchar^^a5{\v L}
- \gdefchar^^a6{\'S}
- \gdefchar^^a7{\S}
- \gdefchar^^a8{\"{}}
- \gdefchar^^a9{\v S}
- \gdefchar^^aa{\cedilla S}
- \gdefchar^^ab{\v T}
- \gdefchar^^ac{\'Z}
- \gdefchar^^ad{\-}
- \gdefchar^^ae{\v Z}
- \gdefchar^^af{\dotaccent Z}
- %
- \gdefchar^^b0{\textdegree}
- \gdefchar^^b1{\ogonek{a}}
- \gdefchar^^b2{\ogonek{ }}
- \gdefchar^^b3{\l}
- \gdefchar^^b4{\'{}}
- \gdefchar^^b5{\v l}
- \gdefchar^^b6{\'s}
- \gdefchar^^b7{\v{}}
- \gdefchar^^b8{\cedilla\ }
- \gdefchar^^b9{\v s}
- \gdefchar^^ba{\cedilla s}
- \gdefchar^^bb{\v t}
- \gdefchar^^bc{\'z}
- \gdefchar^^bd{\H{}}
- \gdefchar^^be{\v z}
- \gdefchar^^bf{\dotaccent z}
- %
- \gdefchar^^c0{\'R}
- \gdefchar^^c1{\'A}
- \gdefchar^^c2{\^A}
- \gdefchar^^c3{\u A}
- \gdefchar^^c4{\"A}
- \gdefchar^^c5{\'L}
- \gdefchar^^c6{\'C}
- \gdefchar^^c7{\cedilla C}
- \gdefchar^^c8{\v C}
- \gdefchar^^c9{\'E}
- \gdefchar^^ca{\ogonek{E}}
- \gdefchar^^cb{\"E}
- \gdefchar^^cc{\v E}
- \gdefchar^^cd{\'I}
- \gdefchar^^ce{\^I}
- \gdefchar^^cf{\v D}
- %
- \gdefchar^^d0{\DH}
- \gdefchar^^d1{\'N}
- \gdefchar^^d2{\v N}
- \gdefchar^^d3{\'O}
- \gdefchar^^d4{\^O}
- \gdefchar^^d5{\H O}
- \gdefchar^^d6{\"O}
- \gdefchar^^d7{$\times$}
- \gdefchar^^d8{\v R}
- \gdefchar^^d9{\ringaccent U}
- \gdefchar^^da{\'U}
- \gdefchar^^db{\H U}
- \gdefchar^^dc{\"U}
- \gdefchar^^dd{\'Y}
- \gdefchar^^de{\cedilla T}
- \gdefchar^^df{\ss}
- %
- \gdefchar^^e0{\'r}
- \gdefchar^^e1{\'a}
- \gdefchar^^e2{\^a}
- \gdefchar^^e3{\u a}
- \gdefchar^^e4{\"a}
- \gdefchar^^e5{\'l}
- \gdefchar^^e6{\'c}
- \gdefchar^^e7{\cedilla c}
- \gdefchar^^e8{\v c}
- \gdefchar^^e9{\'e}
- \gdefchar^^ea{\ogonek{e}}
- \gdefchar^^eb{\"e}
- \gdefchar^^ec{\v e}
- \gdefchar^^ed{\'{\dotless{i}}}
- \gdefchar^^ee{\^{\dotless{i}}}
- \gdefchar^^ef{\v d}
- %
- \gdefchar^^f0{\dh}
- \gdefchar^^f1{\'n}
- \gdefchar^^f2{\v n}
- \gdefchar^^f3{\'o}
- \gdefchar^^f4{\^o}
- \gdefchar^^f5{\H o}
- \gdefchar^^f6{\"o}
- \gdefchar^^f7{$\div$}
- \gdefchar^^f8{\v r}
- \gdefchar^^f9{\ringaccent u}
- \gdefchar^^fa{\'u}
- \gdefchar^^fb{\H u}
- \gdefchar^^fc{\"u}
- \gdefchar^^fd{\'y}
- \gdefchar^^fe{\cedilla t}
- \gdefchar^^ff{\dotaccent{}}
-}
-
-\endgroup % active chars
-
-% UTF-8 character definitions.
-%
-% This code to support UTF-8 is based on LaTeX's utf8.def, with some
-% changes for Texinfo conventions. It is included here under the GPL by
-% permission from Frank Mittelbach and the LaTeX team.
-%
-\newcount\countUTFx
-\newcount\countUTFy
-\newcount\countUTFz
-
-\gdef\UTFviiiTwoOctets#1#2{\expandafter
- \UTFviiiDefined\csname u8:#1\string #2\endcsname}
-%
-\gdef\UTFviiiThreeOctets#1#2#3{\expandafter
- \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
-%
-\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
- \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
-
-\gdef\UTFviiiDefined#1{%
- \ifx #1\relax
- \ifutfviiidefinedwarning
- \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
- \fi
- \else
- \expandafter #1%
- \fi
-}
-\newif\ifutfviiidefinedwarning
-\utfviiidefinedwarningtrue
-
-% Give non-ASCII bytes the active definitions for processing UTF-8 sequences
-\begingroup
- \catcode`\~13
- \catcode`\$12
- \catcode`\"12
-
- % Loop from \countUTFx to \countUTFy, performing \UTFviiiTmp
- % substituting ~ and $ with a character token of that value.
- \gdef\UTFviiiLoop{%
- \catcode\countUTFx\active
- \uccode`\~\countUTFx
- \uccode`\$\countUTFx
- \uppercase\expandafter{\UTFviiiTmp}%
- \advance\countUTFx by 1
- \ifnum\countUTFx < \countUTFy
- \expandafter\UTFviiiLoop
- \fi}
- %
- % For bytes other than the first in a UTF-8 sequence. Not expected to
- % be expanded except when writing to auxiliary files.
- \countUTFx = "80
- \countUTFy = "C2
- \def\UTFviiiTmp{%
- \gdef~{%
- \ifpassthroughchars $\fi}}%
- \UTFviiiLoop
-
- \countUTFx = "C2
- \countUTFy = "E0
- \def\UTFviiiTmp{%
- \gdef~{%
- \ifpassthroughchars $%
- \else\expandafter\UTFviiiTwoOctets\expandafter$\fi}}%
- \UTFviiiLoop
-
- \countUTFx = "E0
- \countUTFy = "F0
- \def\UTFviiiTmp{%
- \gdef~{%
- \ifpassthroughchars $%
- \else\expandafter\UTFviiiThreeOctets\expandafter$\fi}}%
- \UTFviiiLoop
-
- \countUTFx = "F0
- \countUTFy = "F4
- \def\UTFviiiTmp{%
- \gdef~{%
- \ifpassthroughchars $%
- \else\expandafter\UTFviiiFourOctets\expandafter$\fi
- }}%
- \UTFviiiLoop
- %
- % for pdftex only, used to expand ASCII to UTF-16BE.
- \gdef\asciitounicode{%
- \countUTFx = "20
- \countUTFy = "80
- \def\UTFviiiTmp{%
- \def~{\nullbyte $}}%
- \UTFviiiLoop
- }
- {\catcode0=11 \gdef\nullbyte{^^00}}%
-\endgroup
-
-\def\globallet{\global\let} % save some \expandafter's below
-
-% @U{xxxx} to produce U+xxxx, if we support it.
-\def\U#1{%
- \expandafter\ifx\csname uni:#1\endcsname \relax
- \iftxinativeunicodecapable
- % All Unicode characters can be used if native Unicode handling is
- % active. However, if the font does not have the glyph,
- % letters are missing.
- \begingroup
- \uccode`\.="#1\relax
- \uppercase{.}
- \endgroup
- \else
- \errhelp = \EMsimple
- \errmessage{Unicode character U+#1 not supported, sorry}%
- \fi
- \else
- \csname uni:#1\endcsname
- \fi
-}
-
-% These macros are used here to construct the names of macros
-% that expand to the definitions for UTF-8 sequences.
-\def\UTFviiiTwoOctetsName#1#2{%
- \csname u8:#1\string #2\endcsname}%
-\def\UTFviiiThreeOctetsName#1#2#3{%
- \csname u8:#1\string #2\string #3\endcsname}%
-\def\UTFviiiFourOctetsName#1#2#3#4{%
- \csname u8:#1\string #2\string #3\string #4\endcsname}%
-
-% generate UTF-16 from codepoint
-\def\utfsixteentotoks#1#2{%
- \countUTFz = "#2\relax
- \ifnum \countUTFz > 65535
- % doesn't work for codepoints > U+FFFF
- % we don't define glyphs for any of these anyway, so it doesn't matter
- #1={U+#2}%
- \else
- \countUTFx = \countUTFz
- \divide\countUTFx by 256
- \countUTFy = \countUTFx
- \multiply\countUTFx by 256
- \advance\countUTFz by -\countUTFx
- \uccode`,=\countUTFy
- \uccode`;=\countUTFz
- \ifnum\countUTFy = 0
- \uppercase{#1={\nullbyte\string;}}%
- \else\ifnum\countUTFz = 0
- \uppercase{#1={\string,\nullbyte}}%
- \else
- \uppercase{#1={\string,\string;}}%
- \fi\fi
- % NB \uppercase cannot insert a null byte
- \fi
-}
-
-\newif\ifutfbytespdf
-\utfbytespdffalse
-
-% For UTF-8 byte sequences (TeX, e-TeX and pdfTeX),
-% provide a definition macro to replace a Unicode character;
-% this gets used by the @U command
-%
-\begingroup
- \catcode`\"=12
- \catcode`\<=12
- \catcode`\.=12
- \catcode`\,=12
- \catcode`\;=12
- \catcode`\!=12
- \catcode`\~=13
- \gdef\DeclareUnicodeCharacterUTFviii#1#2{%
- \countUTFz = "#1\relax
- \begingroup
- \parseXMLCharref
- %
- % Completely expand \UTFviiiTmp, which looks like:
- % 1. \UTFviiTwoOctetsName B1 B2
- % 2. \csname u8:B1 \string B2 \endcsname
- % 3. \u8: B1 B2 (a single control sequence token)
- \xdef\UTFviiiTmp{\UTFviiiTmp}%
- %
- \ifpdf
- \toksA={#2}%
- \utfsixteentotoks\toksB{#1}%
- \expandafter\xdef\UTFviiiTmp{%
- \noexpand\ifutfbytespdf\noexpand\utfbytes{\the\toksB}%
- \noexpand\else\the\toksA\noexpand\fi}%
- \else
- \expandafter\gdef\UTFviiiTmp{#2}%
- \fi
- %
- \expandafter\ifx\csname uni:#1\endcsname \relax \else
- \message{Internal error, already defined: #1}%
- \fi
- %
- % define an additional control sequence for this code point.
- \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp
- \endgroup}
- %
- % Given the value in \countUTFz as a Unicode code point, set
- % \UTFviiiTmp to one of the \UTVviii*OctetsName macros followed by
- % the corresponding UTF-8 sequence.
- \gdef\parseXMLCharref{%
- \ifnum\countUTFz < "20\relax
- \errhelp = \EMsimple
- \errmessage{Cannot define Unicode char value < 0020}%
- \else\ifnum\countUTFz < "800\relax
- \parseUTFviiiA,%
- \parseUTFviiiB C\UTFviiiTwoOctetsName.,%
- \else\ifnum\countUTFz < "10000\relax
- \parseUTFviiiA;%
- \parseUTFviiiA,%
- \parseUTFviiiB E\UTFviiiThreeOctetsName.{,;}%
- \else
- \parseUTFviiiA;%
- \parseUTFviiiA,%
- \parseUTFviiiA!%
- \parseUTFviiiB F\UTFviiiFourOctetsName.{!,;}%
- \fi\fi\fi
- }
-
- % Extract a byte from the end of the UTF-8 representation of \countUTFx.
- % It must be a non-initial byte in the sequence.
- % Change \uccode of #1 for it to be used in \parseUTFviiiB as one
- % of the bytes.
- \gdef\parseUTFviiiA#1{%
- \countUTFx = \countUTFz
- \divide\countUTFz by 64
- \countUTFy = \countUTFz % Save to be the future value of \countUTFz.
- \multiply\countUTFz by 64
-
- % \countUTFz is now \countUTFx with the last 5 bits cleared. Subtract
- % in order to get the last five bits.
- \advance\countUTFx by -\countUTFz
-
- % Convert this to the byte in the UTF-8 sequence.
- \advance\countUTFx by 128
- \uccode `#1\countUTFx
- \countUTFz = \countUTFy}
-
- % Used to put a UTF-8 byte sequence into \UTFviiiTmp
- % #1 is the increment for \countUTFz to yield a the first byte of the UTF-8
- % sequence.
- % #2 is one of the \UTFviii*OctetsName macros.
- % #3 is always a full stop (.)
- % #4 is a template for the other bytes in the sequence. The values for these
- % bytes is substituted in here with \uppercase using the \uccode's.
- \gdef\parseUTFviiiB#1#2#3#4{%
- \advance\countUTFz by "#10\relax
- \uccode `#3\countUTFz
- \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
-\endgroup
-
-% For native Unicode handling (XeTeX and LuaTeX),
-% provide a definition macro that sets a catcode to `other' non-globally
-%
-\def\DeclareUnicodeCharacterNativeOther#1#2{%
- \catcode"#1=\other
-}
-
-% Suppress ligature creation from adjacent characters.
-\ifluatex
- % Braces do not suppress ligature creation in LuaTeX, e.g. in of{}fice
- % to suppress the "ff" ligature. Using a kern appears to be the only
- % workaround.
- \def\nolig{\kern0pt{}}
-\else
- \def\nolig{{}}
-\fi
-
-% https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M
-% U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block)
-% U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)
-% U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A
-% U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B
-%
-% Many of our renditions are less than wonderful, and all the missing
-% characters are available somewhere. Loading the necessary fonts
-% awaits user request. We can't truly support Unicode without
-% reimplementing everything that's been done in LaTeX for many years,
-% plus probably using luatex or xetex, and who knows what else.
-% We won't be doing that here in this simple file. But we can try to at
-% least make most of the characters not bomb out.
-%
-\def\unicodechardefs{%
- \DeclareUnicodeCharacter{0020}{ } % space
- \DeclareUnicodeCharacter{0021}{\char"21 }% % space to terminate number
- \DeclareUnicodeCharacter{0022}{\char"22 }%
- \DeclareUnicodeCharacter{0023}{\char"23 }%
- \DeclareUnicodeCharacter{0024}{\char"24 }%
- \DeclareUnicodeCharacter{0025}{\char"25 }%
- \DeclareUnicodeCharacter{0026}{\char"26 }%
- \DeclareUnicodeCharacter{0027}{\char"27 }%
- \DeclareUnicodeCharacter{0028}{\char"28 }%
- \DeclareUnicodeCharacter{0029}{\char"29 }%
- \DeclareUnicodeCharacter{002A}{\char"2A }%
- \DeclareUnicodeCharacter{002B}{\char"2B }%
- \DeclareUnicodeCharacter{002C}{\char"2C }%
- \DeclareUnicodeCharacter{002D}{\char"2D }%
- \DeclareUnicodeCharacter{002E}{\char"2E }%
- \DeclareUnicodeCharacter{002F}{\char"2F }%
- \DeclareUnicodeCharacter{0030}{0}%
- \DeclareUnicodeCharacter{0031}{1}%
- \DeclareUnicodeCharacter{0032}{2}%
- \DeclareUnicodeCharacter{0033}{3}%
- \DeclareUnicodeCharacter{0034}{4}%
- \DeclareUnicodeCharacter{0035}{5}%
- \DeclareUnicodeCharacter{0036}{6}%
- \DeclareUnicodeCharacter{0037}{7}%
- \DeclareUnicodeCharacter{0038}{8}%
- \DeclareUnicodeCharacter{0039}{9}%
- \DeclareUnicodeCharacter{003A}{\char"3A }%
- \DeclareUnicodeCharacter{003B}{\char"3B }%
- \DeclareUnicodeCharacter{003C}{\char"3C }%
- \DeclareUnicodeCharacter{003D}{\char"3D }%
- \DeclareUnicodeCharacter{003E}{\char"3E }%
- \DeclareUnicodeCharacter{003F}{\char"3F }%
- \DeclareUnicodeCharacter{0040}{\char"40 }%
- \DeclareUnicodeCharacter{0041}{A}%
- \DeclareUnicodeCharacter{0042}{B}%
- \DeclareUnicodeCharacter{0043}{C}%
- \DeclareUnicodeCharacter{0044}{D}%
- \DeclareUnicodeCharacter{0045}{E}%
- \DeclareUnicodeCharacter{0046}{F}%
- \DeclareUnicodeCharacter{0047}{G}%
- \DeclareUnicodeCharacter{0048}{H}%
- \DeclareUnicodeCharacter{0049}{I}%
- \DeclareUnicodeCharacter{004A}{J}%
- \DeclareUnicodeCharacter{004B}{K}%
- \DeclareUnicodeCharacter{004C}{L}%
- \DeclareUnicodeCharacter{004D}{M}%
- \DeclareUnicodeCharacter{004E}{N}%
- \DeclareUnicodeCharacter{004F}{O}%
- \DeclareUnicodeCharacter{0050}{P}%
- \DeclareUnicodeCharacter{0051}{Q}%
- \DeclareUnicodeCharacter{0052}{R}%
- \DeclareUnicodeCharacter{0053}{S}%
- \DeclareUnicodeCharacter{0054}{T}%
- \DeclareUnicodeCharacter{0055}{U}%
- \DeclareUnicodeCharacter{0056}{V}%
- \DeclareUnicodeCharacter{0057}{W}%
- \DeclareUnicodeCharacter{0058}{X}%
- \DeclareUnicodeCharacter{0059}{Y}%
- \DeclareUnicodeCharacter{005A}{Z}%
- \DeclareUnicodeCharacter{005B}{\char"5B }%
- \DeclareUnicodeCharacter{005C}{\char"5C }%
- \DeclareUnicodeCharacter{005D}{\char"5D }%
- \DeclareUnicodeCharacter{005E}{\char"5E }%
- \DeclareUnicodeCharacter{005F}{\char"5F }%
- \DeclareUnicodeCharacter{0060}{\char"60 }%
- \DeclareUnicodeCharacter{0061}{a}%
- \DeclareUnicodeCharacter{0062}{b}%
- \DeclareUnicodeCharacter{0063}{c}%
- \DeclareUnicodeCharacter{0064}{d}%
- \DeclareUnicodeCharacter{0065}{e}%
- \DeclareUnicodeCharacter{0066}{f}%
- \DeclareUnicodeCharacter{0067}{g}%
- \DeclareUnicodeCharacter{0068}{h}%
- \DeclareUnicodeCharacter{0069}{i}%
- \DeclareUnicodeCharacter{006A}{j}%
- \DeclareUnicodeCharacter{006B}{k}%
- \DeclareUnicodeCharacter{006C}{l}%
- \DeclareUnicodeCharacter{006D}{m}%
- \DeclareUnicodeCharacter{006E}{n}%
- \DeclareUnicodeCharacter{006F}{o}%
- \DeclareUnicodeCharacter{0070}{p}%
- \DeclareUnicodeCharacter{0071}{q}%
- \DeclareUnicodeCharacter{0072}{r}%
- \DeclareUnicodeCharacter{0073}{s}%
- \DeclareUnicodeCharacter{0074}{t}%
- \DeclareUnicodeCharacter{0075}{u}%
- \DeclareUnicodeCharacter{0076}{v}%
- \DeclareUnicodeCharacter{0077}{w}%
- \DeclareUnicodeCharacter{0078}{x}%
- \DeclareUnicodeCharacter{0079}{y}%
- \DeclareUnicodeCharacter{007A}{z}%
- \DeclareUnicodeCharacter{007B}{\char"7B }%
- \DeclareUnicodeCharacter{007C}{\char"7C }%
- \DeclareUnicodeCharacter{007D}{\char"7D }%
- \DeclareUnicodeCharacter{007E}{\char"7E }%
- % \DeclareUnicodeCharacter{007F}{} % DEL
- %
- \DeclareUnicodeCharacter{00A0}{\tie}%
- \DeclareUnicodeCharacter{00A1}{\exclamdown}%
- \DeclareUnicodeCharacter{00A2}{{\tcfont \char162}}% 0242=cent
- \DeclareUnicodeCharacter{00A3}{\pounds{}}%
- \DeclareUnicodeCharacter{00A4}{{\tcfont \char164}}% 0244=currency
- \DeclareUnicodeCharacter{00A5}{{\tcfont \char165}}% 0245=yen
- \DeclareUnicodeCharacter{00A6}{{\tcfont \char166}}% 0246=brokenbar
- \DeclareUnicodeCharacter{00A7}{\S}%
- \DeclareUnicodeCharacter{00A8}{\"{ }}%
- \DeclareUnicodeCharacter{00A9}{\copyright{}}%
- \DeclareUnicodeCharacter{00AA}{\ordf}%
- \DeclareUnicodeCharacter{00AB}{\guillemetleft{}}%
- \DeclareUnicodeCharacter{00AC}{\ensuremath\lnot}%
- \DeclareUnicodeCharacter{00AD}{\-}%
- \DeclareUnicodeCharacter{00AE}{\registeredsymbol{}}%
- \DeclareUnicodeCharacter{00AF}{\={ }}%
- %
- \DeclareUnicodeCharacter{00B0}{\textdegree}%
- \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}%
- \DeclareUnicodeCharacter{00B2}{$^2$}%
- \DeclareUnicodeCharacter{00B3}{$^3$}%
- \DeclareUnicodeCharacter{00B4}{\'{ }}%
- \DeclareUnicodeCharacter{00B5}{$\mu$}%
- \DeclareUnicodeCharacter{00B6}{\P}%
- \DeclareUnicodeCharacter{00B7}{\ensuremath\cdot}%
- \DeclareUnicodeCharacter{00B8}{\cedilla{ }}%
- \DeclareUnicodeCharacter{00B9}{$^1$}%
- \DeclareUnicodeCharacter{00BA}{\ordm}%
- \DeclareUnicodeCharacter{00BB}{\guillemetright{}}%
- \DeclareUnicodeCharacter{00BC}{$1\over4$}%
- \DeclareUnicodeCharacter{00BD}{$1\over2$}%
- \DeclareUnicodeCharacter{00BE}{$3\over4$}%
- \DeclareUnicodeCharacter{00BF}{\questiondown}%
- %
- \DeclareUnicodeCharacter{00C0}{\`A}%
- \DeclareUnicodeCharacter{00C1}{\'A}%
- \DeclareUnicodeCharacter{00C2}{\^A}%
- \DeclareUnicodeCharacter{00C3}{\~A}%
- \DeclareUnicodeCharacter{00C4}{\"A}%
- \DeclareUnicodeCharacter{00C5}{\AA}%
- \DeclareUnicodeCharacter{00C6}{\AE}%
- \DeclareUnicodeCharacter{00C7}{\cedilla{C}}%
- \DeclareUnicodeCharacter{00C8}{\`E}%
- \DeclareUnicodeCharacter{00C9}{\'E}%
- \DeclareUnicodeCharacter{00CA}{\^E}%
- \DeclareUnicodeCharacter{00CB}{\"E}%
- \DeclareUnicodeCharacter{00CC}{\`I}%
- \DeclareUnicodeCharacter{00CD}{\'I}%
- \DeclareUnicodeCharacter{00CE}{\^I}%
- \DeclareUnicodeCharacter{00CF}{\"I}%
- %
- \DeclareUnicodeCharacter{00D0}{\DH}%
- \DeclareUnicodeCharacter{00D1}{\~N}%
- \DeclareUnicodeCharacter{00D2}{\`O}%
- \DeclareUnicodeCharacter{00D3}{\'O}%
- \DeclareUnicodeCharacter{00D4}{\^O}%
- \DeclareUnicodeCharacter{00D5}{\~O}%
- \DeclareUnicodeCharacter{00D6}{\"O}%
- \DeclareUnicodeCharacter{00D7}{\ensuremath\times}%
- \DeclareUnicodeCharacter{00D8}{\O}%
- \DeclareUnicodeCharacter{00D9}{\`U}%
- \DeclareUnicodeCharacter{00DA}{\'U}%
- \DeclareUnicodeCharacter{00DB}{\^U}%
- \DeclareUnicodeCharacter{00DC}{\"U}%
- \DeclareUnicodeCharacter{00DD}{\'Y}%
- \DeclareUnicodeCharacter{00DE}{\TH}%
- \DeclareUnicodeCharacter{00DF}{\ss}%
- %
- \DeclareUnicodeCharacter{00E0}{\`a}%
- \DeclareUnicodeCharacter{00E1}{\'a}%
- \DeclareUnicodeCharacter{00E2}{\^a}%
- \DeclareUnicodeCharacter{00E3}{\~a}%
- \DeclareUnicodeCharacter{00E4}{\"a}%
- \DeclareUnicodeCharacter{00E5}{\aa}%
- \DeclareUnicodeCharacter{00E6}{\ae}%
- \DeclareUnicodeCharacter{00E7}{\cedilla{c}}%
- \DeclareUnicodeCharacter{00E8}{\`e}%
- \DeclareUnicodeCharacter{00E9}{\'e}%
- \DeclareUnicodeCharacter{00EA}{\^e}%
- \DeclareUnicodeCharacter{00EB}{\"e}%
- \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}%
- \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}%
- \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}%
- \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}%
- %
- \DeclareUnicodeCharacter{00F0}{\dh}%
- \DeclareUnicodeCharacter{00F1}{\~n}%
- \DeclareUnicodeCharacter{00F2}{\`o}%
- \DeclareUnicodeCharacter{00F3}{\'o}%
- \DeclareUnicodeCharacter{00F4}{\^o}%
- \DeclareUnicodeCharacter{00F5}{\~o}%
- \DeclareUnicodeCharacter{00F6}{\"o}%
- \DeclareUnicodeCharacter{00F7}{\ensuremath\div}%
- \DeclareUnicodeCharacter{00F8}{\o}%
- \DeclareUnicodeCharacter{00F9}{\`u}%
- \DeclareUnicodeCharacter{00FA}{\'u}%
- \DeclareUnicodeCharacter{00FB}{\^u}%
- \DeclareUnicodeCharacter{00FC}{\"u}%
- \DeclareUnicodeCharacter{00FD}{\'y}%
- \DeclareUnicodeCharacter{00FE}{\th}%
- \DeclareUnicodeCharacter{00FF}{\"y}%
- %
- \DeclareUnicodeCharacter{0100}{\=A}%
- \DeclareUnicodeCharacter{0101}{\=a}%
- \DeclareUnicodeCharacter{0102}{\u{A}}%
- \DeclareUnicodeCharacter{0103}{\u{a}}%
- \DeclareUnicodeCharacter{0104}{\ogonek{A}}%
- \DeclareUnicodeCharacter{0105}{\ogonek{a}}%
- \DeclareUnicodeCharacter{0106}{\'C}%
- \DeclareUnicodeCharacter{0107}{\'c}%
- \DeclareUnicodeCharacter{0108}{\^C}%
- \DeclareUnicodeCharacter{0109}{\^c}%
- \DeclareUnicodeCharacter{010A}{\dotaccent{C}}%
- \DeclareUnicodeCharacter{010B}{\dotaccent{c}}%
- \DeclareUnicodeCharacter{010C}{\v{C}}%
- \DeclareUnicodeCharacter{010D}{\v{c}}%
- \DeclareUnicodeCharacter{010E}{\v{D}}%
- \DeclareUnicodeCharacter{010F}{d'}%
- %
- \DeclareUnicodeCharacter{0110}{\DH}%
- \DeclareUnicodeCharacter{0111}{\dh}%
- \DeclareUnicodeCharacter{0112}{\=E}%
- \DeclareUnicodeCharacter{0113}{\=e}%
- \DeclareUnicodeCharacter{0114}{\u{E}}%
- \DeclareUnicodeCharacter{0115}{\u{e}}%
- \DeclareUnicodeCharacter{0116}{\dotaccent{E}}%
- \DeclareUnicodeCharacter{0117}{\dotaccent{e}}%
- \DeclareUnicodeCharacter{0118}{\ogonek{E}}%
- \DeclareUnicodeCharacter{0119}{\ogonek{e}}%
- \DeclareUnicodeCharacter{011A}{\v{E}}%
- \DeclareUnicodeCharacter{011B}{\v{e}}%
- \DeclareUnicodeCharacter{011C}{\^G}%
- \DeclareUnicodeCharacter{011D}{\^g}%
- \DeclareUnicodeCharacter{011E}{\u{G}}%
- \DeclareUnicodeCharacter{011F}{\u{g}}%
- %
- \DeclareUnicodeCharacter{0120}{\dotaccent{G}}%
- \DeclareUnicodeCharacter{0121}{\dotaccent{g}}%
- \DeclareUnicodeCharacter{0122}{\cedilla{G}}%
- \DeclareUnicodeCharacter{0123}{\cedilla{g}}%
- \DeclareUnicodeCharacter{0124}{\^H}%
- \DeclareUnicodeCharacter{0125}{\^h}%
- \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}%
- \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}%
- \DeclareUnicodeCharacter{0128}{\~I}%
- \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}%
- \DeclareUnicodeCharacter{012A}{\=I}%
- \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}%
- \DeclareUnicodeCharacter{012C}{\u{I}}%
- \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}%
- \DeclareUnicodeCharacter{012E}{\ogonek{I}}%
- \DeclareUnicodeCharacter{012F}{\ogonek{i}}%
- %
- \DeclareUnicodeCharacter{0130}{\dotaccent{I}}%
- \DeclareUnicodeCharacter{0131}{\dotless{i}}%
- \DeclareUnicodeCharacter{0132}{IJ}%
- \DeclareUnicodeCharacter{0133}{ij}%
- \DeclareUnicodeCharacter{0134}{\^J}%
- \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}%
- \DeclareUnicodeCharacter{0136}{\cedilla{K}}%
- \DeclareUnicodeCharacter{0137}{\cedilla{k}}%
- \DeclareUnicodeCharacter{0138}{\ensuremath\kappa}%
- \DeclareUnicodeCharacter{0139}{\'L}%
- \DeclareUnicodeCharacter{013A}{\'l}%
- \DeclareUnicodeCharacter{013B}{\cedilla{L}}%
- \DeclareUnicodeCharacter{013C}{\cedilla{l}}%
- \DeclareUnicodeCharacter{013D}{L'}% should kern
- \DeclareUnicodeCharacter{013E}{l'}% should kern
- \DeclareUnicodeCharacter{013F}{L\U{00B7}}%
- %
- \DeclareUnicodeCharacter{0140}{l\U{00B7}}%
- \DeclareUnicodeCharacter{0141}{\L}%
- \DeclareUnicodeCharacter{0142}{\l}%
- \DeclareUnicodeCharacter{0143}{\'N}%
- \DeclareUnicodeCharacter{0144}{\'n}%
- \DeclareUnicodeCharacter{0145}{\cedilla{N}}%
- \DeclareUnicodeCharacter{0146}{\cedilla{n}}%
- \DeclareUnicodeCharacter{0147}{\v{N}}%
- \DeclareUnicodeCharacter{0148}{\v{n}}%
- \DeclareUnicodeCharacter{0149}{'n}%
- \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}%
- \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}%
- \DeclareUnicodeCharacter{014C}{\=O}%
- \DeclareUnicodeCharacter{014D}{\=o}%
- \DeclareUnicodeCharacter{014E}{\u{O}}%
- \DeclareUnicodeCharacter{014F}{\u{o}}%
- %
- \DeclareUnicodeCharacter{0150}{\H{O}}%
- \DeclareUnicodeCharacter{0151}{\H{o}}%
- \DeclareUnicodeCharacter{0152}{\OE}%
- \DeclareUnicodeCharacter{0153}{\oe}%
- \DeclareUnicodeCharacter{0154}{\'R}%
- \DeclareUnicodeCharacter{0155}{\'r}%
- \DeclareUnicodeCharacter{0156}{\cedilla{R}}%
- \DeclareUnicodeCharacter{0157}{\cedilla{r}}%
- \DeclareUnicodeCharacter{0158}{\v{R}}%
- \DeclareUnicodeCharacter{0159}{\v{r}}%
- \DeclareUnicodeCharacter{015A}{\'S}%
- \DeclareUnicodeCharacter{015B}{\'s}%
- \DeclareUnicodeCharacter{015C}{\^S}%
- \DeclareUnicodeCharacter{015D}{\^s}%
- \DeclareUnicodeCharacter{015E}{\cedilla{S}}%
- \DeclareUnicodeCharacter{015F}{\cedilla{s}}%
- %
- \DeclareUnicodeCharacter{0160}{\v{S}}%
- \DeclareUnicodeCharacter{0161}{\v{s}}%
- \DeclareUnicodeCharacter{0162}{\cedilla{T}}%
- \DeclareUnicodeCharacter{0163}{\cedilla{t}}%
- \DeclareUnicodeCharacter{0164}{\v{T}}%
- \DeclareUnicodeCharacter{0165}{\v{t}}%
- \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}%
- \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}%
- \DeclareUnicodeCharacter{0168}{\~U}%
- \DeclareUnicodeCharacter{0169}{\~u}%
- \DeclareUnicodeCharacter{016A}{\=U}%
- \DeclareUnicodeCharacter{016B}{\=u}%
- \DeclareUnicodeCharacter{016C}{\u{U}}%
- \DeclareUnicodeCharacter{016D}{\u{u}}%
- \DeclareUnicodeCharacter{016E}{\ringaccent{U}}%
- \DeclareUnicodeCharacter{016F}{\ringaccent{u}}%
- %
- \DeclareUnicodeCharacter{0170}{\H{U}}%
- \DeclareUnicodeCharacter{0171}{\H{u}}%
- \DeclareUnicodeCharacter{0172}{\ogonek{U}}%
- \DeclareUnicodeCharacter{0173}{\ogonek{u}}%
- \DeclareUnicodeCharacter{0174}{\^W}%
- \DeclareUnicodeCharacter{0175}{\^w}%
- \DeclareUnicodeCharacter{0176}{\^Y}%
- \DeclareUnicodeCharacter{0177}{\^y}%
- \DeclareUnicodeCharacter{0178}{\"Y}%
- \DeclareUnicodeCharacter{0179}{\'Z}%
- \DeclareUnicodeCharacter{017A}{\'z}%
- \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}%
- \DeclareUnicodeCharacter{017C}{\dotaccent{z}}%
- \DeclareUnicodeCharacter{017D}{\v{Z}}%
- \DeclareUnicodeCharacter{017E}{\v{z}}%
- \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}}%
- %
- \DeclareUnicodeCharacter{01C4}{D\v{Z}}%
- \DeclareUnicodeCharacter{01C5}{D\v{z}}%
- \DeclareUnicodeCharacter{01C6}{d\v{z}}%
- \DeclareUnicodeCharacter{01C7}{LJ}%
- \DeclareUnicodeCharacter{01C8}{Lj}%
- \DeclareUnicodeCharacter{01C9}{lj}%
- \DeclareUnicodeCharacter{01CA}{NJ}%
- \DeclareUnicodeCharacter{01CB}{Nj}%
- \DeclareUnicodeCharacter{01CC}{nj}%
- \DeclareUnicodeCharacter{01CD}{\v{A}}%
- \DeclareUnicodeCharacter{01CE}{\v{a}}%
- \DeclareUnicodeCharacter{01CF}{\v{I}}%
- %
- \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}%
- \DeclareUnicodeCharacter{01D1}{\v{O}}%
- \DeclareUnicodeCharacter{01D2}{\v{o}}%
- \DeclareUnicodeCharacter{01D3}{\v{U}}%
- \DeclareUnicodeCharacter{01D4}{\v{u}}%
- %
- \DeclareUnicodeCharacter{01E2}{\={\AE}}%
- \DeclareUnicodeCharacter{01E3}{\={\ae}}%
- \DeclareUnicodeCharacter{01E6}{\v{G}}%
- \DeclareUnicodeCharacter{01E7}{\v{g}}%
- \DeclareUnicodeCharacter{01E8}{\v{K}}%
- \DeclareUnicodeCharacter{01E9}{\v{k}}%
- %
- \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}%
- \DeclareUnicodeCharacter{01F1}{DZ}%
- \DeclareUnicodeCharacter{01F2}{Dz}%
- \DeclareUnicodeCharacter{01F3}{dz}%
- \DeclareUnicodeCharacter{01F4}{\'G}%
- \DeclareUnicodeCharacter{01F5}{\'g}%
- \DeclareUnicodeCharacter{01F8}{\`N}%
- \DeclareUnicodeCharacter{01F9}{\`n}%
- \DeclareUnicodeCharacter{01FC}{\'{\AE}}%
- \DeclareUnicodeCharacter{01FD}{\'{\ae}}%
- \DeclareUnicodeCharacter{01FE}{\'{\O}}%
- \DeclareUnicodeCharacter{01FF}{\'{\o}}%
- %
- \DeclareUnicodeCharacter{021E}{\v{H}}%
- \DeclareUnicodeCharacter{021F}{\v{h}}%
- %
- \DeclareUnicodeCharacter{0226}{\dotaccent{A}}%
- \DeclareUnicodeCharacter{0227}{\dotaccent{a}}%
- \DeclareUnicodeCharacter{0228}{\cedilla{E}}%
- \DeclareUnicodeCharacter{0229}{\cedilla{e}}%
- \DeclareUnicodeCharacter{022E}{\dotaccent{O}}%
- \DeclareUnicodeCharacter{022F}{\dotaccent{o}}%
- %
- \DeclareUnicodeCharacter{0232}{\=Y}%
- \DeclareUnicodeCharacter{0233}{\=y}%
- \DeclareUnicodeCharacter{0237}{\dotless{j}}%
- %
- \DeclareUnicodeCharacter{02BC}{'}%
- %
- \DeclareUnicodeCharacter{02DB}{\ogonek{ }}%
- %
- % Greek letters upper case
- \DeclareUnicodeCharacter{0391}{{\it A}}%
- \DeclareUnicodeCharacter{0392}{{\it B}}%
- \DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}}%
- \DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}}%
- \DeclareUnicodeCharacter{0395}{{\it E}}%
- \DeclareUnicodeCharacter{0396}{{\it Z}}%
- \DeclareUnicodeCharacter{0397}{{\it H}}%
- \DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}}%
- \DeclareUnicodeCharacter{0399}{{\it I}}%
- \DeclareUnicodeCharacter{039A}{{\it K}}%
- \DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}}%
- \DeclareUnicodeCharacter{039C}{{\it M}}%
- \DeclareUnicodeCharacter{039D}{{\it N}}%
- \DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}}%
- \DeclareUnicodeCharacter{039F}{{\it O}}%
- \DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}}%
- \DeclareUnicodeCharacter{03A1}{{\it P}}%
- %\DeclareUnicodeCharacter{03A2}{} % none - corresponds to final sigma
- \DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}}%
- \DeclareUnicodeCharacter{03A4}{{\it T}}%
- \DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}}%
- \DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}}%
- \DeclareUnicodeCharacter{03A7}{{\it X}}%
- \DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}}%
- \DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}}%
- %
- % Vowels with accents
- \DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}}%
- \DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}}%
- \DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}}%
- \DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}}%
- \DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}}%
- \DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}}%
- %
- % Standalone accent
- \DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}}%
- %
- % Greek letters lower case
- \DeclareUnicodeCharacter{03B1}{\ensuremath\alpha}%
- \DeclareUnicodeCharacter{03B2}{\ensuremath\beta}%
- \DeclareUnicodeCharacter{03B3}{\ensuremath\gamma}%
- \DeclareUnicodeCharacter{03B4}{\ensuremath\delta}%
- \DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon}%
- \DeclareUnicodeCharacter{03B6}{\ensuremath\zeta}%
- \DeclareUnicodeCharacter{03B7}{\ensuremath\eta}%
- \DeclareUnicodeCharacter{03B8}{\ensuremath\theta}%
- \DeclareUnicodeCharacter{03B9}{\ensuremath\iota}%
- \DeclareUnicodeCharacter{03BA}{\ensuremath\kappa}%
- \DeclareUnicodeCharacter{03BB}{\ensuremath\lambda}%
- \DeclareUnicodeCharacter{03BC}{\ensuremath\mu}%
- \DeclareUnicodeCharacter{03BD}{\ensuremath\nu}%
- \DeclareUnicodeCharacter{03BE}{\ensuremath\xi}%
- \DeclareUnicodeCharacter{03BF}{{\it o}}% omicron
- \DeclareUnicodeCharacter{03C0}{\ensuremath\pi}%
- \DeclareUnicodeCharacter{03C1}{\ensuremath\rho}%
- \DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma}%
- \DeclareUnicodeCharacter{03C3}{\ensuremath\sigma}%
- \DeclareUnicodeCharacter{03C4}{\ensuremath\tau}%
- \DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon}%
- \DeclareUnicodeCharacter{03C6}{\ensuremath\phi}%
- \DeclareUnicodeCharacter{03C7}{\ensuremath\chi}%
- \DeclareUnicodeCharacter{03C8}{\ensuremath\psi}%
- \DeclareUnicodeCharacter{03C9}{\ensuremath\omega}%
- %
- % More Greek vowels with accents
- \DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}}%
- \DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}}%
- \DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}}%
- \DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}}%
- \DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}}%
- %
- % Variant Greek letters
- \DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta}%
- \DeclareUnicodeCharacter{03D6}{\ensuremath\varpi}%
- \DeclareUnicodeCharacter{03F1}{\ensuremath\varrho}%
- %
- \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}%
- \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}%
- \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}%
- \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}%
- \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}%
- \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}%
- \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}%
- \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}%
- \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}%
- \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}%
- \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}%
- \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}%
- %
- \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}%
- \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}%
- %
- \DeclareUnicodeCharacter{1E20}{\=G}%
- \DeclareUnicodeCharacter{1E21}{\=g}%
- \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}%
- \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}%
- \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}%
- \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}%
- \DeclareUnicodeCharacter{1E26}{\"H}%
- \DeclareUnicodeCharacter{1E27}{\"h}%
- %
- \DeclareUnicodeCharacter{1E30}{\'K}%
- \DeclareUnicodeCharacter{1E31}{\'k}%
- \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}%
- \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}%
- \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}%
- \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}%
- \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}%
- \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}%
- \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}%
- \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}%
- \DeclareUnicodeCharacter{1E3E}{\'M}%
- \DeclareUnicodeCharacter{1E3F}{\'m}%
- %
- \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}%
- \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}%
- \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}%
- \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}%
- \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}%
- \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}%
- \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}%
- \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}%
- \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}%
- \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}%
- %
- \DeclareUnicodeCharacter{1E54}{\'P}%
- \DeclareUnicodeCharacter{1E55}{\'p}%
- \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}%
- \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}%
- \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}%
- \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}%
- \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}%
- \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}%
- \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}%
- \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}%
- %
- \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}%
- \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}%
- \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}%
- \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}%
- \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}%
- \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}%
- \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}%
- \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}%
- \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}%
- \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}%
- %
- \DeclareUnicodeCharacter{1E7C}{\~V}%
- \DeclareUnicodeCharacter{1E7D}{\~v}%
- \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}%
- \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}%
- %
- \DeclareUnicodeCharacter{1E80}{\`W}%
- \DeclareUnicodeCharacter{1E81}{\`w}%
- \DeclareUnicodeCharacter{1E82}{\'W}%
- \DeclareUnicodeCharacter{1E83}{\'w}%
- \DeclareUnicodeCharacter{1E84}{\"W}%
- \DeclareUnicodeCharacter{1E85}{\"w}%
- \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}%
- \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}%
- \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}%
- \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}%
- \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}%
- \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}%
- \DeclareUnicodeCharacter{1E8C}{\"X}%
- \DeclareUnicodeCharacter{1E8D}{\"x}%
- \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}%
- \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}%
- %
- \DeclareUnicodeCharacter{1E90}{\^Z}%
- \DeclareUnicodeCharacter{1E91}{\^z}%
- \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}%
- \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}%
- \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}%
- \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}%
- \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}%
- \DeclareUnicodeCharacter{1E97}{\"t}%
- \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}%
- \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}%
- %
- \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}%
- \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}%
- %
- \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}%
- \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}%
- \DeclareUnicodeCharacter{1EBC}{\~E}%
- \DeclareUnicodeCharacter{1EBD}{\~e}%
- %
- \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}%
- \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}%
- \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}%
- \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}%
- %
- \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}%
- \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}%
- %
- \DeclareUnicodeCharacter{1EF2}{\`Y}%
- \DeclareUnicodeCharacter{1EF3}{\`y}%
- \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}%
- %
- \DeclareUnicodeCharacter{1EF8}{\~Y}%
- \DeclareUnicodeCharacter{1EF9}{\~y}%
- %
- % Exotic spaces
- \DeclareUnicodeCharacter{2007}{\hphantom{0}}%
- %
- % Punctuation
- \DeclareUnicodeCharacter{2013}{--}%
- \DeclareUnicodeCharacter{2014}{---}%
- \DeclareUnicodeCharacter{2018}{\quoteleft\nolig}%
- \DeclareUnicodeCharacter{2019}{\quoteright\nolig}%
- \DeclareUnicodeCharacter{201A}{\quotesinglbase{}}%
- \DeclareUnicodeCharacter{201C}{\quotedblleft{}}%
- \DeclareUnicodeCharacter{201D}{\quotedblright{}}%
- \DeclareUnicodeCharacter{201E}{\quotedblbase{}}%
- \DeclareUnicodeCharacter{2020}{\ensuremath\dagger}%
- \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger}%
- \DeclareUnicodeCharacter{2022}{\bullet{}}%
- \DeclareUnicodeCharacter{202F}{\thinspace}%
- \DeclareUnicodeCharacter{2026}{\dots{}}%
- \DeclareUnicodeCharacter{2039}{\guilsinglleft{}}%
- \DeclareUnicodeCharacter{203A}{\guilsinglright{}}%
- %
- \DeclareUnicodeCharacter{20AC}{\euro{}}%
- %
- \DeclareUnicodeCharacter{2192}{\arrow}%
- \DeclareUnicodeCharacter{21D2}{\result{}}%
- %
- % Mathematical symbols
- \DeclareUnicodeCharacter{2200}{\ensuremath\forall}%
- \DeclareUnicodeCharacter{2203}{\ensuremath\exists}%
- \DeclareUnicodeCharacter{2208}{\ensuremath\in}%
- \DeclareUnicodeCharacter{2212}{\minus{}}%
- \DeclareUnicodeCharacter{2217}{\ast}%
- \DeclareUnicodeCharacter{221E}{\ensuremath\infty}%
- \DeclareUnicodeCharacter{2225}{\ensuremath\parallel}%
- \DeclareUnicodeCharacter{2227}{\ensuremath\wedge}%
- \DeclareUnicodeCharacter{2229}{\ensuremath\cap}%
- \DeclareUnicodeCharacter{2261}{\equiv{}}%
- \DeclareUnicodeCharacter{2264}{\ensuremath\leq}%
- \DeclareUnicodeCharacter{2265}{\ensuremath\geq}%
- \DeclareUnicodeCharacter{2282}{\ensuremath\subset}%
- \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}%
- %
- \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}%
- \DeclareUnicodeCharacter{2032}{\ensuremath{^\prime}}%
- \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}%
- \DeclareUnicodeCharacter{2111}{\ensuremath\Im}%
- \DeclareUnicodeCharacter{2113}{\ensuremath\ell}%
- \DeclareUnicodeCharacter{2118}{\ensuremath\wp}%
- \DeclareUnicodeCharacter{211C}{\ensuremath\Re}%
- \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}%
- \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}%
- \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}%
- \DeclareUnicodeCharacter{2193}{\ensuremath\downarrow}%
- \DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow}%
- \DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow}%
- \DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow}%
- \DeclareUnicodeCharacter{2197}{\ensuremath\nearrow}%
- \DeclareUnicodeCharacter{2198}{\ensuremath\searrow}%
- \DeclareUnicodeCharacter{2199}{\ensuremath\swarrow}%
- \DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto}%
- \DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow}%
- \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}%
- \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}%
- \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}%
- \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}%
- \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}%
- \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}%
- \DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow}%
- \DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow}%
- \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}%
- \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}%
- \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}%
- \DeclareUnicodeCharacter{2202}{\ensuremath\partial}%
- \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}%
- \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}%
- \DeclareUnicodeCharacter{2209}{\ensuremath\notin}%
- \DeclareUnicodeCharacter{220B}{\ensuremath\owns}%
- \DeclareUnicodeCharacter{220F}{\ensuremath\prod}%
- \DeclareUnicodeCharacter{2210}{\ensuremath\coprod}%
- \DeclareUnicodeCharacter{2211}{\ensuremath\sum}%
- \DeclareUnicodeCharacter{2213}{\ensuremath\mp}%
- \DeclareUnicodeCharacter{2218}{\ensuremath\circ}%
- \DeclareUnicodeCharacter{221A}{\ensuremath\surd}%
- \DeclareUnicodeCharacter{221D}{\ensuremath\propto}%
- \DeclareUnicodeCharacter{2220}{\ensuremath\angle}%
- \DeclareUnicodeCharacter{2223}{\ensuremath\mid}%
- \DeclareUnicodeCharacter{2228}{\ensuremath\vee}%
- \DeclareUnicodeCharacter{222A}{\ensuremath\cup}%
- \DeclareUnicodeCharacter{222B}{\ensuremath\smallint}%
- \DeclareUnicodeCharacter{222E}{\ensuremath\oint}%
- \DeclareUnicodeCharacter{223C}{\ensuremath\sim}%
- \DeclareUnicodeCharacter{2240}{\ensuremath\wr}%
- \DeclareUnicodeCharacter{2243}{\ensuremath\simeq}%
- \DeclareUnicodeCharacter{2245}{\ensuremath\cong}%
- \DeclareUnicodeCharacter{2248}{\ensuremath\approx}%
- \DeclareUnicodeCharacter{224D}{\ensuremath\asymp}%
- \DeclareUnicodeCharacter{2250}{\ensuremath\doteq}%
- \DeclareUnicodeCharacter{2260}{\ensuremath\neq}%
- \DeclareUnicodeCharacter{226A}{\ensuremath\ll}%
- \DeclareUnicodeCharacter{226B}{\ensuremath\gg}%
- \DeclareUnicodeCharacter{227A}{\ensuremath\prec}%
- \DeclareUnicodeCharacter{227B}{\ensuremath\succ}%
- \DeclareUnicodeCharacter{2283}{\ensuremath\supset}%
- \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}%
- \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}%
- \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}%
- \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}%
- \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}%
- \DeclareUnicodeCharacter{2294}{\ensuremath\sqcup}%
- \DeclareUnicodeCharacter{2295}{\ensuremath\oplus}%
- \DeclareUnicodeCharacter{2296}{\ensuremath\ominus}%
- \DeclareUnicodeCharacter{2297}{\ensuremath\otimes}%
- \DeclareUnicodeCharacter{2298}{\ensuremath\oslash}%
- \DeclareUnicodeCharacter{2299}{\ensuremath\odot}%
- \DeclareUnicodeCharacter{22A2}{\ensuremath\vdash}%
- \DeclareUnicodeCharacter{22A3}{\ensuremath\dashv}%
- \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}%
- \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}%
- \DeclareUnicodeCharacter{22A8}{\ensuremath\models}%
- \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}%
- \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}%
- \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}%
- \DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup}%
- \DeclareUnicodeCharacter{22C4}{\ensuremath\diamond}%
- \DeclareUnicodeCharacter{22C5}{\ensuremath\cdot}%
- \DeclareUnicodeCharacter{22C6}{\ensuremath\star}%
- \DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie}%
- \DeclareUnicodeCharacter{2308}{\ensuremath\lceil}%
- \DeclareUnicodeCharacter{2309}{\ensuremath\rceil}%
- \DeclareUnicodeCharacter{230A}{\ensuremath\lfloor}%
- \DeclareUnicodeCharacter{230B}{\ensuremath\rfloor}%
- \DeclareUnicodeCharacter{2322}{\ensuremath\frown}%
- \DeclareUnicodeCharacter{2323}{\ensuremath\smile}%
- %
- \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}%
- \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}%
- \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}%
- \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}%
- \DeclareUnicodeCharacter{25C7}{\ensuremath\diamond}%
- \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}%
- \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}%
- \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}%
- \DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit}%
- \DeclareUnicodeCharacter{266D}{\ensuremath\flat}%
- \DeclareUnicodeCharacter{266E}{\ensuremath\natural}%
- \DeclareUnicodeCharacter{266F}{\ensuremath\sharp}%
- \DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc}%
- \DeclareUnicodeCharacter{27B9}{\ensuremath\rangle}%
- \DeclareUnicodeCharacter{27C2}{\ensuremath\perp}%
- \DeclareUnicodeCharacter{27E8}{\ensuremath\langle}%
- \DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow}%
- \DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow}%
- \DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow}%
- \DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto}%
- \DeclareUnicodeCharacter{29F5}{\ensuremath\setminus}%
- \DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot}%
- \DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus}%
- \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}%
- \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}%
- \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}%
- \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}%
- \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}%
- \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}%
- %
- \global\mathchardef\checkmark="1370% actually the square root sign
- \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}%
- %
- % These are all the combining accents. We need these empty definitions
- % at present for the sake of PDF outlines.
- \DeclareUnicodeCharacter{0300}{}%
- \DeclareUnicodeCharacter{0301}{}%
- \DeclareUnicodeCharacter{0302}{}%
- \DeclareUnicodeCharacter{0303}{}%
- \DeclareUnicodeCharacter{0305}{}%
- \DeclareUnicodeCharacter{0306}{}%
- \DeclareUnicodeCharacter{0307}{}%
- \DeclareUnicodeCharacter{0308}{}%
- \DeclareUnicodeCharacter{030A}{}%
- \DeclareUnicodeCharacter{030B}{}%
- \DeclareUnicodeCharacter{030C}{}%
- \DeclareUnicodeCharacter{0323}{}%
- \DeclareUnicodeCharacter{0327}{}%
- \DeclareUnicodeCharacter{0328}{}%
- \DeclareUnicodeCharacter{0331}{}%
- \DeclareUnicodeCharacter{0361}{}%
-}% end of \unicodechardefs
-
-% UTF-8 byte sequence (pdfTeX) definitions (replacing and @U command)
-% It makes the setting that replace UTF-8 byte sequence.
-\def\utfeightchardefs{%
- \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterUTFviii
- \unicodechardefs
-}
-
-% Whether the active definitions of non-ASCII characters expand to
-% non-active tokens with the same character code. This is used to
-% write characters literally, instead of using active definitions for
-% printing the correct glyphs.
-\newif\ifpassthroughchars
-\passthroughcharsfalse
-
-% For native Unicode handling (XeTeX and LuaTeX),
-% provide a definition macro to replace/pass-through a Unicode character
-%
-\def\DeclareUnicodeCharacterNative#1#2{%
- \ifnum"#1>"7F % only make non-ASCII chars active
- \catcode"#1=\active
- \def\dodeclareunicodecharacternative##1##2##3{%
- \begingroup
- \uccode`\~="##2\relax
- \uppercase{\gdef~}{%
- \ifpassthroughchars
- ##1%
- \else
- ##3%
- \fi
- }
- \endgroup
- }
- \begingroup
- \uccode`\.="#1\relax
- \uppercase{\def\UTFNativeTmp{.}}%
- \expandafter\dodeclareunicodecharacternative\UTFNativeTmp{#1}{#2}%
- \endgroup
- \fi
-}
-
-% Native Unicode handling (XeTeX and LuaTeX) character replacing definition.
-% It activates the setting that replaces Unicode characters.
-\def\nativeunicodechardefs{%
- \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNative
- \unicodechardefs
-}
-
-% For native Unicode handling (XeTeX and LuaTeX),
-% make the character token expand
-% to the sequences given in \unicodechardefs for printing.
-\def\DeclareUnicodeCharacterNativeAtU#1#2{%
- \def\UTFAtUTmp{#2}
- \expandafter\globallet\csname uni:#1\endcsname \UTFAtUTmp
-}
-
-% @U command definitions for native Unicode handling (XeTeX and LuaTeX).
-\def\nativeunicodechardefsatu{%
- \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNativeAtU
- \unicodechardefs
-}
-
-% US-ASCII character definitions.
-\def\asciichardefs{% nothing need be done
- \relax
-}
-
-% Define all Unicode characters we know about
-\iftxinativeunicodecapable
- \nativeunicodechardefsatu
-\else
- \utfeightchardefs
-\fi
-
-
-\message{formatting,}
-
-\newdimen\defaultparindent \defaultparindent = 15pt
-
-\chapheadingskip = 15pt plus 4pt minus 2pt
-\secheadingskip = 12pt plus 3pt minus 2pt
-\subsecheadingskip = 9pt plus 2pt minus 2pt
-
-% Prevent underfull vbox error messages.
-\vbadness = 10000
-
-% Don't be very finicky about underfull hboxes, either.
-\hbadness = 6666
-
-% Following George Bush, get rid of widows and orphans.
-\widowpenalty=10000
-\clubpenalty=10000
-
-% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
-% using an old version of TeX, don't do anything. We want the amount of
-% stretch added to depend on the line length, hence the dependence on
-% \hsize. We call this whenever the paper size is set.
-%
-\def\setemergencystretch{%
- \ifx\emergencystretch\thisisundefined
- % Allow us to assign to \emergencystretch anyway.
- \def\emergencystretch{\dimen0}%
- \else
- \emergencystretch = .15\hsize
- \fi
-}
-
-% Parameters in order: 1) textheight; 2) textwidth;
-% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
-% 7) physical page height; 8) physical page width.
-%
-% We also call \setleading{\textleading}, so the caller should define
-% \textleading. The caller should also set \parskip.
-%
-\def\internalpagesizes#1#2#3#4#5#6#7#8{%
- \voffset = #3\relax
- \topskip = #6\relax
- \splittopskip = \topskip
- %
- \vsize = #1\relax
- \advance\vsize by \topskip
- \txipageheight = \vsize
- %
- \hsize = #2\relax
- \txipagewidth = \hsize
- %
- \normaloffset = #4\relax
- \bindingoffset = #5\relax
- %
- \ifpdf
- \pdfpageheight #7\relax
- \pdfpagewidth #8\relax
- % if we don't reset these, they will remain at "1 true in" of
- % whatever layout pdftex was dumped with.
- \pdfhorigin = 1 true in
- \pdfvorigin = 1 true in
- \else
- \ifxetex
- \pdfpageheight #7\relax
- \pdfpagewidth #8\relax
- % XeTeX does not have \pdfhorigin and \pdfvorigin.
- \else
- \special{papersize=#8,#7}%
- \fi
- \fi
- %
- \setleading{\textleading}
- %
- \parindent = \defaultparindent
- \setemergencystretch
-}
-
-% @letterpaper (the default).
-\def\letterpaper{{\globaldefs = 1
- \parskip = 3pt plus 2pt minus 1pt
- \textleading = 13.2pt
- %
- % If page is nothing but text, make it come out even.
- \internalpagesizes{607.2pt}{6in}% that's 46 lines
- {\voffset}{.25in}%
- {\bindingoffset}{36pt}%
- {11in}{8.5in}%
-}}
-
-% Use @smallbook to reset parameters for 7x9.25 trim size.
-\def\smallbook{{\globaldefs = 1
- \parskip = 2pt plus 1pt
- \textleading = 12pt
- %
- \internalpagesizes{7.5in}{5in}%
- {-.2in}{0in}%
- {\bindingoffset}{16pt}%
- {9.25in}{7in}%
- %
- \lispnarrowing = 0.3in
- \tolerance = 700
- \contentsrightmargin = 0pt
- \defbodyindent = .5cm
-}}
-
-% Use @afourpaper to print on European A4 paper.
-\def\afourpaper{{\globaldefs = 1
- \parskip = 3pt plus 2pt minus 1pt
- \textleading = 13.2pt
- %
- % Double-side printing via postscript on Laserjet 4050
- % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
- % To change the settings for a different printer or situation, adjust
- % \normaloffset until the front-side and back-side texts align. Then
- % do the same for \bindingoffset. You can set these for testing in
- % your texinfo source file like this:
- % @tex
- % \global\normaloffset = -6mm
- % \global\bindingoffset = 10mm
- % @end tex
- \internalpagesizes{673.2pt}{160mm}% that's 51 lines
- {\voffset}{\hoffset}%
- {\bindingoffset}{44pt}%
- {297mm}{210mm}%
- %
- \tolerance = 700
- \contentsrightmargin = 0pt
- \defbodyindent = 5mm
-}}
-
-% Use @afivepaper to print on European A5 paper.
-% From romildo@urano.iceb.ufop.br, 2 July 2000.
-% He also recommends making @example and @lisp be small.
-\def\afivepaper{{\globaldefs = 1
- \parskip = 2pt plus 1pt minus 0.1pt
- \textleading = 12.5pt
- %
- \internalpagesizes{160mm}{120mm}%
- {\voffset}{-11.4mm}%
- {\bindingoffset}{8pt}%
- {210mm}{148mm}%
- %
- \lispnarrowing = 0.2in
- \tolerance = 800
- \contentsrightmargin = 0pt
- \defbodyindent = 2mm
- \tableindent = 12mm
-}}
-
-% A specific text layout, 24x15cm overall, intended for A4 paper.
-\def\afourlatex{{\globaldefs = 1
- \afourpaper
- \internalpagesizes{237mm}{150mm}%
- {\voffset}{4.6mm}%
- {\bindingoffset}{7mm}%
- {297mm}{210mm}%
- %
- % Must explicitly reset to 0 because we call \afourpaper.
- \globaldefs = 0
-}}
-
-% Use @afourwide to print on A4 paper in landscape format.
-\def\afourwide{{\globaldefs = 1
- \afourpaper
- \internalpagesizes{241mm}{165mm}%
- {\voffset}{-2.95mm}%
- {\bindingoffset}{7mm}%
- {297mm}{210mm}%
- \globaldefs = 0
-}}
-
-\def\bsixpaper{{\globaldefs = 1
- \afourpaper
- \internalpagesizes{140mm}{100mm}%
- {-6.35mm}{-12.7mm}%
- {\bindingoffset}{14pt}%
- {176mm}{125mm}%
- \let\SETdispenvsize=\smallword
- \lispnarrowing = 0.2in
- \globaldefs = 0
-}}
-
-
-% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
-% Perhaps we should allow setting the margins, \topskip, \parskip,
-% and/or leading, also. Or perhaps we should compute them somehow.
-%
-\parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
-\def\pagesizesyyy#1,#2,#3\finish{{%
- \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
- \globaldefs = 1
- %
- \parskip = 3pt plus 2pt minus 1pt
- \setleading{\textleading}%
- %
- \dimen0 = #1\relax
- \advance\dimen0 by 2.5in % default 1in margin above heading line
- % and 1.5in to include heading, footing and
- % bottom margin
- %
- \dimen2 = \hsize
- \advance\dimen2 by 2in % default to 1 inch margin on each side
- %
- \internalpagesizes{#1}{\hsize}%
- {\voffset}{\normaloffset}%
- {\bindingoffset}{44pt}%
- {\dimen0}{\dimen2}%
-}}
-
-% Set default to letter.
-%
-\letterpaper
-
-% Default value of \hfuzz, for suppressing warnings about overfull hboxes.
-\hfuzz = 1pt
-
-
-\message{microtype,}
-
-% protrusion, from Thanh's protcode.tex.
-\def\mtsetprotcode#1{%
- \rpcode#1`\!=200 \rpcode#1`\,=700 \rpcode#1`\-=700 \rpcode#1`\.=700
- \rpcode#1`\;=500 \rpcode#1`\:=500 \rpcode#1`\?=200
- \rpcode#1`\'=700
- \rpcode#1 34=500 % ''
- \rpcode#1 123=300 % --
- \rpcode#1 124=200 % ---
- \rpcode#1`\)=50 \rpcode#1`\A=50 \rpcode#1`\F=50 \rpcode#1`\K=50
- \rpcode#1`\L=50 \rpcode#1`\T=50 \rpcode#1`\V=50 \rpcode#1`\W=50
- \rpcode#1`\X=50 \rpcode#1`\Y=50 \rpcode#1`\k=50 \rpcode#1`\r=50
- \rpcode#1`\t=50 \rpcode#1`\v=50 \rpcode#1`\w=50 \rpcode#1`\x=50
- \rpcode#1`\y=50
- %
- \lpcode#1`\`=700
- \lpcode#1 92=500 % ``
- \lpcode#1`\(=50 \lpcode#1`\A=50 \lpcode#1`\J=50 \lpcode#1`\T=50
- \lpcode#1`\V=50 \lpcode#1`\W=50 \lpcode#1`\X=50 \lpcode#1`\Y=50
- \lpcode#1`\v=50 \lpcode#1`\w=50 \lpcode#1`\x=50 \lpcode#1`\y=0
- %
- \mtadjustprotcode#1\relax
-}
-
-\newcount\countC
-\def\mtadjustprotcode#1{%
- \countC=0
- \loop
- \ifcase\lpcode#1\countC\else
- \mtadjustcp\lpcode#1\countC
- \fi
- \ifcase\rpcode#1\countC\else
- \mtadjustcp\rpcode#1\countC
- \fi
- \advance\countC 1
- \ifnum\countC < 256 \repeat
-}
-
-\newcount\countB
-\def\mtadjustcp#1#2#3{%
- \setbox\boxA=\hbox{%
- \ifx#2\font\else#2\fi
- \char#3}%
- \countB=\wd\boxA
- \multiply\countB #1#2#3\relax
- \divide\countB \fontdimen6 #2\relax
- #1#2#3=\countB\relax
-}
-
-\ifxetex % XeTeX
- \mtsetprotcode\textrm
- \def\mtfontexpand#1{}
-\else
- \ifluatex % LuaTeX
- \mtsetprotcode\textrm
- \def\mtfontexpand#1{\expandglyphsinfont#1 20 20 1\relax}
- \else
- \ifpdf % pdfTeX
- \mtsetprotcode\textrm
- \def\mtfontexpand#1{\pdffontexpand#1 20 20 1 autoexpand\relax}
- \else % TeX
- \def\mtfontexpand#1{}
- \fi
- \fi
-\fi
-
-
-\newif\ifmicrotype
-
-\def\microtypeON{%
- \microtypetrue
- %
- \ifxetex % XeTeX
- \XeTeXprotrudechars=2
- \else
- \ifluatex % LuaTeX
- \adjustspacing=2
- \protrudechars=2
- \else
- \ifpdf % pdfTeX
- \pdfadjustspacing=2
- \pdfprotrudechars=2
- \fi
- \fi
- \fi
- %
- \mtfontexpand\textrm
- \mtfontexpand\textsl
- \mtfontexpand\textbf
-}
-
-\def\microtypeOFF{%
- \microtypefalse
- %
- \ifxetex % XeTeX
- \XeTeXprotrudechars=0
- \else
- \ifluatex % LuaTeX
- \adjustspacing=0
- \protrudechars=0
- \else
- \ifpdf % pdfTeX
- \pdfadjustspacing=0
- \pdfprotrudechars=0
- \fi
- \fi
- \fi
-}
-
-\microtypeOFF
-
-\parseargdef\microtype{%
- \def\txiarg{#1}%
- \ifx\txiarg\onword
- \microtypeON
- \else\ifx\txiarg\offword
- \microtypeOFF
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @microtype option `\txiarg', must be on|off}%
- \fi\fi
-}
-
-
-\message{and turning on texinfo input format.}
-
-% Make UTF-8 the default encoding.
-\documentencodingzzz{UTF-8}
-
-\def^^L{\par} % remove \outer, so ^L can appear in an @comment
-\catcode`\^^K = 10 % treat vertical tab as whitespace
-
-% DEL is a comment character, in case @c does not suffice.
-\catcode`\^^? = 14
-
-% Define macros to output various characters with catcode for normal text.
-\catcode`\"=\other \def\normaldoublequote{"}
-\catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
-\catcode`\+=\other \def\normalplus{+}
-\catcode`\<=\other \def\normalless{<}
-\catcode`\>=\other \def\normalgreater{>}
-\catcode`\^=\other \def\normalcaret{^}
-\catcode`\_=\other \def\normalunderscore{_}
-\catcode`\|=\other \def\normalverticalbar{|}
-\catcode`\~=\other \def\normaltilde{~}
-
-% Set catcodes for Texinfo file
-
-% Active characters for printing the wanted glyph.
-% Most of these we simply print from the \tt font, but for some, we can
-% use math or other variants that look better in normal text.
-%
-\catcode`\"=\active
-\def\activedoublequote{{\tt\char34}}
-\let"=\activedoublequote
-\catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde
-\chardef\hatchar=`\^
-\catcode`\^=\active \def\activehat{{\tt \hatchar}} \let^ = \activehat
-
-\catcode`\_=\active
-\def_{\ifusingtt\normalunderscore\_}
-\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
-\let\realunder=_
-
-\catcode`\|=\active \def|{{\tt\char124}}
-
-\chardef \less=`\<
-\catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless
-\chardef \gtr=`\>
-\catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr
-\catcode`\+=\active \def+{{\tt \char 43}}
-\catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
-\catcode`\-=\active \let-=\normaldash
-
-
-% used for headline/footline in the output routine, in case the page
-% breaks in the middle of an @tex block.
-\def\texinfochars{%
- \let< = \activeless
- \let> = \activegtr
- \let~ = \activetilde
- \let^ = \activehat
- \setregularquotes
- \let\b = \strong
- \let\i = \smartitalic
- % in principle, all other definitions in \tex have to be undone too.
-}
-
-% Used sometimes to turn off (effectively) the active characters even after
-% parsing them.
-\def\turnoffactive{%
- \passthroughcharstrue
- \let-=\normaldash
- \let"=\normaldoublequote
- \let$=\normaldollar %$ font-lock fix
- \let+=\normalplus
- \let<=\normalless
- \let>=\normalgreater
- \let^=\normalcaret
- \let_=\normalunderscore
- \let|=\normalverticalbar
- \let~=\normaltilde
- \otherbackslash
- \setregularquotes
- \unsepspaces
-}
-
-% If a .fmt file is being used, characters that might appear in a file
-% name cannot be active until we have parsed the command line.
-% So turn them off again, and have \loadconf turn them back on.
-\catcode`+=\other \catcode`\_=\other
-
-
-% \backslashcurfont outputs one backslash character in current font,
-% as in \char`\\.
-\global\chardef\backslashcurfont=`\\
-
-% Print a typewriter backslash. For math mode, we can't simply use
-% \backslashcurfont: the story here is that in math mode, the \char
-% of \backslashcurfont ends up printing the roman \ from the math symbol
-% font (because \char in math mode uses the \mathcode, and plain.tex
-% sets \mathcode`\\="026E). Hence we use an explicit \mathchar,
-% which is the decimal equivalent of "715c (class 7, e.g., use \fam;
-% ignored family value; char position "5C). We can't use " for the
-% usual hex value because it has already been made active.
-
-\def\ttbackslash{{\tt \ifmmode \mathchar29020 \else \backslashcurfont \fi}}
-\let\backslashchar = \ttbackslash % \backslashchar{} is for user documents.
-
-% These are made active for url-breaking, so need
-% active definitions as the normal characters.
-\def\normaldot{.}
-\def\normalquest{?}
-\def\normalslash{/}
-
-% \newlinesloadsconf - call \loadconf as soon as possible in the
-% file, e.g. at the first newline.
-%
-{\catcode`\^=7
-\catcode`\^^M=13
-\gdef\newlineloadsconf{%
- \catcode`\^^M=13 %
- \newlineloadsconfzz%
-}
-\gdef\newlineloadsconfzz#1^^M{%
- \def\c{\loadconf\c}%
- % Definition for the first newline read in the file
- \def ^^M{\loadconf}%
- % In case the first line has a whole-line or environment command on it
- \let\originalparsearg\parsearg%
- \def\parsearg{\loadconf\originalparsearg}%
- %
- % \startenvironment is in the expansion of commands defined with \envdef
- \let\originalstartenvironment\startenvironment%
- \def\startenvironment{\loadconf\startenvironment}%
-}}
-
-
-% Emergency active definition of newline, in case an active newline token
-% appears by mistake.
-{\catcode`\^=7 \catcode13=13%
-\gdef\enableemergencynewline{%
- \gdef^^M{%
- \par%
- %<warning: active newline>\par%
-}}}
-
-
-% \loadconf gets called at the beginning of every Texinfo file.
-% If texinfo.cnf is present on the system, read it. Useful for site-wide
-% @afourpaper, etc. Not opening texinfo.cnf directly in texinfo.tex
-% makes it possible to make a format file for Texinfo.
-%
-\gdef\loadconf{%
- \relax % Terminate the filename if running as "tex '&texinfo' FILE.texi".
- %
- % Turn off the definitions that trigger \loadconf
- \everyjobreset
- \catcode13=5 % regular end of line
- \enableemergencynewline
- \let\c=\comment
- \let\parsearg\originalparsearg
- \let\startenvironment\originalstartenvironment
- %
- % Also turn back on active characters that might appear in the input
- % file name, in case not using a pre-dumped format.
- \catcode`+=\active
- \catcode`\_=\active
- %
- \openin 1 texinfo.cnf
- \ifeof 1 \else \input texinfo.cnf \fi
- \closein 1
-}
-
-% Redefine some control sequences to be controlled by the \ifdummies
-% and \ifindexnofonts switches. Do this at the end so that the control
-% sequences are all defined.
-\definedummies
-
-
-
-
-\catcode`\@=0
-
-% \realbackslash is an actual character `\' with catcode other.
-{\catcode`\\=\other @gdef@realbackslash{\}}
-
-% In Texinfo, backslash is an active character; it prints the backslash
-% in fixed width font.
-\catcode`\\=\active % @ for escape char from now on.
-
-@let\ = @ttbackslash
-
-% If in a .fmt file, print the version number.
-% \eatinput stops the `\input texinfo' from showing up.
-% After that, `\' should revert to printing a backslash.
-% Turn on active characters that we couldn't do earlier because
-% they might have appeared in the input file name.
-%
-@everyjob{@message{[Texinfo version @texinfoversion]}%
- @global@let\ = @eatinput
- @catcode`+=@active @catcode`@_=@active}
-
-{@catcode`@^=7 @catcode`@^^M=13%
-@gdef@eatinput input texinfo#1^^M{@loadconf}}
-
-@def@everyjobreset{@ifx\@eatinput @let\ = @ttbackslash @fi}
-
-% \otherbackslash defines an active \ to be a literal `\' character with
-% catcode other.
-@gdef@otherbackslash{@let\=@realbackslash}
-
-% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
-% the literal character `\'.
-%
-{@catcode`- = @active
- @gdef@normalturnoffactive{%
- @turnoffactive
- @let\=@ttbackslash
- }
-}
-
-% Say @foo, not \foo, in error messages.
-@escapechar = `@@
-
-% These look ok in all fonts, so just make them not special.
-% @hashchar{} gets its own user-level command, because of #line.
-@catcode`@& = @other @def@normalamp{&}
-@catcode`@# = @other @def@normalhash{#}
-@catcode`@% = @other @def@normalpercent{%}
-
-@let @hashchar = @normalhash
-
-@c Finally, make ` and ' active, so that txicodequoteundirected and
-@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
-@c don't make ` and ' active, @code will not get them as active chars.
-@c Do this last of all since we use ` in the previous @catcode assignments.
-@catcode`@'=@active
-@catcode`@`=@active
-
-@c Local variables:
-@c eval: (add-hook 'before-save-hook 'time-stamp nil t)
-@c time-stamp-pattern: "texinfoversion{%Y-%02m-%02d.%02H}"
-@c page-delimiter: "^\\\\message"
-@c End:
-
-@newlineloadsconf
diff --git a/deps/libffi/doc/version.texi b/deps/libffi/doc/version.texi
deleted file mode 100644
index c9adde9c03f..00000000000
--- a/deps/libffi/doc/version.texi
+++ /dev/null
@@ -1,4 +0,0 @@
-@set UPDATED 14 November 2026
-@set UPDATED-MONTH November 2026
-@set EDITION 3.8.1
-@set VERSION 3.8.1
diff --git a/deps/libffi/testsuite/Makefile.am b/deps/libffi/testsuite/Makefile.am
deleted file mode 100644
index 4fab507d1e9..00000000000
--- a/deps/libffi/testsuite/Makefile.am
+++ /dev/null
@@ -1,109 +0,0 @@
-## Process this file with automake to produce Makefile.in.
-
-AUTOMAKE_OPTIONS = foreign dejagnu
-
-EXTRA_DEJAGNU_SITE_CONFIG=../local.exp
-
-CLEANFILES = *.exe core* *.log *.sum
-
-EXTRA_DIST = config/default.exp emscripten/build.sh emscripten/conftest.py \
- emscripten/node-tests.sh emscripten/test.html emscripten/test_libffi.py \
- emscripten/build-tests.sh lib/libffi.exp lib/target-libpath.exp \
- lib/wrapper.exp libffi.bhaible/Makefile libffi.bhaible/README \
- libffi.bhaible/alignof.h libffi.bhaible/bhaible.exp libffi.bhaible/test-call.c \
- libffi.bhaible/test-callback.c libffi.bhaible/testcases.c libffi.call/align_mixed.c \
- libffi.call/align_stdcall.c libffi.call/bpo_38748.c libffi.call/call.exp \
- libffi.call/closure_raw.c \
- libffi.call/closure_thiscall_fastcall_pop.c \
- libffi.call/err_bad_typedef.c libffi.call/ffitest.h libffi.call/float.c \
- libffi.call/float1.c libffi.call/float2.c libffi.call/float3.c \
- libffi.call/float4.c libffi.call/float_va.c libffi.call/i128-1.c \
- libffi.call/large_struct_by_value.c libffi.call/many.c \
- libffi.call/many2.c libffi.call/many_double.c \
- libffi.call/many_large_structs.c libffi.call/many_mixed.c \
- libffi.call/many_small_structs.c \
- libffi.call/negint.c libffi.call/offsets.c libffi.call/overread.c \
- libffi.call/plan.c libffi.call/plan_mixed.c libffi.call/plan_spill.c \
- libffi.call/plan_struct.c libffi.call/plan_size.c libffi.call/plan_var.c \
- libffi.call/pr1172638.c libffi.call/promotion.c libffi.call/pyobjc_tc.c libffi.call/return_dbl.c \
- libffi.call/return_dbl1.c libffi.call/return_dbl2.c libffi.call/return_fl.c \
- libffi.call/return_fl1.c libffi.call/return_fl2.c libffi.call/return_fl3.c \
- libffi.call/return_ldl.c libffi.call/return_ll.c libffi.call/return_ll1.c \
- libffi.call/return_sc.c libffi.call/return_sl.c libffi.call/return_uc.c \
- libffi.call/return_ul.c libffi.call/return_void.c libffi.call/s55.c libffi.call/strlen.c \
- libffi.call/strlen2.c libffi.call/strlen3.c libffi.call/strlen4.c \
- libffi.call/struct1.c libffi.call/struct10.c libffi.call/struct2.c \
- libffi.call/struct3.c libffi.call/struct4.c libffi.call/struct5.c \
- libffi.call/struct6.c libffi.call/struct7.c libffi.call/struct8.c \
- libffi.call/struct9.c libffi.call/struct_by_value_2.c libffi.call/struct_by_value_3.c \
- libffi.call/struct_by_value_3f.c libffi.call/struct_by_value_4.c libffi.call/struct_by_value_4f.c \
- libffi.call/struct_by_value_big.c libffi.call/struct_by_value_small.c libffi.call/struct_return_2H.c \
- libffi.call/struct_int_float.c libffi.call/struct_stack_small.c libffi.call/longjmp.c \
- libffi.call/struct_return_8H.c libffi.call/uninitialized.c libffi.call/va_1.c \
- libffi.call/va_2.c libffi.call/va_3.c libffi.call/va_struct1.c \
- libffi.call/va_struct2.c libffi.call/va_struct3.c libffi.call/callback.c \
- libffi.call/callback2.c libffi.call/callback3.c libffi.call/callback4.c libffi.call/x32.c \
- libffi.closures/closure.exp libffi.closures/closure_int128.c \
- libffi.closures/closure_mmap_failure.c libffi.closures/closure_trampoline_table.c \
- libffi.closures/closure_fn0.c libffi.closures/closure_fn1.c \
- libffi.closures/closure_fn2.c libffi.closures/closure_fn3.c libffi.closures/closure_fn4.c \
- libffi.closures/closure_fn5.c libffi.closures/closure_fn6.c libffi.closures/closure_loc_fn0.c \
- libffi.closures/closure_simple.c libffi.closures/cls_12byte.c libffi.closures/cls_16byte.c \
- libffi.closures/cls_18byte.c libffi.closures/cls_19byte.c libffi.closures/cls_1_1byte.c \
- libffi.closures/cls_20byte.c libffi.closures/cls_20byte1.c libffi.closures/cls_24byte.c \
- libffi.closures/cls_2byte.c libffi.closures/cls_3_1byte.c libffi.closures/cls_3byte1.c \
- libffi.closures/cls_3byte2.c libffi.closures/cls_3float.c libffi.closures/cls_4_1byte.c \
- libffi.closures/cls_4byte.c libffi.closures/cls_5_1_byte.c libffi.closures/cls_5byte.c \
- libffi.closures/cls_64byte.c libffi.closures/cls_6_1_byte.c libffi.closures/cls_6byte.c \
- libffi.closures/cls_7_1_byte.c libffi.closures/cls_7byte.c libffi.closures/cls_8byte.c \
- libffi.closures/cls_9byte1.c libffi.closures/cls_9byte2.c libffi.closures/cls_align_double.c \
- libffi.closures/cls_align_float.c libffi.closures/cls_align_longdouble.c libffi.closures/cls_align_longdouble_split.c \
- libffi.closures/cls_align_longdouble_split2.c libffi.closures/cls_align_pointer.c libffi.closures/cls_align_sint16.c \
- libffi.closures/cls_align_sint32.c libffi.closures/cls_align_sint64.c libffi.closures/cls_align_uint16.c \
- libffi.closures/cls_align_uint32.c libffi.closures/cls_align_uint64.c libffi.closures/cls_dbls_struct.c \
- libffi.closures/cls_double.c libffi.closures/cls_double_va.c libffi.closures/cls_float.c \
- libffi.closures/cls_longdouble.c libffi.closures/cls_longdouble_va.c libffi.closures/cls_many_mixed_args.c \
- libffi.closures/cls_many_mixed_float_double.c libffi.closures/cls_multi_schar.c libffi.closures/cls_multi_sshort.c \
- libffi.closures/cls_multi_sshortchar.c libffi.closures/cls_multi_uchar.c libffi.closures/cls_multi_ushort.c \
- libffi.closures/cls_multi_ushortchar.c libffi.closures/cls_pointer.c libffi.closures/cls_pointer_stack.c \
- libffi.closures/cls_schar.c libffi.closures/cls_sint.c libffi.closures/cls_sshort.c \
- libffi.closures/cls_struct_fp_return.c libffi.closures/cls_struct_ld_return.c libffi.closures/cls_struct_va1.c libffi.closures/cls_uchar.c libffi.closures/cls_uint.c \
- libffi.closures/cls_uint_va.c libffi.closures/cls_ulong_va.c libffi.closures/cls_ulonglong.c \
- libffi.closures/cls_ushort.c libffi.closures/err_bad_abi.c libffi.closures/ffitest.h \
- libffi.closures/huge_struct.c libffi.closures/nested_struct.c libffi.closures/nested_struct1.c \
- libffi.closures/nested_struct10.c libffi.closures/nested_struct11.c libffi.closures/nested_struct12.c \
- libffi.closures/nested_struct13.c libffi.closures/nested_struct2.c libffi.closures/nested_struct3.c \
- libffi.closures/nested_struct4.c libffi.closures/nested_struct5.c libffi.closures/nested_struct6.c \
- libffi.closures/nested_struct7.c libffi.closures/nested_struct8.c libffi.closures/nested_struct9.c \
- libffi.closures/problem1.c libffi.closures/single_entry_structs1.c libffi.closures/single_entry_structs2.c \
- libffi.closures/single_entry_structs3.c libffi.closures/stret_large.c libffi.closures/stret_large2.c \
- libffi.closures/stret_medium.c libffi.closures/stret_medium2.c libffi.closures/testclosure.c \
- libffi.closures/unwindtest.cc libffi.closures/unwindtest_ffi_call.cc libffi.complex/cls_align_complex.inc \
- libffi.complex/cls_align_complex_double.c libffi.complex/cls_align_complex_float.c libffi.complex/cls_align_complex_longdouble.c \
- libffi.complex/cls_complex.inc libffi.complex/cls_complex_double.c libffi.complex/cls_complex_float.c \
- libffi.complex/cls_complex_longdouble.c libffi.complex/cls_complex_struct.inc libffi.complex/cls_complex_struct_double.c \
- libffi.complex/cls_complex_struct_float.c libffi.complex/cls_complex_struct_longdouble.c libffi.complex/cls_complex_va.inc \
- libffi.complex/cls_complex_va_double.c libffi.complex/cls_complex_va_float.c libffi.complex/cls_complex_va_longdouble.c \
- libffi.complex/complex.exp libffi.complex/complex.inc libffi.complex/complex_defs_double.inc \
- libffi.complex/complex_defs_float.inc libffi.complex/complex_defs_longdouble.inc libffi.complex/complex_double.c \
- libffi.complex/complex_float.c libffi.complex/complex_i128.c libffi.complex/complex_int.c libffi.complex/complex_int_small.c libffi.complex/complex_longdouble.c \
- libffi.complex/complex_longdouble_abi.c libffi.complex/complex_regs.inc libffi.complex/complex_regs_double.c \
- libffi.complex/complex_regs_float.c libffi.complex/complex_regs_longdouble.c \
- libffi.complex/ffitest.h libffi.complex/many_complex.inc libffi.complex/many_complex_double.c \
- libffi.complex/many_complex_float.c libffi.complex/many_complex_longdouble.c libffi.complex/return_complex.inc \
- libffi.complex/return_complex1.inc libffi.complex/return_complex1_double.c libffi.complex/return_complex1_float.c \
- libffi.complex/return_complex1_longdouble.c libffi.complex/return_complex2.inc libffi.complex/return_complex2_double.c \
- libffi.complex/return_complex2_float.c libffi.complex/return_complex2_longdouble.c libffi.complex/return_complex_double.c \
- libffi.complex/return_complex_float.c libffi.complex/return_complex_longdouble.c libffi.go/aa-direct.c \
- libffi.go/closure1.c libffi.go/ffitest.h libffi.go/go.exp \
- libffi.go/static-chain.h Makefile.am Makefile.in \
- libffi.jspi/cls_jspi.c libffi.jspi/ffitest.h libffi.jspi/jspi.exp \
- libffi.threads/ffitest.h libffi.threads/threads.exp libffi.threads/tsan.c \
- libffi.vector/vector.exp libffi.vector/ffitest.h libffi.vector/vector.h \
- libffi.vector/vector_float32x4.c libffi.vector/vector_float32x2.c \
- libffi.vector/vector_double2.c libffi.vector/vector_int32x4.c \
- libffi.vector/vector_args_spill.c libffi.vector/vector_vec3.c \
- libffi.vector/vector_double4.c libffi.vector/vector_hva.c \
- libffi.vector/cls_vector.c libffi.vector/vector_validate.c \
- libffi.vector/vector_unsupported_abi.c \
- libffi.configure/libdir.sh
diff --git a/deps/libffi/testsuite/Makefile.in b/deps/libffi/testsuite/Makefile.in
deleted file mode 100644
index 62c61d5132c..00000000000
--- a/deps/libffi/testsuite/Makefile.in
+++ /dev/null
@@ -1,655 +0,0 @@
-# Makefile.in generated by automake 1.18.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2025 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-VPATH = @srcdir@
-am__is_gnu_make = { \
- if test -z '$(MAKELEVEL)'; then \
- false; \
- elif test -n '$(MAKE_HOST)'; then \
- true; \
- elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
- true; \
- else \
- false; \
- fi; \
-}
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-am__rm_f = rm -f $(am__rm_f_notfound)
-am__rm_rf = rm -rf $(am__rm_f_notfound)
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = testsuite
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \
- $(top_srcdir)/m4/ax_cc_maxopt.m4 \
- $(top_srcdir)/m4/ax_cflags_warn_all.m4 \
- $(top_srcdir)/m4/ax_check_compile_flag.m4 \
- $(top_srcdir)/m4/ax_compiler_vendor.m4 \
- $(top_srcdir)/m4/ax_configure_args.m4 \
- $(top_srcdir)/m4/ax_enable_builddir.m4 \
- $(top_srcdir)/m4/ax_gcc_archflag.m4 \
- $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \
- $(top_srcdir)/m4/ax_prepend_flag.m4 \
- $(top_srcdir)/m4/ax_require_defined.m4 \
- $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
- $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
- $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/fficonfig.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-DEJATOOL = $(PACKAGE)
-RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
-EXPECT = expect
-RUNTEST = runtest
-am__DIST_COMMON = $(srcdir)/Makefile.in
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AM_LTLDFLAGS = @AM_LTLDFLAGS@
-AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-CSCOPE = @CSCOPE@
-CTAGS = @CTAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-ETAGS = @ETAGS@
-EXEEXT = @EXEEXT@
-FFI_EXEC_TRAMPOLINE_TABLE = @FFI_EXEC_TRAMPOLINE_TABLE@
-FFI_VERSION_NUMBER = @FFI_VERSION_NUMBER@
-FFI_VERSION_STRING = @FFI_VERSION_STRING@
-FGREP = @FGREP@
-FILECMD = @FILECMD@
-GREP = @GREP@
-HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
-HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OPT_LDFLAGS = @OPT_LDFLAGS@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PRTDIAG = @PRTDIAG@
-RANLIB = @RANLIB@
-READELF = @READELF@
-SECTION_LDFLAGS = @SECTION_LDFLAGS@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-TARGET = @TARGET@
-TARGETDIR = @TARGETDIR@
-TARGET_OBJ = @TARGET_OBJ@
-VERSION = @VERSION@
-WASM64_MEMORY64 = @WASM64_MEMORY64@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-ac_ct_READELF = @ac_ct_READELF@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__rm_f_notfound = @am__rm_f_notfound@
-am__tar = @am__tar@
-am__untar = @am__untar@
-am__xargs_n = @am__xargs_n@
-ax_enable_builddir_sed = @ax_enable_builddir_sed@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-runstatedir = @runstatedir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sys_symbol_underscore = @sys_symbol_underscore@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-tmake_file = @tmake_file@
-toolexecdir = @toolexecdir@
-toolexeclibdir = @toolexeclibdir@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = foreign dejagnu
-EXTRA_DEJAGNU_SITE_CONFIG = ../local.exp
-CLEANFILES = *.exe core* *.log *.sum
-EXTRA_DIST = config/default.exp emscripten/build.sh emscripten/conftest.py \
- emscripten/node-tests.sh emscripten/test.html emscripten/test_libffi.py \
- emscripten/build-tests.sh lib/libffi.exp lib/target-libpath.exp \
- lib/wrapper.exp libffi.bhaible/Makefile libffi.bhaible/README \
- libffi.bhaible/alignof.h libffi.bhaible/bhaible.exp libffi.bhaible/test-call.c \
- libffi.bhaible/test-callback.c libffi.bhaible/testcases.c libffi.call/align_mixed.c \
- libffi.call/align_stdcall.c libffi.call/bpo_38748.c libffi.call/call.exp \
- libffi.call/closure_raw.c \
- libffi.call/closure_thiscall_fastcall_pop.c \
- libffi.call/err_bad_typedef.c libffi.call/ffitest.h libffi.call/float.c \
- libffi.call/float1.c libffi.call/float2.c libffi.call/float3.c \
- libffi.call/float4.c libffi.call/float_va.c libffi.call/i128-1.c \
- libffi.call/large_struct_by_value.c libffi.call/many.c \
- libffi.call/many2.c libffi.call/many_double.c \
- libffi.call/many_large_structs.c libffi.call/many_mixed.c \
- libffi.call/many_small_structs.c \
- libffi.call/negint.c libffi.call/offsets.c libffi.call/overread.c \
- libffi.call/plan.c libffi.call/plan_mixed.c libffi.call/plan_spill.c \
- libffi.call/plan_struct.c libffi.call/plan_size.c libffi.call/plan_var.c \
- libffi.call/pr1172638.c libffi.call/promotion.c libffi.call/pyobjc_tc.c libffi.call/return_dbl.c \
- libffi.call/return_dbl1.c libffi.call/return_dbl2.c libffi.call/return_fl.c \
- libffi.call/return_fl1.c libffi.call/return_fl2.c libffi.call/return_fl3.c \
- libffi.call/return_ldl.c libffi.call/return_ll.c libffi.call/return_ll1.c \
- libffi.call/return_sc.c libffi.call/return_sl.c libffi.call/return_uc.c \
- libffi.call/return_ul.c libffi.call/return_void.c libffi.call/s55.c libffi.call/strlen.c \
- libffi.call/strlen2.c libffi.call/strlen3.c libffi.call/strlen4.c \
- libffi.call/struct1.c libffi.call/struct10.c libffi.call/struct2.c \
- libffi.call/struct3.c libffi.call/struct4.c libffi.call/struct5.c \
- libffi.call/struct6.c libffi.call/struct7.c libffi.call/struct8.c \
- libffi.call/struct9.c libffi.call/struct_by_value_2.c libffi.call/struct_by_value_3.c \
- libffi.call/struct_by_value_3f.c libffi.call/struct_by_value_4.c libffi.call/struct_by_value_4f.c \
- libffi.call/struct_by_value_big.c libffi.call/struct_by_value_small.c libffi.call/struct_return_2H.c \
- libffi.call/struct_int_float.c libffi.call/struct_stack_small.c libffi.call/longjmp.c \
- libffi.call/struct_return_8H.c libffi.call/uninitialized.c libffi.call/va_1.c \
- libffi.call/va_2.c libffi.call/va_3.c libffi.call/va_struct1.c \
- libffi.call/va_struct2.c libffi.call/va_struct3.c libffi.call/callback.c \
- libffi.call/callback2.c libffi.call/callback3.c libffi.call/callback4.c libffi.call/x32.c \
- libffi.closures/closure.exp libffi.closures/closure_int128.c \
- libffi.closures/closure_mmap_failure.c libffi.closures/closure_trampoline_table.c \
- libffi.closures/closure_fn0.c libffi.closures/closure_fn1.c \
- libffi.closures/closure_fn2.c libffi.closures/closure_fn3.c libffi.closures/closure_fn4.c \
- libffi.closures/closure_fn5.c libffi.closures/closure_fn6.c libffi.closures/closure_loc_fn0.c \
- libffi.closures/closure_simple.c libffi.closures/cls_12byte.c libffi.closures/cls_16byte.c \
- libffi.closures/cls_18byte.c libffi.closures/cls_19byte.c libffi.closures/cls_1_1byte.c \
- libffi.closures/cls_20byte.c libffi.closures/cls_20byte1.c libffi.closures/cls_24byte.c \
- libffi.closures/cls_2byte.c libffi.closures/cls_3_1byte.c libffi.closures/cls_3byte1.c \
- libffi.closures/cls_3byte2.c libffi.closures/cls_3float.c libffi.closures/cls_4_1byte.c \
- libffi.closures/cls_4byte.c libffi.closures/cls_5_1_byte.c libffi.closures/cls_5byte.c \
- libffi.closures/cls_64byte.c libffi.closures/cls_6_1_byte.c libffi.closures/cls_6byte.c \
- libffi.closures/cls_7_1_byte.c libffi.closures/cls_7byte.c libffi.closures/cls_8byte.c \
- libffi.closures/cls_9byte1.c libffi.closures/cls_9byte2.c libffi.closures/cls_align_double.c \
- libffi.closures/cls_align_float.c libffi.closures/cls_align_longdouble.c libffi.closures/cls_align_longdouble_split.c \
- libffi.closures/cls_align_longdouble_split2.c libffi.closures/cls_align_pointer.c libffi.closures/cls_align_sint16.c \
- libffi.closures/cls_align_sint32.c libffi.closures/cls_align_sint64.c libffi.closures/cls_align_uint16.c \
- libffi.closures/cls_align_uint32.c libffi.closures/cls_align_uint64.c libffi.closures/cls_dbls_struct.c \
- libffi.closures/cls_double.c libffi.closures/cls_double_va.c libffi.closures/cls_float.c \
- libffi.closures/cls_longdouble.c libffi.closures/cls_longdouble_va.c libffi.closures/cls_many_mixed_args.c \
- libffi.closures/cls_many_mixed_float_double.c libffi.closures/cls_multi_schar.c libffi.closures/cls_multi_sshort.c \
- libffi.closures/cls_multi_sshortchar.c libffi.closures/cls_multi_uchar.c libffi.closures/cls_multi_ushort.c \
- libffi.closures/cls_multi_ushortchar.c libffi.closures/cls_pointer.c libffi.closures/cls_pointer_stack.c \
- libffi.closures/cls_schar.c libffi.closures/cls_sint.c libffi.closures/cls_sshort.c \
- libffi.closures/cls_struct_fp_return.c libffi.closures/cls_struct_ld_return.c libffi.closures/cls_struct_va1.c libffi.closures/cls_uchar.c libffi.closures/cls_uint.c \
- libffi.closures/cls_uint_va.c libffi.closures/cls_ulong_va.c libffi.closures/cls_ulonglong.c \
- libffi.closures/cls_ushort.c libffi.closures/err_bad_abi.c libffi.closures/ffitest.h \
- libffi.closures/huge_struct.c libffi.closures/nested_struct.c libffi.closures/nested_struct1.c \
- libffi.closures/nested_struct10.c libffi.closures/nested_struct11.c libffi.closures/nested_struct12.c \
- libffi.closures/nested_struct13.c libffi.closures/nested_struct2.c libffi.closures/nested_struct3.c \
- libffi.closures/nested_struct4.c libffi.closures/nested_struct5.c libffi.closures/nested_struct6.c \
- libffi.closures/nested_struct7.c libffi.closures/nested_struct8.c libffi.closures/nested_struct9.c \
- libffi.closures/problem1.c libffi.closures/single_entry_structs1.c libffi.closures/single_entry_structs2.c \
- libffi.closures/single_entry_structs3.c libffi.closures/stret_large.c libffi.closures/stret_large2.c \
- libffi.closures/stret_medium.c libffi.closures/stret_medium2.c libffi.closures/testclosure.c \
- libffi.closures/unwindtest.cc libffi.closures/unwindtest_ffi_call.cc libffi.complex/cls_align_complex.inc \
- libffi.complex/cls_align_complex_double.c libffi.complex/cls_align_complex_float.c libffi.complex/cls_align_complex_longdouble.c \
- libffi.complex/cls_complex.inc libffi.complex/cls_complex_double.c libffi.complex/cls_complex_float.c \
- libffi.complex/cls_complex_longdouble.c libffi.complex/cls_complex_struct.inc libffi.complex/cls_complex_struct_double.c \
- libffi.complex/cls_complex_struct_float.c libffi.complex/cls_complex_struct_longdouble.c libffi.complex/cls_complex_va.inc \
- libffi.complex/cls_complex_va_double.c libffi.complex/cls_complex_va_float.c libffi.complex/cls_complex_va_longdouble.c \
- libffi.complex/complex.exp libffi.complex/complex.inc libffi.complex/complex_defs_double.inc \
- libffi.complex/complex_defs_float.inc libffi.complex/complex_defs_longdouble.inc libffi.complex/complex_double.c \
- libffi.complex/complex_float.c libffi.complex/complex_i128.c libffi.complex/complex_int.c libffi.complex/complex_int_small.c libffi.complex/complex_longdouble.c \
- libffi.complex/complex_longdouble_abi.c libffi.complex/complex_regs.inc libffi.complex/complex_regs_double.c \
- libffi.complex/complex_regs_float.c libffi.complex/complex_regs_longdouble.c \
- libffi.complex/ffitest.h libffi.complex/many_complex.inc libffi.complex/many_complex_double.c \
- libffi.complex/many_complex_float.c libffi.complex/many_complex_longdouble.c libffi.complex/return_complex.inc \
- libffi.complex/return_complex1.inc libffi.complex/return_complex1_double.c libffi.complex/return_complex1_float.c \
- libffi.complex/return_complex1_longdouble.c libffi.complex/return_complex2.inc libffi.complex/return_complex2_double.c \
- libffi.complex/return_complex2_float.c libffi.complex/return_complex2_longdouble.c libffi.complex/return_complex_double.c \
- libffi.complex/return_complex_float.c libffi.complex/return_complex_longdouble.c libffi.go/aa-direct.c \
- libffi.go/closure1.c libffi.go/ffitest.h libffi.go/go.exp \
- libffi.go/static-chain.h Makefile.am Makefile.in \
- libffi.jspi/cls_jspi.c libffi.jspi/ffitest.h libffi.jspi/jspi.exp \
- libffi.threads/ffitest.h libffi.threads/threads.exp libffi.threads/tsan.c \
- libffi.vector/vector.exp libffi.vector/ffitest.h libffi.vector/vector.h \
- libffi.vector/vector_float32x4.c libffi.vector/vector_float32x2.c \
- libffi.vector/vector_double2.c libffi.vector/vector_int32x4.c \
- libffi.vector/vector_args_spill.c libffi.vector/vector_vec3.c \
- libffi.vector/vector_double4.c libffi.vector/vector_hva.c \
- libffi.vector/cls_vector.c libffi.vector/vector_validate.c \
- libffi.vector/vector_unsupported_abi.c \
- libffi.configure/libdir.sh
-
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign testsuite/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign testsuite/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-tags TAGS:
-
-ctags CTAGS:
-
-cscope cscopelist:
-
-
-check-DEJAGNU: site.exp
- srcdir='$(srcdir)'; export srcdir; \
- EXPECT=$(EXPECT); export EXPECT; \
- if $(SHELL) -c "$(RUNTEST) --version" > /dev/null 2>&1; then \
- exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \
- if $(RUNTEST) $(RUNTESTDEFAULTFLAGS) $(AM_RUNTESTFLAGS) $(RUNTESTFLAGS); \
- then :; else exit_status=1; fi; \
- done; \
- else echo "WARNING: could not find '$(RUNTEST)'" 1>&2; :;\
- fi; \
- exit $$exit_status
-site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
- $(AM_V_GEN)set -e; ( \
- echo '## these variables are automatically generated by make ##'; \
- echo '# Do not edit here. If you wish to override these values'; \
- echo '# edit the last section'; \
- echo 'set srcdir "$(srcdir)"'; \
- echo "set objdir \"`pwd`\""; \
- echo 'set build_alias "$(build_alias)"'; \
- echo 'set build_triplet $(build_triplet)'; \
- echo 'set host_alias "$(host_alias)"'; \
- echo 'set host_triplet $(host_triplet)'; \
- echo 'set target_alias "$(target_alias)"'; \
- echo 'set target_triplet $(target_triplet)'; \
- list='$(EXTRA_DEJAGNU_SITE_CONFIG)'; \
- for f in $$list; do \
- echo "## Begin content included from file $$f. Do not modify. ##"; \
- cat `test -f "$$f" || echo '$(srcdir)/'`$$f; \
- echo "## End content included from file $$f. ##"; \
- done; \
- echo "## End of auto-generated content; you can edit from here. ##"; \
- if test -f site.exp; then \
- sed -e '1,/^## End of auto-generated content.*##/d' site.exp; \
- fi; \
- ) >site.tmp; \
- rm -f site.bak; \
- test ! -f site.exp || mv site.exp site.bak; \
- mv site.tmp site.exp
-
-distclean-DEJAGNU:
- -rm -f site.exp site.bak
- -l='$(DEJATOOL)'; for tool in $$l; do \
- rm -f $$tool.sum $$tool.log; \
- done
-
-distdir: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) distdir-am
-
-distdir-am: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
- $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
-check: check-am
-all-am: Makefile
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
- -$(am__rm_f) $(CLEANFILES)
-
-distclean-generic:
- -$(am__rm_f) $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-DEJAGNU distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: check-am install-am install-strip
-
-.PHONY: all all-am check check-DEJAGNU check-am clean clean-generic \
- clean-libtool cscopelist-am ctags-am distclean \
- distclean-DEJAGNU distclean-generic distclean-libtool distdir \
- dvi dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
- uninstall-am
-
-.PRECIOUS: Makefile
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
-
-# Tell GNU make to disable its built-in pattern rules.
-%:: %,v
-%:: RCS/%,v
-%:: RCS/%
-%:: s.%
-%:: SCCS/s.%
diff --git a/deps/libffi/testsuite/check-dlmalloc-static.sh b/deps/libffi/testsuite/check-dlmalloc-static.sh
deleted file mode 100755
index 708cc2125d7..00000000000
--- a/deps/libffi/testsuite/check-dlmalloc-static.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/sh
-# Check that closures.c keeps the bundled dlmalloc private.
-#
-# closures.c declares each dl* function static before it includes
-# dlmalloc.c. A dl* function missing from that list gets dlmalloc's
-# default extern linkage. The version script hides it in libffi.so.
-# libffi.a has no version script, so a program that links libffi.a
-# exports it.
-#
-# Usage: check-dlmalloc-static.sh NM LIBTOOL-OBJECT
-
-nm_cmd=$1
-lo=$2
-
-case $nm_cmd in
- *dumpbin*)
- echo "SKIP: $nm_cmd does not print nm-style output"
- exit 0
- ;;
-esac
-
-pic_object=none
-non_pic_object=none
-. "./$lo"
-dir=`dirname "$lo"`
-
-status=0
-checked=0
-for obj in "$pic_object" "$non_pic_object"; do
- test "$obj" = none && continue
- checked=1
- leaked=`$nm_cmd "$dir/$obj" | awk 'NF >= 3 && $2 ~ /^[A-TV-Z]$/ { print $3 }' | grep '^_*dl'`
- if test -n "$leaked"; then
- echo "FAIL: $dir/$obj defines these dlmalloc functions as external symbols:"
- echo "$leaked" | sed 's/^/ /'
- echo "Declare them static in src/closures.c, before it includes dlmalloc.c."
- status=1
- fi
-done
-
-if test $checked = 0; then
- echo "FAIL: $lo names no object to check"
- exit 1
-fi
-test $status = 0 && echo "PASS: no dlmalloc function in $lo is external"
-exit $status
diff --git a/deps/libffi/testsuite/config/default.exp b/deps/libffi/testsuite/config/default.exp
deleted file mode 100644
index 90967cccc18..00000000000
--- a/deps/libffi/testsuite/config/default.exp
+++ /dev/null
@@ -1 +0,0 @@
-load_lib "standard.exp"
diff --git a/deps/libffi/testsuite/emscripten/build-tests.sh b/deps/libffi/testsuite/emscripten/build-tests.sh
deleted file mode 100755
index b73cb79fa98..00000000000
--- a/deps/libffi/testsuite/emscripten/build-tests.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env bash
-
-if ! [ -x "$(command -v emcc)" ]; then
- echo "Error: emcc could not be found." >&2
- exit 1
-fi
-
-set -e
-
-cd "$1"
-shift
-
-export CFLAGS="-fPIC -O2 -I../../target/include $EXTRA_CFLAGS"
-export CXXFLAGS="$CFLAGS -sNO_DISABLE_EXCEPTION_CATCHING $EXTRA_CXXFLAGS"
-export LDFLAGS=" \
- -L../../target/lib/ -lffi \
- -sEXPORT_ALL \
- -sMODULARIZE \
- -sMAIN_MODULE \
- -sNO_DISABLE_EXCEPTION_CATCHING \
- $EXTRA_LD_FLAGS \
-"
-
-# Rename main functions to test__filename so we can link them together
-ls *c | sed 's!\(.*\)\.c!sed -i "s/main/test__\1/g" \0!g' | bash
-
-# Compile
-ls *.c | sed 's/\(.*\)\.c/emcc $CFLAGS -c \1.c -o \1.o /g' | bash
-ls *.cc | sed 's/\(.*\)\.cc/em++ $CXXFLAGS -c \1.cc -o \1.o /g' | bash
-
-# Link
-em++ $LDFLAGS *.o -o test.js
-cp ../emscripten/test.html .
diff --git a/deps/libffi/testsuite/emscripten/build.sh b/deps/libffi/testsuite/emscripten/build.sh
deleted file mode 100755
index a332c1d5396..00000000000
--- a/deps/libffi/testsuite/emscripten/build.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/env bash
-
-if ! [ -x "$(command -v emcc)" ]; then
- echo "Error: emcc could not be found." >&2
- exit 1
-fi
-
-set -e
-
-SOURCE_DIR=$PWD
-
-# Working directories
-TARGET=$SOURCE_DIR/target
-mkdir -p "$TARGET"
-
-# Define default arguments
-DEBUG=false
-
-# Parse arguments
-while [ $# -gt 0 ]; do
- case $1 in
- --debug) DEBUG=true ;;
- *) echo "ERROR: Unknown parameter: $1" >&2; exit 1 ;;
- esac
- shift
-done
-
-# Common compiler flags
-export CFLAGS="-O3 -fPIC"
-if [ "$DEBUG" = "true" ]; then export CFLAGS+=" -DDEBUG_F"; fi
-export CXXFLAGS="$CFLAGS"
-
-# Build paths
-export CPATH="$TARGET/include"
-export PKG_CONFIG_PATH="$TARGET/lib/pkgconfig"
-export EM_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
-
-# Specific variables for cross-compilation
-export CHOST="${TARGET_HOST}-unknown-linux" # wasm32-unknown-emscripten
-
-autoreconf -fiv
-emconfigure ./configure --host=$CHOST --prefix="$TARGET" --enable-static --disable-shared --disable-dependency-tracking \
- --disable-builddir --disable-multi-os-directory --disable-raw-api --disable-docs ${EXTRA_CONFIGURE_FLAGS}
-make install
-cp fficonfig.h target/include/
-cp include/ffi_common.h target/include/
diff --git a/deps/libffi/testsuite/emscripten/conftest.py b/deps/libffi/testsuite/emscripten/conftest.py
deleted file mode 100644
index b2e36dd5ace..00000000000
--- a/deps/libffi/testsuite/emscripten/conftest.py
+++ /dev/null
@@ -1,86 +0,0 @@
-from pathlib import Path
-from pytest import fixture
-from pytest_pyodide.server import spawn_web_server
-from pytest_pyodide import runner
-
-import logging
-
-TEST_PATH = Path(__file__).parents[1].resolve()
-
-
-class BaseRunner(runner._BrowserBaseRunner):
- def __init__(
- self,
- *args,
- test_dir,
- **kwargs,
- ):
- self.test_dir = test_dir
- super().__init__(
- *args,
- **kwargs,
- load_pyodide=False,
- )
-
- def prepare_driver(self):
- self.base_url = (
- f"http://{self.server_hostname}:{self.server_port}/{self.test_dir}/"
- )
- self.goto(f"{self.base_url}/test.html")
-
- def javascript_setup(self):
- self.run_js("globalThis.TestModule = await globalThis.Module();")
-
-
-class FirefoxRunner(BaseRunner, runner.SeleniumFirefoxRunner):
- pass
-
-
-class ChromeRunner(BaseRunner, runner.SeleniumChromeRunner):
- pass
-
-
-# TODO: Figure out how to get NodeRunner to work.
-
-RUNNER_DICT = {x.browser: x for x in [FirefoxRunner, ChromeRunner]}
-
-
-@fixture(params=list(RUNNER_DICT), scope="class")
-def selenium_class_scope(request, web_server_main):
- server_hostname, server_port, server_log = web_server_main
- assert request.param in RUNNER_DICT
-
- logger = logging.getLogger('selenium')
- logger.setLevel(logging.DEBUG)
-
- cls = RUNNER_DICT[request.param]
- selenium = cls(
- test_dir=request.cls.TEST_BUILD_DIR,
- server_port=server_port,
- server_hostname=server_hostname,
- server_log=server_log,
- )
- request.cls.call_number = 0
- try:
- yield selenium
- finally:
- print(selenium.logs)
- selenium.driver.quit()
-
-
-@fixture(scope="function")
-def selenium(selenium_class_scope, request):
- selenium = selenium_class_scope
- request.cls.call_number += 1
- # Refresh page every 50 calls to prevent firefox out of memory errors
- if request.cls.call_number % 50 == 0:
- selenium.driver.refresh()
- selenium.javascript_setup()
- selenium.clean_logs()
- yield selenium
-
-
-@fixture(scope="session")
-def web_server_main(request):
- with spawn_web_server(TEST_PATH) as output:
- yield output
diff --git a/deps/libffi/testsuite/emscripten/node-tests.sh b/deps/libffi/testsuite/emscripten/node-tests.sh
deleted file mode 100755
index 273d60b5abb..00000000000
--- a/deps/libffi/testsuite/emscripten/node-tests.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-
-if ! [ -x "$(command -v emcc)" ]; then
- echo "Error: emcc could not be found." >&2
- exit 1
-fi
-
-# Common compiler flags
-export CFLAGS="-fPIC $EXTRA_CFLAGS"
-export CXXFLAGS="$CFLAGS -fexceptions $EXTRA_CXXFLAGS"
-export LDFLAGS="-sEXPORTED_FUNCTIONS=_main,_malloc,_free -sALLOW_TABLE_GROWTH -sASSERTIONS -Wno-main"
-
-# Specific variables for cross-compilation
-export CHOST="${TARGET_HOST}-unknown-linux" # wasm32-unknown-emscripten
-
-autoreconf -fiv
-emconfigure ./configure --prefix="$(pwd)/target" --host=$CHOST --enable-static --disable-shared \
- --disable-builddir --disable-multi-os-directory --disable-raw-api --disable-docs ${EXTRA_CONFIGURE_FLAGS} ||
- (cat config.log && exit 1)
-make
-
-EMMAKEN_JUST_CONFIGURE=1 emmake make check \
- RUNTESTFLAGS="LDFLAGS_FOR_TARGET='$LDFLAGS $EXTRA_TEST_LDFLAGS'" || (cat testsuite/libffi.log && exit 1)
diff --git a/deps/libffi/testsuite/emscripten/test.html b/deps/libffi/testsuite/emscripten/test.html
deleted file mode 100644
index 7701503850b..00000000000
--- a/deps/libffi/testsuite/emscripten/test.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <script src="test.js"></script>
- </head>
- <body></body>
-</html>
diff --git a/deps/libffi/testsuite/emscripten/test_libffi.py b/deps/libffi/testsuite/emscripten/test_libffi.py
deleted file mode 100644
index 059d53565c8..00000000000
--- a/deps/libffi/testsuite/emscripten/test_libffi.py
+++ /dev/null
@@ -1,51 +0,0 @@
-import subprocess
-import pathlib
-import pytest
-
-TEST_PATH = pathlib.Path(__file__).parents[1].resolve()
-
-xfails = {}
-
-
-def libffi_tests(self, selenium, libffi_test):
- if libffi_test in xfails:
- pytest.xfail(f'known failure with code "{xfails[libffi_test]}"')
- res = selenium.run_js(
- """
- window.TestModule = await Module();
- """
- )
- selenium.run_js(
- f"""
- try {{
- TestModule._test__{libffi_test}();
- }} catch(e){{
- if(e.name !== "ExitStatus"){{
- throw e;
- }}
- if(e.status !== 0){{
- throw new Error(`Terminated with nonzero status code ${{e.status}}: ` + e.message);
- }}
- }}
- """
- )
-
-
-class TestCall:
- TEST_BUILD_DIR = "libffi.call.test"
- test_call = libffi_tests
-
-
-class TestClosures:
- TEST_BUILD_DIR = "libffi.closures.test"
- test_closures = libffi_tests
-
-
-def pytest_generate_tests(metafunc):
- test_build_dir = metafunc.cls.TEST_BUILD_DIR
- test_names = [x.stem for x in (TEST_PATH / test_build_dir).glob("*.o")]
- metafunc.parametrize("libffi_test", test_names)
-
-
-if __name__ == "__main__":
- subprocess.call(["build-tests.sh", "libffi.call"])
diff --git a/deps/libffi/testsuite/lib/libffi.exp b/deps/libffi/testsuite/lib/libffi.exp
deleted file mode 100644
index 6cb40f8703b..00000000000
--- a/deps/libffi/testsuite/lib/libffi.exp
+++ /dev/null
@@ -1,744 +0,0 @@
-# Copyright (C) 2003, 2005, 2008, 2009, 2010, 2011, 2014, 2019, 2022, 2025 Free Software Foundation, Inc.
-
-# This program 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 3 of the License, or
-# (at your option) any later version.
-#
-# This program 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; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-proc load_gcc_lib { filename } {
- global srcdir
- load_file $srcdir/lib/$filename
-}
-
-load_lib dg.exp
-load_lib libgloss.exp
-load_gcc_lib target-libpath.exp
-load_gcc_lib wrapper.exp
-
-proc check_effective_target_gccbug { } {
- global has_gccbug
- return $has_gccbug
-}
-
-# True when this is a powerpc64 linux target whose compiler makes long double
-# 128 bits wide. A few tests pin -mlong-double-128 to exercise the IBM-128
-# paths, but they may only do so when the library they link against was built
-# the same way: the powerpc linker refuses to merge objects that disagree about
-# the long double ABI. Probe the compiler rather than the target triplet, so a
-# -mlong-double-64 build (musl's choice on ppc64le) drops the option and tests
-# the 64-bit long double instead.
-proc check_effective_target_ppc64_longdouble128 { } {
- if { ![istarget powerpc64*-*-linux-gnu*] } {
- return 0
- }
- return [libffi_feature_test "#if defined(__LONG_DOUBLE_128__)"]
-}
-
-# Return 1 if the target matches the effective target 'arg', 0 otherwise.
-# This can be used with any check_* proc that takes no argument and
-# returns only 1 or 0. It could be used with check_* procs that take
-# arguments with keywords that pass particular arguments.
-
-proc is-effective-target { arg } {
- global et_index
- set selected 0
- if { ![info exists et_index] } {
- # Initialize the effective target index that is used in some
- # check_effective_target_* procs.
- set et_index 0
- }
- if { [info procs check_effective_target_${arg}] != [list] } {
- set selected [check_effective_target_${arg}]
- } else {
- error "unknown effective target keyword `$arg'"
- }
- verbose "is-effective-target: $arg $selected" 2
- return $selected
-}
-
-proc is-effective-target-keyword { arg } {
- if { [info procs check_effective_target_${arg}] != [list] } {
- return 1
- } else {
- return 0
- }
-}
-
-# Intercept the call to the DejaGnu version of dg-process-target to
-# support use of an effective-target keyword in place of a list of
-# target triplets to xfail or skip a test.
-#
-# The argument to dg-process-target is the keyword "target" or "xfail"
-# followed by a selector:
-# target-triplet-1 ...
-# effective-target-keyword
-# selector-expression
-#
-# For a target list the result is "S" if the target is selected, "N" otherwise.
-# For an xfail list the result is "F" if the target is affected, "P" otherwise.
-
-# In contexts that allow either "target" or "xfail" the argument can be
-# target selector1 xfail selector2
-# which returns "N" if selector1 is not selected, otherwise the result of
-# "xfail selector2".
-#
-# A selector expression appears within curly braces and uses a single logical
-# operator: !, &&, or ||. An operand is another selector expression, an
-# effective-target keyword, or a list of target triplets within quotes or
-# curly braces.
-
-if { [info procs saved-dg-process-target] == [list] } {
- rename dg-process-target saved-dg-process-target
-
- # Evaluate an operand within a selector expression.
- proc selector_opd { op } {
- set selector "target"
- lappend selector $op
- set answer [ expr { [dg-process-target $selector] == "S" } ]
- verbose "selector_opd: `$op' $answer" 2
- return $answer
- }
-
- # Evaluate a target triplet list within a selector expression.
- # Unlike other operands, this needs to be expanded from a list to
- # the same string as "target".
- proc selector_list { op } {
- set selector "target [join $op]"
- set answer [ expr { [dg-process-target $selector] == "S" } ]
- verbose "selector_list: `$op' $answer" 2
- return $answer
- }
-
- # Evaluate a selector expression.
- proc selector_expression { exp } {
- if { [llength $exp] == 2 } {
- if [string match "!" [lindex $exp 0]] {
- set op1 [lindex $exp 1]
- set answer [expr { ! [selector_opd $op1] }]
- } else {
- # Assume it's a list of target triplets.
- set answer [selector_list $exp]
- }
- } elseif { [llength $exp] == 3 } {
- set op1 [lindex $exp 0]
- set opr [lindex $exp 1]
- set op2 [lindex $exp 2]
- if [string match "&&" $opr] {
- set answer [expr { [selector_opd $op1] && [selector_opd $op2] }]
- } elseif [string match "||" $opr] {
- set answer [expr { [selector_opd $op1] || [selector_opd $op2] }]
- } else {
- # Assume it's a list of target triplets.
- set answer [selector_list $exp]
- }
- } else {
- # Assume it's a list of target triplets.
- set answer [selector_list $exp]
- }
-
- verbose "selector_expression: `$exp' $answer" 2
- return $answer
- }
-
- # Evaluate "target selector" or "xfail selector".
-
- proc dg-process-target-1 { args } {
- verbose "dg-process-target-1: `$args'" 2
-
- # Extract the 'what' keyword from the argument list.
- set selector [string trim [lindex $args 0]]
- if [regexp "^xfail " $selector] {
- set what "xfail"
- } elseif [regexp "^target " $selector] {
- set what "target"
- } else {
- error "syntax error in target selector \"$selector\""
- }
-
- # Extract the rest of the list, which might be a keyword.
- regsub "^${what}" $selector "" rest
- set rest [string trim $rest]
-
- if [is-effective-target-keyword $rest] {
- # The selector is an effective target keyword.
- if [is-effective-target $rest] {
- return [expr { $what == "xfail" ? "F" : "S" }]
- } else {
- return [expr { $what == "xfail" ? "P" : "N" }]
- }
- }
-
- if [string match "{*}" $rest] {
- if [selector_expression [lindex $rest 0]] {
- return [expr { $what == "xfail" ? "F" : "S" }]
- } else {
- return [expr { $what == "xfail" ? "P" : "N" }]
- }
- }
-
- # The selector is not an effective-target keyword, so process
- # the list of target triplets.
- return [saved-dg-process-target $selector]
- }
-
- # Intercept calls to the DejaGnu function. In addition to
- # processing "target selector" or "xfail selector", handle
- # "target selector1 xfail selector2".
-
- proc dg-process-target { args } {
- verbose "replacement dg-process-target: `$args'" 2
-
- set selector [string trim [lindex $args 0]]
-
- # If the argument list contains both 'target' and 'xfail',
- # process 'target' and, if that succeeds, process 'xfail'.
- if [regexp "^target .* xfail .*" $selector] {
- set xfail_index [string first "xfail" $selector]
- set xfail_selector [string range $selector $xfail_index end]
- set target_selector [string range $selector 0 [expr $xfail_index-1]]
- set target_selector [string trim $target_selector]
- if { [dg-process-target-1 $target_selector] == "N" } {
- return "N"
- }
- return [dg-process-target-1 $xfail_selector]
-
- }
- return [dg-process-target-1 $selector]
- }
-}
-
-# Define libffi callbacks for dg.exp.
-
-proc libffi-dg-test-1 { target_compile prog do_what extra_tool_flags } {
-
- # To get all \n in dg-output test strings to match printf output
- # in a system that outputs it as \015\012 (i.e. not just \012), we
- # need to change all \n into \r?\n. As there is no dejagnu flag
- # or hook to do that, we simply change the text being tested.
- # Unfortunately, we have to know that the variable is called
- # dg-output-text and lives in the caller of libffi-dg-test, which
- # is two calls up. Overriding proc dg-output would be longer and
- # would necessarily have the same assumption.
- upvar 2 dg-output-text output_match
-
- if { [llength $output_match] > 1 } {
- regsub -all "\n" [lindex $output_match 1] "\r?\n" x
- set output_match [lreplace $output_match 1 1 $x]
- }
-
- if { [ istarget "wasm32-*-*" ] } {
- # emscripten will get confused if told to build as .exe
- set exec_suffix ""
- } else {
- set exec_suffix ".exe"
- }
-
- # Set up the compiler flags, based on what we're going to do.
-
- set options [list]
- switch $do_what {
- "compile" {
- set compile_type "assembly"
- set output_file "[file rootname [file tail $prog]].s"
- }
- "link" {
- set compile_type "executable"
- set output_file "[file rootname [file tail $prog]]$exec_suffix"
- # The following line is needed for targets like the i960 where
- # the default output file is b.out. Sigh.
- }
- "run" {
- set compile_type "executable"
- # FIXME: "./" is to cope with "." not being in $PATH.
- # Should this be handled elsewhere?
- # YES.
- set output_file "./[file rootname [file tail $prog]]$exec_suffix"
- # This is the only place where we care if an executable was
- # created or not. If it was, dg.exp will try to run it.
- remote_file build delete $output_file;
- }
- default {
- perror "$do_what: not a valid dg-do keyword"
- return ""
- }
- }
-
- if { $extra_tool_flags != "" } {
- lappend options "additional_flags=$extra_tool_flags"
- }
-
- set comp_output [libffi_target_compile "$prog" "$output_file" "$compile_type" $options];
-
-
- return [list $comp_output $output_file]
-}
-
-
-proc libffi-dg-test { prog do_what extra_tool_flags } {
- return [libffi-dg-test-1 target_compile $prog $do_what $extra_tool_flags]
-}
-
-proc libffi-dg-prune { target_triplet text } {
- # We get this with some qemu emulated systems (eg. ppc64le-linux-gnu)
- regsub -all "(^|\n)\[^\n\]*unable to perform all requested operations" $text "" text
- # We get this from sparc64 linux systems
- regsub -all "(^|\n)\[^\n\]*warning: .* has a LOAD segment with RWX permissions" $text "" text
- # Ignore Emscripten INFO messages
- regsub -all "(^|\n)(cache|shared):INFO:\[^\n\]*" $text "" text
- return $text
-}
-
-proc libffi-init { args } {
- global gluefile wrap_flags;
- global srcdir
- global blddirffi
- global objdir
- global TOOL_OPTIONS
- global tool
- global libffi_include
- global libffi_link_flags
- global tool_root_dir
- global ld_library_path
- global compiler_vendor
-
- if ![info exists blddirffi] {
- set blddirffi [pwd]/..
- }
-
- verbose "libffi $blddirffi"
-
- # Which compiler are we building with?
- if { [string match $compiler_vendor "gnu"] } {
- set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
- if {$gccdir != ""} {
- set gccdir [file dirname $gccdir]
- }
- verbose "gccdir $gccdir"
-
- set ld_library_path "."
- append ld_library_path ":${gccdir}"
-
- set compiler "${gccdir}/xgcc"
- if { [is_remote host] == 0 && [which $compiler] != 0 } {
- foreach i "[exec $compiler --print-multi-lib]" {
- set mldir ""
- regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
- set mldir [string trimright $mldir "\;@"]
- if { "$mldir" == "." } {
- continue
- }
- if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
- append ld_library_path ":${gccdir}/${mldir}"
- }
- }
- }
- }
-
- # add the library path for libffi.
- append ld_library_path ":${blddirffi}/.libs"
-
- verbose "ld_library_path: $ld_library_path"
-
- # Point to the Libffi headers in libffi.
- set libffi_include "${blddirffi}/include"
- verbose "libffi_include $libffi_include"
-
- set libffi_dir "${blddirffi}/.libs"
- verbose "libffi_dir $libffi_dir"
- if { $libffi_dir != "" } {
- set libffi_dir [file dirname ${libffi_dir}]
- set libffi_link_flags "-L ../.libs"
- }
-
- set_ld_library_path_env_vars
- libffi_maybe_build_wrapper "${objdir}/testglue.o"
-}
-
-proc libffi_exit { } {
- global gluefile;
-
- if [info exists gluefile] {
- file_on_build delete $gluefile;
- unset gluefile;
- }
-}
-
-proc libffi_target_compile { source dest type options } {
- global gluefile wrap_flags;
- global srcdir
- global blddirffi
- global TOOL_OPTIONS
- global libffi_link_flags
- global libffi_include
- global target_triplet
- global compiler_vendor
-
- if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {
- lappend options "libs=${gluefile}"
- lappend options "ldflags=$wrap_flags"
- }
-
- # TOOL_OPTIONS must come first, so that it doesn't override testcase
- # specific options.
- if [info exists TOOL_OPTIONS] {
- lappend options "additional_flags=$TOOL_OPTIONS"
- }
-
- # Search for include files in build_dir/include, build_dir and source_dir/include.
- # The .. in the last path is necessary because srcdir points to libffi source/testsuite.
- lappend options "additional_flags=-I${libffi_include} -I${blddirffi} -I${srcdir}/../include"
- if { [string match $type "executable"] } {
-
- lappend options "additional_flags=${libffi_link_flags}"
-
- # Darwin needs a stack execution allowed flag.
- if { [istarget "*-*-darwin9*"] || [istarget "*-*-darwin1*"]
- || [istarget "*-*-darwin2*"] } {
- # lappend options "additional_flags=-Wl,-allow_stack_execute"
- lappend options "additional_flags=-Wno-unused-command-line-argument"
- lappend options "additional_flags=-Wl,-search_paths_first"
- }
-
- # If you're building the compiler with --prefix set to a place
- # where it's not yet installed, then the linker won't be able to
- # find the libgcc used by libffi.dylib. We could pass the
- # -dylib_file option, but that's complicated, and it's much easier
- # to just make the linker find libgcc using -L options.
- if { [string match "*-*-darwin*" $target_triplet] } {
- lappend options "libs= -shared-libgcc"
- }
-
- if { [string match "*-*-openbsd*" $target_triplet] } {
- lappend options "libs= -lpthread"
- }
-
- if { [string match "*-*-freebsd*" $target_triplet] } {
- lappend options "libs= -lpthread"
- }
-
- if { [string match "*-*-netbsd*" $target_triplet] } {
- lappend options "libs= -lpthread"
- }
-
- lappend options "libs= -lffi"
-
- if { [string match "aarch64*-*-linux*" $target_triplet] } {
- if { ! [string match "*android*" $target_triplet] } {
- lappend options "libs= -lpthread"
- }
- }
-
- # this may be required for g++, but just confused clang.
- if { [string match "*.cc" $source] } {
- lappend options "c++"
- if { [string match "*-*-darwin*" $target_triplet] } {
- if { [string match $compiler_vendor "gnu"] } {
- lappend options "libs= -lc++"
- }
- } elseif { [string match "*android*" $target_triplet] } {
- lappend options "libs= -lc++"
- } elseif { [string match "wasm*-*" $target_triplet] } {
- lappend options "additional_flags=-fexceptions"
- }
- }
-
- if { [string match "arc*-*-linux*" $target_triplet] } {
- lappend options "libs= -lpthread"
- }
- }
-
- # emscripten emits this warning while building the feature test
- # which causes it to be seen as unsupported.
- if { [string match "wasm32-*" $target_triplet] } {
- lappend options "additional_flags=-Wno-unused-command-line-argument"
- lappend options "libs= -lpthread"
- }
-
- # Newer clang warns about file-scope variables that are assigned
- # but never read. Several tests do this deliberately.
- if { [libffi_compiler_accepts_flag "-Wno-unused-but-set-global"] } {
- lappend options "additional_flags=-Wno-unused-but-set-global"
- }
-
- verbose "options: $options"
- return [target_compile $source $dest $type $options]
-}
-
-# Returns true if the compiler accepts FLAG without complaint. The
-# result is cached, so the probe only runs once per flag.
-proc libffi_compiler_accepts_flag { flag } {
- global libffi_accepted_flags
-
- if { [info exists libffi_accepted_flags($flag)] } {
- return $libffi_accepted_flags($flag)
- }
-
- set src "ffiflag[pid].c"
- set f [open $src "w"]
- puts $f "int main() {return 0;}"
- close $f
-
- set lines [target_compile $src $src.i preprocess "additional_flags=$flag"]
- file delete $src
- file delete $src.i
-
- set libffi_accepted_flags($flag) [string match "" $lines]
- verbose "compiler accepts $flag: $libffi_accepted_flags($flag)"
- return $libffi_accepted_flags($flag)
-}
-
-# TEST should be a preprocessor condition. Returns true if it holds.
-proc libffi_feature_test { test } {
- set src "ffitest[pid].c"
-
- set f [open $src "w"]
- puts $f "#include <ffi.h>"
- puts $f $test
- puts $f "/* OK */"
- puts $f "#else"
- puts $f "# error Failed $test"
- puts $f "#endif"
- puts $f "int main() {return 0;}"
- close $f
-
- set lines [libffi_target_compile $src $src.i preprocess ""]
- file delete $src
- file delete $src.i
-
- return [string match "" $lines]
-}
-
-# Utility routines.
-
-#
-# search_for -- looks for a string match in a file
-#
-proc search_for { file pattern } {
- set fd [open $file r]
- while { [gets $fd cur_line]>=0 } {
- if [string match "*$pattern*" $cur_line] then {
- close $fd
- return 1
- }
- }
- close $fd
- return 0
-}
-
-# Modified dg-runtest that can cycle through a list of optimization options
-# as c-torture does.
-proc libffi-dg-runtest { testcases default-extra-flags } {
- global runtests
-
- foreach test $testcases {
- # If we're only testing specific files and this isn't one of
- # them, skip it.
- if ![runtest_file_p $runtests $test] {
- continue
- }
-
- # Look for a loop within the source code - if we don't find one,
- # don't pass -funroll[-all]-loops.
- global torture_with_loops torture_without_loops
- if [expr [search_for $test "for*("]+[search_for $test "while*("]] {
- set option_list $torture_with_loops
- } else {
- set option_list $torture_without_loops
- }
-
- set nshort [file tail [file dirname $test]]/[file tail $test]
-
- foreach flags $option_list {
- verbose "Testing $nshort, $flags" 1
- dg-test $test $flags ${default-extra-flags}
- }
- }
-}
-
-proc run-many-tests { testcases extra_flags } {
- global compiler_vendor
- global has_gccbug
- global env
- switch $compiler_vendor {
- "clang" {
- set common "-W -Wall"
- if [info exists env(LIBFFI_TEST_OPTIMIZATION)] {
- set optimizations [ list $env(LIBFFI_TEST_OPTIMIZATION) ]
- } else {
- set optimizations { "-O0" "-O2" }
- }
- }
- "gnu" {
- set common "-W -Wall -Wno-psabi -fno-diagnostics-color"
- if [info exists env(LIBFFI_TEST_OPTIMIZATION)] {
- set optimizations [ list $env(LIBFFI_TEST_OPTIMIZATION) ]
- } else {
- set optimizations { "-O0" "-O2" }
- }
- }
- default {
- # Assume we are using the vendor compiler.
- set common ""
- if [info exists env(LIBFFI_TEST_OPTIMIZATION)] {
- set optimizations [ list $env(LIBFFI_TEST_OPTIMIZATION) ]
- } else {
- set optimizations { "" }
- }
- }
- }
-
- info exists env(LD_LIBRARY_PATH)
-
- set targetabis { "" }
- if [string match $compiler_vendor "gnu"] {
- if [libffi_feature_test "#ifdef __i386__"] {
- set targetabis {
- ""
- "-DABI_NUM=FFI_STDCALL -DABI_ATTR=__STDCALL__"
- "-DABI_NUM=FFI_THISCALL -DABI_ATTR=__THISCALL__"
- "-DABI_NUM=FFI_FASTCALL -DABI_ATTR=__FASTCALL__"
- }
- } elseif { [istarget "x86_64-*-*"] \
- && [libffi_feature_test "#if !defined __ILP32__ \
- && !defined __i386__"] } {
- set targetabis {
- ""
- "-DABI_NUM=FFI_GNUW64 -DABI_ATTR=__MSABI__"
- }
- }
- }
-
- set common [ concat $common $extra_flags ]
- foreach test $testcases {
- set testname [file tail $test]
- if [search_for $test "ABI_NUM"] {
- set abis $targetabis
- } else {
- set abis { "" }
- }
- foreach opt $optimizations {
- foreach abi $abis {
- set options [concat $common $opt $abi]
- set has_gccbug false;
- if { [string match $compiler_vendor "gnu"] \
- && [string match "*MSABI*" $abi] \
- && ( ( [string match "*DGTEST=57 *" $common] \
- && [string match "*call.c*" $testname] ) \
- || ( [string match "*DGTEST=54 *" $common] \
- && [string match "*callback*" $testname] ) \
- || [string match "*DGTEST=55 *" $common] \
- || [string match "*DGTEST=56 *" $common] ) } then {
- if [libffi_feature_test "#if (__GNUC__ < 9) || ((__GNUC__ == 9) && (__GNUC_MINOR__ < 3))"] {
- set has_gccbug true;
- }
- }
- verbose "Testing $testname, $options" 1
- verbose "has_gccbug = $has_gccbug" 1
- dg-test $test $options ""
- }
- }
- }
-}
-
-# Like check_conditional_xfail, but callable from a dg test.
-
-proc dg-xfail-if { args } {
- set args [lreplace $args 0 0]
- set selector "target [join [lindex $args 1]]"
- if { [dg-process-target $selector] == "S" } {
- global compiler_conditional_xfail_data
- set compiler_conditional_xfail_data $args
- }
-}
-
-proc check-flags { args } {
-
- # The args are within another list; pull them out.
- set args [lindex $args 0]
-
- # The next two arguments are optional. If they were not specified,
- # use the defaults.
- if { [llength $args] == 2 } {
- lappend $args [list "*"]
- }
- if { [llength $args] == 3 } {
- lappend $args [list ""]
- }
-
- # If the option strings are the defaults, or the same as the
- # defaults, there is no need to call check_conditional_xfail to
- # compare them to the actual options.
- if { [string compare [lindex $args 2] "*"] == 0
- && [string compare [lindex $args 3] "" ] == 0 } {
- set result 1
- } else {
- # The target list might be an effective-target keyword, so replace
- # the original list with "*-*-*", since we already know it matches.
- set result [check_conditional_xfail [lreplace $args 1 1 "*-*-*"]]
- }
-
- return $result
-}
-
-proc dg-skip-if { args } {
- # Verify the number of arguments. The last two are optional.
- set args [lreplace $args 0 0]
- if { [llength $args] < 2 || [llength $args] > 4 } {
- error "dg-skip-if 2: need 2, 3, or 4 arguments"
- }
-
- # Don't bother if we're already skipping the test.
- upvar dg-do-what dg-do-what
- if { [lindex ${dg-do-what} 1] == "N" } {
- return
- }
-
- set selector [list target [lindex $args 1]]
- if { [dg-process-target $selector] == "S" } {
- if [check-flags $args] {
- upvar dg-do-what dg-do-what
- set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
- }
- }
-}
-
-# We need to make sure that additional_files and additional_sources
-# are both cleared out after every test. It is not enough to clear
-# them out *before* the next test run because gcc-target-compile gets
-# run directly from some .exp files (outside of any test). (Those
-# uses should eventually be eliminated.)
-
-# Because the DG framework doesn't provide a hook that is run at the
-# end of a test, we must replace dg-test with a wrapper.
-
-if { [info procs saved-dg-test] == [list] } {
- rename dg-test saved-dg-test
-
- proc dg-test { args } {
- global additional_files
- global additional_sources
- global errorInfo
-
- if { [ catch { eval saved-dg-test $args } errmsg ] } {
- set saved_info $errorInfo
- set additional_files ""
- set additional_sources ""
- error $errmsg $saved_info
- }
- set additional_files ""
- set additional_sources ""
- }
-}
-
-# Local Variables:
-# tcl-indent-level:4
-# End:
diff --git a/deps/libffi/testsuite/lib/target-libpath.exp b/deps/libffi/testsuite/lib/target-libpath.exp
deleted file mode 100644
index e33a656c6cc..00000000000
--- a/deps/libffi/testsuite/lib/target-libpath.exp
+++ /dev/null
@@ -1,283 +0,0 @@
-# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
-
-# This program 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 3 of the License, or
-# (at your option) any later version.
-#
-# This program 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 GCC; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-# This file was contributed by John David Anglin (dave.anglin@nrc-cnrc.gc.ca)
-
-set orig_environment_saved 0
-set orig_ld_library_path_saved 0
-set orig_ld_run_path_saved 0
-set orig_shlib_path_saved 0
-set orig_ld_libraryn32_path_saved 0
-set orig_ld_library64_path_saved 0
-set orig_ld_library_path_32_saved 0
-set orig_ld_library_path_64_saved 0
-set orig_dyld_library_path_saved 0
-set orig_path_saved 0
-
-#######################################
-# proc set_ld_library_path_env_vars { }
-#######################################
-
-proc set_ld_library_path_env_vars { } {
- global ld_library_path
- global orig_environment_saved
- global orig_ld_library_path_saved
- global orig_ld_run_path_saved
- global orig_shlib_path_saved
- global orig_ld_libraryn32_path_saved
- global orig_ld_library64_path_saved
- global orig_ld_library_path_32_saved
- global orig_ld_library_path_64_saved
- global orig_dyld_library_path_saved
- global orig_path_saved
- global orig_ld_library_path
- global orig_ld_run_path
- global orig_shlib_path
- global orig_ld_libraryn32_path
- global orig_ld_library64_path
- global orig_ld_library_path_32
- global orig_ld_library_path_64
- global orig_dyld_library_path
- global orig_path
- global GCC_EXEC_PREFIX
-
- # Set the relocated compiler prefix, but only if the user hasn't specified one.
- if { [info exists GCC_EXEC_PREFIX] && ![info exists env(GCC_EXEC_PREFIX)] } {
- setenv GCC_EXEC_PREFIX "$GCC_EXEC_PREFIX"
- }
-
- # Setting the ld library path causes trouble when testing cross-compilers.
- if { [is_remote target] } {
- return
- }
-
- if { $orig_environment_saved == 0 } {
- global env
-
- set orig_environment_saved 1
-
- # Save the original environment.
- if [info exists env(LD_LIBRARY_PATH)] {
- set orig_ld_library_path "$env(LD_LIBRARY_PATH)"
- set orig_ld_library_path_saved 1
- }
- if [info exists env(LD_RUN_PATH)] {
- set orig_ld_run_path "$env(LD_RUN_PATH)"
- set orig_ld_run_path_saved 1
- }
- if [info exists env(SHLIB_PATH)] {
- set orig_shlib_path "$env(SHLIB_PATH)"
- set orig_shlib_path_saved 1
- }
- if [info exists env(LD_LIBRARYN32_PATH)] {
- set orig_ld_libraryn32_path "$env(LD_LIBRARYN32_PATH)"
- set orig_ld_libraryn32_path_saved 1
- }
- if [info exists env(LD_LIBRARY64_PATH)] {
- set orig_ld_library64_path "$env(LD_LIBRARY64_PATH)"
- set orig_ld_library64_path_saved 1
- }
- if [info exists env(LD_LIBRARY_PATH_32)] {
- set orig_ld_library_path_32 "$env(LD_LIBRARY_PATH_32)"
- set orig_ld_library_path_32_saved 1
- }
- if [info exists env(LD_LIBRARY_PATH_64)] {
- set orig_ld_library_path_64 "$env(LD_LIBRARY_PATH_64)"
- set orig_ld_library_path_64_saved 1
- }
- if [info exists env(DYLD_LIBRARY_PATH)] {
- set orig_dyld_library_path "$env(DYLD_LIBRARY_PATH)"
- set orig_dyld_library_path_saved 1
- }
- if [info exists env(PATH)] {
- set orig_path "$env(PATH)"
- set orig_path_saved 1
- }
- }
-
- # We need to set ld library path in the environment. Currently,
- # unix.exp doesn't set the environment correctly for all systems.
- # It only sets SHLIB_PATH and LD_LIBRARY_PATH when it executes a
- # program. We also need the environment set for compilations, etc.
- #
- # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
- # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
- # (for the 64-bit ABI). The same applies to Darwin (DYLD_LIBRARY_PATH),
- # Solaris 32 bit (LD_LIBRARY_PATH_32), Solaris 64 bit (LD_LIBRARY_PATH_64),
- # and HP-UX (SHLIB_PATH). In some cases, the variables are independent
- # of LD_LIBRARY_PATH, and in other cases LD_LIBRARY_PATH is used if the
- # variable is not defined.
- #
- # Doing this is somewhat of a hack as ld_library_path gets repeated in
- # SHLIB_PATH and LD_LIBRARY_PATH when unix_load sets these variables.
- if { $orig_ld_library_path_saved } {
- setenv LD_LIBRARY_PATH "$ld_library_path:$orig_ld_library_path"
- } else {
- setenv LD_LIBRARY_PATH "$ld_library_path"
- }
- if { $orig_ld_run_path_saved } {
- setenv LD_RUN_PATH "$ld_library_path:$orig_ld_run_path"
- } else {
- setenv LD_RUN_PATH "$ld_library_path"
- }
- # The default shared library dynamic path search for 64-bit
- # HP-UX executables searches LD_LIBRARY_PATH before SHLIB_PATH.
- # LD_LIBRARY_PATH isn't used for 32-bit executables. Thus, we
- # set LD_LIBRARY_PATH and SHLIB_PATH as if they were independent.
- if { $orig_shlib_path_saved } {
- setenv SHLIB_PATH "$ld_library_path:$orig_shlib_path"
- } else {
- setenv SHLIB_PATH "$ld_library_path"
- }
- if { $orig_ld_libraryn32_path_saved } {
- setenv LD_LIBRARYN32_PATH "$ld_library_path:$orig_ld_libraryn32_path"
- } elseif { $orig_ld_library_path_saved } {
- setenv LD_LIBRARYN32_PATH "$ld_library_path:$orig_ld_library_path"
- } else {
- setenv LD_LIBRARYN32_PATH "$ld_library_path"
- }
- if { $orig_ld_library64_path_saved } {
- setenv LD_LIBRARY64_PATH "$ld_library_path:$orig_ld_library64_path"
- } elseif { $orig_ld_library_path_saved } {
- setenv LD_LIBRARY64_PATH "$ld_library_path:$orig_ld_library_path"
- } else {
- setenv LD_LIBRARY64_PATH "$ld_library_path"
- }
- if { $orig_ld_library_path_32_saved } {
- setenv LD_LIBRARY_PATH_32 "$ld_library_path:$orig_ld_library_path_32"
- } elseif { $orig_ld_library_path_saved } {
- setenv LD_LIBRARY_PATH_32 "$ld_library_path:$orig_ld_library_path"
- } else {
- setenv LD_LIBRARY_PATH_32 "$ld_library_path"
- }
- if { $orig_ld_library_path_64_saved } {
- setenv LD_LIBRARY_PATH_64 "$ld_library_path:$orig_ld_library_path_64"
- } elseif { $orig_ld_library_path_saved } {
- setenv LD_LIBRARY_PATH_64 "$ld_library_path:$orig_ld_library_path"
- } else {
- setenv LD_LIBRARY_PATH_64 "$ld_library_path"
- }
- if { $orig_dyld_library_path_saved } {
- setenv DYLD_LIBRARY_PATH "$ld_library_path:$orig_dyld_library_path"
- } else {
- setenv DYLD_LIBRARY_PATH "$ld_library_path"
- }
- if { [istarget *-*-cygwin*] || [ istarget *-*-msys* ] || [istarget *-*-mingw*] } {
- if { $orig_path_saved } {
- setenv PATH "$ld_library_path:$orig_path"
- } else {
- setenv PATH "$ld_library_path"
- }
- }
-
- verbose -log "set_ld_library_path_env_vars: ld_library_path=$ld_library_path"
-}
-
-#######################################
-# proc restore_ld_library_path_env_vars { }
-#######################################
-
-proc restore_ld_library_path_env_vars { } {
- global orig_environment_saved
- global orig_ld_library_path_saved
- global orig_ld_run_path_saved
- global orig_shlib_path_saved
- global orig_ld_libraryn32_path_saved
- global orig_ld_library64_path_saved
- global orig_ld_library_path_32_saved
- global orig_ld_library_path_64_saved
- global orig_dyld_library_path_saved
- global orig_path_saved
- global orig_ld_library_path
- global orig_ld_run_path
- global orig_shlib_path
- global orig_ld_libraryn32_path
- global orig_ld_library64_path
- global orig_ld_library_path_32
- global orig_ld_library_path_64
- global orig_dyld_library_path
- global orig_path
-
- if { $orig_environment_saved == 0 } {
- return
- }
-
- if { $orig_ld_library_path_saved } {
- setenv LD_LIBRARY_PATH "$orig_ld_library_path"
- } elseif [info exists env(LD_LIBRARY_PATH)] {
- unsetenv LD_LIBRARY_PATH
- }
- if { $orig_ld_run_path_saved } {
- setenv LD_RUN_PATH "$orig_ld_run_path"
- } elseif [info exists env(LD_RUN_PATH)] {
- unsetenv LD_RUN_PATH
- }
- if { $orig_shlib_path_saved } {
- setenv SHLIB_PATH "$orig_shlib_path"
- } elseif [info exists env(SHLIB_PATH)] {
- unsetenv SHLIB_PATH
- }
- if { $orig_ld_libraryn32_path_saved } {
- setenv LD_LIBRARYN32_PATH "$orig_ld_libraryn32_path"
- } elseif [info exists env(LD_LIBRARYN32_PATH)] {
- unsetenv LD_LIBRARYN32_PATH
- }
- if { $orig_ld_library64_path_saved } {
- setenv LD_LIBRARY64_PATH "$orig_ld_library64_path"
- } elseif [info exists env(LD_LIBRARY64_PATH)] {
- unsetenv LD_LIBRARY64_PATH
- }
- if { $orig_ld_library_path_32_saved } {
- setenv LD_LIBRARY_PATH_32 "$orig_ld_library_path_32"
- } elseif [info exists env(LD_LIBRARY_PATH_32)] {
- unsetenv LD_LIBRARY_PATH_32
- }
- if { $orig_ld_library_path_64_saved } {
- setenv LD_LIBRARY_PATH_64 "$orig_ld_library_path_64"
- } elseif [info exists env(LD_LIBRARY_PATH_64)] {
- unsetenv LD_LIBRARY_PATH_64
- }
- if { $orig_dyld_library_path_saved } {
- setenv DYLD_LIBRARY_PATH "$orig_dyld_library_path"
- } elseif [info exists env(DYLD_LIBRARY_PATH)] {
- unsetenv DYLD_LIBRARY_PATH
- }
- if { $orig_path_saved } {
- setenv PATH "$orig_path"
- } elseif [info exists env(PATH)] {
- unsetenv PATH
- }
-}
-
-#######################################
-# proc get_shlib_extension { }
-#######################################
-
-proc get_shlib_extension { } {
- global shlib_ext
-
- if { [ istarget *-*-darwin* ] } {
- set shlib_ext "dylib"
- } elseif { [ istarget *-*-cygwin* ] || [ istarget *-*-msys* ] || [ istarget *-*-mingw* ] } {
- set shlib_ext "dll"
- } elseif { [ istarget hppa*-*-hpux* ] } {
- set shlib_ext "sl"
- } else {
- set shlib_ext "so"
- }
- return $shlib_ext
-}
-
diff --git a/deps/libffi/testsuite/lib/wrapper.exp b/deps/libffi/testsuite/lib/wrapper.exp
deleted file mode 100644
index 4e5ae435a13..00000000000
--- a/deps/libffi/testsuite/lib/wrapper.exp
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright (C) 2004, 2007 Free Software Foundation, Inc.
-
-# This program 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 3 of the License, or
-# (at your option) any later version.
-#
-# This program 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 GCC; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-# This file contains GCC-specifics for status wrappers for test programs.
-
-# ${tool}_maybe_build_wrapper -- Build wrapper object if the target
-# needs it. FILENAME is the path to the wrapper file. If there are
-# additional arguments, they are command-line options to provide to
-# the compiler when compiling FILENAME.
-
-proc ${tool}_maybe_build_wrapper { filename args } {
- global gluefile wrap_flags
-
- if { [target_info needs_status_wrapper] != "" \
- && [target_info needs_status_wrapper] != "0" \
- && ![info exists gluefile] } {
- set saved_wrap_compile_flags [target_info wrap_compile_flags]
- set flags [join $args " "]
- # The wrapper code may contain code that gcc objects on. This
- # became true for dejagnu-1.4.4. The set of warnings and code
- # that gcc objects on may change, so just make sure -w is always
- # passed to turn off all warnings.
- set_currtarget_info wrap_compile_flags \
- "$saved_wrap_compile_flags -w $flags"
- set result [build_wrapper $filename]
- set_currtarget_info wrap_compile_flags "$saved_wrap_compile_flags"
- if { $result != "" } {
- set gluefile [lindex $result 0]
- set wrap_flags [lindex $result 1]
- }
- }
-}
diff --git a/deps/libffi/testsuite/libffi.bhaible/Makefile b/deps/libffi/testsuite/libffi.bhaible/Makefile
deleted file mode 100644
index 3322de94f7a..00000000000
--- a/deps/libffi/testsuite/libffi.bhaible/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-CC = gcc
-CFLAGS = -O2 -Wall
-prefix =
-includedir = $(prefix)/include
-libdir = $(prefix)/lib
-CPPFLAGS = -I$(includedir)
-LDFLAGS = -L$(libdir) -Wl,-rpath,$(libdir)
-
-all: check-call check-callback
-
-test-call: test-call.c testcases.c
- $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o test-call test-call.c -lffi
-
-test-callback: test-callback.c testcases.c
- $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o test-callback test-callback.c -lffi
-
-check-call: test-call
- ./test-call > test-call.out
- LC_ALL=C uniq -u < test-call.out > failed-call
- test '!' -s failed-call
-
-check-callback: test-callback
- ./test-callback > test-callback.out
- LC_ALL=C uniq -u < test-callback.out > failed-callback
- test '!' -s failed-callback
-
-clean:
- rm -f test-call test-callback test-call.out test-callback.out failed-call failed-callback
diff --git a/deps/libffi/testsuite/libffi.bhaible/README b/deps/libffi/testsuite/libffi.bhaible/README
deleted file mode 100644
index be8540b64fa..00000000000
--- a/deps/libffi/testsuite/libffi.bhaible/README
+++ /dev/null
@@ -1,78 +0,0 @@
-This package contains a test suite for libffi.
-
-This test suite can be compiled with a C compiler. No need for 'expect'
-or some other package that is often not installed.
-
-The test suite consists of 81 C functions, each with a different signature.
-* test-call verifies that calling each function directly produces the same
- results as calling the function indirectly through 'ffi_call'.
-* test-callback verifies that calling each function directly produces the same
- results as calling a function that is a callback (object build by
- 'ffi_prep_closure_loc') and simulates the original function.
-
-Each direct or indirect invocation should produce one line of output to
-stdout. A correct output consists of paired lines, such as
-
-void f(void):
-void f(void):
-int f(void):->99
-int f(void):->99
-int f(int):(1)->2
-int f(int):(1)->2
-int f(2*int):(1,2)->3
-int f(2*int):(1,2)->3
-...
-
-The Makefile then creates two files:
-* failed-call, which consists of the non-paired lines of output of
- 'test-call',
-* failed-callback, which consists of the non-paired lines of output of
- 'test-callback'.
-
-The test suite passes if both failed-call and failed-callback come out
-as empty.
-
-
-How to use the test suite
--------------------------
-
-1. Modify the Makefile's variables
- prefix = the directory in which libffi was installed
- CC = the C compiler, often with options such as "-m32" or "-m64"
- that enforce a certain ABI,
- CFLAGS = optimization options (need to change them only for non-GCC
- compilers)
-2. Run "make". If it fails already in "test-call", run also
- "make check-callback".
-3. If this failed, inspect the output files.
-
-
-How to interpret the results
-----------------------------
-
-The failed-call and failed-callback files consist of paired lines:
-The first line is the result of the direct invocation.
-The second line is the result of invocation through libffi.
-
-For example, this output
-
-uchar f(uchar,ushort,uint,ulong):(97,2,3,4)->255
-uchar f(uchar,ushort,uint,ulong):(97,2,3,4)->0
-
-indicates that the arguments were passed correctly, but the return
-value came out wrong.
-
-And this output
-
-float f(17*float,3*int,L):(0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,6,7,8,561,1105,1729,2465,2821,6601)->15319.1
-float f(17*float,3*int,L):(0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,-140443648,10,268042216,-72537980,-140443648,-140443648,-140443648,-140443648,-140443648)->-6.47158e+08
-
-indicates that integer arguments that come after 17 floating-point arguments
-were not passed correctly.
-
-
-Credits
--------
-
-The test suite is based on the one of GNU libffcall-2.0.
-Authors: Bill Triggs, Bruno Haible
diff --git a/deps/libffi/testsuite/libffi.bhaible/alignof.h b/deps/libffi/testsuite/libffi.bhaible/alignof.h
deleted file mode 100644
index 00604a513ad..00000000000
--- a/deps/libffi/testsuite/libffi.bhaible/alignof.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Determine alignment of types.
- Copyright (C) 2003-2004, 2006, 2009-2017 Free Software Foundation, Inc.
-
- This program 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, or (at your option)
- any later version.
-
- This program 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, see <https://www.gnu.org/licenses/>. */
-
-#ifndef _ALIGNOF_H
-#define _ALIGNOF_H
-
-#include <stddef.h>
-
-/* alignof_slot (TYPE)
- Determine the alignment of a structure slot (field) of a given type,
- at compile time. Note that the result depends on the ABI.
- This is the same as alignof (TYPE) and _Alignof (TYPE), defined in
- <stdalign.h> if __alignof_is_defined is 1.
- Note: The result cannot be used as a value for an 'enum' constant,
- due to bugs in HP-UX 10.20 cc and AIX 3.2.5 xlc. */
-#if defined __cplusplus
- template <class type> struct alignof_helper { char __slot1; type __slot2; };
-# define alignof_slot(type) offsetof (alignof_helper<type>, __slot2)
-#else
-# define alignof_slot(type) offsetof (struct { char __slot1; type __slot2; }, __slot2)
-#endif
-
-/* alignof_type (TYPE)
- Determine the good alignment of an object of the given type at compile time.
- Note that this is not necessarily the same as alignof_slot(type).
- For example, with GNU C on x86 platforms: alignof_type(double) = 8, but
- - when -malign-double is not specified: alignof_slot(double) = 4,
- - when -malign-double is specified: alignof_slot(double) = 8.
- Note: The result cannot be used as a value for an 'enum' constant,
- due to bugs in HP-UX 10.20 cc and AIX 3.2.5 xlc. */
-#if defined __GNUC__ || defined __IBM__ALIGNOF__
-# define alignof_type __alignof__
-#else
-# define alignof_type alignof_slot
-#endif
-
-#endif /* _ALIGNOF_H */
diff --git a/deps/libffi/testsuite/libffi.bhaible/bhaible.exp b/deps/libffi/testsuite/libffi.bhaible/bhaible.exp
deleted file mode 100644
index 44aebc5e063..00000000000
--- a/deps/libffi/testsuite/libffi.bhaible/bhaible.exp
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright (C) 2003, 2006, 2009, 2010, 2014, 2018 Free Software Foundation, Inc.
-
-# This program 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 3 of the License, or
-# (at your option) any later version.
-#
-# This program 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; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-dg-init
-libffi-init
-
-global srcdir subdir
-global compiler_vendor
-
-# The conversion of this testsuite into a dejagnu compatible testsuite
-# was done in a pretty lazy fashion, and requires the use of compiler
-# flags to disable warnings for now.
-if { [string match $compiler_vendor "gnu"] } {
- set warning_options "-Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-uninitialized";
-}
-if { [string match $compiler_vendor "microsoft"] } {
- # -wd4996 suggest use of vsprintf_s instead of vsprintf
- # -wd4116 unnamed type definition
- # -wd4101 unreferenced local variable
- # -wd4244 warning about implicit double to float conversion
- set warning_options "-wd4996 -wd4116 -wd4101 -wd4244";
-}
-if { ![string match $compiler_vendor "microsoft"] && ![string match $compiler_vendor "gnu"] } {
- set warning_options "-Wno-unused-variable -Wno-unused-parameter -Wno-uninitialized";
-}
-
-
-set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/test-call.c]]
-
-for {set i 1} {$i < 82} {incr i} {
- run-many-tests $tlist [format "-DDGTEST=%d %s" $i $warning_options]
-}
-
-set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/test-callback.c]]
-
-for {set i 1} {$i < 81} {incr i} {
- if { [libffi_feature_test "#if FFI_CLOSURES"] } {
- run-many-tests $tlist [format "-DDGTEST=%d %s" $i $warning_options]
- } else {
- foreach test $tlist {
- unsupported [format "%s -DDGTEST=%d %s" $test $i $warning_options]
- }
- }
-}
-
-dg-finish
-
-# Local Variables:
-# tcl-indent-level:4
-# End:
diff --git a/deps/libffi/testsuite/libffi.bhaible/test-call.c b/deps/libffi/testsuite/libffi.bhaible/test-call.c
deleted file mode 100644
index 4887e0092eb..00000000000
--- a/deps/libffi/testsuite/libffi.bhaible/test-call.c
+++ /dev/null
@@ -1,1746 +0,0 @@
-/**
- Copyright 1993 Bill Triggs <Bill.Triggs@inrialpes.fr>
- Copyright 1995-2017 Bruno Haible <bruno@clisp.org>
-
- This program 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 3 of the License, or
- (at your option) any later version.
-
- This program 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, see <http://www.gnu.org/licenses/>.
-**/
-
-/* { dg-do run { xfail gccbug } } */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ffi.h>
-#include "alignof.h"
-#include <stdarg.h>
-
-/* libffi testsuite local changes -------------------------------- */
-#ifdef DGTEST
-/* Redefine exit(1) as a test failure */
-#define exit(V) (void)((V) ? (abort(), 1) : exit(0))
-int count = 0;
-char rbuf1[2048];
-char rbuf2[2048];
-int _fprintf(FILE *stream, const char *format, ...)
-{
- va_list args;
- va_start(args, format);
-
- switch (count++)
- {
- case 0:
- case 1:
- vsprintf(&rbuf1[strlen(rbuf1)], format, args);
- break;
- case 2:
- printf("%s", rbuf1);
- vsprintf(rbuf2, format, args);
- break;
- case 3:
- vsprintf(&rbuf2[strlen(rbuf2)], format, args);
- printf("%s", rbuf2);
- fflush (stdout);
- if (strcmp (rbuf1, rbuf2)) abort();
- break;
- }
-
- va_end(args);
-
- return 0;
-}
-#define fprintf _fprintf
-#endif
-/* --------------------------------------------------------------- */
-
-#include "testcases.c"
-
-#ifndef ABI_NUM
-#define ABI_NUM FFI_DEFAULT_ABI
-#endif
-
-/* Definitions that ought to be part of libffi. */
-static ffi_type ffi_type_char;
-#define ffi_type_slonglong ffi_type_sint64
-#define ffi_type_ulonglong ffi_type_uint64
-
-/* libffi does not support arrays inside structs. */
-#define SKIP_EXTRA_STRUCTS
-
-#define FFI_PREP_CIF(cif,argtypes,rettype) \
- if (ffi_prep_cif(&(cif),ABI_NUM,sizeof(argtypes)/sizeof(argtypes[0]),&rettype,argtypes) != FFI_OK) abort()
-#define FFI_PREP_CIF_NOARGS(cif,rettype) \
- if (ffi_prep_cif(&(cif),ABI_NUM,0,&rettype,NULL) != FFI_OK) abort()
-#define FFI_CALL(cif,fn,args,retaddr) \
- ffi_call(&(cif),(void(*)(void))(fn),retaddr,args)
-
-long clear_traces_i (long a, long b, long c, long d, long e, long f, long g, long h,
- long i, long j, long k, long l, long m, long n, long o, long p)
-{ return 0; }
-float clear_traces_f (float a, float b, float c, float d, float e, float f, float g,
- float h, float i, float j, float k, float l, float m, float n,
- float o, float p)
-{ return 0.0; }
-double clear_traces_d (double a, double b, double c, double d, double e, double f, double g,
- double h, double i, double j, double k, double l, double m, double n,
- double o, double p)
-{ return 0.0; }
-J clear_traces_J (void)
-{ J j; j.l1 = j.l2 = 0; return j; }
-void clear_traces (void)
-{ clear_traces_i(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
- clear_traces_f(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0);
- clear_traces_d(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0);
- clear_traces_J();
-}
-
-void
- void_tests (void)
-{
-#if (!defined(DGTEST)) || DGTEST == 1
- v_v();
- clear_traces();
- {
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_void);
- {
- FFI_CALL(cif,v_v,NULL,NULL);
- }
- }
-#endif
- return;
-}
-void
- int_tests (void)
-{
- int ir;
- ffi_arg retvalue;
-#if (!defined(DGTEST)) || DGTEST == 2
- ir = i_v();
- fprintf(out,"->%d\n",ir);
- fflush(out);
- ir = 0; clear_traces();
- {
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_sint);
- {
- FFI_CALL(cif,i_v,NULL,&retvalue);
- ir = retvalue;
- }
- }
- fprintf(out,"->%d\n",ir);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 3
- ir = i_i(i1);
- fprintf(out,"->%d\n",ir);
- fflush(out);
- ir = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
- {
- /*const*/ void* args[] = { &i1 };
- FFI_CALL(cif,i_i,args,&retvalue);
- ir = retvalue;
- }
- }
- fprintf(out,"->%d\n",ir);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 4
- ir = i_i2(i1,i2);
- fprintf(out,"->%d\n",ir);
- fflush(out);
- ir = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
- {
- /*const*/ void* args[] = { &i1, &i2 };
- FFI_CALL(cif,i_i2,args,&retvalue);
- ir = retvalue;
- }
- }
- fprintf(out,"->%d\n",ir);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 5
- ir = i_i4(i1,i2,i3,i4);
- fprintf(out,"->%d\n",ir);
- fflush(out);
- ir = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
- {
- /*const*/ void* args[] = { &i1, &i2, &i3, &i4 };
- FFI_CALL(cif,i_i4,args,&retvalue);
- ir = retvalue;
- }
- }
- fprintf(out,"->%d\n",ir);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 6
- ir = i_i8(i1,i2,i3,i4,i5,i6,i7,i8);
- fprintf(out,"->%d\n",ir);
- fflush(out);
- ir = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
- {
- /*const*/ void* args[] = { &i1, &i2, &i3, &i4, &i5, &i6, &i7, &i8 };
- FFI_CALL(cif,i_i8,args,&retvalue);
- ir = retvalue;
- }
- }
- fprintf(out,"->%d\n",ir);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 7
- ir = i_i16(i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15,i16);
- fprintf(out,"->%d\n",ir);
- fflush(out);
- ir = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
- {
- /*const*/ void* args[] = { &i1, &i2, &i3, &i4, &i5, &i6, &i7, &i8, &i9, &i10, &i11, &i12, &i13, &i14, &i15, &i16 };
- FFI_CALL(cif,i_i16,args,&retvalue);
- ir = retvalue;
- }
- }
- fprintf(out,"->%d\n",ir);
- fflush(out);
-#endif
-
- return;
-}
-void
- float_tests (void)
-{
- float fr;
-
-#if (!defined(DGTEST)) || DGTEST == 8
- fr = f_f(f1);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_float };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- {
- /*const*/ void* args[] = { &f1 };
- FFI_CALL(cif,f_f,args,&fr);
- }
- }
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 9
- fr = f_f2(f1,f2);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- {
- /*const*/ void* args[] = { &f1, &f2 };
- FFI_CALL(cif,f_f2,args,&fr);
- }
- }
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 10
- fr = f_f4(f1,f2,f3,f4);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- {
- /*const*/ void* args[] = { &f1, &f2, &f3, &f4 };
- FFI_CALL(cif,f_f4,args,&fr);
- }
- }
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 11
- fr = f_f8(f1,f2,f3,f4,f5,f6,f7,f8);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- {
- /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8 };
- FFI_CALL(cif,f_f8,args,&fr);
- }
- }
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 12
- fr = f_f16(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- {
- /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &f13, &f14, &f15, &f16 };
- FFI_CALL(cif,f_f16,args,&fr);
- }
- }
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 13
- fr = f_f24(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f22,f23,f24);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- {
- /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &f13, &f14, &f15, &f16, &f17, &f18, &f19, &f20, &f21, &f22, &f23, &f24 };
- FFI_CALL(cif,f_f24,args,&fr);
- }
- }
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-}
-void
- double_tests (void)
-{
- double dr;
-
-#if (!defined(DGTEST)) || DGTEST == 14
-
- dr = d_d(d1);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &d1 };
- FFI_CALL(cif,d_d,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 15
- dr = d_d2(d1,d2);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &d1, &d2 };
- FFI_CALL(cif,d_d2,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 16
- dr = d_d4(d1,d2,d3,d4);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &d1, &d2, &d3, &d4 };
- FFI_CALL(cif,d_d4,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 17
- dr = d_d8(d1,d2,d3,d4,d5,d6,d7,d8);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8 };
- FFI_CALL(cif,d_d8,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 18
- dr = d_d16(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10, &d11, &d12, &d13, &d14, &d15, &d16 };
- FFI_CALL(cif,d_d16,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
- return;
-}
-void
- pointer_tests (void)
-{
- void* vpr;
-
-#if (!defined(DGTEST)) || DGTEST == 19
- vpr = vp_vpdpcpsp(&uc1,&d2,str3,&I4);
- fprintf(out,"->0x%p\n",vpr);
- fflush(out);
- vpr = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_pointer, &ffi_type_pointer, &ffi_type_pointer, &ffi_type_pointer };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_pointer);
- {
- void* puc1 = &uc1;
- void* pd2 = &d2;
- void* pstr3 = str3;
- void* pI4 = &I4;
- /*const*/ void* args[] = { &puc1, &pd2, &pstr3, &pI4 };
- FFI_CALL(cif,vp_vpdpcpsp,args,&vpr);
- }
- }
- fprintf(out,"->0x%p\n",vpr);
- fflush(out);
-#endif
- return;
-}
-void
- mixed_number_tests (void)
-{
- uchar ucr;
- ushort usr;
- float fr;
- double dr;
- long long llr;
-
- /* Unsigned types.
- */
-#if (!defined(DGTEST)) || DGTEST == 20
- ucr = uc_ucsil(uc1, us2, ui3, ul4);
- fprintf(out,"->%u\n",ucr);
- fflush(out);
- ucr = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_uchar, &ffi_type_ushort, &ffi_type_uint, &ffi_type_ulong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_uchar);
- {
- ffi_arg r;
- /*const*/ void* args[] = { &uc1, &us2, &ui3, &ul4 };
- FFI_CALL(cif,uc_ucsil,args,&r);
- ucr = (uchar) r;
- }
- }
- fprintf(out,"->%u\n",ucr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 21
- /* Mixed int & float types.
- */
- dr = d_iidd(i1,i2,d3,d4);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_double, &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &i1, &i2, &d3, &d4 };
- FFI_CALL(cif,d_iidd,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 22
- dr = d_iiidi(i1,i2,i3,d4,i5);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_double, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &i1, &i2, &i3, &d4, &i5 };
- FFI_CALL(cif,d_iiidi,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 23
- dr = d_idid(i1,d2,i3,d4);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_double, &ffi_type_sint, &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &i1, &d2, &i3, &d4 };
- FFI_CALL(cif,d_idid,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 24
- dr = d_fdi(f1,d2,i3);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_double, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &f1, &d2, &i3 };
- FFI_CALL(cif,d_fdi,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 25
- usr = us_cdcd(c1,d2,c3,d4);
- fprintf(out,"->%u\n",usr);
- fflush(out);
- usr = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_char, &ffi_type_double, &ffi_type_char, &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_ushort);
- {
- ffi_arg rint;
- /*const*/ void* args[] = { &c1, &d2, &c3, &d4 };
- FFI_CALL(cif,us_cdcd,args,&rint);
- usr = (ushort) rint;
- }
- }
- fprintf(out,"->%u\n",usr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 26
- /* Long long types.
- */
- llr = ll_iiilli(i1,i2,i3,ll1,i13);
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
- llr = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_slonglong, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
- {
- /*const*/ void* args[] = { &i1, &i2, &i3, &ll1, &i13 };
- FFI_CALL(cif,ll_iiilli,args,&llr);
- }
- }
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 27
- llr = ll_flli(f13,ll1,i13);
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
- llr = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_slonglong, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
- {
- /*const*/ void* args[] = { &f13, &ll1, &i13 };
- FFI_CALL(cif,ll_flli,args,&llr);
- }
- }
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 28
- fr = f_fi(f1,i9);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- {
- /*const*/ void* args[] = { &f1, &i9 };
- FFI_CALL(cif,f_fi,args,&fr);
- }
- }
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 29
- fr = f_f2i(f1,f2,i9);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- {
- /*const*/ void* args[] = { &f1, &f2, &i9 };
- FFI_CALL(cif,f_f2i,args,&fr);
- }
- }
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 30
- fr = f_f3i(f1,f2,f3,i9);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- {
- /*const*/ void* args[] = { &f1, &f2, &f3, &i9 };
- FFI_CALL(cif,f_f3i,args,&fr);
- }
- }
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 31
- fr = f_f4i(f1,f2,f3,f4,i9);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- {
- /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &i9 };
- FFI_CALL(cif,f_f4i,args,&fr);
- }
- }
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 32
- fr = f_f7i(f1,f2,f3,f4,f5,f6,f7,i9);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- {
- /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &i9 };
- FFI_CALL(cif,f_f7i,args,&fr);
- }
- }
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 33
- fr = f_f8i(f1,f2,f3,f4,f5,f6,f7,f8,i9);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- {
- /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &i9 };
- FFI_CALL(cif,f_f8i,args,&fr);
- }
- }
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 34
- fr = f_f12i(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,i9);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- {
- /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &i9 };
- FFI_CALL(cif,f_f12i,args,&fr);
- }
- }
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 35
- fr = f_f13i(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,i9);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- {
- /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &f13, &i9 };
- FFI_CALL(cif,f_f13i,args,&fr);
- }
- }
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 36
- dr = d_di(d1,i9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &d1, &i9 };
- FFI_CALL(cif,d_di,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 37
- dr = d_d2i(d1,d2,i9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &d1, &d2, &i9 };
- FFI_CALL(cif,d_d2i,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 38
- dr = d_d3i(d1,d2,d3,i9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &d1, &d2, &d3, &i9 };
- FFI_CALL(cif,d_d3i,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 39
- dr = d_d4i(d1,d2,d3,d4,i9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &i9 };
- FFI_CALL(cif,d_d4i,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 40
- dr = d_d7i(d1,d2,d3,d4,d5,d6,d7,i9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &i9 };
- FFI_CALL(cif,d_d7i,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 41
- dr = d_d8i(d1,d2,d3,d4,d5,d6,d7,d8,i9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &i9 };
- FFI_CALL(cif,d_d8i,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 42
- dr = d_d12i(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,i9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10, &d11, &d12, &i9 };
- FFI_CALL(cif,d_d12i,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 43
- dr = d_d13i(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,i9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10, &d11, &d12, &d13, &i9 };
- FFI_CALL(cif,d_d13i,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
- return;
-}
-void
- small_structure_return_tests (void)
-{
-#if (!defined(DGTEST)) || DGTEST == 44
- {
- Size1 r = S1_v();
- fprintf(out,"->{%c}\n",r.x1);
- fflush(out);
- memset(&r,0,sizeof(r)); clear_traces();
- {
- ffi_type* ffi_type_Size1_elements[] = { &ffi_type_char, NULL };
- ffi_type ffi_type_Size1;
- ffi_type_Size1.type = FFI_TYPE_STRUCT;
- ffi_type_Size1.size = sizeof(Size1);
- ffi_type_Size1.alignment = alignof_slot(Size1);
- ffi_type_Size1.elements = ffi_type_Size1_elements;
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_Size1);
- {
- FFI_CALL(cif,S1_v,NULL,&r);
- }
- }
- fprintf(out,"->{%c}\n",r.x1);
- fflush(out);
- }
-#endif
-#if (!defined(DGTEST)) || DGTEST == 45
- {
- Size2 r = S2_v();
- fprintf(out,"->{%c%c}\n",r.x1,r.x2);
- fflush(out);
- memset(&r,0,sizeof(r)); clear_traces();
- {
- ffi_type* ffi_type_Size2_elements[] = { &ffi_type_char, &ffi_type_char, NULL };
- ffi_type ffi_type_Size2;
- ffi_type_Size2.type = FFI_TYPE_STRUCT;
- ffi_type_Size2.size = sizeof(Size2);
- ffi_type_Size2.alignment = alignof_slot(Size2);
- ffi_type_Size2.elements = ffi_type_Size2_elements;
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_Size2);
- {
- FFI_CALL(cif,S2_v,NULL,&r);
- }
- }
- fprintf(out,"->{%c%c}\n",r.x1,r.x2);
- fflush(out);
- }
-#endif
-#if (!defined(DGTEST)) || DGTEST == 46
- {
- Size3 r = S3_v();
- fprintf(out,"->{%c%c%c}\n",r.x1,r.x2,r.x3);
- fflush(out);
- memset(&r,0,sizeof(r)); clear_traces();
- {
- ffi_type* ffi_type_Size3_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
- ffi_type ffi_type_Size3;
- ffi_type_Size3.type = FFI_TYPE_STRUCT;
- ffi_type_Size3.size = sizeof(Size3);
- ffi_type_Size3.alignment = alignof_slot(Size3);
- ffi_type_Size3.elements = ffi_type_Size3_elements;
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_Size3);
- {
- FFI_CALL(cif,S3_v,NULL,&r);
- }
- }
- fprintf(out,"->{%c%c%c}\n",r.x1,r.x2,r.x3);
- fflush(out);
- }
-#endif
-#if (!defined(DGTEST)) || DGTEST == 47
- {
- Size4 r = S4_v();
- fprintf(out,"->{%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4);
- fflush(out);
- memset(&r,0,sizeof(r)); clear_traces();
- {
- ffi_type* ffi_type_Size4_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
- ffi_type ffi_type_Size4;
- ffi_type_Size4.type = FFI_TYPE_STRUCT;
- ffi_type_Size4.size = sizeof(Size4);
- ffi_type_Size4.alignment = alignof_slot(Size4);
- ffi_type_Size4.elements = ffi_type_Size4_elements;
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_Size4);
- {
- FFI_CALL(cif,S4_v,NULL,&r);
- }
- }
- fprintf(out,"->{%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4);
- fflush(out);
- }
-#endif
-#if (!defined(DGTEST)) || DGTEST == 48
- {
- Size7 r = S7_v();
- fprintf(out,"->{%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7);
- fflush(out);
- memset(&r,0,sizeof(r)); clear_traces();
- {
- ffi_type* ffi_type_Size7_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
- ffi_type ffi_type_Size7;
- ffi_type_Size7.type = FFI_TYPE_STRUCT;
- ffi_type_Size7.size = sizeof(Size7);
- ffi_type_Size7.alignment = alignof_slot(Size7);
- ffi_type_Size7.elements = ffi_type_Size7_elements;
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_Size7);
- {
- FFI_CALL(cif,S7_v,NULL,&r);
- }
- }
- fprintf(out,"->{%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7);
- fflush(out);
- }
-#endif
-#if (!defined(DGTEST)) || DGTEST == 49
- {
- Size8 r = S8_v();
- fprintf(out,"->{%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8);
- fflush(out);
- memset(&r,0,sizeof(r)); clear_traces();
- {
- ffi_type* ffi_type_Size8_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
- ffi_type ffi_type_Size8;
- ffi_type_Size8.type = FFI_TYPE_STRUCT;
- ffi_type_Size8.size = sizeof(Size8);
- ffi_type_Size8.alignment = alignof_slot(Size8);
- ffi_type_Size8.elements = ffi_type_Size8_elements;
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_Size8);
- {
- FFI_CALL(cif,S8_v,NULL,&r);
- }
- }
- fprintf(out,"->{%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8);
- fflush(out);
- }
-#endif
-#if (!defined(DGTEST)) || DGTEST == 50
- {
- Size12 r = S12_v();
- fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12);
- fflush(out);
- memset(&r,0,sizeof(r)); clear_traces();
- {
- ffi_type* ffi_type_Size12_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
- ffi_type ffi_type_Size12;
- ffi_type_Size12.type = FFI_TYPE_STRUCT;
- ffi_type_Size12.size = sizeof(Size12);
- ffi_type_Size12.alignment = alignof_slot(Size12);
- ffi_type_Size12.elements = ffi_type_Size12_elements;
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_Size12);
- {
- FFI_CALL(cif,S12_v,NULL,&r);
- }
- }
- fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12);
- fflush(out);
- }
-#endif
-#if (!defined(DGTEST)) || DGTEST == 51
- {
- Size15 r = S15_v();
- fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15);
- fflush(out);
- memset(&r,0,sizeof(r)); clear_traces();
- {
- ffi_type* ffi_type_Size15_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
- ffi_type ffi_type_Size15;
- ffi_type_Size15.type = FFI_TYPE_STRUCT;
- ffi_type_Size15.size = sizeof(Size15);
- ffi_type_Size15.alignment = alignof_slot(Size15);
- ffi_type_Size15.elements = ffi_type_Size15_elements;
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_Size15);
- {
- FFI_CALL(cif,S15_v,NULL,&r);
- }
- }
- fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15);
- fflush(out);
- }
-#endif
-#if (!defined(DGTEST)) || DGTEST == 52
- {
- Size16 r = S16_v();
- fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15,r.x16);
- fflush(out);
- memset(&r,0,sizeof(r)); clear_traces();
- {
- ffi_type* ffi_type_Size16_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
- ffi_type ffi_type_Size16;
- ffi_type_Size16.type = FFI_TYPE_STRUCT;
- ffi_type_Size16.size = sizeof(Size16);
- ffi_type_Size16.alignment = alignof_slot(Size16);
- ffi_type_Size16.elements = ffi_type_Size16_elements;
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_Size16);
- {
- FFI_CALL(cif,S16_v,NULL,&r);
- }
- }
- fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15,r.x16);
- fflush(out);
- }
-#endif
-}
-void
- structure_tests (void)
-{
- Int Ir;
- Char Cr;
- Float Fr;
- Double Dr;
- J Jr;
-#ifndef SKIP_EXTRA_STRUCTS
- T Tr;
- X Xr;
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 53
- Ir = I_III(I1,I2,I3);
- fprintf(out,"->{%d}\n",Ir.x);
- fflush(out);
- Ir.x = 0; clear_traces();
- {
- ffi_type* ffi_type_Int_elements[] = { &ffi_type_sint, NULL };
- ffi_type ffi_type_Int;
- ffi_type_Int.type = FFI_TYPE_STRUCT;
- ffi_type_Int.size = sizeof(Int);
- ffi_type_Int.alignment = alignof_slot(Int);
- ffi_type_Int.elements = ffi_type_Int_elements;
- ffi_type* argtypes[] = { &ffi_type_Int, &ffi_type_Int, &ffi_type_Int };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_Int);
- {
- /*const*/ void* args[] = { &I1, &I2, &I3 };
- FFI_CALL(cif,I_III,args,&Ir);
- }
- }
- fprintf(out,"->{%d}\n",Ir.x);
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 54
- Cr = C_CdC(C1,d2,C3);
- fprintf(out,"->{'%c'}\n",Cr.x);
- fflush(out);
- Cr.x = '\0'; clear_traces();
- {
- ffi_type* ffi_type_Char_elements[] = { &ffi_type_char, NULL };
- ffi_type ffi_type_Char;
- ffi_type_Char.type = FFI_TYPE_STRUCT;
- ffi_type_Char.size = sizeof(Char);
- ffi_type_Char.alignment = alignof_slot(Char);
- ffi_type_Char.elements = ffi_type_Char_elements;
- ffi_type* argtypes[] = { &ffi_type_Char, &ffi_type_double, &ffi_type_Char };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_Char);
- {
- /*const*/ void* args[] = { &C1, &d2, &C3 };
- FFI_CALL(cif,C_CdC,args,&Cr);
- }
- }
- fprintf(out,"->{'%c'}\n",Cr.x);
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 55
- Fr = F_Ffd(F1,f2,d3);
- fprintf(out,"->{%g}\n",Fr.x);
- fflush(out);
- Fr.x = 0.0; clear_traces();
- {
- ffi_type* ffi_type_Float_elements[] = { &ffi_type_float, NULL };
- ffi_type ffi_type_Float;
- ffi_type_Float.type = FFI_TYPE_STRUCT;
- ffi_type_Float.size = sizeof(Float);
- ffi_type_Float.alignment = alignof_slot(Float);
- ffi_type_Float.elements = ffi_type_Float_elements;
- ffi_type* argtypes[] = { &ffi_type_Float, &ffi_type_float, &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_Float);
- {
- /*const*/ void* args[] = { &F1, &f2, &d3 };
- FFI_CALL(cif,F_Ffd,args,&Fr);
- }
- }
- fprintf(out,"->{%g}\n",Fr.x);
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 56
- Dr = D_fDd(f1,D2,d3);
- fprintf(out,"->{%g}\n",Dr.x);
- fflush(out);
- Dr.x = 0.0; clear_traces();
- {
- ffi_type* ffi_type_Double_elements[] = { &ffi_type_double, NULL };
- ffi_type ffi_type_Double;
- ffi_type_Double.type = FFI_TYPE_STRUCT;
- ffi_type_Double.size = sizeof(Double);
- ffi_type_Double.alignment = alignof_slot(Double);
- ffi_type_Double.elements = ffi_type_Double_elements;
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_Double, &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_Double);
- {
- /*const*/ void* args[] = { &f1, &D2, &d3 };
- FFI_CALL(cif,D_fDd,args,&Dr);
- }
- }
- fprintf(out,"->{%g}\n",Dr.x);
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 57
- Dr = D_Dfd(D1,f2,d3);
- fprintf(out,"->{%g}\n",Dr.x);
- fflush(out);
- Dr.x = 0.0; clear_traces();
- {
- ffi_type* ffi_type_Double_elements[] = { &ffi_type_double, NULL };
- ffi_type ffi_type_Double;
- ffi_type_Double.type = FFI_TYPE_STRUCT;
- ffi_type_Double.size = sizeof(Double);
- ffi_type_Double.alignment = alignof_slot(Double);
- ffi_type_Double.elements = ffi_type_Double_elements;
- ffi_type* argtypes[] = { &ffi_type_Double, &ffi_type_float, &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_Double);
- {
- /*const*/ void* args[] = { &D1, &f2, &d3 };
- FFI_CALL(cif,D_Dfd,args,&Dr);
- }
- }
- fprintf(out,"->{%g}\n",Dr.x);
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 58
- Jr = J_JiJ(J1,i2,J2);
- fprintf(out,"->{%ld,%ld}\n",Jr.l1,Jr.l2);
- fflush(out);
- Jr.l1 = Jr.l2 = 0; clear_traces();
- {
- ffi_type* ffi_type_J_elements[] = { &ffi_type_slong, &ffi_type_slong, NULL };
- ffi_type ffi_type_J;
- ffi_type_J.type = FFI_TYPE_STRUCT;
- ffi_type_J.size = sizeof(J);
- ffi_type_J.alignment = alignof_slot(J);
- ffi_type_J.elements = ffi_type_J_elements;
- ffi_type* argtypes[] = { &ffi_type_J, &ffi_type_sint, &ffi_type_J };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_J);
- {
- /*const*/ void* args[] = { &J1, &i2, &J2 };
- FFI_CALL(cif,J_JiJ,args,&Jr);
- }
- }
- fprintf(out,"->{%ld,%ld}\n",Jr.l1,Jr.l2);
- fflush(out);
-#endif
-#ifndef SKIP_EXTRA_STRUCTS
-#if (!defined(DGTEST)) || DGTEST == 59
- Tr = T_TcT(T1,' ',T2);
- fprintf(out,"->{\"%c%c%c\"}\n",Tr.c[0],Tr.c[1],Tr.c[2]);
- fflush(out);
- Tr.c[0] = Tr.c[1] = Tr.c[2] = 0; clear_traces();
- {
- ffi_type* ffi_type_T_elements[] = { ??, NULL };
- ffi_type ffi_type_T;
- ffi_type_T.type = FFI_TYPE_STRUCT;
- ffi_type_T.size = sizeof(T);
- ffi_type_T.alignment = alignof_slot(T);
- ffi_type_T.elements = ffi_type_T_elements;
- ffi_type* argtypes[] = { &ffi_type_T, &ffi_type_char, &ffi_type_T };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_T);
- {
- char space = ' ';
- /*const*/ void* args[] = { &T1, &space, &T2 };
- FFI_CALL(cif,T_TcT,args,&Tr);
- }
- }
- fprintf(out,"->{\"%c%c%c\"}\n",Tr.c[0],Tr.c[1],Tr.c[2]);
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 60
- Xr = X_BcdB(B1,c2,d3,B2);
- fprintf(out,"->{\"%s\",'%c'}\n",Xr.c,Xr.c1);
- fflush(out);
- Xr.c[0]=Xr.c1='\0'; clear_traces();
- {
- ffi_type* ffi_type_X_elements[] = { ??, NULL };
- ffi_type ffi_type_X;
- ffi_type_X.type = FFI_TYPE_STRUCT;
- ffi_type_X.size = sizeof(X);
- ffi_type_X.alignment = alignof_slot(X);
- ffi_type_X.elements = ffi_type_X_elements;
- ffi_type* argtypes[] = { &ffi_type_X, &ffi_type_char, &ffi_type_double, &ffi_type_X };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_X);
- {
- /*const*/ void* args[] = { &B1, &c2, &d3, &B2 };
- FFI_CALL(cif,X_BcdB,args,&Xr);
- }
- }
- fprintf(out,"->{\"%s\",'%c'}\n",Xr.c,Xr.c1);
- fflush(out);
-#endif
-#endif
-
- return;
-}
-
-void
- gpargs_boundary_tests (void)
-{
- ffi_type* ffi_type_K_elements[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, NULL };
- ffi_type ffi_type_K;
- ffi_type* ffi_type_L_elements[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, NULL };
- ffi_type ffi_type_L;
- long lr;
- long long llr;
- float fr;
- double dr;
-
- ffi_type_K.type = FFI_TYPE_STRUCT;
- ffi_type_K.size = sizeof(K);
- ffi_type_K.alignment = alignof_slot(K);
- ffi_type_K.elements = ffi_type_K_elements;
-
- ffi_type_L.type = FFI_TYPE_STRUCT;
- ffi_type_L.size = sizeof(L);
- ffi_type_L.alignment = alignof_slot(L);
- ffi_type_L.elements = ffi_type_L_elements;
-
-#if (!defined(DGTEST)) || DGTEST == 61
- lr = l_l0K(K1,l9);
- fprintf(out,"->%ld\n",lr);
- fflush(out);
- lr = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_K, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
- {
- /*const*/ void* args[] = { &K1, &l9 };
- FFI_CALL(cif,l_l0K,args,&lr);
- }
- }
- fprintf(out,"->%ld\n",lr);
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 62
- lr = l_l1K(l1,K1,l9);
- fprintf(out,"->%ld\n",lr);
- fflush(out);
- lr = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
- {
- /*const*/ void* args[] = { &l1, &K1, &l9 };
- FFI_CALL(cif,l_l1K,args,&lr);
- }
- }
- fprintf(out,"->%ld\n",lr);
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 63
- lr = l_l2K(l1,l2,K1,l9);
- fprintf(out,"->%ld\n",lr);
- fflush(out);
- lr = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
- {
- /*const*/ void* args[] = { &l1, &l2, &K1, &l9 };
- FFI_CALL(cif,l_l2K,args,&lr);
- }
- }
- fprintf(out,"->%ld\n",lr);
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 64
- lr = l_l3K(l1,l2,l3,K1,l9);
- fprintf(out,"->%ld\n",lr);
- fflush(out);
- lr = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
- {
- /*const*/ void* args[] = { &l1, &l2, &l3, &K1, &l9 };
- FFI_CALL(cif,l_l3K,args,&lr);
- }
- }
- fprintf(out,"->%ld\n",lr);
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 65
- lr = l_l4K(l1,l2,l3,l4,K1,l9);
- fprintf(out,"->%ld\n",lr);
- fflush(out);
- lr = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
- {
- /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &K1, &l9 };
- FFI_CALL(cif,l_l4K,args,&lr);
- }
- }
- fprintf(out,"->%ld\n",lr);
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 66
- lr = l_l5K(l1,l2,l3,l4,l5,K1,l9);
- fprintf(out,"->%ld\n",lr);
- fflush(out);
- lr = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
- {
- /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &K1, &l9 };
- FFI_CALL(cif,l_l5K,args,&lr);
- }
- }
- fprintf(out,"->%ld\n",lr);
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 67
- lr = l_l6K(l1,l2,l3,l4,l5,l6,K1,l9);
- fprintf(out,"->%ld\n",lr);
- fflush(out);
- lr = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
- {
- /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &K1, &l9 };
- FFI_CALL(cif,l_l6K,args,&lr);
- }
- }
- fprintf(out,"->%ld\n",lr);
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 68
- fr = f_f17l3L(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,l6,l7,l8,L1);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_L };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- {
- /*const*/ void* args[] = { &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8, &f9, &f10, &f11, &f12, &f13, &f14, &f15, &f16, &f17, &l6, &l7, &l8, &L1 };
- FFI_CALL(cif,f_f17l3L,args,&fr);
- }
- }
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 69
- dr = d_d17l3L(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16,d17,l6,l7,l8,L1);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_L };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &d1, &d2, &d3, &d4, &d5, &d6, &d7, &d8, &d9, &d10, &d11, &d12, &d13, &d14, &d15, &d16, &d17, &l6, &l7, &l8, &L1 };
- FFI_CALL(cif,d_d17l3L,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 70
- llr = ll_l2ll(l1,l2,ll1,l9);
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
- llr = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
- {
- /*const*/ void* args[] = { &l1, &l2, &ll1, &l9 };
- FFI_CALL(cif,ll_l2ll,args,&llr);
- }
- }
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 71
- llr = ll_l3ll(l1,l2,l3,ll1,l9);
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
- llr = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
- {
- /*const*/ void* args[] = { &l1, &l2, &l3, &ll1, &l9 };
- FFI_CALL(cif,ll_l3ll,args,&llr);
- }
- }
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 72
- llr = ll_l4ll(l1,l2,l3,l4,ll1,l9);
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
- llr = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
- {
- /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &ll1, &l9 };
- FFI_CALL(cif,ll_l4ll,args,&llr);
- }
- }
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 73
- llr = ll_l5ll(l1,l2,l3,l4,l5,ll1,l9);
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
- llr = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
- {
- /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &ll1, &l9 };
- FFI_CALL(cif,ll_l5ll,args,&llr);
- }
- }
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 74
- llr = ll_l6ll(l1,l2,l3,l4,l5,l6,ll1,l9);
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
- llr = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
- {
- /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &ll1, &l9 };
- FFI_CALL(cif,ll_l6ll,args,&llr);
- }
- }
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 75
- llr = ll_l7ll(l1,l2,l3,l4,l5,l6,l7,ll1,l9);
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
- llr = 0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
- {
- /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &l7, &ll1, &l9 };
- FFI_CALL(cif,ll_l7ll,args,&llr);
- }
- }
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 76
- dr = d_l2d(l1,l2,d2,l9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &l1, &l2, &d2, &l9 };
- FFI_CALL(cif,d_l2d,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 77
- dr = d_l3d(l1,l2,l3,d2,l9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &l1, &l2, &l3, &d2, &l9 };
- FFI_CALL(cif,d_l3d,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 78
- dr = d_l4d(l1,l2,l3,l4,d2,l9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &d2, &l9 };
- FFI_CALL(cif,d_l4d,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 79
- dr = d_l5d(l1,l2,l3,l4,l5,d2,l9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &d2, &l9 };
- FFI_CALL(cif,d_l5d,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 80
- dr = d_l6d(l1,l2,l3,l4,l5,l6,d2,l9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &d2, &l9 };
- FFI_CALL(cif,d_l6d,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-#if (!defined(DGTEST)) || DGTEST == 81
- dr = d_l7d(l1,l2,l3,l4,l5,l6,l7,d2,l9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- {
- /*const*/ void* args[] = { &l1, &l2, &l3, &l4, &l5, &l6, &l7, &d2, &l9 };
- FFI_CALL(cif,d_l7d,args,&dr);
- }
- }
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
- return;
-}
-
-int
- main (void)
-{
- ffi_type_char = (char)(-1) < 0 ? ffi_type_schar : ffi_type_uchar;
- out = stdout;
-
- void_tests();
- int_tests();
- float_tests();
- double_tests();
- pointer_tests();
- mixed_number_tests();
- small_structure_return_tests();
- structure_tests();
- gpargs_boundary_tests();
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.bhaible/test-callback.c b/deps/libffi/testsuite/libffi.bhaible/test-callback.c
deleted file mode 100644
index 0b16799d868..00000000000
--- a/deps/libffi/testsuite/libffi.bhaible/test-callback.c
+++ /dev/null
@@ -1,2885 +0,0 @@
-/*
- * Copyright 1993 Bill Triggs <Bill.Triggs@inrialpes.fr>
- * Copyright 1995-2017 Bruno Haible <bruno@clisp.org>
- *
- * This program 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 3 of the License, or
- * (at your option) any later version.
- *
- * This program 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, see <http://www.gnu.org/licenses/>.
- */
-
-/* { dg-do run { xfail gccbug } } */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ffi.h>
-#include "alignof.h"
-#include <stdarg.h>
-
-/* libffi testsuite local changes -------------------------------- */
-#ifdef DGTEST
-/* Redefine exit(1) as a test failure */
-#define exit(V) (void)((V) ? (abort(), 1) : exit(0))
-int count = 0;
-char rbuf1[2048];
-char rbuf2[2048];
-int _fprintf(FILE *stream, const char *format, ...)
-{
- va_list args;
- va_start(args, format);
-
- switch (count++)
- {
- case 0:
- case 1:
- vsprintf(&rbuf1[strlen(rbuf1)], format, args);
- break;
- case 2:
- printf("%s", rbuf1);
- vsprintf(rbuf2, format, args);
- break;
- case 3:
- vsprintf(&rbuf2[strlen(rbuf2)], format, args);
- printf("%s", rbuf2);
- if (strcmp (rbuf1, rbuf2)) abort();
- break;
- }
-
- va_end(args);
-
- return 0;
-}
-#define fprintf _fprintf
-#endif
-/* --------------------------------------------------------------- */
-
-#include "testcases.c"
-
-#ifndef ABI_NUM
-#define ABI_NUM FFI_DEFAULT_ABI
-#endif
-
-/* Definitions that ought to be part of libffi. */
-static ffi_type ffi_type_char;
-#define ffi_type_slonglong ffi_type_sint64
-#define ffi_type_ulonglong ffi_type_uint64
-
-/* libffi does not support arrays inside structs. */
-#define SKIP_EXTRA_STRUCTS
-
-#define FFI_PREP_CIF(cif,argtypes,rettype) \
- if (ffi_prep_cif(&(cif),ABI_NUM,sizeof(argtypes)/sizeof(argtypes[0]),&rettype,argtypes) != FFI_OK) abort()
-#define FFI_PREP_CIF_NOARGS(cif,rettype) \
- if (ffi_prep_cif(&(cif),ABI_NUM,0,&rettype,NULL) != FFI_OK) abort()
-
-#if defined(__sparc__) && defined(__sun) && defined(__SUNPRO_C) /* SUNWspro cc */
-/* SunPRO cc miscompiles the simulator function for X_BcdB: d.i[1] is
- * temporarily stored in %l2 and put onto the stack from %l2, but in between
- * the copy of X has used %l2 as a counter without saving and restoring its
- * value.
- */
-#define SKIP_X
-#endif
-#if defined(__mipsn32__) && !defined(__GNUC__)
-/* The X test crashes for an unknown reason. */
-#define SKIP_X
-#endif
-
-
-/* These functions simulate the behaviour of the functions defined in testcases.c. */
-
-/* void tests */
-void v_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&v_v) { fprintf(out,"wrong data for v_v\n"); exit(1); }
- fprintf(out,"void f(void):\n");
- fflush(out);
-}
-
-/* int tests */
-void i_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&i_v) { fprintf(out,"wrong data for i_v\n"); exit(1); }
- {int r=99;
- fprintf(out,"int f(void):");
- fflush(out);
- *(ffi_arg*)retp = r;
-}}
-void i_i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&i_i) { fprintf(out,"wrong data for i_i\n"); exit(1); }
- int a = *(int*)(*args++);
- int r=a+1;
- fprintf(out,"int f(int):(%d)",a);
- fflush(out);
- *(ffi_arg*)retp = r;
-}
-void i_i2_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&i_i2) { fprintf(out,"wrong data for i_i2\n"); exit(1); }
- {int a = *(int*)(*args++);
- int b = *(int*)(*args++);
- int r=a+b;
- fprintf(out,"int f(2*int):(%d,%d)",a,b);
- fflush(out);
- *(ffi_arg*)retp = r;
-}}
-void i_i4_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&i_i4) { fprintf(out,"wrong data for i_i4\n"); exit(1); }
- {int a = *(int*)(*args++);
- int b = *(int*)(*args++);
- int c = *(int*)(*args++);
- int d = *(int*)(*args++);
- int r=a+b+c+d;
- fprintf(out,"int f(4*int):(%d,%d,%d,%d)",a,b,c,d);
- fflush(out);
- *(ffi_arg*)retp = r;
-}}
-void i_i8_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&i_i8) { fprintf(out,"wrong data for i_i8\n"); exit(1); }
- {int a = *(int*)(*args++);
- int b = *(int*)(*args++);
- int c = *(int*)(*args++);
- int d = *(int*)(*args++);
- int e = *(int*)(*args++);
- int f = *(int*)(*args++);
- int g = *(int*)(*args++);
- int h = *(int*)(*args++);
- int r=a+b+c+d+e+f+g+h;
- fprintf(out,"int f(8*int):(%d,%d,%d,%d,%d,%d,%d,%d)",a,b,c,d,e,f,g,h);
- fflush(out);
- *(ffi_arg*)retp = r;
-}}
-void i_i16_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&i_i16) { fprintf(out,"wrong data for i_i16\n"); exit(1); }
- {int a = *(int*)(*args++);
- int b = *(int*)(*args++);
- int c = *(int*)(*args++);
- int d = *(int*)(*args++);
- int e = *(int*)(*args++);
- int f = *(int*)(*args++);
- int g = *(int*)(*args++);
- int h = *(int*)(*args++);
- int i = *(int*)(*args++);
- int j = *(int*)(*args++);
- int k = *(int*)(*args++);
- int l = *(int*)(*args++);
- int m = *(int*)(*args++);
- int n = *(int*)(*args++);
- int o = *(int*)(*args++);
- int p = *(int*)(*args++);
- int r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p;
- fprintf(out,"int f(16*int):(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)",
- a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);
- fflush(out);
- *(ffi_arg*)retp = r;
-}}
-
-/* float tests */
-void f_f_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&f_f) { fprintf(out,"wrong data for f_f\n"); exit(1); }
- {float a = *(float*)(*args++);
- float r=a+1.0;
- fprintf(out,"float f(float):(%g)",a);
- fflush(out);
- *(float*)retp = r;
-}}
-void f_f2_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&f_f2) { fprintf(out,"wrong data for f_f2\n"); exit(1); }
- {float a = *(float*)(*args++);
- float b = *(float*)(*args++);
- float r=a+b;
- fprintf(out,"float f(2*float):(%g,%g)",a,b);
- fflush(out);
- *(float*)retp = r;
-}}
-void f_f4_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&f_f4) { fprintf(out,"wrong data for f_f4\n"); exit(1); }
- {float a = *(float*)(*args++);
- float b = *(float*)(*args++);
- float c = *(float*)(*args++);
- float d = *(float*)(*args++);
- float r=a+b+c+d;
- fprintf(out,"float f(4*float):(%g,%g,%g,%g)",a,b,c,d);
- fflush(out);
- *(float*)retp = r;
-}}
-void f_f8_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&f_f8) { fprintf(out,"wrong data for f_f8\n"); exit(1); }
- {float a = *(float*)(*args++);
- float b = *(float*)(*args++);
- float c = *(float*)(*args++);
- float d = *(float*)(*args++);
- float e = *(float*)(*args++);
- float f = *(float*)(*args++);
- float g = *(float*)(*args++);
- float h = *(float*)(*args++);
- float r=a+b+c+d+e+f+g+h;
- fprintf(out,"float f(8*float):(%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h);
- fflush(out);
- *(float*)retp = r;
-}}
-void f_f16_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&f_f16) { fprintf(out,"wrong data for f_f16\n"); exit(1); }
- {float a = *(float*)(*args++);
- float b = *(float*)(*args++);
- float c = *(float*)(*args++);
- float d = *(float*)(*args++);
- float e = *(float*)(*args++);
- float f = *(float*)(*args++);
- float g = *(float*)(*args++);
- float h = *(float*)(*args++);
- float i = *(float*)(*args++);
- float j = *(float*)(*args++);
- float k = *(float*)(*args++);
- float l = *(float*)(*args++);
- float m = *(float*)(*args++);
- float n = *(float*)(*args++);
- float o = *(float*)(*args++);
- float p = *(float*)(*args++);
- float r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p;
- fprintf(out,"float f(16*float):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);
- fflush(out);
- *(float*)retp = r;
-}}
-void f_f24_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&f_f24) { fprintf(out,"wrong data for f_f24\n"); exit(1); }
- {float a = *(float*)(*args++);
- float b = *(float*)(*args++);
- float c = *(float*)(*args++);
- float d = *(float*)(*args++);
- float e = *(float*)(*args++);
- float f = *(float*)(*args++);
- float g = *(float*)(*args++);
- float h = *(float*)(*args++);
- float i = *(float*)(*args++);
- float j = *(float*)(*args++);
- float k = *(float*)(*args++);
- float l = *(float*)(*args++);
- float m = *(float*)(*args++);
- float n = *(float*)(*args++);
- float o = *(float*)(*args++);
- float p = *(float*)(*args++);
- float q = *(float*)(*args++);
- float s = *(float*)(*args++);
- float t = *(float*)(*args++);
- float u = *(float*)(*args++);
- float v = *(float*)(*args++);
- float w = *(float*)(*args++);
- float x = *(float*)(*args++);
- float y = *(float*)(*args++);
- float r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+v+w+x+y;
- fprintf(out,"float f(24*float):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,v,w,x,y);
- fflush(out);
- *(float*)retp = r;
-}}
-
-/* double tests */
-void d_d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_d) { fprintf(out,"wrong data for d_d\n"); exit(1); }
- {double a = *(double*)(*args++);
- double r=a+1.0;
- fprintf(out,"double f(double):(%g)",a);
- fflush(out);
- *(double*)retp = r;
-}}
-void d_d2_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_d2) { fprintf(out,"wrong data for d_d2\n"); exit(1); }
- {double a = *(double*)(*args++);
- double b = *(double*)(*args++);
- double r=a+b;
- fprintf(out,"double f(2*double):(%g,%g)",a,b);
- fflush(out);
- *(double*)retp = r;
-}}
-void d_d4_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_d4) { fprintf(out,"wrong data for d_d4\n"); exit(1); }
- {double a = *(double*)(*args++);
- double b = *(double*)(*args++);
- double c = *(double*)(*args++);
- double d = *(double*)(*args++);
- double r=a+b+c+d;
- fprintf(out,"double f(4*double):(%g,%g,%g,%g)",a,b,c,d);
- fflush(out);
- *(double*)retp = r;
-}}
-void d_d8_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_d8) { fprintf(out,"wrong data for d_d8\n"); exit(1); }
- {double a = *(double*)(*args++);
- double b = *(double*)(*args++);
- double c = *(double*)(*args++);
- double d = *(double*)(*args++);
- double e = *(double*)(*args++);
- double f = *(double*)(*args++);
- double g = *(double*)(*args++);
- double h = *(double*)(*args++);
- double r=a+b+c+d+e+f+g+h;
- fprintf(out,"double f(8*double):(%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h);
- fflush(out);
- *(double*)retp = r;
-}}
-void d_d16_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_d16) { fprintf(out,"wrong data for d_d16\n"); exit(1); }
- {double a = *(double*)(*args++);
- double b = *(double*)(*args++);
- double c = *(double*)(*args++);
- double d = *(double*)(*args++);
- double e = *(double*)(*args++);
- double f = *(double*)(*args++);
- double g = *(double*)(*args++);
- double h = *(double*)(*args++);
- double i = *(double*)(*args++);
- double j = *(double*)(*args++);
- double k = *(double*)(*args++);
- double l = *(double*)(*args++);
- double m = *(double*)(*args++);
- double n = *(double*)(*args++);
- double o = *(double*)(*args++);
- double p = *(double*)(*args++);
- double r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p;
- fprintf(out,"double f(16*double):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);
- fflush(out);
- *(double*)retp = r;
-}}
-
-/* pointer tests */
-void vp_vpdpcpsp_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&vp_vpdpcpsp) { fprintf(out,"wrong data for vp_vpdpcpsp\n"); exit(1); }
- {void* a = *(void* *)(*args++);
- double* b = *(double* *)(*args++);
- char* c = *(char* *)(*args++);
- Int* d = *(Int* *)(*args++);
- void* ret = (char*)b + 1;
- fprintf(out,"void* f(void*,double*,char*,Int*):(0x%p,0x%p,0x%p,0x%p)",a,b,c,d);
- fflush(out);
- *(void* *)retp = ret;
-}}
-
-/* mixed number tests */
-void uc_ucsil_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&uc_ucsil) { fprintf(out,"wrong data for uc_ucsil\n"); exit(1); }
- {uchar a = *(unsigned char *)(*args++);
- ushort b = *(unsigned short *)(*args++);
- uint c = *(unsigned int *)(*args++);
- ulong d = *(unsigned long *)(*args++);
- uchar r = (uchar)-1;
- fprintf(out,"uchar f(uchar,ushort,uint,ulong):(%u,%u,%u,%lu)",a,b,c,d);
- fflush(out);
- *(ffi_arg *)retp = r;
-}}
-void d_iidd_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_iidd) { fprintf(out,"wrong data for d_iidd\n"); exit(1); }
- {int a = *(int*)(*args++);
- int b = *(int*)(*args++);
- double c = *(double*)(*args++);
- double d = *(double*)(*args++);
- double r=a+b+c+d;
- fprintf(out,"double f(int,int,double,double):(%d,%d,%g,%g)",a,b,c,d);
- fflush(out);
- *(double*)retp = r;
-}}
-void d_iiidi_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_iiidi) { fprintf(out,"wrong data for d_iiidi\n"); exit(1); }
- {int a = *(int*)(*args++);
- int b = *(int*)(*args++);
- int c = *(int*)(*args++);
- double d = *(double*)(*args++);
- int e = *(int*)(*args++);
- double r=a+b+c+d+e;
- fprintf(out,"double f(int,int,int,double,int):(%d,%d,%d,%g,%d)",a,b,c,d,e);
- fflush(out);
- *(double*)retp = r;
-}}
-void d_idid_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_idid) { fprintf(out,"wrong data for d_idid\n"); exit(1); }
- {int a = *(int*)(*args++);
- double b = *(double*)(*args++);
- int c = *(int*)(*args++);
- double d = *(double*)(*args++);
- double r=a+b+c+d;
- fprintf(out,"double f(int,double,int,double):(%d,%g,%d,%g)",a,b,c,d);
- fflush(out);
- *(double*)retp = r;
-}}
-void d_fdi_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_fdi) { fprintf(out,"wrong data for d_fdi\n"); exit(1); }
- {float a = *(float*)(*args++);
- double b = *(double*)(*args++);
- int c = *(int*)(*args++);
- double r=a+b+c;
- fprintf(out,"double f(float,double,int):(%g,%g,%d)",a,b,c);
- fflush(out);
- *(double*)retp = r;
-}}
-void us_cdcd_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&us_cdcd) { fprintf(out,"wrong data for us_cdcd\n"); exit(1); }
- {char a = *(char*)(*args++);
- double b = *(double*)(*args++);
- char c = *(char*)(*args++);
- double d = *(double*)(*args++);
- ushort r = (ushort)(a + b + c + d);
- fprintf(out,"ushort f(char,double,char,double):('%c',%g,'%c',%g)",a,b,c,d);
- fflush(out);
- *(ffi_arg *)retp = r;
-}}
-void ll_iiilli_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&ll_iiilli) { fprintf(out,"wrong data for ll_iiilli\n"); exit(1); }
- {int a = *(int*)(*args++);
- int b = *(int*)(*args++);
- int c = *(int*)(*args++);
- long long d = *(long long *)(*args++);
- int e = *(int*)(*args++);
- long long r = (long long)(int)a + (long long)(int)b + (long long)(int)c + d + (long long)e;
- fprintf(out,"long long f(int,int,int,long long,int):(%d,%d,%d,0x%lx%08lx,%d)",a,b,c,(long)(d>>32),(long)(d&0xffffffff),e);
- fflush(out);
- *(long long *)retp = r;
-}}
-void ll_flli_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&ll_flli) { fprintf(out,"wrong data for ll_flli\n"); exit(1); }
- {float a = *(float*)(*args++);
- long long b = *(long long *)(*args++);
- int c = *(int*)(*args++);
- long long r = (long long)(int)a + b + (long long)c;
- fprintf(out,"long long f(float,long long,int):(%g,0x%lx%08lx,0x%lx)",a,(long)(b>>32),(long)(b&0xffffffff),(long)c);
- fflush(out);
- *(long long *)retp = r;
-}}
-void f_fi_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&f_fi) { fprintf(out,"wrong data for f_fi\n"); exit(1); }
- {float a = *(float*)(*args++);
- int z = *(int*)(*args++);
- float r=a+z;
- fprintf(out,"float f(float,int):(%g,%d)",a,z);
- fflush(out);
- *(float*)retp = r;
-}}
-void f_f2i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&f_f2i) { fprintf(out,"wrong data for f_f2i\n"); exit(1); }
- {float a = *(float*)(*args++);
- float b = *(float*)(*args++);
- int z = *(int*)(*args++);
- float r=a+b+z;
- fprintf(out,"float f(2*float,int):(%g,%g,%d)",a,b,z);
- fflush(out);
- *(float*)retp = r;
-}}
-void f_f3i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&f_f3i) { fprintf(out,"wrong data for f_f3i\n"); exit(1); }
- {float a = *(float*)(*args++);
- float b = *(float*)(*args++);
- float c = *(float*)(*args++);
- int z = *(int*)(*args++);
- float r=a+b+c+z;
- fprintf(out,"float f(3*float,int):(%g,%g,%g,%d)",a,b,c,z);
- fflush(out);
- *(float*)retp = r;
-}}
-void f_f4i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&f_f4i) { fprintf(out,"wrong data for f_f4i\n"); exit(1); }
- {float a = *(float*)(*args++);
- float b = *(float*)(*args++);
- float c = *(float*)(*args++);
- float d = *(float*)(*args++);
- int z = *(int*)(*args++);
- float r=a+b+c+d+z;
- fprintf(out,"float f(4*float,int):(%g,%g,%g,%g,%d)",a,b,c,d,z);
- fflush(out);
- *(float*)retp = r;
-}}
-void f_f7i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&f_f7i) { fprintf(out,"wrong data for f_f7i\n"); exit(1); }
- {float a = *(float*)(*args++);
- float b = *(float*)(*args++);
- float c = *(float*)(*args++);
- float d = *(float*)(*args++);
- float e = *(float*)(*args++);
- float f = *(float*)(*args++);
- float g = *(float*)(*args++);
- int z = *(int*)(*args++);
- float r=a+b+c+d+e+f+g+z;
- fprintf(out,"float f(7*float,int):(%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,z);
- fflush(out);
- *(float*)retp = r;
-}}
-void f_f8i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&f_f8i) { fprintf(out,"wrong data for f_f8i\n"); exit(1); }
- {float a = *(float*)(*args++);
- float b = *(float*)(*args++);
- float c = *(float*)(*args++);
- float d = *(float*)(*args++);
- float e = *(float*)(*args++);
- float f = *(float*)(*args++);
- float g = *(float*)(*args++);
- float h = *(float*)(*args++);
- int z = *(int*)(*args++);
- float r=a+b+c+d+e+f+g+h+z;
- fprintf(out,"float f(8*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,z);
- fflush(out);
- *(float*)retp = r;
-}}
-void f_f12i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&f_f12i) { fprintf(out,"wrong data for f_f12i\n"); exit(1); }
- {float a = *(float*)(*args++);
- float b = *(float*)(*args++);
- float c = *(float*)(*args++);
- float d = *(float*)(*args++);
- float e = *(float*)(*args++);
- float f = *(float*)(*args++);
- float g = *(float*)(*args++);
- float h = *(float*)(*args++);
- float i = *(float*)(*args++);
- float j = *(float*)(*args++);
- float k = *(float*)(*args++);
- float l = *(float*)(*args++);
- int z = *(int*)(*args++);
- float r=a+b+c+d+e+f+g+h+i+j+k+l+z;
- fprintf(out,"float f(12*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,z);
- fflush(out);
- *(float*)retp = r;
-}}
-void f_f13i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&f_f13i) { fprintf(out,"wrong data for f_f13i\n"); exit(1); }
- {float a = *(float*)(*args++);
- float b = *(float*)(*args++);
- float c = *(float*)(*args++);
- float d = *(float*)(*args++);
- float e = *(float*)(*args++);
- float f = *(float*)(*args++);
- float g = *(float*)(*args++);
- float h = *(float*)(*args++);
- float i = *(float*)(*args++);
- float j = *(float*)(*args++);
- float k = *(float*)(*args++);
- float l = *(float*)(*args++);
- float m = *(float*)(*args++);
- int z = *(int*)(*args++);
- float r=a+b+c+d+e+f+g+h+i+j+k+l+m+z;
- fprintf(out,"float f(13*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,m,z);
- fflush(out);
- *(float*)retp = r;
-}}
-void d_di_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_di) { fprintf(out,"wrong data for d_di\n"); exit(1); }
- {double a = *(double*)(*args++);
- int z = *(int*)(*args++);
- double r=a+z;
- fprintf(out,"double f(double,int):(%g,%d)",a,z);
- fflush(out);
- *(double*)retp = r;
-}}
-void d_d2i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_d2i) { fprintf(out,"wrong data for d_d2i\n"); exit(1); }
- {double a = *(double*)(*args++);
- double b = *(double*)(*args++);
- int z = *(int*)(*args++);
- double r=a+b+z;
- fprintf(out,"double f(2*double,int):(%g,%g,%d)",a,b,z);
- fflush(out);
- *(double*)retp = r;
-}}
-void d_d3i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_d3i) { fprintf(out,"wrong data for d_d3i\n"); exit(1); }
- {double a = *(double*)(*args++);
- double b = *(double*)(*args++);
- double c = *(double*)(*args++);
- int z = *(int*)(*args++);
- double r=a+b+c+z;
- fprintf(out,"double f(3*double,int):(%g,%g,%g,%d)",a,b,c,z);
- fflush(out);
- *(double*)retp = r;
-}}
-void d_d4i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_d4i) { fprintf(out,"wrong data for d_d4i\n"); exit(1); }
- {double a = *(double*)(*args++);
- double b = *(double*)(*args++);
- double c = *(double*)(*args++);
- double d = *(double*)(*args++);
- int z = *(int*)(*args++);
- double r=a+b+c+d+z;
- fprintf(out,"double f(4*double,int):(%g,%g,%g,%g,%d)",a,b,c,d,z);
- fflush(out);
- *(double*)retp = r;
-}}
-void d_d7i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_d7i) { fprintf(out,"wrong data for d_d7i\n"); exit(1); }
- {double a = *(double*)(*args++);
- double b = *(double*)(*args++);
- double c = *(double*)(*args++);
- double d = *(double*)(*args++);
- double e = *(double*)(*args++);
- double f = *(double*)(*args++);
- double g = *(double*)(*args++);
- int z = *(int*)(*args++);
- double r=a+b+c+d+e+f+g+z;
- fprintf(out,"double f(7*double,int):(%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,z);
- fflush(out);
- *(double*)retp = r;
-}}
-void d_d8i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_d8i) { fprintf(out,"wrong data for d_d8i\n"); exit(1); }
- {double a = *(double*)(*args++);
- double b = *(double*)(*args++);
- double c = *(double*)(*args++);
- double d = *(double*)(*args++);
- double e = *(double*)(*args++);
- double f = *(double*)(*args++);
- double g = *(double*)(*args++);
- double h = *(double*)(*args++);
- int z = *(int*)(*args++);
- double r=a+b+c+d+e+f+g+h+z;
- fprintf(out,"double f(8*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,z);
- fflush(out);
- *(double*)retp = r;
-}}
-void d_d12i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_d12i) { fprintf(out,"wrong data for d_d12i\n"); exit(1); }
- {double a = *(double*)(*args++);
- double b = *(double*)(*args++);
- double c = *(double*)(*args++);
- double d = *(double*)(*args++);
- double e = *(double*)(*args++);
- double f = *(double*)(*args++);
- double g = *(double*)(*args++);
- double h = *(double*)(*args++);
- double i = *(double*)(*args++);
- double j = *(double*)(*args++);
- double k = *(double*)(*args++);
- double l = *(double*)(*args++);
- int z = *(int*)(*args++);
- double r=a+b+c+d+e+f+g+h+i+j+k+l+z;
- fprintf(out,"double f(12*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,z);
- fflush(out);
- *(double*)retp = r;
-}}
-void d_d13i_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_d13i) { fprintf(out,"wrong data for d_d13i\n"); exit(1); }
- {double a = *(double*)(*args++);
- double b = *(double*)(*args++);
- double c = *(double*)(*args++);
- double d = *(double*)(*args++);
- double e = *(double*)(*args++);
- double f = *(double*)(*args++);
- double g = *(double*)(*args++);
- double h = *(double*)(*args++);
- double i = *(double*)(*args++);
- double j = *(double*)(*args++);
- double k = *(double*)(*args++);
- double l = *(double*)(*args++);
- double m = *(double*)(*args++);
- int z = *(int*)(*args++);
- double r=a+b+c+d+e+f+g+h+i+j+k+l+m+z;
- fprintf(out,"double f(13*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,m,z);
- fflush(out);
- *(double*)retp = r;
-}}
-
-/* small structure return tests */
-void S1_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&S1_v) { fprintf(out,"wrong data for S1_v\n"); exit(1); }
- {Size1 r = Size1_1;
- fprintf(out,"Size1 f(void):");
- fflush(out);
- *(Size1*)retp = r;
-}}
-void S2_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&S2_v) { fprintf(out,"wrong data for S2_v\n"); exit(1); }
- {Size2 r = Size2_1;
- fprintf(out,"Size2 f(void):");
- fflush(out);
- *(Size2*)retp = r;
-}}
-void S3_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&S3_v) { fprintf(out,"wrong data for S3_v\n"); exit(1); }
- {Size3 r = Size3_1;
- fprintf(out,"Size3 f(void):");
- fflush(out);
- *(Size3*)retp = r;
-}}
-void S4_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&S4_v) { fprintf(out,"wrong data for S4_v\n"); exit(1); }
- {Size4 r = Size4_1;
- fprintf(out,"Size4 f(void):");
- fflush(out);
- *(Size4*)retp = r;
-}}
-void S7_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&S7_v) { fprintf(out,"wrong data for S7_v\n"); exit(1); }
- {Size7 r = Size7_1;
- fprintf(out,"Size7 f(void):");
- fflush(out);
- *(Size7*)retp = r;
-}}
-void S8_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&S8_v) { fprintf(out,"wrong data for S8_v\n"); exit(1); }
- {Size8 r = Size8_1;
- fprintf(out,"Size8 f(void):");
- fflush(out);
- *(Size8*)retp = r;
-}}
-void S12_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&S12_v) { fprintf(out,"wrong data for S12_v\n"); exit(1); }
- {Size12 r = Size12_1;
- fprintf(out,"Size12 f(void):");
- fflush(out);
- *(Size12*)retp = r;
-}}
-void S15_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&S15_v) { fprintf(out,"wrong data for S15_v\n"); exit(1); }
- {Size15 r = Size15_1;
- fprintf(out,"Size15 f(void):");
- fflush(out);
- *(Size15*)retp = r;
-}}
-void S16_v_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&S16_v) { fprintf(out,"wrong data for S16_v\n"); exit(1); }
- {Size16 r = Size16_1;
- fprintf(out,"Size16 f(void):");
- fflush(out);
- *(Size16*)retp = r;
-}}
-
-/* structure tests */
-void I_III_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&I_III) { fprintf(out,"wrong data for I_III\n"); exit(1); }
- {Int a = *(Int*)(*args++);
- Int b = *(Int*)(*args++);
- Int c = *(Int*)(*args++);
- Int r;
- r.x = a.x + b.x + c.x;
- fprintf(out,"Int f(Int,Int,Int):({%d},{%d},{%d})",a.x,b.x,c.x);
- fflush(out);
- *(Int*)retp = r;
-}}
-void C_CdC_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&C_CdC) { fprintf(out,"wrong data for C_CdC\n"); exit(1); }
- {Char a = *(Char*)(*args++);
- double b = *(double*)(*args++);
- Char c = *(Char*)(*args++);
- Char r;
- r.x = (a.x + c.x)/2;
- fprintf(out,"Char f(Char,double,Char):({'%c'},%g,{'%c'})",a.x,b,c.x);
- fflush(out);
- *(Char*)retp = r;
-}}
-void F_Ffd_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&F_Ffd) { fprintf(out,"wrong data for F_Ffd\n"); exit(1); }
- {Float a = *(Float*)(*args++);
- float b = *(float*)(*args++);
- double c = *(double*)(*args++);
- Float r;
- r.x = a.x + b + c;
- fprintf(out,"Float f(Float,float,double):({%g},%g,%g)",a.x,b,c);
- fflush(out);
- *(Float*)retp = r;
-}}
-void D_fDd_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&D_fDd) { fprintf(out,"wrong data for D_fDd\n"); exit(1); }
- {float a = *(float*)(*args++);
- Double b = *(Double*)(*args++);
- double c = *(double*)(*args++);
- Double r;
- r.x = a + b.x + c;
- fprintf(out,"Double f(float,Double,double):(%g,{%g},%g)",a,b.x,c);
- fflush(out);
- *(Double*)retp = r;
-}}
-void D_Dfd_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&D_Dfd) { fprintf(out,"wrong data for D_Dfd\n"); exit(1); }
- {Double a = *(Double*)(*args++);
- float b = *(float*)(*args++);
- double c = *(double*)(*args++);
- Double r;
- r.x = a.x + b + c;
- fprintf(out,"Double f(Double,float,double):({%g},%g,%g)",a.x,b,c);
- fflush(out);
- *(Double*)retp = r;
-}}
-void J_JiJ_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&J_JiJ) { fprintf(out,"wrong data for J_JiJ\n"); exit(1); }
- {J a = *(J*)(*args++);
- int b= *(int*)(*args++);
- J c = *(J*)(*args++);
- J r;
- r.l1 = a.l1+c.l1; r.l2 = a.l2+b+c.l2;
- fprintf(out,"J f(J,int,J):({%ld,%ld},%d,{%ld,%ld})",a.l1,a.l2,b,c.l1,c.l2);
- fflush(out);
- *(J*)retp = r;
-}}
-#ifndef SKIP_EXTRA_STRUCTS
-void T_TcT_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&T_TcT) { fprintf(out,"wrong data for T_TcT\n"); exit(1); }
- {T a = *(T*)(*args++);
- char b = *(char*)(*args++);
- T c = *(T*)(*args++);
- T r;
- r.c[0]='b'; r.c[1]=c.c[1]; r.c[2]=c.c[2];
- fprintf(out,"T f(T,char,T):({\"%c%c%c\"},'%c',{\"%c%c%c\"})",a.c[0],a.c[1],a.c[2],b,c.c[0],c.c[1],c.c[2]);
- fflush(out);
- *(T*)retp = r;
-}}
-void X_BcdB_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&X_BcdB) { fprintf(out,"wrong data for X_BcdB\n"); exit(1); }
- {B a = *(B*)(*args++);
- char b = *(char*)(*args++);
- double c = *(double*)(*args++);
- B d = *(B*)(*args++);
- static X xr={"return val",'R'};
- X r;
- r = xr;
- r.c1 = b;
- fprintf(out,"X f(B,char,double,B):({%g,{%d,%d,%d}},'%c',%g,{%g,{%d,%d,%d}})",
- a.d,a.i[0],a.i[1],a.i[2],b,c,d.d,d.i[0],d.i[1],d.i[2]);
- fflush(out);
- *(X*)retp = r;
-}}
-#endif
-
-/* gpargs boundary tests */
-void l_l0K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&l_l0K) { fprintf(out,"wrong data for l_l0K\n"); exit(1); }
- {K b = *(K*)(*args++);
- long c = *(long*)(*args++);
- long r = b.l1 + b.l2 + b.l3 + b.l4 + c;
- fprintf(out,"long f(K,long):(%ld,%ld,%ld,%ld,%ld)",b.l1,b.l2,b.l3,b.l4,c);
- fflush(out);
- *(ffi_arg*)retp = r;
-}}
-void l_l1K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&l_l1K) { fprintf(out,"wrong data for l_l1K\n"); exit(1); }
- {long a1 = *(long*)(*args++);
- K b = *(K*)(*args++);
- long c = *(long*)(*args++);
- long r = a1 + b.l1 + b.l2 + b.l3 + b.l4 + c;
- fprintf(out,"long f(long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld)",a1,b.l1,b.l2,b.l3,b.l4,c);
- fflush(out);
- *(ffi_arg*)retp = r;
-}}
-void l_l2K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&l_l2K) { fprintf(out,"wrong data for l_l2K\n"); exit(1); }
- {long a1 = *(long*)(*args++);
- long a2 = *(long*)(*args++);
- K b = *(K*)(*args++);
- long c = *(long*)(*args++);
- long r = a1 + a2 + b.l1 + b.l2 + b.l3 + b.l4 + c;
- fprintf(out,"long f(2*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,b.l1,b.l2,b.l3,b.l4,c);
- fflush(out);
- *(ffi_arg*)retp = r;
-}}
-void l_l3K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&l_l3K) { fprintf(out,"wrong data for l_l3K\n"); exit(1); }
- {long a1 = *(long*)(*args++);
- long a2 = *(long*)(*args++);
- long a3 = *(long*)(*args++);
- K b = *(K*)(*args++);
- long c = *(long*)(*args++);
- long r = a1 + a2 + a3 + b.l1 + b.l2 + b.l3 + b.l4 + c;
- fprintf(out,"long f(3*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,b.l1,b.l2,b.l3,b.l4,c);
- fflush(out);
- *(ffi_arg*)retp = r;
-}}
-void l_l4K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&l_l4K) { fprintf(out,"wrong data for l_l4K\n"); exit(1); }
- {long a1 = *(long*)(*args++);
- long a2 = *(long*)(*args++);
- long a3 = *(long*)(*args++);
- long a4 = *(long*)(*args++);
- K b = *(K*)(*args++);
- long c = *(long*)(*args++);
- long r = a1 + a2 + a3 + a4 + b.l1 + b.l2 + b.l3 + b.l4 + c;
- fprintf(out,"long f(4*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,b.l1,b.l2,b.l3,b.l4,c);
- fflush(out);
- *(ffi_arg*)retp = r;
-}}
-void l_l5K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&l_l5K) { fprintf(out,"wrong data for l_l5K\n"); exit(1); }
- {long a1 = *(long*)(*args++);
- long a2 = *(long*)(*args++);
- long a3 = *(long*)(*args++);
- long a4 = *(long*)(*args++);
- long a5 = *(long*)(*args++);
- K b = *(K*)(*args++);
- long c = *(long*)(*args++);
- long r = a1 + a2 + a3 + a4 + a5 + b.l1 + b.l2 + b.l3 + b.l4 + c;
- fprintf(out,"long f(5*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,a5,b.l1,b.l2,b.l3,b.l4,c);
- fflush(out);
- *(ffi_arg*)retp = r;
-}}
-void l_l6K_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&l_l6K) { fprintf(out,"wrong data for l_l6K\n"); exit(1); }
- {long a1 = *(long*)(*args++);
- long a2 = *(long*)(*args++);
- long a3 = *(long*)(*args++);
- long a4 = *(long*)(*args++);
- long a5 = *(long*)(*args++);
- long a6 = *(long*)(*args++);
- K b = *(K*)(*args++);
- long c = *(long*)(*args++);
- long r = a1 + a2 + a3 + a4 + a5 + a6 + b.l1 + b.l2 + b.l3 + b.l4 + c;
- fprintf(out,"long f(6*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,a5,a6,b.l1,b.l2,b.l3,b.l4,c);
- fflush(out);
- *(ffi_arg*)retp = r;
-}}
-void f_f17l3L_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&f_f17l3L) { fprintf(out,"wrong data for f_f17l3L\n"); exit(1); }
- {float a = *(float*)(*args++);
- float b = *(float*)(*args++);
- float c = *(float*)(*args++);
- float d = *(float*)(*args++);
- float e = *(float*)(*args++);
- float f = *(float*)(*args++);
- float g = *(float*)(*args++);
- float h = *(float*)(*args++);
- float i = *(float*)(*args++);
- float j = *(float*)(*args++);
- float k = *(float*)(*args++);
- float l = *(float*)(*args++);
- float m = *(float*)(*args++);
- float n = *(float*)(*args++);
- float o = *(float*)(*args++);
- float p = *(float*)(*args++);
- float q = *(float*)(*args++);
- long s = *(long*)(*args++);
- long t = *(long*)(*args++);
- long u = *(long*)(*args++);
- L z = *(L*)(*args++);
- float r = a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+z.l1+z.l2+z.l3+z.l4+z.l5+z.l6;
- fprintf(out,"float f(17*float,3*int,L):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,z.l1,z.l2,z.l3,z.l4,z.l5,z.l6);
- fflush(out);
- *(float*)retp = r;
-}}
-void d_d17l3L_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_d17l3L) { fprintf(out,"wrong data for d_d17l3L\n"); exit(1); }
- {double a = *(double*)(*args++);
- double b = *(double*)(*args++);
- double c = *(double*)(*args++);
- double d = *(double*)(*args++);
- double e = *(double*)(*args++);
- double f = *(double*)(*args++);
- double g = *(double*)(*args++);
- double h = *(double*)(*args++);
- double i = *(double*)(*args++);
- double j = *(double*)(*args++);
- double k = *(double*)(*args++);
- double l = *(double*)(*args++);
- double m = *(double*)(*args++);
- double n = *(double*)(*args++);
- double o = *(double*)(*args++);
- double p = *(double*)(*args++);
- double q = *(double*)(*args++);
- long s = *(long*)(*args++);
- long t = *(long*)(*args++);
- long u = *(long*)(*args++);
- L z = *(L*)(*args++);
- double r = a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+z.l1+z.l2+z.l3+z.l4+z.l5+z.l6;
- fprintf(out,"double f(17*double,3*int,L):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,z.l1,z.l2,z.l3,z.l4,z.l5,z.l6);
- fflush(out);
- *(double*)retp = r;
-}}
-void ll_l2ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&ll_l2ll) { fprintf(out,"wrong data for ll_l2ll\n"); exit(1); }
- {long a1 = *(long*)(*args++);
- long a2 = *(long*)(*args++);
- long long b = *(long long *)(*args++);
- long c = *(long*)(*args++);
- long long r = (long long) (a1 + a2) + b + c;
- fprintf(out,"long long f(2*long,long long,long):(%ld,%ld,0x%lx%08lx,%ld)",a1,a2,(long)(b>>32),(long)(b&0xffffffff),c);
- fflush(out);
- *(long long *)retp = r;
-}}
-void ll_l3ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&ll_l3ll) { fprintf(out,"wrong data for ll_l3ll\n"); exit(1); }
- {long a1 = *(long*)(*args++);
- long a2 = *(long*)(*args++);
- long a3 = *(long*)(*args++);
- long long b = *(long long *)(*args++);
- long c = *(long*)(*args++);
- long long r = (long long) (a1 + a2 + a3) + b + c;
- fprintf(out,"long long f(3*long,long long,long):(%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,(long)(b>>32),(long)(b&0xffffffff),c);
- fflush(out);
- *(long long *)retp = r;
-}}
-void ll_l4ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&ll_l4ll) { fprintf(out,"wrong data for ll_l4ll\n"); exit(1); }
- {long a1 = *(long*)(*args++);
- long a2 = *(long*)(*args++);
- long a3 = *(long*)(*args++);
- long a4 = *(long*)(*args++);
- long long b = *(long long *)(*args++);
- long c = *(long*)(*args++);
- long long r = (long long) (a1 + a2 + a3 + a4) + b + c;
- fprintf(out,"long long f(4*long,long long,long):(%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,(long)(b>>32),(long)(b&0xffffffff),c);
- fflush(out);
- *(long long *)retp = r;
-}}
-void ll_l5ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&ll_l5ll) { fprintf(out,"wrong data for ll_l5ll\n"); exit(1); }
- {long a1 = *(long*)(*args++);
- long a2 = *(long*)(*args++);
- long a3 = *(long*)(*args++);
- long a4 = *(long*)(*args++);
- long a5 = *(long*)(*args++);
- long long b = *(long long *)(*args++);
- long c = *(long*)(*args++);
- long long r = (long long) (a1 + a2 + a3 + a4 + a5) + b + c;
- fprintf(out,"long long f(5*long,long long,long):(%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,(long)(b>>32),(long)(b&0xffffffff),c);
- fflush(out);
- *(long long *)retp = r;
-}}
-void ll_l6ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&ll_l6ll) { fprintf(out,"wrong data for ll_l6ll\n"); exit(1); }
- {long a1 = *(long*)(*args++);
- long a2 = *(long*)(*args++);
- long a3 = *(long*)(*args++);
- long a4 = *(long*)(*args++);
- long a5 = *(long*)(*args++);
- long a6 = *(long*)(*args++);
- long long b = *(long long *)(*args++);
- long c = *(long*)(*args++);
- long long r = (long long) (a1 + a2 + a3 + a4 + a5 + a6) + b + c;
- fprintf(out,"long long f(6*long,long long,long):(%ld,%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,a6,(long)(b>>32),(long)(b&0xffffffff),c);
- fflush(out);
- *(long long *)retp = r;
-}}
-void ll_l7ll_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&ll_l7ll) { fprintf(out,"wrong data for ll_l7ll\n"); exit(1); }
- {long a1 = *(long*)(*args++);
- long a2 = *(long*)(*args++);
- long a3 = *(long*)(*args++);
- long a4 = *(long*)(*args++);
- long a5 = *(long*)(*args++);
- long a6 = *(long*)(*args++);
- long a7 = *(long*)(*args++);
- long long b = *(long long *)(*args++);
- long c = *(long*)(*args++);
- long long r = (long long) (a1 + a2 + a3 + a4 + a5 + a6 + a7) + b + c;
- fprintf(out,"long long f(7*long,long long,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,a6,a7,(long)(b>>32),(long)(b&0xffffffff),c);
- fflush(out);
- *(long long *)retp = r;
-}}
-void d_l2d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_l2d) { fprintf(out,"wrong data for d_l2d\n"); exit(1); }
- {long a1 = *(long*)(*args++);
- long a2 = *(long*)(*args++);
- double b = *(double*)(*args++);
- long c = *(long*)(*args++);
- double r = (double) (a1 + a2) + b + c;
- fprintf(out,"double f(2*long,double,long):(%ld,%ld,%g,%ld)",a1,a2,b,c);
- fflush(out);
- *(double*)retp = r;
-}}
-void d_l3d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_l3d) { fprintf(out,"wrong data for d_l3d\n"); exit(1); }
- {long a1 = *(long*)(*args++);
- long a2 = *(long*)(*args++);
- long a3 = *(long*)(*args++);
- double b = *(double*)(*args++);
- long c = *(long*)(*args++);
- double r = (double) (a1 + a2 + a3) + b + c;
- fprintf(out,"double f(3*long,double,long):(%ld,%ld,%ld,%g,%ld)",a1,a2,a3,b,c);
- fflush(out);
- *(double*)retp = r;
-}}
-void d_l4d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_l4d) { fprintf(out,"wrong data for d_l4d\n"); exit(1); }
- {long a1 = *(long*)(*args++);
- long a2 = *(long*)(*args++);
- long a3 = *(long*)(*args++);
- long a4 = *(long*)(*args++);
- double b = *(double*)(*args++);
- long c = *(long*)(*args++);
- double r = (double) (a1 + a2 + a3 + a4) + b + c;
- fprintf(out,"double f(4*long,double,long):(%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,b,c);
- fflush(out);
- *(double*)retp = r;
-}}
-void d_l5d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_l5d) { fprintf(out,"wrong data for d_l5d\n"); exit(1); }
- {long a1 = *(long*)(*args++);
- long a2 = *(long*)(*args++);
- long a3 = *(long*)(*args++);
- long a4 = *(long*)(*args++);
- long a5 = *(long*)(*args++);
- double b = *(double*)(*args++);
- long c = *(long*)(*args++);
- double r = (double) (a1 + a2 + a3 + a4 + a5) + b + c;
- fprintf(out,"double f(5*long,double,long):(%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,b,c);
- fflush(out);
- *(double*)retp = r;
-}}
-void d_l6d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_l6d) { fprintf(out,"wrong data for d_l6d\n"); exit(1); }
- {long a1 = *(long*)(*args++);
- long a2 = *(long*)(*args++);
- long a3 = *(long*)(*args++);
- long a4 = *(long*)(*args++);
- long a5 = *(long*)(*args++);
- long a6 = *(long*)(*args++);
- double b = *(double*)(*args++);
- long c = *(long*)(*args++);
- double r = (double) (a1 + a2 + a3 + a4 + a5 + a6) + b + c;
- fprintf(out,"double f(6*long,double,long):(%ld,%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,a6,b,c);
- fflush(out);
- *(double*)retp = r;
-}}
-void d_l7d_simulator (ffi_cif* cif, void* retp, /*const*/ void* /*const*/ *args, void* data)
-{
- if (data != (void*)&d_l7d) { fprintf(out,"wrong data for d_l7d\n"); exit(1); }
- {long a1 = *(long*)(*args++);
- long a2 = *(long*)(*args++);
- long a3 = *(long*)(*args++);
- long a4 = *(long*)(*args++);
- long a5 = *(long*)(*args++);
- long a6 = *(long*)(*args++);
- long a7 = *(long*)(*args++);
- double b = *(double*)(*args++);
- long c = *(long*)(*args++);
- double r = (double) (a1 + a2 + a3 + a4 + a5 + a6 + a7) + b + c;
- fprintf(out,"double f(7*long,double,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,a6,a7,b,c);
- fflush(out);
- *(double*)retp = r;
-}}
-
-
-/*
- * The way we run these tests - first call the function directly, then
- * through vacall() - there is the danger that arguments or results seem
- * to be passed correctly, but what we are seeing are in fact the vestiges
- * (traces) or the previous call. This may seriously fake the test.
- * Avoid this by clearing the registers between the first and the second call.
- */
-long clear_traces_i (long a, long b, long c, long d, long e, long f, long g, long h,
- long i, long j, long k, long l, long m, long n, long o, long p)
-{ return 0; }
-float clear_traces_f (float a, float b, float c, float d, float e, float f, float g,
- float h, float i, float j, float k, float l, float m, float n,
- float o, float p)
-{ return 0.0; }
-double clear_traces_d (double a, double b, double c, double d, double e, double f, double g,
- double h, double i, double j, double k, double l, double m, double n,
- double o, double p)
-{ return 0.0; }
-J clear_traces_J (void)
-{ J j; j.l1 = j.l2 = 0; return j; }
-void clear_traces (void)
-{ clear_traces_i(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
- clear_traces_f(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0);
- clear_traces_d(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0);
- clear_traces_J();
-}
-
-int main (void)
-{
- void* callback_code;
- void* callback_writable;
-#define ALLOC_CALLBACK() \
- callback_writable = ffi_closure_alloc(sizeof(ffi_closure),&callback_code); \
- if (!callback_writable) abort()
-#define PREP_CALLBACK(cif,simulator,data) \
- if (ffi_prep_closure_loc(callback_writable,&(cif),simulator,data,callback_code) != FFI_OK) abort()
-#define FREE_CALLBACK() \
- ffi_closure_free(callback_writable)
-
- ffi_type_char = (char)(-1) < 0 ? ffi_type_schar : ffi_type_uchar;
- out = stdout;
-
-#if (!defined(DGTEST)) || DGTEST == 1
- /* void tests */
- v_v();
- clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_void);
- PREP_CALLBACK(cif,v_v_simulator,(void*)&v_v);
- ((void (ABI_ATTR *) (void)) callback_code) ();
- }
- FREE_CALLBACK();
-#endif
-
- /* int tests */
- { int ir;
-
-#if (!defined(DGTEST)) || DGTEST == 2
- ir = i_v();
- fprintf(out,"->%d\n",ir);
- fflush(out);
- ir = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_sint);
- PREP_CALLBACK(cif,i_v_simulator,(void*)&i_v);
- ir = ((int (ABI_ATTR *) (void)) callback_code) ();
- }
- FREE_CALLBACK();
- fprintf(out,"->%d\n",ir);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 3
- ir = i_i(i1);
- fprintf(out,"->%d\n",ir);
- fflush(out);
- ir = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
- PREP_CALLBACK(cif,i_i_simulator,(void*)&i_i);
- ir = ((int (ABI_ATTR *) (int)) callback_code) (i1);
- }
- FREE_CALLBACK();
- fprintf(out,"->%d\n",ir);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 4
- ir = i_i2(i1,i2);
- fprintf(out,"->%d\n",ir);
- fflush(out);
- ir = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
- PREP_CALLBACK(cif,i_i2_simulator,(void*)&i_i2);
- ir = ((int (ABI_ATTR *) (int,int)) callback_code) (i1,i2);
- }
- FREE_CALLBACK();
- fprintf(out,"->%d\n",ir);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 5
- ir = i_i4(i1,i2,i3,i4);
- fprintf(out,"->%d\n",ir);
- fflush(out);
- ir = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
- PREP_CALLBACK(cif,i_i4_simulator,(void*)&i_i4);
- ir = ((int (ABI_ATTR *) (int,int,int,int)) callback_code) (i1,i2,i3,i4);
- }
- FREE_CALLBACK();
- fprintf(out,"->%d\n",ir);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 6
- ir = i_i8(i1,i2,i3,i4,i5,i6,i7,i8);
- fprintf(out,"->%d\n",ir);
- fflush(out);
- ir = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
- PREP_CALLBACK(cif,i_i8_simulator,(void*)&i_i8);
- ir = ((int (ABI_ATTR *) (int,int,int,int,int,int,int,int)) callback_code) (i1,i2,i3,i4,i5,i6,i7,i8);
- }
- FREE_CALLBACK();
- fprintf(out,"->%d\n",ir);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 7
- ir = i_i16(i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15,i16);
- fprintf(out,"->%d\n",ir);
- fflush(out);
- ir = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_sint);
- PREP_CALLBACK(cif,i_i16_simulator,(void*)&i_i16);
- ir = ((int (ABI_ATTR *) (int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int)) callback_code) (i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15,i16);
- }
- FREE_CALLBACK();
- fprintf(out,"->%d\n",ir);
- fflush(out);
-#endif
- }
-
- /* float tests */
- { float fr;
-
-#if (!defined(DGTEST)) || DGTEST == 8
- fr = f_f(f1);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_float };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- PREP_CALLBACK(cif,f_f_simulator,(void*)&f_f);
- fr = ((float (ABI_ATTR *) (float)) callback_code) (f1);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 9
- fr = f_f2(f1,f2);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- PREP_CALLBACK(cif,f_f2_simulator,(void*)&f_f2);
- fr = ((float (ABI_ATTR *) (float,float)) callback_code) (f1,f2);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 10
- fr = f_f4(f1,f2,f3,f4);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- PREP_CALLBACK(cif,f_f4_simulator,(void*)&f_f4);
- fr = ((float (ABI_ATTR *) (float,float,float,float)) callback_code) (f1,f2,f3,f4);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 11
- fr = f_f8(f1,f2,f3,f4,f5,f6,f7,f8);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- PREP_CALLBACK(cif,f_f8_simulator,(void*)&f_f8);
- fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 12
- fr = f_f16(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- PREP_CALLBACK(cif,f_f16_simulator,(void*)&f_f16);
- fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 13
- fr = f_f24(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f22,f23,f24);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- PREP_CALLBACK(cif,f_f24_simulator,(void*)&f_f24);
- fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f22,f23,f24);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
- }
-
- /* double tests */
- { double dr;
-
-#if (!defined(DGTEST)) || DGTEST == 14
- dr = d_d(d1);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_d_simulator,(void*)&d_d);
- dr = ((double (ABI_ATTR *) (double)) callback_code) (d1);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 15
- dr = d_d2(d1,d2);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_d2_simulator,(void*)&d_d2);
- dr = ((double (ABI_ATTR *) (double,double)) callback_code) (d1,d2);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 16
- dr = d_d4(d1,d2,d3,d4);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_d4_simulator,(void*)&d_d4);
- dr = ((double (ABI_ATTR *) (double,double,double,double)) callback_code) (d1,d2,d3,d4);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 17
- dr = d_d8(d1,d2,d3,d4,d5,d6,d7,d8);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_d8_simulator,(void*)&d_d8);
- dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 18
- dr = d_d16(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_d16_simulator,(void*)&d_d16);
- dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
- }
-
- /* pointer tests */
- { void* vpr;
-
-#if (!defined(DGTEST)) || DGTEST == 19
- vpr = vp_vpdpcpsp(&uc1,&d2,str3,&I4);
- fprintf(out,"->0x%p\n",vpr);
- fflush(out);
- vpr = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_pointer, &ffi_type_pointer, &ffi_type_pointer, &ffi_type_pointer };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_pointer);
- PREP_CALLBACK(cif,vp_vpdpcpsp_simulator,(void*)&vp_vpdpcpsp);
- vpr = ((void* (ABI_ATTR *) (void*,double*,char*,Int*)) callback_code) (&uc1,&d2,str3,&I4);
- }
- FREE_CALLBACK();
- fprintf(out,"->0x%p\n",vpr);
- fflush(out);
-#endif
- }
-
- /* mixed number tests */
- { uchar ucr;
- ushort usr;
- float fr;
- double dr;
- long long llr;
-
-#if (!defined(DGTEST)) || DGTEST == 20
- ucr = uc_ucsil(uc1,us2,ui3,ul4);
- fprintf(out,"->%u\n",ucr);
- fflush(out);
- ucr = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_uchar, &ffi_type_ushort, &ffi_type_uint, &ffi_type_ulong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_uchar);
- PREP_CALLBACK(cif,uc_ucsil_simulator,(void*)&uc_ucsil);
- ucr = ((uchar (ABI_ATTR *) (uchar,ushort,uint,ulong)) callback_code) (uc1,us2,ui3,ul4);
- }
- FREE_CALLBACK();
- fprintf(out,"->%u\n",ucr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 21
- dr = d_iidd(i1,i2,d3,d4);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_double, &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_iidd_simulator,(void*)&d_iidd);
- dr = ((double (ABI_ATTR *) (int,int,double,double)) callback_code) (i1,i2,d3,d4);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 22
- dr = d_iiidi(i1,i2,i3,d4,i5);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_double, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_iiidi_simulator,(void*)&d_iiidi);
- dr = ((double (ABI_ATTR *) (int,int,int,double,int)) callback_code) (i1,i2,i3,d4,i5);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 23
- dr = d_idid(i1,d2,i3,d4);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_double, &ffi_type_sint, &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_idid_simulator,(void*)&d_idid);
- dr = ((double (ABI_ATTR *) (int,double,int,double)) callback_code) (i1,d2,i3,d4);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 24
- dr = d_fdi(f1,d2,i3);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_double, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_fdi_simulator,(void*)&d_fdi);
- dr = ((double (ABI_ATTR *) (float,double,int)) callback_code) (f1,d2,i3);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 25
- usr = us_cdcd(c1,d2,c3,d4);
- fprintf(out,"->%u\n",usr);
- fflush(out);
- usr = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_char, &ffi_type_double, &ffi_type_char, &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_ushort);
- PREP_CALLBACK(cif,us_cdcd_simulator,(void*)&us_cdcd);
- usr = ((ushort (ABI_ATTR *) (char,double,char,double)) callback_code) (c1,d2,c3,d4);
- }
- FREE_CALLBACK();
- fprintf(out,"->%u\n",usr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 26
- llr = ll_iiilli(i1,i2,i3,ll1,i13);
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
- llr = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_sint, &ffi_type_sint, &ffi_type_sint, &ffi_type_slonglong, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
- PREP_CALLBACK(cif,ll_iiilli_simulator,(void*)&ll_iiilli);
- llr = ((long long (ABI_ATTR *) (int,int,int,long long,int)) callback_code) (i1,i2,i3,ll1,i13);
- }
- FREE_CALLBACK();
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 27
- llr = ll_flli(f13,ll1,i13);
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
- llr = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_slonglong, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
- PREP_CALLBACK(cif,ll_flli_simulator,(void*)&ll_flli);
- llr = ((long long (ABI_ATTR *) (float,long long,int)) callback_code) (f13,ll1,i13);
- }
- FREE_CALLBACK();
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 28
- fr = f_fi(f1,i9);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- PREP_CALLBACK(cif,f_fi_simulator,(void*)&f_fi);
- fr = ((float (ABI_ATTR *) (float,int)) callback_code) (f1,i9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 29
- fr = f_f2i(f1,f2,i9);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- PREP_CALLBACK(cif,f_f2i_simulator,(void*)&f_f2i);
- fr = ((float (ABI_ATTR *) (float,float,int)) callback_code) (f1,f2,i9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 30
- fr = f_f3i(f1,f2,f3,i9);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- PREP_CALLBACK(cif,f_f3i_simulator,(void*)&f_f3i);
- fr = ((float (ABI_ATTR *) (float,float,float,int)) callback_code) (f1,f2,f3,i9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 31
- fr = f_f4i(f1,f2,f3,f4,i9);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- PREP_CALLBACK(cif,f_f4i_simulator,(void*)&f_f4i);
- fr = ((float (ABI_ATTR *) (float,float,float,float,int)) callback_code) (f1,f2,f3,f4,i9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 32
- fr = f_f7i(f1,f2,f3,f4,f5,f6,f7,i9);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- PREP_CALLBACK(cif,f_f7i_simulator,(void*)&f_f7i);
- fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,int)) callback_code) (f1,f2,f3,f4,f5,f6,f7,i9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 33
- fr = f_f8i(f1,f2,f3,f4,f5,f6,f7,f8,i9);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- PREP_CALLBACK(cif,f_f8i_simulator,(void*)&f_f8i);
- fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float,int)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8,i9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 34
- fr = f_f13i(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,i9);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- PREP_CALLBACK(cif,f_f13i_simulator,(void*)&f_f13i);
- fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float,float,float,float,float,float,int)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,i9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 35
- dr = d_di(d1,i9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_di_simulator,(void*)&d_di);
- dr = ((double (ABI_ATTR *) (double,int)) callback_code) (d1,i9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 36
- dr = d_d2i(d1,d2,i9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_d2i_simulator,(void*)&d_d2i);
- dr = ((double (ABI_ATTR *) (double,double,int)) callback_code) (d1,d2,i9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 37
- dr = d_d3i(d1,d2,d3,i9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_d3i_simulator,(void*)&d_d3i);
- dr = ((double (ABI_ATTR *) (double,double,double,int)) callback_code) (d1,d2,d3,i9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 38
- dr = d_d4i(d1,d2,d3,d4,i9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_d4i_simulator,(void*)&d_d4i);
- dr = ((double (ABI_ATTR *) (double,double,double,double,int)) callback_code) (d1,d2,d3,d4,i9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 39
- dr = d_d7i(d1,d2,d3,d4,d5,d6,d7,i9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_d7i_simulator,(void*)&d_d7i);
- dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,int)) callback_code) (d1,d2,d3,d4,d5,d6,d7,i9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 40
- dr = d_d8i(d1,d2,d3,d4,d5,d6,d7,d8,i9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_d8i_simulator,(void*)&d_d8i);
- dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double,int)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8,i9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 41
- dr = d_d12i(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,i9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_d12i_simulator,(void*)&d_d12i);
- dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double,double,double,double,double,int)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,i9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 42
- dr = d_d13i(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,i9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_sint };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_d13i_simulator,(void*)&d_d13i);
- dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double,double,double,double,double,double,int)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,i9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
- }
-
- /* small structure return tests */
-#if (!defined(DGTEST)) || DGTEST == 43
- {
- Size1 r = S1_v();
- fprintf(out,"->{%c}\n",r.x1);
- fflush(out);
- memset(&r,0,sizeof(r)); clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* ffi_type_Size1_elements[] = { &ffi_type_char, NULL };
- ffi_type ffi_type_Size1;
- ffi_type_Size1.type = FFI_TYPE_STRUCT;
- ffi_type_Size1.size = sizeof(Size1);
- ffi_type_Size1.alignment = alignof_slot(Size1);
- ffi_type_Size1.elements = ffi_type_Size1_elements;
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_Size1);
- PREP_CALLBACK(cif,S1_v_simulator,(void*)&S1_v);
- r = ((Size1 (ABI_ATTR *) (void)) callback_code) ();
- }
- FREE_CALLBACK();
- fprintf(out,"->{%c}\n",r.x1);
- fflush(out);
- }
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 44
- {
- Size2 r = S2_v();
- fprintf(out,"->{%c%c}\n",r.x1,r.x2);
- fflush(out);
- memset(&r,0,sizeof(r)); clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* ffi_type_Size2_elements[] = { &ffi_type_char, &ffi_type_char, NULL };
- ffi_type ffi_type_Size2;
- ffi_type_Size2.type = FFI_TYPE_STRUCT;
- ffi_type_Size2.size = sizeof(Size2);
- ffi_type_Size2.alignment = alignof_slot(Size2);
- ffi_type_Size2.elements = ffi_type_Size2_elements;
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_Size2);
- PREP_CALLBACK(cif,S2_v_simulator,(void*)&S2_v);
- r = ((Size2 (ABI_ATTR *) (void)) callback_code) ();
- }
- FREE_CALLBACK();
- fprintf(out,"->{%c%c}\n",r.x1,r.x2);
- fflush(out);
- }
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 45
- {
- Size3 r = S3_v();
- fprintf(out,"->{%c%c%c}\n",r.x1,r.x2,r.x3);
- fflush(out);
- memset(&r,0,sizeof(r)); clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* ffi_type_Size3_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
- ffi_type ffi_type_Size3;
- ffi_type_Size3.type = FFI_TYPE_STRUCT;
- ffi_type_Size3.size = sizeof(Size3);
- ffi_type_Size3.alignment = alignof_slot(Size3);
- ffi_type_Size3.elements = ffi_type_Size3_elements;
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_Size3);
- PREP_CALLBACK(cif,S3_v_simulator,(void*)&S3_v);
- r = ((Size3 (ABI_ATTR *) (void)) callback_code) ();
- }
- FREE_CALLBACK();
- fprintf(out,"->{%c%c%c}\n",r.x1,r.x2,r.x3);
- fflush(out);
- }
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 46
- {
- Size4 r = S4_v();
- fprintf(out,"->{%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4);
- fflush(out);
- memset(&r,0,sizeof(r)); clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* ffi_type_Size4_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
- ffi_type ffi_type_Size4;
- ffi_type_Size4.type = FFI_TYPE_STRUCT;
- ffi_type_Size4.size = sizeof(Size4);
- ffi_type_Size4.alignment = alignof_slot(Size4);
- ffi_type_Size4.elements = ffi_type_Size4_elements;
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_Size4);
- PREP_CALLBACK(cif,S4_v_simulator,(void*)&S4_v);
- r = ((Size4 (ABI_ATTR *) (void)) callback_code) ();
- }
- FREE_CALLBACK();
- fprintf(out,"->{%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4);
- fflush(out);
- }
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 47
- {
- Size7 r = S7_v();
- fprintf(out,"->{%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7);
- fflush(out);
- memset(&r,0,sizeof(r)); clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* ffi_type_Size7_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
- ffi_type ffi_type_Size7;
- ffi_type_Size7.type = FFI_TYPE_STRUCT;
- ffi_type_Size7.size = sizeof(Size7);
- ffi_type_Size7.alignment = alignof_slot(Size7);
- ffi_type_Size7.elements = ffi_type_Size7_elements;
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_Size7);
- PREP_CALLBACK(cif,S7_v_simulator,(void*)&S7_v);
- r = ((Size7 (ABI_ATTR *) (void)) callback_code) ();
- }
- FREE_CALLBACK();
- fprintf(out,"->{%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7);
- fflush(out);
- }
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 48
- {
- Size8 r = S8_v();
- fprintf(out,"->{%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8);
- fflush(out);
- memset(&r,0,sizeof(r)); clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* ffi_type_Size8_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
- ffi_type ffi_type_Size8;
- ffi_type_Size8.type = FFI_TYPE_STRUCT;
- ffi_type_Size8.size = sizeof(Size8);
- ffi_type_Size8.alignment = alignof_slot(Size8);
- ffi_type_Size8.elements = ffi_type_Size8_elements;
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_Size8);
- PREP_CALLBACK(cif,S8_v_simulator,(void*)&S8_v);
- r = ((Size8 (ABI_ATTR *) (void)) callback_code) ();
- }
- FREE_CALLBACK();
- fprintf(out,"->{%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8);
- fflush(out);
- }
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 49
- {
- Size12 r = S12_v();
- fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12);
- fflush(out);
- memset(&r,0,sizeof(r)); clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* ffi_type_Size12_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
- ffi_type ffi_type_Size12;
- ffi_type_Size12.type = FFI_TYPE_STRUCT;
- ffi_type_Size12.size = sizeof(Size12);
- ffi_type_Size12.alignment = alignof_slot(Size12);
- ffi_type_Size12.elements = ffi_type_Size12_elements;
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_Size12);
- PREP_CALLBACK(cif,S12_v_simulator,(void*)&S12_v);
- r = ((Size12 (ABI_ATTR *) (void)) callback_code) ();
- }
- FREE_CALLBACK();
- fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12);
- fflush(out);
- }
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 50
- {
- Size15 r = S15_v();
- fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15);
- fflush(out);
- memset(&r,0,sizeof(r)); clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* ffi_type_Size15_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
- ffi_type ffi_type_Size15;
- ffi_type_Size15.type = FFI_TYPE_STRUCT;
- ffi_type_Size15.size = sizeof(Size15);
- ffi_type_Size15.alignment = alignof_slot(Size15);
- ffi_type_Size15.elements = ffi_type_Size15_elements;
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_Size15);
- PREP_CALLBACK(cif,S15_v_simulator,(void*)&S15_v);
- r = ((Size15 (ABI_ATTR *) (void)) callback_code) ();
- }
- FREE_CALLBACK();
- fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15);
- fflush(out);
- }
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 51
- {
- Size16 r = S16_v();
- fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15,r.x16);
- fflush(out);
- memset(&r,0,sizeof(r)); clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* ffi_type_Size16_elements[] = { &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, &ffi_type_char, NULL };
- ffi_type ffi_type_Size16;
- ffi_type_Size16.type = FFI_TYPE_STRUCT;
- ffi_type_Size16.size = sizeof(Size16);
- ffi_type_Size16.alignment = alignof_slot(Size16);
- ffi_type_Size16.elements = ffi_type_Size16_elements;
- ffi_cif cif;
- FFI_PREP_CIF_NOARGS(cif,ffi_type_Size16);
- PREP_CALLBACK(cif,S16_v_simulator,(void*)&S16_v);
- r = ((Size16 (ABI_ATTR *) (void)) callback_code) ();
- }
- FREE_CALLBACK();
- fprintf(out,"->{%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c}\n",r.x1,r.x2,r.x3,r.x4,r.x5,r.x6,r.x7,r.x8,r.x9,r.x10,r.x11,r.x12,r.x13,r.x14,r.x15,r.x16);
- fflush(out);
- }
-#endif
-
-
- /* structure tests */
- { Int Ir;
- Char Cr;
- Float Fr;
- Double Dr;
- J Jr;
-#ifndef SKIP_EXTRA_STRUCTS
- T Tr;
- X Xr;
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 52
- Ir = I_III(I1,I2,I3);
- fprintf(out,"->{%d}\n",Ir.x);
- fflush(out);
- Ir.x = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* ffi_type_Int_elements[] = { &ffi_type_sint, NULL };
- ffi_type ffi_type_Int;
- ffi_type_Int.type = FFI_TYPE_STRUCT;
- ffi_type_Int.size = sizeof(Int);
- ffi_type_Int.alignment = alignof_slot(Int);
- ffi_type_Int.elements = ffi_type_Int_elements;
- ffi_type* argtypes[] = { &ffi_type_Int, &ffi_type_Int, &ffi_type_Int };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_Int);
- PREP_CALLBACK(cif,I_III_simulator,(void*)&I_III);
- Ir = ((Int (ABI_ATTR *) (Int,Int,Int)) callback_code) (I1,I2,I3);
- }
- FREE_CALLBACK();
- fprintf(out,"->{%d}\n",Ir.x);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 53
- Cr = C_CdC(C1,d2,C3);
- fprintf(out,"->{'%c'}\n",Cr.x);
- fflush(out);
- Cr.x = '\0'; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* ffi_type_Char_elements[] = { &ffi_type_char, NULL };
- ffi_type ffi_type_Char;
- ffi_type_Char.type = FFI_TYPE_STRUCT;
- ffi_type_Char.size = sizeof(Char);
- ffi_type_Char.alignment = alignof_slot(Char);
- ffi_type_Char.elements = ffi_type_Char_elements;
- ffi_type* argtypes[] = { &ffi_type_Char, &ffi_type_double, &ffi_type_Char };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_Char);
- PREP_CALLBACK(cif,C_CdC_simulator,(void*)&C_CdC);
- Cr = ((Char (ABI_ATTR *) (Char,double,Char)) callback_code) (C1,d2,C3);
- }
- FREE_CALLBACK();
- fprintf(out,"->{'%c'}\n",Cr.x);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 54
- Fr = F_Ffd(F1,f2,d3);
- fprintf(out,"->{%g}\n",Fr.x);
- fflush(out);
- Fr.x = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* ffi_type_Float_elements[] = { &ffi_type_float, NULL };
- ffi_type ffi_type_Float;
- ffi_type_Float.type = FFI_TYPE_STRUCT;
- ffi_type_Float.size = sizeof(Float);
- ffi_type_Float.alignment = alignof_slot(Float);
- ffi_type_Float.elements = ffi_type_Float_elements;
- ffi_type* argtypes[] = { &ffi_type_Float, &ffi_type_float, &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_Float);
- PREP_CALLBACK(cif,F_Ffd_simulator,(void*)&F_Ffd);
- Fr = ((Float (ABI_ATTR *) (Float,float,double)) callback_code) (F1,f2,d3);
- }
- FREE_CALLBACK();
- fprintf(out,"->{%g}\n",Fr.x);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 55
- Dr = D_fDd(f1,D2,d3);
- fprintf(out,"->{%g}\n",Dr.x);
- fflush(out);
- Dr.x = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* ffi_type_Double_elements[] = { &ffi_type_double, NULL };
- ffi_type ffi_type_Double;
- ffi_type_Double.type = FFI_TYPE_STRUCT;
- ffi_type_Double.size = sizeof(Double);
- ffi_type_Double.alignment = alignof_slot(Double);
- ffi_type_Double.elements = ffi_type_Double_elements;
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_Double, &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_Double);
- PREP_CALLBACK(cif,D_fDd_simulator,(void*)&D_fDd);
- Dr = ((Double (ABI_ATTR *) (float,Double,double)) callback_code) (f1,D2,d3);
- }
- FREE_CALLBACK();
- fprintf(out,"->{%g}\n",Dr.x);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 56
- Dr = D_Dfd(D1,f2,d3);
- fprintf(out,"->{%g}\n",Dr.x);
- fflush(out);
- Dr.x = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* ffi_type_Double_elements[] = { &ffi_type_double, NULL };
- ffi_type ffi_type_Double;
- ffi_type_Double.type = FFI_TYPE_STRUCT;
- ffi_type_Double.size = sizeof(Double);
- ffi_type_Double.alignment = alignof_slot(Double);
- ffi_type_Double.elements = ffi_type_Double_elements;
- ffi_type* argtypes[] = { &ffi_type_Double, &ffi_type_float, &ffi_type_double };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_Double);
- PREP_CALLBACK(cif,D_Dfd_simulator,(void*)&D_Dfd);
- Dr = ((Double (ABI_ATTR *) (Double,float,double)) callback_code) (D1,f2,d3);
- }
- FREE_CALLBACK();
- fprintf(out,"->{%g}\n",Dr.x);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 57
- Jr = J_JiJ(J1,i2,J2);
- fprintf(out,"->{%ld,%ld}\n",Jr.l1,Jr.l2);
- fflush(out);
- Jr.l1 = Jr.l2 = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* ffi_type_J_elements[] = { &ffi_type_slong, &ffi_type_slong, NULL };
- ffi_type ffi_type_J;
- ffi_type_J.type = FFI_TYPE_STRUCT;
- ffi_type_J.size = sizeof(J);
- ffi_type_J.alignment = alignof_slot(J);
- ffi_type_J.elements = ffi_type_J_elements;
- ffi_type* argtypes[] = { &ffi_type_J, &ffi_type_sint, &ffi_type_J };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_J);
- PREP_CALLBACK(cif,J_JiJ_simulator,(void*)&J_JiJ);
- Jr = ((J (ABI_ATTR *) (J,int,J)) callback_code) (J1,i2,J2);
- }
- FREE_CALLBACK();
- fprintf(out,"->{%ld,%ld}\n",Jr.l1,Jr.l2);
- fflush(out);
-#endif
-
-#ifndef SKIP_EXTRA_STRUCTS
-#if (!defined(DGTEST)) || DGTEST == 58
- Tr = T_TcT(T1,' ',T2);
- fprintf(out,"->{\"%c%c%c\"}\n",Tr.c[0],Tr.c[1],Tr.c[2]);
- fflush(out);
- Tr.c[0] = Tr.c[1] = Tr.c[2] = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* ffi_type_T_elements[] = { ??, NULL };
- ffi_type ffi_type_T;
- ffi_type_T.type = FFI_TYPE_STRUCT;
- ffi_type_T.size = sizeof(T);
- ffi_type_T.alignment = alignof_slot(T);
- ffi_type_T.elements = ffi_type_T_elements;
- ffi_type* argtypes[] = { &ffi_type_T, &ffi_type_char, &ffi_type_T };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_T);
- PREP_CALLBACK(cif,T_TcT_simulator,(void*)&T_TcT);
- Tr = ((T (ABI_ATTR *) (T,char,T)) callback_code) (T1,' ',T2);
- }
- FREE_CALLBACK();
- fprintf(out,"->{\"%c%c%c\"}\n",Tr.c[0],Tr.c[1],Tr.c[2]);
- fflush(out);
-#endif
-
-#ifndef SKIP_X
-#if (!defined(DGTEST)) || DGTEST == 59
- Xr = X_BcdB(B1,c2,d3,B2);
- fprintf(out,"->{\"%s\",'%c'}\n",Xr.c,Xr.c1);
- fflush(out);
- Xr.c[0]=Xr.c1='\0'; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* ffi_type_X_elements[] = { ??, NULL };
- ffi_type ffi_type_X;
- ffi_type_X.type = FFI_TYPE_STRUCT;
- ffi_type_X.size = sizeof(X);
- ffi_type_X.alignment = alignof_slot(X);
- ffi_type_X.elements = ffi_type_X_elements;
- ffi_type* argtypes[] = { &ffi_type_X, &ffi_type_char, &ffi_type_double, &ffi_type_X };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_X);
- PREP_CALLBACK(cif,X_BcdB_simulator,(void*)&X_BcdB);
- Xr = ((X (ABI_ATTR *) (B,char,double,B)) callback_code) (B1,c2,d3,B2);
- }
- FREE_CALLBACK();
- fprintf(out,"->{\"%s\",'%c'}\n",Xr.c,Xr.c1);
- fflush(out);
-#endif
-#endif
-#endif
- }
-
-
- /* gpargs boundary tests */
- {
- ffi_type* ffi_type_K_elements[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, NULL };
- ffi_type ffi_type_K;
- ffi_type* ffi_type_L_elements[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, NULL };
- ffi_type ffi_type_L;
- long lr;
- long long llr;
- float fr;
- double dr;
-
- ffi_type_K.type = FFI_TYPE_STRUCT;
- ffi_type_K.size = sizeof(K);
- ffi_type_K.alignment = alignof_slot(K);
- ffi_type_K.elements = ffi_type_K_elements;
-
- ffi_type_L.type = FFI_TYPE_STRUCT;
- ffi_type_L.size = sizeof(L);
- ffi_type_L.alignment = alignof_slot(L);
- ffi_type_L.elements = ffi_type_L_elements;
-
-#if (!defined(DGTEST)) || DGTEST == 60
- lr = l_l0K(K1,l9);
- fprintf(out,"->%ld\n",lr);
- fflush(out);
- lr = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_K, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
- PREP_CALLBACK(cif,l_l0K_simulator,(void*)l_l0K);
- lr = ((long (ABI_ATTR *) (K,long)) callback_code) (K1,l9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%ld\n",lr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 61
- lr = l_l1K(l1,K1,l9);
- fprintf(out,"->%ld\n",lr);
- fflush(out);
- lr = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
- PREP_CALLBACK(cif,l_l1K_simulator,(void*)l_l1K);
- lr = ((long (ABI_ATTR *) (long,K,long)) callback_code) (l1,K1,l9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%ld\n",lr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 62
- lr = l_l2K(l1,l2,K1,l9);
- fprintf(out,"->%ld\n",lr);
- fflush(out);
- lr = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
- PREP_CALLBACK(cif,l_l2K_simulator,(void*)l_l2K);
- lr = ((long (ABI_ATTR *) (long,long,K,long)) callback_code) (l1,l2,K1,l9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%ld\n",lr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 63
- lr = l_l3K(l1,l2,l3,K1,l9);
- fprintf(out,"->%ld\n",lr);
- fflush(out);
- lr = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
- PREP_CALLBACK(cif,l_l3K_simulator,(void*)l_l3K);
- lr = ((long (ABI_ATTR *) (long,long,long,K,long)) callback_code) (l1,l2,l3,K1,l9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%ld\n",lr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 64
- lr = l_l4K(l1,l2,l3,l4,K1,l9);
- fprintf(out,"->%ld\n",lr);
- fflush(out);
- lr = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
- PREP_CALLBACK(cif,l_l4K_simulator,(void*)l_l4K);
- lr = ((long (ABI_ATTR *) (long,long,long,long,K,long)) callback_code) (l1,l2,l3,l4,K1,l9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%ld\n",lr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 65
- lr = l_l5K(l1,l2,l3,l4,l5,K1,l9);
- fprintf(out,"->%ld\n",lr);
- fflush(out);
- lr = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
- PREP_CALLBACK(cif,l_l5K_simulator,(void*)l_l5K);
- lr = ((long (ABI_ATTR *) (long,long,long,long,long,K,long)) callback_code) (l1,l2,l3,l4,l5,K1,l9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%ld\n",lr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 66
- lr = l_l6K(l1,l2,l3,l4,l5,l6,K1,l9);
- fprintf(out,"->%ld\n",lr);
- fflush(out);
- lr = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_K, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slong);
- PREP_CALLBACK(cif,l_l6K_simulator,(void*)l_l6K);
- lr = ((long (ABI_ATTR *) (long,long,long,long,long,long,K,long)) callback_code) (l1,l2,l3,l4,l5,l6,K1,l9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%ld\n",lr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 67
- fr = f_f17l3L(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,l6,l7,l8,L1);
- fprintf(out,"->%g\n",fr);
- fflush(out);
- fr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_float, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_L };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_float);
- PREP_CALLBACK(cif,f_f17l3L_simulator,(void*)&f_f17l3L);
- fr = ((float (ABI_ATTR *) (float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,long,long,long,L)) callback_code) (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,l6,l7,l8,L1);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",fr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 68
- dr = d_d17l3L(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16,d17,l6,l7,l8,L1);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_double, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_L };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_d17l3L_simulator,(void*)&d_d17l3L);
- dr = ((double (ABI_ATTR *) (double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,long,long,long,L)) callback_code) (d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16,d17,l6,l7,l8,L1);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 69
- llr = ll_l2ll(l1,l2,ll1,l9);
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
- llr = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
- PREP_CALLBACK(cif,ll_l2ll_simulator,(void*)ll_l2ll);
- llr = ((long long (ABI_ATTR *) (long,long,long long,long)) callback_code) (l1,l2,ll1,l9);
- }
- FREE_CALLBACK();
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 70
- llr = ll_l3ll(l1,l2,l3,ll1,l9);
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
- llr = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
- PREP_CALLBACK(cif,ll_l3ll_simulator,(void*)ll_l3ll);
- llr = ((long long (ABI_ATTR *) (long,long,long,long long,long)) callback_code) (l1,l2,l3,ll1,l9);
- }
- FREE_CALLBACK();
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 71
- llr = ll_l4ll(l1,l2,l3,l4,ll1,l9);
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
- llr = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
- PREP_CALLBACK(cif,ll_l4ll_simulator,(void*)ll_l4ll);
- llr = ((long long (ABI_ATTR *) (long,long,long,long,long long,long)) callback_code) (l1,l2,l3,l4,ll1,l9);
- }
- FREE_CALLBACK();
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 72
- llr = ll_l5ll(l1,l2,l3,l4,l5,ll1,l9);
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
- llr = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
- PREP_CALLBACK(cif,ll_l5ll_simulator,(void*)ll_l5ll);
- llr = ((long long (ABI_ATTR *) (long,long,long,long,long,long long,long)) callback_code) (l1,l2,l3,l4,l5,ll1,l9);
- }
- FREE_CALLBACK();
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 73
- llr = ll_l6ll(l1,l2,l3,l4,l5,l6,ll1,l9);
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
- llr = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
- PREP_CALLBACK(cif,ll_l6ll_simulator,(void*)ll_l6ll);
- llr = ((long long (ABI_ATTR *) (long,long,long,long,long,long,long long,long)) callback_code) (l1,l2,l3,l4,l5,l6,ll1,l9);
- }
- FREE_CALLBACK();
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 74
- llr = ll_l7ll(l1,l2,l3,l4,l5,l6,l7,ll1,l9);
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
- llr = 0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slonglong, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_slonglong);
- PREP_CALLBACK(cif,ll_l7ll_simulator,(void*)ll_l7ll);
- llr = ((long long (ABI_ATTR *) (long,long,long,long,long,long,long,long long,long)) callback_code) (l1,l2,l3,l4,l5,l6,l7,ll1,l9);
- }
- FREE_CALLBACK();
- fprintf(out,"->0x%lx%08lx\n",(long)(llr>>32),(long)(llr&0xffffffff));
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 75
- dr = d_l2d(l1,l2,ll1,l9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_l2d_simulator,(void*)d_l2d);
- dr = ((double (ABI_ATTR *) (long,long,double,long)) callback_code) (l1,l2,ll1,l9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 76
- dr = d_l3d(l1,l2,l3,ll1,l9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_l3d_simulator,(void*)d_l3d);
- dr = ((double (ABI_ATTR *) (long,long,long,double,long)) callback_code) (l1,l2,l3,ll1,l9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 77
- dr = d_l4d(l1,l2,l3,l4,ll1,l9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_l4d_simulator,(void*)d_l4d);
- dr = ((double (ABI_ATTR *) (long,long,long,long,double,long)) callback_code) (l1,l2,l3,l4,ll1,l9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 78
- dr = d_l5d(l1,l2,l3,l4,l5,ll1,l9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_l5d_simulator,(void*)d_l5d);
- dr = ((double (ABI_ATTR *) (long,long,long,long,long,double,long)) callback_code) (l1,l2,l3,l4,l5,ll1,l9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 79
- dr = d_l6d(l1,l2,l3,l4,l5,l6,ll1,l9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_l6d_simulator,(void*)d_l6d);
- dr = ((double (ABI_ATTR *) (long,long,long,long,long,long,double,long)) callback_code) (l1,l2,l3,l4,l5,l6,ll1,l9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
-#if (!defined(DGTEST)) || DGTEST == 80
- dr = d_l7d(l1,l2,l3,l4,l5,l6,l7,ll1,l9);
- fprintf(out,"->%g\n",dr);
- fflush(out);
- dr = 0.0; clear_traces();
- ALLOC_CALLBACK();
- {
- ffi_type* argtypes[] = { &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_slong, &ffi_type_double, &ffi_type_slong };
- ffi_cif cif;
- FFI_PREP_CIF(cif,argtypes,ffi_type_double);
- PREP_CALLBACK(cif,d_l7d_simulator,(void*)d_l7d);
- dr = ((double (ABI_ATTR *) (long,long,long,long,long,long,long,double,long)) callback_code) (l1,l2,l3,l4,l5,l6,l7,ll1,l9);
- }
- FREE_CALLBACK();
- fprintf(out,"->%g\n",dr);
- fflush(out);
-#endif
-
- }
-
- exit(0);
-}
-
diff --git a/deps/libffi/testsuite/libffi.bhaible/testcases.c b/deps/libffi/testsuite/libffi.bhaible/testcases.c
deleted file mode 100644
index 22cf1ebb5cc..00000000000
--- a/deps/libffi/testsuite/libffi.bhaible/testcases.c
+++ /dev/null
@@ -1,747 +0,0 @@
-/*
- * Copyright 1993 Bill Triggs <Bill.Triggs@inrialpes.fr>
- * Copyright 1995-2017 Bruno Haible <bruno@clisp.org>
- *
- * This program 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 3 of the License, or
- * (at your option) any later version.
- *
- * This program 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, see <http://www.gnu.org/licenses/>.
- */
-
-/* This file defines test functions of selected signatures, that exercise
- dark corners of the various ABIs. */
-
-#include <stdio.h>
-
-FILE* out = NULL;
-
-#define uchar unsigned char
-#define ushort unsigned short
-#define uint unsigned int
-#define ulong unsigned long
-
-typedef struct { char x; } Char;
-typedef struct { short x; } Short;
-typedef struct { int x; } Int;
-typedef struct { long x; } Long;
-typedef struct { float x; } Float;
-typedef struct { double x; } Double;
-typedef struct { char c; float f; } A;
-typedef struct { double d; int i[3]; } B;
-typedef struct { long l1; long l2; } J;
-typedef struct { long l1; long l2; long l3; long l4; } K;
-typedef struct { long l1; long l2; long l3; long l4; long l5; long l6; } L;
-typedef struct { char x1; } Size1;
-typedef struct { char x1; char x2; } Size2;
-typedef struct { char x1; char x2; char x3; } Size3;
-typedef struct { char x1; char x2; char x3; char x4; } Size4;
-typedef struct {
- char x1; char x2; char x3; char x4; char x5; char x6; char x7;
-} Size7;
-typedef struct {
- char x1; char x2; char x3; char x4; char x5; char x6; char x7; char x8;
-} Size8;
-typedef struct {
- char x1; char x2; char x3; char x4; char x5; char x6; char x7; char x8;
- char x9; char x10; char x11; char x12;
-} Size12;
-typedef struct {
- char x1; char x2; char x3; char x4; char x5; char x6; char x7; char x8;
- char x9; char x10; char x11; char x12; char x13; char x14; char x15;
-} Size15;
-typedef struct {
- char x1; char x2; char x3; char x4; char x5; char x6; char x7; char x8;
- char x9; char x10; char x11; char x12; char x13; char x14; char x15; char x16;
-} Size16;
-typedef struct { char c[3]; } T;
-typedef struct { char c[33],c1; } X;
-
-/* Don't use a number over 127, as some systems use signed chars and
- the test case 25 doesn't account for this, resulting in undefined
- behavior. See https://github.com/libffi/libffi/issues/598. */
-char c1='a', c2=127, c3=(char)1;
-
-short s1=32767, s2=(short)32768, s3=3, s4=4, s5=5, s6=6, s7=7, s8=8, s9=9;
-int i1=1, i2=2, i3=3, i4=4, i5=5, i6=6, i7=7, i8=8, i9=9,
- i10=11, i11=12, i12=13, i13=14, i14=15, i15=16, i16=17;
-long l1=1, l2=2, l3=3, l4=4, l5=5, l6=6, l7=7, l8=8, l9=9;
-long long ll1 = 3875056143130689530LL;
-float f1=0.1f, f2=0.2f, f3=0.3f, f4=0.4f, f5=0.5f, f6=0.6f, f7=0.7f, f8=0.8f, f9=0.9f,
- f10=1.1f, f11=1.2f, f12=1.3f, f13=1.4f, f14=1.5f, f15=1.6f, f16=1.7f, f17=1.8f,
- f18=1.9f, f19=2.1f, f20=2.2f, f21=2.3f, f22=2.4f, f23=2.5f, f24=2.6f;
-double d1=0.1, d2=0.2, d3=0.3, d4=0.4, d5=0.5, d6=0.6, d7=0.7, d8=0.8, d9=0.9,
- d10=1.1, d11=1.2, d12=1.3, d13=1.4, d14=1.5, d15=1.6, d16=1.7, d17=1.8;
-
-uchar uc1='a', uc2=127, uc3=128, uc4=255, uc5=(uchar)-1;
-ushort us1=1, us2=2, us3=3, us4=4, us5=5, us6=6, us7=7, us8=8, us9=9;
-uint ui1=1, ui2=2, ui3=3, ui4=4, ui5=5, ui6=6, ui7=7, ui8=8, ui9=9;
-ulong ul1=1, ul2=2, ul3=3, ul4=4, ul5=5, ul6=6, ul7=7, ul8=8, ul9=9;
-
-char *str1="hello",str2[]="goodbye",*str3="still here?";
-Char C1={'A'}, C2={'B'}, C3={'C'}, C4={'\377'}, C5={(char)(-1)};
-Short S1={1}, S2={2}, S3={3}, S4={4}, S5={5}, S6={6}, S7={7}, S8={8}, S9={9};
-Int I1={1}, I2={2}, I3={3}, I4={4}, I5={5}, I6={6}, I7={7}, I8={8}, I9={9};
-Float F1={0.1f}, F2={0.2f}, F3={0.3f}, F4={0.4f}, F5={0.5f}, F6={0.6f}, F7={0.7f}, F8={0.8f}, F9={0.9f};
-Double D1={0.1}, D2={0.2}, D3={0.3}, D4={0.4}, D5={0.5}, D6={0.6}, D7={0.7}, D8={0.8}, D9={0.9};
-
-A A1={'a',0.1f},A2={'b',0.2f},A3={'\377',0.3f};
-B B1={0.1,{1,2,3}},B2={0.2,{5,4,3}};
-J J1={47,11},J2={73,55};
-K K1={19,69,12,28};
-L L1={561,1105,1729,2465,2821,6601}; /* A002997 */
-Size1 Size1_1={'a'};
-Size2 Size2_1={'a','b'};
-Size3 Size3_1={'a','b','c'};
-Size4 Size4_1={'a','b','c','d'};
-Size7 Size7_1={'a','b','c','d','e','f','g'};
-Size8 Size8_1={'a','b','c','d','e','f','g','h'};
-Size12 Size12_1={'a','b','c','d','e','f','g','h','i','j','k','l'};
-Size15 Size15_1={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o'};
-Size16 Size16_1={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p'};
-T T1={{'t','h','e'}},T2={{'f','o','x'}};
-X X1={"abcdefghijklmnopqrstuvwxyzABCDEF",'G'}, X2={"123",'9'}, X3={"return-return-return",'R'};
-
-#if defined(__GNUC__)
-#define __STDCALL__ __attribute__((stdcall))
-#define __THISCALL__ __attribute__((thiscall))
-#define __FASTCALL__ __attribute__((fastcall))
-#define __MSABI__ __attribute__((ms_abi))
-#else
-#define __STDCALL__ __stdcall
-#define __THISCALL__ __thiscall
-#define __FASTCALL__ __fastcall
-#endif
-
-#ifndef ABI_ATTR
-#define ABI_ATTR
-#endif
-
-/* void tests */
-void ABI_ATTR v_v (void)
-{
- fprintf(out,"void f(void):\n");
- fflush(out);
-}
-
-/* int tests */
-int ABI_ATTR i_v (void)
-{
- int r=99;
- fprintf(out,"int f(void):");
- fflush(out);
- return r;
-}
-int ABI_ATTR i_i (int a)
-{
- int r=a+1;
- fprintf(out,"int f(int):(%d)",a);
- fflush(out);
- return r;
-}
-int ABI_ATTR i_i2 (int a, int b)
-{
- int r=a+b;
- fprintf(out,"int f(2*int):(%d,%d)",a,b);
- fflush(out);
- return r;
-}
-int ABI_ATTR i_i4 (int a, int b, int c, int d)
-{
- int r=a+b+c+d;
- fprintf(out,"int f(4*int):(%d,%d,%d,%d)",a,b,c,d);
- fflush(out);
- return r;
-}
-int ABI_ATTR i_i8 (int a, int b, int c, int d, int e, int f, int g, int h)
-{
- int r=a+b+c+d+e+f+g+h;
- fprintf(out,"int f(8*int):(%d,%d,%d,%d,%d,%d,%d,%d)",a,b,c,d,e,f,g,h);
- fflush(out);
- return r;
-}
-int ABI_ATTR i_i16 (int a, int b, int c, int d, int e, int f, int g, int h,
- int i, int j, int k, int l, int m, int n, int o, int p)
-{
- int r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p;
- fprintf(out,"int f(16*int):(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)",
- a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);
- fflush(out);
- return r;
-}
-
-/* float tests */
-float ABI_ATTR f_f (float a)
-{
- float r=a+1.0f;
- fprintf(out,"float f(float):(%g)",a);
- fflush(out);
- return r;
-}
-float ABI_ATTR f_f2 (float a, float b)
-{
- float r=a+b;
- fprintf(out,"float f(2*float):(%g,%g)",a,b);
- fflush(out);
- return r;
-}
-float ABI_ATTR f_f4 (float a, float b, float c, float d)
-{
- float r=a+b+c+d;
- fprintf(out,"float f(4*float):(%g,%g,%g,%g)",a,b,c,d);
- fflush(out);
- return r;
-}
-float ABI_ATTR f_f8 (float a, float b, float c, float d, float e, float f,
- float g, float h)
-{
- float r=a+b+c+d+e+f+g+h;
- fprintf(out,"float f(8*float):(%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h);
- fflush(out);
- return r;
-}
-float ABI_ATTR f_f16 (float a, float b, float c, float d, float e, float f, float g, float h,
- float i, float j, float k, float l, float m, float n, float o, float p)
-{
- float r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p;
- fprintf(out,"float f(16*float):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);
- fflush(out);
- return r;
-}
-float ABI_ATTR f_f24 (float a, float b, float c, float d, float e, float f, float g, float h,
- float i, float j, float k, float l, float m, float n, float o, float p,
- float q, float s, float t, float u, float v, float w, float x, float y)
-{
- float r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+v+w+x+y;
- fprintf(out,"float f(24*float):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,v,w,x,y);
- fflush(out);
- return r;
-}
-
-/* double tests */
-double ABI_ATTR d_d (double a)
-{
- double r=a+1.0;
- fprintf(out,"double f(double):(%g)",a);
- fflush(out);
- return r;
-}
-double ABI_ATTR d_d2 (double a, double b)
-{
- double r=a+b;
- fprintf(out,"double f(2*double):(%g,%g)",a,b);
- fflush(out);
- return r;
-}
-double ABI_ATTR d_d4 (double a, double b, double c, double d)
-{
- double r=a+b+c+d;
- fprintf(out,"double f(4*double):(%g,%g,%g,%g)",a,b,c,d);
- fflush(out);
- return r;
-}
-double ABI_ATTR d_d8 (double a, double b, double c, double d, double e, double f,
- double g, double h)
-{
- double r=a+b+c+d+e+f+g+h;
- fprintf(out,"double f(8*double):(%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h);
- fflush(out);
- return r;
-}
-double ABI_ATTR d_d16 (double a, double b, double c, double d, double e, double f,
- double g, double h, double i, double j, double k, double l,
- double m, double n, double o, double p)
-{
- double r=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p;
- fprintf(out,"double f(16*double):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);
- fflush(out);
- return r;
-}
-
-/* pointer tests */
-void* ABI_ATTR vp_vpdpcpsp (void* a, double* b, char* c, Int* d)
-{
- void* ret = (char*)b + 1;
- fprintf(out,"void* f(void*,double*,char*,Int*):(0x%p,0x%p,0x%p,0x%p)",a,b,c,d);
- fflush(out);
- return ret;
-}
-
-/* mixed number tests */
-uchar ABI_ATTR uc_ucsil (uchar a, ushort b, uint c, ulong d)
-{
- uchar r = (uchar)-1;
- fprintf(out,"uchar f(uchar,ushort,uint,ulong):(%u,%u,%u,%lu)",a,b,c,d);
- fflush(out);
- return r;
-}
-double ABI_ATTR d_iidd (int a, int b, double c, double d)
-{
- double r = a+b+c+d;
- fprintf(out,"double f(int,int,double,double):(%d,%d,%g,%g)",a,b,c,d);
- fflush(out);
- return r;
-}
-double ABI_ATTR d_iiidi (int a, int b, int c, double d, int e)
-{
- double r = a+b+c+d+e;
- fprintf(out,"double f(int,int,int,double,int):(%d,%d,%d,%g,%d)",a,b,c,d,e);
- fflush(out);
- return r;
-}
-double ABI_ATTR d_idid (int a, double b, int c, double d)
-{
- double r = a+b+c+d;
- fprintf(out,"double f(int,double,int,double):(%d,%g,%d,%g)",a,b,c,d);
- fflush(out);
- return r;
-}
-double ABI_ATTR d_fdi (float a, double b, int c)
-{
- double r = a+b+c;
- fprintf(out,"double f(float,double,int):(%g,%g,%d)",a,b,c);
- fflush(out);
- return r;
-}
-ushort ABI_ATTR us_cdcd (char a, double b, char c, double d)
-{
- ushort r = (ushort)(a + b + c + d);
- fprintf(out,"ushort f(char,double,char,double):('%c',%g,'%c',%g)",a,b,c,d);
- fflush(out);
- return r;
-}
-
-long long ABI_ATTR ll_iiilli (int a, int b, int c, long long d, int e)
-{
- long long r = (long long)(int)a+(long long)(int)b+(long long)(int)c+d+(long long)(int)e;
- fprintf(out,"long long f(int,int,int,long long,int):(%d,%d,%d,0x%lx%08lx,%d)",a,b,c,(long)(d>>32),(long)(d&0xffffffff),e);
- fflush(out);
- return r;
-}
-long long ABI_ATTR ll_flli (float a, long long b, int c)
-{
- long long r = (long long)(int)a + b + (long long)c;
- fprintf(out,"long long f(float,long long,int):(%g,0x%lx%08lx,0x%lx)",a,(long)(b>>32),(long)(b&0xffffffff),(long)c);
- fflush(out);
- return r;
-}
-
-float ABI_ATTR f_fi (float a, int z)
-{
- float r = a+z;
- fprintf(out,"float f(float,int):(%g,%d)",a,z);
- fflush(out);
- return r;
-}
-float ABI_ATTR f_f2i (float a, float b, int z)
-{
- float r = a+b+z;
- fprintf(out,"float f(2*float,int):(%g,%g,%d)",a,b,z);
- fflush(out);
- return r;
-}
-float ABI_ATTR f_f3i (float a, float b, float c, int z)
-{
- float r = a+b+c+z;
- fprintf(out,"float f(3*float,int):(%g,%g,%g,%d)",a,b,c,z);
- fflush(out);
- return r;
-}
-float ABI_ATTR f_f4i (float a, float b, float c, float d, int z)
-{
- float r = a+b+c+d+z;
- fprintf(out,"float f(4*float,int):(%g,%g,%g,%g,%d)",a,b,c,d,z);
- fflush(out);
- return r;
-}
-float ABI_ATTR f_f7i (float a, float b, float c, float d, float e, float f, float g,
- int z)
-{
- float r = a+b+c+d+e+f+g+z;
- fprintf(out,"float f(7*float,int):(%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,z);
- fflush(out);
- return r;
-}
-float ABI_ATTR f_f8i (float a, float b, float c, float d, float e, float f, float g,
- float h, int z)
-{
- float r = a+b+c+d+e+f+g+h+z;
- fprintf(out,"float f(8*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,z);
- fflush(out);
- return r;
-}
-float ABI_ATTR f_f12i (float a, float b, float c, float d, float e, float f, float g,
- float h, float i, float j, float k, float l, int z)
-{
- float r = a+b+c+d+e+f+g+h+i+j+k+l+z;
- fprintf(out,"float f(12*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,z);
- fflush(out);
- return r;
-}
-float ABI_ATTR f_f13i (float a, float b, float c, float d, float e, float f, float g,
- float h, float i, float j, float k, float l, float m, int z)
-{
- float r = a+b+c+d+e+f+g+h+i+j+k+l+m+z;
- fprintf(out,"float f(13*float,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,m,z);
- fflush(out);
- return r;
-}
-
-double ABI_ATTR d_di (double a, int z)
-{
- double r = a+z;
- fprintf(out,"double f(double,int):(%g,%d)",a,z);
- fflush(out);
- return r;
-}
-double ABI_ATTR d_d2i (double a, double b, int z)
-{
- double r = a+b+z;
- fprintf(out,"double f(2*double,int):(%g,%g,%d)",a,b,z);
- fflush(out);
- return r;
-}
-double ABI_ATTR d_d3i (double a, double b, double c, int z)
-{
- double r = a+b+c+z;
- fprintf(out,"double f(3*double,int):(%g,%g,%g,%d)",a,b,c,z);
- fflush(out);
- return r;
-}
-double ABI_ATTR d_d4i (double a, double b, double c, double d, int z)
-{
- double r = a+b+c+d+z;
- fprintf(out,"double f(4*double,int):(%g,%g,%g,%g,%d)",a,b,c,d,z);
- fflush(out);
- return r;
-}
-double ABI_ATTR d_d7i (double a, double b, double c, double d, double e, double f,
- double g, int z)
-{
- double r = a+b+c+d+e+f+g+z;
- fprintf(out,"double f(7*double,int):(%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,z);
- fflush(out);
- return r;
-}
-double ABI_ATTR d_d8i (double a, double b, double c, double d, double e, double f,
- double g, double h, int z)
-{
- double r = a+b+c+d+e+f+g+h+z;
- fprintf(out,"double f(8*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,z);
- fflush(out);
- return r;
-}
-double ABI_ATTR d_d12i (double a, double b, double c, double d, double e, double f,
- double g, double h, double i, double j, double k, double l,
- int z)
-{
- double r = a+b+c+d+e+f+g+h+i+j+k+l+z;
- fprintf(out,"double f(12*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,z);
- fflush(out);
- return r;
-}
-double ABI_ATTR d_d13i (double a, double b, double c, double d, double e, double f,
- double g, double h, double i, double j, double k, double l,
- double m, int z)
-{
- double r = a+b+c+d+e+f+g+h+i+j+k+l+m+z;
- fprintf(out,"double f(13*double,int):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%d)",a,b,c,d,e,f,g,h,i,j,k,l,m,z);
- fflush(out);
- return r;
-}
-
-/* small structure return tests */
-Size1 ABI_ATTR S1_v (void)
-{
- fprintf(out,"Size1 f(void):");
- fflush(out);
- return Size1_1;
-}
-Size2 ABI_ATTR S2_v (void)
-{
- fprintf(out,"Size2 f(void):");
- fflush(out);
- return Size2_1;
-}
-Size3 ABI_ATTR S3_v (void)
-{
- fprintf(out,"Size3 f(void):");
- fflush(out);
- return Size3_1;
-}
-Size4 ABI_ATTR S4_v (void)
-{
- fprintf(out,"Size4 f(void):");
- fflush(out);
- return Size4_1;
-}
-Size7 ABI_ATTR S7_v (void)
-{
- fprintf(out,"Size7 f(void):");
- fflush(out);
- return Size7_1;
-}
-Size8 ABI_ATTR S8_v (void)
-{
- fprintf(out,"Size8 f(void):");
- fflush(out);
- return Size8_1;
-}
-Size12 ABI_ATTR S12_v (void)
-{
- fprintf(out,"Size12 f(void):");
- fflush(out);
- return Size12_1;
-}
-Size15 ABI_ATTR S15_v (void)
-{
- fprintf(out,"Size15 f(void):");
- fflush(out);
- return Size15_1;
-}
-Size16 ABI_ATTR S16_v (void)
-{
- fprintf(out,"Size16 f(void):");
- fflush(out);
- return Size16_1;
-}
-
-/* structure tests */
-Int ABI_ATTR I_III (Int a, Int b, Int c)
-{
- Int r;
- r.x = a.x + b.x + c.x;
- fprintf(out,"Int f(Int,Int,Int):({%d},{%d},{%d})",a.x,b.x,c.x);
- fflush(out);
- return r;
-}
-Char ABI_ATTR C_CdC (Char a, double b, Char c)
-{
- Char r;
- r.x = (a.x + c.x)/2;
- fprintf(out,"Char f(Char,double,Char):({'%c'},%g,{'%c'})",a.x,b,c.x);
- fflush(out);
- return r;
-}
-Float ABI_ATTR F_Ffd (Float a, float b, double c)
-{
- Float r;
- r.x = (float) (a.x + b + c);
- fprintf(out,"Float f(Float,float,double):({%g},%g,%g)",a.x,b,c);
- fflush(out);
- return r;
-}
-Double ABI_ATTR D_fDd (float a, Double b, double c)
-{
- Double r;
- r.x = a + b.x + c;
- fprintf(out,"Double f(float,Double,double):(%g,{%g},%g)",a,b.x,c);
- fflush(out);
- return r;
-}
-Double ABI_ATTR D_Dfd (Double a, float b, double c)
-{
- Double r;
- r.x = a.x + b + c;
- fprintf(out,"Double f(Double,float,double):({%g},%g,%g)",a.x,b,c);
- fflush(out);
- return r;
-}
-J ABI_ATTR J_JiJ (J a, int b, J c)
-{
- J r;
- r.l1 = a.l1+c.l1; r.l2 = a.l2+b+c.l2;
- fprintf(out,"J f(J,int,J):({%ld,%ld},%d,{%ld,%ld})",a.l1,a.l2,b,c.l1,c.l2);
- fflush(out);
- return r;
-}
-T ABI_ATTR T_TcT (T a, char b, T c)
-{
- T r;
- r.c[0]='b'; r.c[1]=c.c[1]; r.c[2]=c.c[2];
- fprintf(out,"T f(T,char,T):({\"%c%c%c\"},'%c',{\"%c%c%c\"})",a.c[0],a.c[1],a.c[2],b,c.c[0],c.c[1],c.c[2]);
- fflush(out);
- return r;
-}
-X ABI_ATTR X_BcdB (B a, char b, double c, B d)
-{
- static X xr={"return val",'R'};
- X r;
- r = xr;
- r.c1 = b;
- fprintf(out,"X f(B,char,double,B):({%g,{%d,%d,%d}},'%c',%g,{%g,{%d,%d,%d}})",
- a.d,a.i[0],a.i[1],a.i[2],b,c,d.d,d.i[0],d.i[1],d.i[2]);
- fflush(out);
- return r;
-}
-
-/* Test for cases where some argument (especially structure, 'long long', or
- 'double') may be passed partially in general-purpose argument registers
- and partially on the stack. Different ABIs pass between 4 and 8 arguments
- (or none) in general-purpose argument registers. */
-
-long ABI_ATTR l_l0K (K b, long c)
-{
- long r = b.l1 + b.l2 + b.l3 + b.l4 + c;
- fprintf(out,"long f(K,long):(%ld,%ld,%ld,%ld,%ld)",b.l1,b.l2,b.l3,b.l4,c);
- fflush(out);
- return r;
-}
-long ABI_ATTR l_l1K (long a1, K b, long c)
-{
- long r = a1 + b.l1 + b.l2 + b.l3 + b.l4 + c;
- fprintf(out,"long f(long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld)",a1,b.l1,b.l2,b.l3,b.l4,c);
- fflush(out);
- return r;
-}
-long ABI_ATTR l_l2K (long a1, long a2, K b, long c)
-{
- long r = a1 + a2 + b.l1 + b.l2 + b.l3 + b.l4 + c;
- fprintf(out,"long f(2*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,b.l1,b.l2,b.l3,b.l4,c);
- fflush(out);
- return r;
-}
-long ABI_ATTR l_l3K (long a1, long a2, long a3, K b, long c)
-{
- long r = a1 + a2 + a3 + b.l1 + b.l2 + b.l3 + b.l4 + c;
- fprintf(out,"long f(3*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,b.l1,b.l2,b.l3,b.l4,c);
- fflush(out);
- return r;
-}
-long ABI_ATTR l_l4K (long a1, long a2, long a3, long a4, K b, long c)
-{
- long r = a1 + a2 + a3 + a4 + b.l1 + b.l2 + b.l3 + b.l4 + c;
- fprintf(out,"long f(4*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,b.l1,b.l2,b.l3,b.l4,c);
- fflush(out);
- return r;
-}
-long ABI_ATTR l_l5K (long a1, long a2, long a3, long a4, long a5, K b, long c)
-{
- long r = a1 + a2 + a3 + a4 + a5 + b.l1 + b.l2 + b.l3 + b.l4 + c;
- fprintf(out,"long f(5*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,a5,b.l1,b.l2,b.l3,b.l4,c);
- fflush(out);
- return r;
-}
-long ABI_ATTR l_l6K (long a1, long a2, long a3, long a4, long a5, long a6, K b, long c)
-{
- long r = a1 + a2 + a3 + a4 + a5 + a6 + b.l1 + b.l2 + b.l3 + b.l4 + c;
- fprintf(out,"long f(6*long,K,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a1,a2,a3,a4,a5,a6,b.l1,b.l2,b.l3,b.l4,c);
- fflush(out);
- return r;
-}
-/* These tests is crafted on the knowledge that for all known ABIs:
- * 17 > number of floating-point argument registers,
- * 3 < number of general-purpose argument registers < 3 + 6. */
-float ABI_ATTR f_f17l3L (float a, float b, float c, float d, float e, float f, float g,
- float h, float i, float j, float k, float l, float m, float n,
- float o, float p, float q,
- long s, long t, long u, L z)
-{
- float r = a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+z.l1+z.l2+z.l3+z.l4+z.l5+z.l6;
- fprintf(out,"float f(17*float,3*int,L):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,z.l1,z.l2,z.l3,z.l4,z.l5,z.l6);
- fflush(out);
- return r;
-}
-double ABI_ATTR d_d17l3L (double a, double b, double c, double d, double e, double f,
- double g, double h, double i, double j, double k, double l,
- double m, double n, double o, double p, double q,
- long s, long t, long u, L z)
-{
- double r = a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+s+t+u+z.l1+z.l2+z.l3+z.l4+z.l5+z.l6;
- fprintf(out,"double f(17*double,3*int,L):(%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,z.l1,z.l2,z.l3,z.l4,z.l5,z.l6);
- fflush(out);
- return r;
-}
-
-long long ABI_ATTR ll_l2ll (long a1, long a2, long long b, long c)
-{
- long long r = (long long) (a1 + a2) + b + c;
- fprintf(out,"long long f(2*long,long long,long):(%ld,%ld,0x%lx%08lx,%ld)",a1,a2,(long)(b>>32),(long)(b&0xffffffff),c);
- fflush(out);
- return r;
-}
-long long ABI_ATTR ll_l3ll (long a1, long a2, long a3, long long b, long c)
-{
- long long r = (long long) (a1 + a2 + a3) + b + c;
- fprintf(out,"long long f(3*long,long long,long):(%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,(long)(b>>32),(long)(b&0xffffffff),c);
- fflush(out);
- return r;
-}
-long long ABI_ATTR ll_l4ll (long a1, long a2, long a3, long a4, long long b, long c)
-{
- long long r = (long long) (a1 + a2 + a3 + a4) + b + c;
- fprintf(out,"long long f(4*long,long long,long):(%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,(long)(b>>32),(long)(b&0xffffffff),c);
- fflush(out);
- return r;
-}
-long long ABI_ATTR ll_l5ll (long a1, long a2, long a3, long a4, long a5, long long b, long c)
-{
- long long r = (long long) (a1 + a2 + a3 + a4 + a5) + b + c;
- fprintf(out,"long long f(5*long,long long,long):(%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,(long)(b>>32),(long)(b&0xffffffff),c);
- fflush(out);
- return r;
-}
-long long ABI_ATTR ll_l6ll (long a1, long a2, long a3, long a4, long a5, long a6, long long b, long c)
-{
- long long r = (long long) (a1 + a2 + a3 + a4 + a5 + a6) + b + c;
- fprintf(out,"long long f(6*long,long long,long):(%ld,%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,a6,(long)(b>>32),(long)(b&0xffffffff),c);
- fflush(out);
- return r;
-}
-long long ABI_ATTR ll_l7ll (long a1, long a2, long a3, long a4, long a5, long a6, long a7, long long b, long c)
-{
- long long r = (long long) (a1 + a2 + a3 + a4 + a5 + a6 + a7) + b + c;
- fprintf(out,"long long f(7*long,long long,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,0x%lx%08lx,%ld)",a1,a2,a3,a4,a5,a6,a7,(long)(b>>32),(long)(b&0xffffffff),c);
- fflush(out);
- return r;
-}
-
-double ABI_ATTR d_l2d (long a1, long a2, double b, long c)
-{
- double r = (double) (a1 + a2) + b + c;
- fprintf(out,"double f(2*long,double,long):(%ld,%ld,%g,%ld)",a1,a2,b,c);
- fflush(out);
- return r;
-}
-double ABI_ATTR d_l3d (long a1, long a2, long a3, double b, long c)
-{
- double r = (double) (a1 + a2 + a3) + b + c;
- fprintf(out,"double f(3*long,double,long):(%ld,%ld,%ld,%g,%ld)",a1,a2,a3,b,c);
- fflush(out);
- return r;
-}
-double ABI_ATTR d_l4d (long a1, long a2, long a3, long a4, double b, long c)
-{
- double r = (double) (a1 + a2 + a3 + a4) + b + c;
- fprintf(out,"double f(4*long,double,long):(%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,b,c);
- fflush(out);
- return r;
-}
-double ABI_ATTR d_l5d (long a1, long a2, long a3, long a4, long a5, double b, long c)
-{
- double r = (double) (a1 + a2 + a3 + a4 + a5) + b + c;
- fprintf(out,"double f(5*long,double,long):(%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,b,c);
- fflush(out);
- return r;
-}
-double ABI_ATTR d_l6d (long a1, long a2, long a3, long a4, long a5, long a6, double b, long c)
-{
- double r = (double) (a1 + a2 + a3 + a4 + a5 + a6) + b + c;
- fprintf(out,"double f(6*long,double,long):(%ld,%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,a6,b,c);
- fflush(out);
- return r;
-}
-double ABI_ATTR d_l7d (long a1, long a2, long a3, long a4, long a5, long a6, long a7, double b, long c)
-{
- double r = (double) (a1 + a2 + a3 + a4 + a5 + a6 + a7) + b + c;
- fprintf(out,"double f(7*long,double,long):(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%g,%ld)",a1,a2,a3,a4,a5,a6,a7,b,c);
- fflush(out);
- return r;
-}
diff --git a/deps/libffi/testsuite/libffi.call/align_mixed.c b/deps/libffi/testsuite/libffi.call/align_mixed.c
deleted file mode 100644
index 5d4959ce975..00000000000
--- a/deps/libffi/testsuite/libffi.call/align_mixed.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Area: ffi_call
- Purpose: Check for proper argument alignment.
- Limitations: none.
- PR: none.
- Originator: <twalljava@java.net> (from many_win32.c) */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-static float ABI_ATTR align_arguments(int i1,
- double f2,
- int i3,
- double f4)
-{
- return i1+f2+i3+f4;
-}
-
-int main(void)
-{
- ffi_cif cif;
- ffi_type *args[4] = {
- &ffi_type_sint,
- &ffi_type_double,
- &ffi_type_sint,
- &ffi_type_double
- };
- double fa[2] = {1,2};
- int ia[2] = {1,2};
- void *values[4] = {&ia[0], &fa[0], &ia[1], &fa[1]};
- float f, ff;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 4,
- &ffi_type_float, args) == FFI_OK);
-
- ff = align_arguments(ia[0], fa[0], ia[1], fa[1]);
-
- ffi_call(&cif, FFI_FN(align_arguments), &f, values);
-
- if (f == ff)
- printf("align arguments tests ok!\n");
- else
- CHECK(0);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/align_stdcall.c b/deps/libffi/testsuite/libffi.call/align_stdcall.c
deleted file mode 100644
index 5e5cb860cce..00000000000
--- a/deps/libffi/testsuite/libffi.call/align_stdcall.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Area: ffi_call
- Purpose: Check for proper argument alignment.
- Limitations: none.
- PR: none.
- Originator: <twalljava@java.net> (from many_win32.c) */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-static float ABI_ATTR align_arguments(int i1,
- double f2,
- int i3,
- double f4)
-{
- return i1+f2+i3+f4;
-}
-
-int main(void)
-{
- ffi_cif cif;
- ffi_type *args[4] = {
- &ffi_type_sint,
- &ffi_type_double,
- &ffi_type_sint,
- &ffi_type_double
- };
- double fa[2] = {1,2};
- int ia[2] = {1,2};
- void *values[4] = {&ia[0], &fa[0], &ia[1], &fa[1]};
- float f, ff;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 4,
- &ffi_type_float, args) == FFI_OK);
-
- ff = align_arguments(ia[0], fa[0], ia[1], fa[1]);;
-
- ffi_call(&cif, FFI_FN(align_arguments), &f, values);
-
- if (f == ff)
- printf("align arguments tests ok!\n");
- else
- CHECK(0);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/bpo_38748.c b/deps/libffi/testsuite/libffi.call/bpo_38748.c
deleted file mode 100644
index 294bda0fec0..00000000000
--- a/deps/libffi/testsuite/libffi.call/bpo_38748.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Area: bpo-38748
- Purpose: test for stdcall alignment problem
- Source: github.com/python/cpython/pull/26204 */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-#include "ffi_common.h"
-
-static UINT32 ABI_ATTR align_arguments(UINT32 l1,
- UINT64 l2)
-{
- return l1 + (UINT32) l2;
-}
-
-int main(void)
-{
- ffi_cif cif;
- ffi_type *args[4] = {
- &ffi_type_uint32,
- &ffi_type_uint64
- };
- ffi_arg lr1, lr2;
- UINT32 l1 = 1;
- UINT64 l2 = 2;
- void *values[2] = {&l1, &l2};
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 2,
- &ffi_type_uint32, args) == FFI_OK);
-
- lr1 = align_arguments(l1, l2);
-
- ffi_call(&cif, FFI_FN(align_arguments), &lr2, values);
-
- if (lr1 == lr2)
- printf("bpo-38748 arguments tests ok!\n");
- else
- CHECK(0);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/call.exp b/deps/libffi/testsuite/libffi.call/call.exp
deleted file mode 100644
index 13ba2bdcd49..00000000000
--- a/deps/libffi/testsuite/libffi.call/call.exp
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright (C) 2003, 2006, 2009, 2010, 2014 Free Software Foundation, Inc.
-
-# This program 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 3 of the License, or
-# (at your option) any later version.
-#
-# This program 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; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-dg-init
-libffi-init
-
-global srcdir subdir
-
-if { [string match $compiler_vendor "microsoft"] } {
- # -wd4005 macro redefinition
- # -wd4244 implicit conversion to type of smaller size
- # -wd4305 truncation to smaller type
- # -wd4477 printf %lu of uintptr_t
- # -wd4312 implicit conversion to type of greater size
- # -wd4311 pointer truncation to unsigned long
- # -EHsc C++ Exception Handling (no SEH exceptions)
- set additional_options "-wd4005 -wd4244 -wd4305 -wd4477 -wd4312 -wd4311 -EHsc";
-} else {
- set additional_options "";
-}
-
-set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.c]]
-
-run-many-tests $tlist $additional_options
-
-set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.cc]]
-
-# No C++ for or1k
-if { [istarget "or1k-*-*"] } {
- foreach test $tlist {
- unsupported "$test"
- }
-} else {
- run-many-tests $tlist $additional_options
-}
-
-dg-finish
-
-# Local Variables:
-# tcl-indent-level:4
-# End:
diff --git a/deps/libffi/testsuite/libffi.call/callback.c b/deps/libffi/testsuite/libffi.call/callback.c
deleted file mode 100644
index 98d552cd816..00000000000
--- a/deps/libffi/testsuite/libffi.call/callback.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures with array and callback.
- Limitations: none.
- PR: none.
- Originator: David Tenty <daltenty@ibm.com> */
-
-/* { dg-do run } */
-/* SPARC64 classifies array members differently from nested structures,
- but libffi's documented array emulation has no distinct array tag. */
-/* { dg-skip-if "array members are not representable in the SPARC64 ABI" { sparc64-*-* } } */
-#include "ffitest.h"
-
-static int i=5;
-
-static void callback(void) { i++; }
-
-typedef struct
-{
- unsigned char c1;
- double s[2];
- unsigned char c2;
-} test_structure_12;
-
-static test_structure_12 ABI_ATTR struct12 (test_structure_12 ts, void (*func)(void))
-{
- ts.c1 += 1;
- ts.c2 += 1;
- ts.s[0] += 1;
- ts.s[1] += 1;
-
- func();
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts12_type,ts12a_type;
- ffi_type *ts12_type_elements[4];
- ffi_type *ts12a_type_elements[3];
-
- test_structure_12 ts12_arg;
- void (*ptr)(void)=&callback;
-
- test_structure_12 *ts12_result =
- (test_structure_12 *) malloc (sizeof(test_structure_12));
-
- ts12a_type.size = 0;
- ts12a_type.alignment = 0;
- ts12a_type.type = FFI_TYPE_STRUCT;
- ts12a_type.elements = ts12a_type_elements;
- ts12a_type_elements[0] = &ffi_type_double;
- ts12a_type_elements[1] = &ffi_type_double;
- ts12a_type_elements[2] = NULL;
-
- ts12_type.size = 0;
- ts12_type.alignment = 0;
- ts12_type.type = FFI_TYPE_STRUCT;
- ts12_type.elements = ts12_type_elements;
- ts12_type_elements[0] = &ffi_type_uchar;
- ts12_type_elements[1] = &ts12a_type;
- ts12_type_elements[2] = &ffi_type_uchar;
- ts12_type_elements[3] = NULL;
-
-
- args[0] = &ts12_type;
- args[1] = &ffi_type_pointer;
- values[0] = &ts12_arg;
- values[1] = &ptr;
-
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 2, &ts12_type, args) == FFI_OK);
-
- ts12_arg.c1 = 5;
- ts12_arg.c2 = 6;
- ts12_arg.s[0] = 7.77;
- ts12_arg.s[1] = 8.88;
-
- printf ("%u\n", ts12_arg.c1);
- printf ("%u\n", ts12_arg.c2);
- printf ("%g\n", ts12_arg.s[0]);
- printf ("%g\n", ts12_arg.s[1]);
- printf ("%d\n", i);
-
- ffi_call(&cif, FFI_FN(struct12), ts12_result, values);
-
- printf ("%u\n", ts12_result->c1);
- printf ("%u\n", ts12_result->c2);
- printf ("%g\n", ts12_result->s[0]);
- printf ("%g\n", ts12_result->s[1]);
- printf ("%d\n", i);
- CHECK(ts12_result->c1 == 5 + 1);
- CHECK(ts12_result->c2 == 6 + 1);
- CHECK(ts12_result->s[0] == 7.77 + 1);
- CHECK(ts12_result->s[1] == 8.88 + 1);
- CHECK(i == 5 + 1);
- CHECK(ts12_type.size == sizeof(test_structure_12));
-
- free (ts12_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/callback2.c b/deps/libffi/testsuite/libffi.call/callback2.c
deleted file mode 100644
index bf989b81773..00000000000
--- a/deps/libffi/testsuite/libffi.call/callback2.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures with nested array and callback.
- Limitations: none.
- PR: none.
- Originator: David Tenty <daltenty@ibm.com> */
-
-/* { dg-do run } */
-/* SPARC64 classifies array members differently from nested structures,
- but libffi's documented array emulation has no distinct array tag. */
-/* { dg-skip-if "array members are not representable in the SPARC64 ABI" { sparc64-*-* } } */
-#include "ffitest.h"
-
-static int i=5;
-
-static void callback(void) { i++; }
-
-typedef struct
-{
- struct { double d; } s1;
- double s[2];
- unsigned char c2;
-} test_structure_12;
-
-static test_structure_12 ABI_ATTR struct12 (test_structure_12 ts, void (*func)(void))
-{
- ts.s1.d += 1;
- ts.c2 += 1;
- ts.s[0] += 1;
- ts.s[1] += 1;
-
- func();
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts12_type,ts12a_type, ts12b_type;
- ffi_type *ts12_type_elements[4];
- ffi_type *ts12a_type_elements[2];
- ffi_type *ts12b_type_elements[3];
-
-
- test_structure_12 ts12_arg;
- void (*ptr)(void)=&callback;
-
- test_structure_12 *ts12_result =
- (test_structure_12 *) malloc (sizeof(test_structure_12));
-
- ts12a_type.size = 0;
- ts12a_type.alignment = 0;
- ts12a_type.type = FFI_TYPE_STRUCT;
- ts12a_type.elements = ts12a_type_elements;
- ts12a_type_elements[0] = &ffi_type_double;
- ts12a_type_elements[1] = NULL;
-
- ts12b_type.size = 0;
- ts12b_type.alignment = 0;
- ts12b_type.type = FFI_TYPE_STRUCT;
- ts12b_type.elements = ts12b_type_elements;
- ts12b_type_elements[0] = &ffi_type_double;
- ts12b_type_elements[1] = &ffi_type_double;
- ts12b_type_elements[2] = NULL;
-
- ts12_type.size = 0;
- ts12_type.alignment = 0;
- ts12_type.type = FFI_TYPE_STRUCT;
- ts12_type.elements = ts12_type_elements;
- ts12_type_elements[0] = &ts12a_type;
- ts12_type_elements[1] = &ts12b_type;
- ts12_type_elements[2] = &ffi_type_uchar;
- ts12_type_elements[3] = NULL;
-
-
- args[0] = &ts12_type;
- args[1] = &ffi_type_pointer;
- values[0] = &ts12_arg;
- values[1] = &ptr;
-
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 2, &ts12_type, args) == FFI_OK);
-
- ts12_arg.s1.d = 5.55;
- ts12_arg.c2 = 6;
- ts12_arg.s[0] = 7.77;
- ts12_arg.s[1] = 8.88;
-
- printf ("%g\n", ts12_arg.s1.d);
- printf ("%u\n", ts12_arg.c2);
- printf ("%g\n", ts12_arg.s[0]);
- printf ("%g\n", ts12_arg.s[1]);
- printf ("%d\n", i);
-
- ffi_call(&cif, FFI_FN(struct12), ts12_result, values);
-
- printf ("%g\n", ts12_result->s1.d);
- printf ("%u\n", ts12_result->c2);
- printf ("%g\n", ts12_result->s[0]);
- printf ("%g\n", ts12_result->s[1]);
- printf ("%d\n", i);
- CHECK(ts12_result->s1.d == 5.55 + 1);
- CHECK(ts12_result->c2 == 6 + 1);
- CHECK(ts12_result->s[0] == 7.77 + 1);
- CHECK(ts12_result->s[1] == 8.88 + 1);
- CHECK(i == 5 + 1);
- CHECK(ts12_type.size == sizeof(test_structure_12));
-
- free (ts12_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/callback3.c b/deps/libffi/testsuite/libffi.call/callback3.c
deleted file mode 100644
index 05bdbf67944..00000000000
--- a/deps/libffi/testsuite/libffi.call/callback3.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures with array and callback.
- Limitations: none.
- PR: none.
- Originator: David Tenty <daltenty@ibm.com> */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static int i=5;
-
-static void callback(void) { i++; }
-
-
-typedef struct
-{
- struct { unsigned char c; double d; } s1;
- double s[2];
- unsigned char c2;
-} test_structure_12;
-
-static test_structure_12 ABI_ATTR struct12 (test_structure_12 ts, void (*func)(void))
-{
- ts.s1.c += 1;
- ts.s1.d += 1;
- ts.c2 += 1;
- ts.s[0] += 1;
- ts.s[1] += 1;
-
- func();
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts12_type,ts12b_type, ts12a_type;
- ffi_type *ts12_type_elements[4];
- ffi_type *ts12b_type_elements[3];
- ffi_type *ts12a_type_elements[3];
-
- test_structure_12 ts12_arg;
- void (*ptr)(void)=&callback;
-
- test_structure_12 *ts12_result =
- (test_structure_12 *) malloc (sizeof(test_structure_12));
-
- ts12a_type.size = 0;
- ts12a_type.alignment = 0;
- ts12a_type.type = FFI_TYPE_STRUCT;
- ts12a_type.elements = ts12a_type_elements;
- ts12a_type_elements[0] = &ffi_type_uchar;
- ts12a_type_elements[1] = &ffi_type_double;
- ts12a_type_elements[2] = NULL;
-
- ts12b_type.size = 0;
- ts12b_type.alignment = 0;
- ts12b_type.type = FFI_TYPE_STRUCT;
- ts12b_type.elements = ts12b_type_elements;
- ts12b_type_elements[0] = &ffi_type_double;
- ts12b_type_elements[1] = &ffi_type_double;
- ts12b_type_elements[2] = NULL;
-
- ts12_type.size = 0;
- ts12_type.alignment = 0;
- ts12_type.type = FFI_TYPE_STRUCT;
- ts12_type.elements = ts12_type_elements;
- ts12_type_elements[0] = &ts12a_type;
- ts12_type_elements[1] = &ts12b_type;
- ts12_type_elements[2] = &ffi_type_uchar;
- ts12_type_elements[3] = NULL;
-
-
- args[0] = &ts12_type;
- args[1] = &ffi_type_pointer;
- values[0] = &ts12_arg;
- values[1] = &ptr;
-
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 2, &ts12_type, args) == FFI_OK);
-
- ts12_arg.s1.c = 5;
- ts12_arg.s1.d = 5.55;
- ts12_arg.c2 = 6;
- ts12_arg.s[0] = 7.77;
- ts12_arg.s[1] = 8.88;
-
- printf ("%d\n", ts12_arg.s1.c);
- printf ("%g\n", ts12_arg.s1.d);
- printf ("%u\n", ts12_arg.c2);
- printf ("%g\n", ts12_arg.s[0]);
- printf ("%g\n", ts12_arg.s[1]);
- printf ("%d\n", i);
-
- ffi_call(&cif, FFI_FN(struct12), ts12_result, values);
-
- printf ("%d\n", ts12_result->s1.c);
- printf ("%g\n", ts12_result->s1.d);
- printf ("%u\n", ts12_result->c2);
- printf ("%g\n", ts12_result->s[0]);
- printf ("%g\n", ts12_result->s[1]);
- printf ("%d\n", i);
- CHECK(ts12_result->s1.c == 5 + 1);
- CHECK(ts12_result->s1.d == 5.55 + 1);
- CHECK(ts12_result->c2 == 6 + 1);
- CHECK(ts12_result->s[0] == 7.77 + 1);
- CHECK(ts12_result->s[1] == 8.88 + 1);
- CHECK(i == 5 + 1);
- CHECK(ts12_type.size == sizeof(test_structure_12));
-
- free (ts12_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/callback4.c b/deps/libffi/testsuite/libffi.call/callback4.c
deleted file mode 100644
index 309ad354755..00000000000
--- a/deps/libffi/testsuite/libffi.call/callback4.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures with array and callback.
- Limitations: none.
- PR: none.
- Originator: David Tenty <daltenty@ibm.com> */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static int i=5;
-
-static void callback(void) { i++; }
-
-
-typedef struct
-{
- unsigned char c1;
- struct { double d; unsigned char c; } s[2];
- unsigned char c2;
-} test_structure_12;
-
-static test_structure_12 ABI_ATTR struct12 (test_structure_12 ts, void (*func)(void))
-{
- ts.c1 += 1;
- ts.s[0].d += 1;
- ts.s[0].c += 1;
- ts.s[1].d += 1;
- ts.s[1].c += 1;
- ts.c2 += 1;
-
- func();
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts12_type,ts12b_type, ts12a_type;
- ffi_type *ts12_type_elements[4];
- ffi_type *ts12b_type_elements[3];
- ffi_type *ts12a_type_elements[3];
-
- test_structure_12 ts12_arg;
- void (*ptr)(void)=&callback;
-
- test_structure_12 *ts12_result =
- (test_structure_12 *) malloc (sizeof(test_structure_12));
-
- ts12a_type.size = 0;
- ts12a_type.alignment = 0;
- ts12a_type.type = FFI_TYPE_STRUCT;
- ts12a_type.elements = ts12a_type_elements;
- ts12a_type_elements[0] = &ffi_type_double;
- ts12a_type_elements[1] = &ffi_type_uchar;
- ts12a_type_elements[2] = NULL;
-
- ts12b_type.size = 0;
- ts12b_type.alignment = 0;
- ts12b_type.type = FFI_TYPE_STRUCT;
- ts12b_type.elements = ts12b_type_elements;
- ts12b_type_elements[0] = &ts12a_type;
- ts12b_type_elements[1] = &ts12a_type;
- ts12b_type_elements[2] = NULL;
-
- ts12_type.size = 0;
- ts12_type.alignment = 0;
- ts12_type.type = FFI_TYPE_STRUCT;
- ts12_type.elements = ts12_type_elements;
- ts12_type_elements[0] = &ffi_type_uchar;
- ts12_type_elements[1] = &ts12b_type;
- ts12_type_elements[2] = &ffi_type_uchar;
- ts12_type_elements[3] = NULL;
-
-
- args[0] = &ts12_type;
- args[1] = &ffi_type_pointer;
- values[0] = &ts12_arg;
- values[1] = &ptr;
-
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 2, &ts12_type, args) == FFI_OK);
-
- ts12_arg.c1 = 5;
- ts12_arg.s[0].d = 5.55;
- ts12_arg.s[0].c = 6;
- ts12_arg.s[1].d = 7.77;
- ts12_arg.s[1].c = 8;
- ts12_arg.c2 = 9;
-
- printf ("%u\n", ts12_arg.c1);
- printf ("%g\n", ts12_arg.s[0].d);
- printf ("%u\n", ts12_arg.s[0].c);
- printf ("%g\n", ts12_arg.s[1].d);
- printf ("%u\n", ts12_arg.s[1].c);
- printf ("%u\n", ts12_arg.c2);
- printf ("%d\n", i);
-
- ffi_call(&cif, FFI_FN(struct12), ts12_result, values);
-
- printf ("%u\n", ts12_result->c1);
- printf ("%g\n", ts12_result->s[0].d);
- printf ("%u\n", ts12_result->s[0].c);
- printf ("%g\n", ts12_result->s[1].d);
- printf ("%u\n", ts12_result->s[1].c);
- printf ("%u\n", ts12_result->c2);
- printf ("%d\n", i);
- CHECK(ts12_result->c1 == 5 + 1);
- CHECK(ts12_result->s[0].d == 5.55 + 1);
- CHECK(ts12_result->s[0].c == 6 + 1);
- CHECK(ts12_result->s[1].d == 7.77 + 1);
- CHECK(ts12_result->s[1].c == 8 + 1);
- CHECK(ts12_result->c2 == 9 + 1);
- CHECK(i == 5 + 1);
- CHECK(ts12_type.size == sizeof(test_structure_12));
-
- free (ts12_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/closure_raw.c b/deps/libffi/testsuite/libffi.call/closure_raw.c
deleted file mode 100644
index 84c32a44544..00000000000
--- a/deps/libffi/testsuite/libffi.call/closure_raw.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Area: ffi_prep_raw_closure_loc
- Purpose: Check that a raw-API closure allocated with ffi_closure_alloc
- is invoked correctly. With static trampolines the executable
- code address differs from the closure data, and the raw API
- passed the wrong one as the handler's user_data, so the handler
- was read from read-only trampoline bytes and the closure made a
- wild indirect call (GHSA-w6j9-w53f-2857). There was previously
- no test for ffi_prep_raw_closure*.
- Limitations: none.
- PR: GHSA-w6j9-w53f-2857. */
-
-/* { dg-do run { xfail i686-pc-cygwin } } */
-/* XFAIL: the i686 MSVC native raw-closure path fails at execution; see
- libffi issue #1074. */
-#include "ffitest.h"
-
-/* The raw API can be configured out (e.g. Emscripten builds with
- --disable-raw-api), which drops ffi_prep_raw_closure_loc from the
- library. Match raw_api.c's own guard so the test links there too. */
-#if FFI_CLOSURES && !FFI_NO_RAW_API
-
-static void
-raw_handler (ffi_cif *cif, void *ret, ffi_raw *args, void *ud)
-{
- (void) cif;
- *(ffi_arg *) ret = (ffi_arg) (args[0].sint + args[1].sint + (intptr_t) ud);
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- ffi_type *args[2] = { &ffi_type_sint, &ffi_type_sint };
- ffi_raw_closure *cl;
- void *code;
- int (*f) (int, int);
-
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 2, &ffi_type_sint, args)
- == FFI_OK);
-
- cl = ffi_closure_alloc (sizeof (ffi_raw_closure), &code);
- CHECK (cl != NULL);
- CHECK (ffi_prep_raw_closure_loc (cl, &cif, raw_handler, (void *) 100, code)
- == FFI_OK);
-
- f = (int (*) (int, int)) code;
- CHECK (f (20, 3) == 123);
-
- ffi_closure_free (cl);
- printf ("raw closure ok\n");
- exit (0);
-}
-
-#else
-int main (void) { return 0; }
-#endif
diff --git a/deps/libffi/testsuite/libffi.call/closure_thiscall_fastcall_pop.c b/deps/libffi/testsuite/libffi.call/closure_thiscall_fastcall_pop.c
deleted file mode 100644
index 9cc0b091943..00000000000
--- a/deps/libffi/testsuite/libffi.call/closure_thiscall_fastcall_pop.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/* Area: closure, ffi_prep_closure_loc
- Purpose: Check i386 THISCALL/FASTCALL closures pop the stack correctly.
- Limitations: i386 + GNU inline asm only; a no-op elsewhere.
- PR: none.
- Originator: i386 closure stack-pop accounting regression.
-
- THISCALL and FASTCALL are callee-clean: the closure must remove its
- stack-resident arguments on return (ret $n). When a 64-bit integer or
- a struct argument is placed on the stack, the closure return path used
- to compute the pop as cif->bytes - narg_reg*4 with narg_reg force-bumped
- to 2, discounting register slots that were never used and under-popping
- the stack. A caller that relies on callee cleanup is then left with the
- argument bytes where its return address should be.
-
- This test invokes the generated closure through a minimal callee-clean
- call site and checks that ESP is balanced across the call (delta 0).
- Without the fix the delta is 8 (FASTCALL uint64) or 4 (THISCALL). */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-#if defined(__i386__) && defined(__GNUC__) && !defined(__APPLE__)
-
-static uint64_t received;
-static int ran;
-
-static void
-cb (ffi_cif *cif, void *resp, void **args, void *userdata)
-{
- (void) cif; (void) resp; (void) userdata;
- received = *(uint64_t *) args[cif->nargs - 1];
- ran++;
-}
-
-/* Push an 8-byte stack argument, load ECX (the thiscall "this" register,
- ignored by the fastcall callee), call the closure, and return how many
- bytes the callee under-popped (0 == it popped exactly what was pushed).
-
- Every operand is read into a register up front, while ESP is still at
- its incoming value, so nothing is referenced through an ESP-relative
- memory operand after we start moving ESP (which would otherwise read a
- stale slot, on clang at -O2 in particular). The stack is then 16-byte
- aligned at the call as the i386 psABI requires, so the -O2-built closure
- body may use aligned SSE without faulting; the alignment cancels out of
- the delta. ESP is restored to its exact incoming value before the delta
- is stored, so a wrong pop cannot corrupt our frame. Not using EBX keeps
- this compatible with -fPIC; the delta is returned via memory so no free
- register is needed for it. */
-static int
-esp_delta (void *code, uint64_t stackarg, unsigned ecxv)
-{
- unsigned delta;
- unsigned lo = (unsigned) stackarg;
- unsigned hi = (unsigned) (stackarg >> 32);
- __asm__ volatile (
- "movl %[lo], %%eax\n\t" /* stash all operands in registers */
- "movl %[hi], %%edx\n\t" /* before ESP moves */
- "movl %[code], %%edi\n\t"
- "movl %[ecxv], %%ecx\n\t" /* thiscall 'this' */
- "movl %%esp, %%esi\n\t" /* remember the real esp */
- "andl $-16, %%esp\n\t" /* 16-byte align, then bias by the */
- "subl $8, %%esp\n\t" /* 8 arg bytes so 'call' is 0 mod 16 */
- "pushl %%edx\n\t" /* high dword */
- "pushl %%eax\n\t" /* low dword */
- "calll *%%edi\n\t"
- "movl %%esi, %%eax\n\t" /* recompute esp just before the */
- "andl $-16, %%eax\n\t" /* pushes... */
- "subl $8, %%eax\n\t"
- "subl %%esp, %%eax\n\t" /* eax = under-popped byte count */
- "movl %%esi, %%esp\n\t" /* restore before touching memory */
- "movl %%eax, %[delta]\n\t"
- : [delta] "=m" (delta)
- : [lo] "m" (lo), [hi] "m" (hi), [code] "m" (code), [ecxv] "m" (ecxv)
- : "memory", "cc", "eax", "ecx", "edx", "esi", "edi");
- return (int) delta;
-}
-
-static int
-check_abi (ffi_abi abi, unsigned nargs, ffi_type **atypes, unsigned ecx)
-{
- ffi_cif cif;
- ffi_closure *closure;
- void *code;
- int delta;
-
- closure = ffi_closure_alloc (sizeof (ffi_closure), &code);
- CHECK (closure != NULL);
- CHECK (ffi_prep_cif (&cif, abi, nargs, &ffi_type_void, atypes) == FFI_OK);
- CHECK (ffi_prep_closure_loc (closure, &cif, cb, NULL, code) == FFI_OK);
-
- ran = 0;
- received = 0;
- delta = esp_delta (code, 0x1122334455667788ULL, ecx);
-
- CHECK (ran == 1);
- CHECK (received == 0x1122334455667788ULL);
- ffi_closure_free (closure);
- return delta;
-}
-
-int
-main (void)
-{
- ffi_type *fastcall_args[1] = { &ffi_type_uint64 };
- ffi_type *thiscall_args[2] = { &ffi_type_pointer, &ffi_type_uint64 };
- int d;
-
- /* FASTCALL void cb(uint64_t): the uint64 is stack-resident; pop must be 8. */
- d = check_abi (FFI_FASTCALL, 1, fastcall_args, 0);
- printf ("FASTCALL uint64 esp delta: %d\n", d);
- CHECK (d == 0);
-
- /* THISCALL void cb(void*, uint64_t): 'this' in ECX, uint64 on the stack;
- pop must be 8 (not 4). */
- d = check_abi (FFI_THISCALL, 2, thiscall_args, 0xdeadbeef);
- printf ("THISCALL this+uint64 esp delta: %d\n", d);
- CHECK (d == 0);
-
- exit (0);
-}
-
-#else
-
-int
-main (void)
-{
- /* Not an i386 GNU target: nothing to check here. */
- exit (0);
-}
-
-#endif
diff --git a/deps/libffi/testsuite/libffi.call/err_bad_typedef.c b/deps/libffi/testsuite/libffi.call/err_bad_typedef.c
deleted file mode 100644
index bf601618617..00000000000
--- a/deps/libffi/testsuite/libffi.call/err_bad_typedef.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Area: ffi_prep_cif
- Purpose: Test error return for bad typedefs.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/6/2007 */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type* arg_types[1];
-
- ffi_type badType = ffi_type_void;
-
- arg_types[0] = NULL;
-
- badType.size = 0;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, &badType,
- arg_types) == FFI_BAD_TYPEDEF);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/ffitest.h b/deps/libffi/testsuite/libffi.call/ffitest.h
deleted file mode 100644
index a7c634b4c63..00000000000
--- a/deps/libffi/testsuite/libffi.call/ffitest.h
+++ /dev/null
@@ -1,166 +0,0 @@
-#undef __USE_MINGW_ANSI_STDIO
-#define __USE_MINGW_ANSI_STDIO 1
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <fcntl.h>
-#include <ffi.h>
-#include "fficonfig.h"
-
-#include <float.h>
-#include <math.h>
-
-#if defined HAVE_STDINT_H
-#include <stdint.h>
-#endif
-
-#if defined HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
-#define MAX_ARGS 256
-
-#define CHECK(x) \
- do { \
- if(!(x)){ \
- printf("Check failed:\n%s\n", #x); \
- abort(); \
- } \
- } while(0)
-
-#define CHECK_FLOAT_EQ(x, y) \
- do { \
- if(fabs((x) - (y)) > FLT_EPSILON){ \
- printf("Check failed CHECK_FLOAT_EQ(%s, %s)\n", #x, #y); \
- abort(); \
- } \
- } while(0)
-
-#define CHECK_DOUBLE_EQ(x, y) \
- do { \
- if(fabs((x) - (y)) > DBL_EPSILON){ \
- printf("Check failed CHECK_FLOAT_EQ(%s, %s)\n", #x, #y); \
- abort(); \
- } \
- } while(0)
-
-/* Define macros so that compilers other than gcc can run the tests. */
-#undef __UNUSED__
-#if defined(__GNUC__)
-#define __UNUSED__ __attribute__((__unused__))
-#define __STDCALL__ __attribute__((stdcall))
-#define __THISCALL__ __attribute__((thiscall))
-#define __FASTCALL__ __attribute__((fastcall))
-#define __MSABI__ __attribute__((ms_abi))
-#else
-#define __UNUSED__
-#define __STDCALL__ __stdcall
-#define __THISCALL__ __thiscall
-#define __FASTCALL__ __fastcall
-#endif
-
-#ifndef ABI_NUM
-#define ABI_NUM FFI_DEFAULT_ABI
-#define ABI_ATTR
-#endif
-
-/* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a
- file open. */
-#ifdef HAVE_MMAP_ANON
-# undef HAVE_MMAP_DEV_ZERO
-
-# include <sys/mman.h>
-# ifndef MAP_FAILED
-# define MAP_FAILED -1
-# endif
-# if !defined (MAP_ANONYMOUS) && defined (MAP_ANON)
-# define MAP_ANONYMOUS MAP_ANON
-# endif
-# define USING_MMAP
-
-#endif
-
-#ifdef HAVE_MMAP_DEV_ZERO
-
-# include <sys/mman.h>
-# ifndef MAP_FAILED
-# define MAP_FAILED -1
-# endif
-# define USING_MMAP
-
-#endif
-
-/* msvc kludge. */
-#if defined(_MSC_VER)
-#define PRIdLL "I64d"
-#define PRIuLL "I64u"
-#else
-#define PRIdLL "lld"
-#define PRIuLL "llu"
-#endif
-
-/* Tru64 UNIX kludge. */
-#if defined(__alpha__) && defined(__osf__)
-/* Tru64 UNIX V4.0 doesn't support %lld/%lld, but long is 64-bit. */
-#undef PRIdLL
-#define PRIdLL "ld"
-#undef PRIuLL
-#define PRIuLL "lu"
-#define PRId8 "hd"
-#define PRIu8 "hu"
-#define PRId64 "ld"
-#define PRIu64 "lu"
-#define PRIuPTR "lu"
-#endif
-
-/* PA HP-UX kludge. */
-#if defined(__hppa__) && defined(__hpux__) && !defined(PRIuPTR)
-#define PRIuPTR "lu"
-#endif
-
-/* IRIX kludge. */
-#if defined(__sgi)
-/* IRIX 6.5 <inttypes.h> provides all definitions, but only for C99
- compilations. */
-#define PRId8 "hhd"
-#define PRIu8 "hhu"
-#if (_MIPS_SZLONG == 32)
-#define PRId64 "lld"
-#define PRIu64 "llu"
-#endif
-/* This doesn't match <inttypes.h>, which always has "lld" here, but the
- arguments are uint64_t, int64_t, which are unsigned long, long for
- 64-bit in <sgidefs.h>. */
-#if (_MIPS_SZLONG == 64)
-#define PRId64 "ld"
-#define PRIu64 "lu"
-#endif
-/* This doesn't match <inttypes.h>, which has "u" here, but the arguments
- are uintptr_t, which is always unsigned long. */
-#define PRIuPTR "lu"
-#endif
-
-/* Solaris < 10 kludge. */
-#if defined(__sun__) && defined(__svr4__) && !defined(PRIuPTR)
-#if defined(__arch64__) || defined (__x86_64__)
-#define PRIuPTR "lu"
-#else
-#define PRIuPTR "u"
-#endif
-#endif
-
-/* MSVC kludge. */
-#if defined _MSC_VER
-#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
-#define PRIuPTR "lu"
-#define PRIu8 "u"
-#define PRId8 "d"
-#define PRIu64 "I64u"
-#define PRId64 "I64d"
-#endif
-#endif
-
-#ifndef PRIuPTR
-#define PRIuPTR "u"
-#endif
diff --git a/deps/libffi/testsuite/libffi.call/float.c b/deps/libffi/testsuite/libffi.call/float.c
deleted file mode 100644
index fbc272d84f1..00000000000
--- a/deps/libffi/testsuite/libffi.call/float.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value float.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-static int floating(int a, float b, double c, long double d)
-{
- int i;
-
- i = (int) ((float)a/b + ((float)c/(float)d));
-
- return i;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg rint;
-
- float f;
- signed int si1;
- double d;
- long double ld;
-
- args[0] = &ffi_type_sint;
- values[0] = &si1;
- args[1] = &ffi_type_float;
- values[1] = &f;
- args[2] = &ffi_type_double;
- values[2] = &d;
- args[3] = &ffi_type_longdouble;
- values[3] = &ld;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &ffi_type_sint, args) == FFI_OK);
-
- si1 = 6;
- f = 3.14159;
- d = (double)1.0/(double)3.0;
- ld = 2.71828182846L;
-
- floating (si1, f, d, ld);
-
- ffi_call(&cif, FFI_FN(floating), &rint, values);
-
- printf ("%d vs %d\n", (int)rint, floating (si1, f, d, ld));
-
- CHECK((int)rint == floating(si1, f, d, ld));
-
- exit (0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/float1.c b/deps/libffi/testsuite/libffi.call/float1.c
deleted file mode 100644
index c48493c6b22..00000000000
--- a/deps/libffi/testsuite/libffi.call/float1.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value double.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-#include "float.h"
-
-#include <math.h>
-
-typedef union
-{
- double d;
- unsigned char c[sizeof (double)];
-} value_type;
-
-#define CANARY 0xba
-
-static double dblit(float f)
-{
- return f/3.0;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- float f;
- value_type result[2];
- unsigned int i;
-
- args[0] = &ffi_type_float;
- values[0] = &f;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_double, args) == FFI_OK);
-
- f = 3.14159;
-
- /* Put a canary in the return array. This is a regression test for
- a buffer overrun. */
- memset(result[1].c, CANARY, sizeof (double));
-
- ffi_call(&cif, FFI_FN(dblit), &result[0].d, values);
-
- /* These are not always the same!! Check for a reasonable delta */
-
- CHECK(fabs(result[0].d - dblit(f)) < DBL_EPSILON);
-
- /* Check the canary. */
- for (i = 0; i < sizeof (double); ++i)
- CHECK(result[1].c[i] == CANARY);
-
- exit(0);
-
-}
diff --git a/deps/libffi/testsuite/libffi.call/float2.c b/deps/libffi/testsuite/libffi.call/float2.c
deleted file mode 100644
index 57cd9e30f92..00000000000
--- a/deps/libffi/testsuite/libffi.call/float2.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value long double.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-/* { dg-do run } */
-
-#include "ffitest.h"
-#include "float.h"
-
-#include <math.h>
-
-static long double ldblit(float f)
-{
- return (long double) (((long double) f)/ (long double) 3.0);
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- float f;
- long double ld;
- long double original;
-
- args[0] = &ffi_type_float;
- values[0] = &f;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_longdouble, args) == FFI_OK);
-
- f = 3.14159;
-
-#if defined(__sun) && defined(__GNUC__)
- /* long double support under SunOS/gcc is pretty much non-existent.
- You'll get the odd bus error in library routines like printf() */
-#else
- printf ("%Lf\n", ldblit(f));
-#endif
-
- ld = 666;
- ffi_call(&cif, FFI_FN(ldblit), &ld, values);
-
-#if defined(__sun) && defined(__GNUC__)
- /* long double support under SunOS/gcc is pretty much non-existent.
- You'll get the odd bus error in library routines like printf() */
-#else
- printf ("%Lf, %Lf, %Lf, %Lf\n", ld, ldblit(f), ld - ldblit(f), LDBL_EPSILON);
-#endif
-
- /* These are not always the same!! Check for a reasonable delta */
- original = ldblit(f);
- if (((ld > original) ? (ld - original) : (original - ld)) < LDBL_EPSILON)
- puts("long double return value tests ok!");
- else
- CHECK(0);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/float3.c b/deps/libffi/testsuite/libffi.call/float3.c
deleted file mode 100644
index bab3206a174..00000000000
--- a/deps/libffi/testsuite/libffi.call/float3.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Area: ffi_call
- Purpose: Check float arguments with different orders.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-#include "float.h"
-
-#include <math.h>
-
-static double floating_1(float a, double b, long double c)
-{
- return (double) a + b + (double) c;
-}
-
-static double floating_2(long double a, double b, float c)
-{
- return (double) a + b + (double) c;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- double rd;
-
- float f;
- double d;
- long double ld;
-
- args[0] = &ffi_type_float;
- values[0] = &f;
- args[1] = &ffi_type_double;
- values[1] = &d;
- args[2] = &ffi_type_longdouble;
- values[2] = &ld;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
- &ffi_type_double, args) == FFI_OK);
-
- f = 3.14159;
- d = (double)1.0/(double)3.0;
- ld = 2.71828182846L;
-
- floating_1 (f, d, ld);
-
- ffi_call(&cif, FFI_FN(floating_1), &rd, values);
-
- CHECK(fabs(rd - floating_1(f, d, ld)) < DBL_EPSILON);
-
- args[0] = &ffi_type_longdouble;
- values[0] = &ld;
- args[1] = &ffi_type_double;
- values[1] = &d;
- args[2] = &ffi_type_float;
- values[2] = &f;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
- &ffi_type_double, args) == FFI_OK);
-
- floating_2 (ld, d, f);
-
- ffi_call(&cif, FFI_FN(floating_2), &rd, values);
-
- CHECK(fabs(rd - floating_2(ld, d, f)) < DBL_EPSILON);
-
- exit (0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/float4.c b/deps/libffi/testsuite/libffi.call/float4.c
deleted file mode 100644
index 0dd6d85e7aa..00000000000
--- a/deps/libffi/testsuite/libffi.call/float4.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Area: ffi_call
- Purpose: Check denorm double value.
- Limitations: none.
- PR: PR26483.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-/* { dg-options "-mieee" { target alpha*-*-* } } */
-
-#include "ffitest.h"
-#include "float.h"
-
-typedef union
-{
- double d;
- unsigned char c[sizeof (double)];
-} value_type;
-
-#define CANARY 0xba
-
-static double dblit(double d)
-{
- return d;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- double d;
- value_type result[2];
- unsigned int i;
-
- args[0] = &ffi_type_double;
- values[0] = &d;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_double, args) == FFI_OK);
-
- d = DBL_MIN / 2;
-
- /* Put a canary in the return array. This is a regression test for
- a buffer overrun. */
- memset(result[1].c, CANARY, sizeof (double));
-
- ffi_call(&cif, FFI_FN(dblit), &result[0].d, values);
-
- /* The standard delta check doesn't work for denorms. Since we didn't do
- any arithmetic, we should get the original result back, and hence an
- exact check should be OK here. */
-
- CHECK(result[0].d == dblit(d));
-
- /* Check the canary. */
- for (i = 0; i < sizeof (double); ++i)
- CHECK(result[1].c[i] == CANARY);
-
- exit(0);
-
-}
diff --git a/deps/libffi/testsuite/libffi.call/float_va.c b/deps/libffi/testsuite/libffi.call/float_va.c
deleted file mode 100644
index d01d9d0a9c5..00000000000
--- a/deps/libffi/testsuite/libffi.call/float_va.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/* Area: fp and variadics
- Purpose: check fp inputs and returns work on variadics, even the fixed params
- Limitations: None
- PR: none
- Originator: <david.gilbert@linaro.org> 2011-01-25
-
- Intended to stress the difference in ABI on ARM vfp
-*/
-
-/* { dg-do run } */
-
-#include <stdarg.h>
-
-#include "ffitest.h"
-
-/* prints out all the parameters, and returns the sum of them all.
- * 'x' is the number of variadic parameters all of which are double in this test
- */
-double float_va_fn(unsigned int x, double y,...)
-{
- double total=0.0;
- va_list ap;
- unsigned int i;
-
- total+=(double)x;
- total+=y;
-
- printf("%u: %.1f :", x, y);
-
- va_start(ap, y);
- for(i=0;i<x;i++)
- {
- double arg=va_arg(ap, double);
- total+=arg;
- printf(" %d:%.1f ", i, arg);
- }
- va_end(ap);
-
- printf(" total: %.1f\n", total);
-
- return total;
-}
-
-int main (void)
-{
- ffi_cif cif;
-
- ffi_type *arg_types[5];
- void *values[5];
- double doubles[5];
- unsigned int firstarg;
- double resfp;
-
- /* First test, pass float_va_fn(0,2.0) - note there are no actual
- * variadic parameters, but it's declared variadic so the ABI may be
- * different. */
- /* Call it statically and then via ffi */
- resfp=float_va_fn(0,2.0);
- /* { dg-output "0: 2.0 : total: 2.0" } */
- printf("compiled: %.1f\n", resfp);
- /* { dg-output "\ncompiled: 2.0" } */
-
- arg_types[0] = &ffi_type_uint;
- arg_types[1] = &ffi_type_double;
- arg_types[2] = NULL;
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 2, 2,
- &ffi_type_double, arg_types) == FFI_OK);
-
- firstarg = 0;
- doubles[0] = 2.0;
- values[0] = &firstarg;
- values[1] = &doubles[0];
- ffi_call(&cif, FFI_FN(float_va_fn), &resfp, values);
- /* { dg-output "\n0: 2.0 : total: 2.0" } */
- printf("ffi: %.1f\n", resfp);
- /* { dg-output "\nffi: 2.0" } */
- CHECK_DOUBLE_EQ(resfp, 2);
-
- /* Second test, float_va_fn(2,2.0,3.0,4.0), now with variadic params */
- /* Call it statically and then via ffi */
- resfp=float_va_fn(2,2.0,3.0,4.0);
- /* { dg-output "\n2: 2.0 : 0:3.0 1:4.0 total: 11.0" } */
- printf("compiled: %.1f\n", resfp);
- /* { dg-output "\ncompiled: 11.0" } */
- CHECK_DOUBLE_EQ(resfp, 11);
-
- arg_types[0] = &ffi_type_uint;
- arg_types[1] = &ffi_type_double;
- arg_types[2] = &ffi_type_double;
- arg_types[3] = &ffi_type_double;
- arg_types[4] = NULL;
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 2, 4,
- &ffi_type_double, arg_types) == FFI_OK);
-
- firstarg = 2;
- doubles[0] = 2.0;
- doubles[1] = 3.0;
- doubles[2] = 4.0;
- values[0] = &firstarg;
- values[1] = &doubles[0];
- values[2] = &doubles[1];
- values[3] = &doubles[2];
- ffi_call(&cif, FFI_FN(float_va_fn), &resfp, values);
- /* { dg-output "\n2: 2.0 : 0:3.0 1:4.0 total: 11.0" } */
- printf("ffi: %.1f\n", resfp);
- /* { dg-output "\nffi: 11.0" } */
- CHECK_DOUBLE_EQ(resfp, 11);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/i128-1.c b/deps/libffi/testsuite/libffi.call/i128-1.c
deleted file mode 100644
index 1395f5e9426..00000000000
--- a/deps/libffi/testsuite/libffi.call/i128-1.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Area: ffi_call
- Purpose: Check int128 call and return.
- Limitations: none.
- PR: none. */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-#if defined(FFI_TARGET_HAS_INT128) && defined(__SIZEOF_INT128__)
-
-typedef __int128_t i128;
-
-static const i128 val = ((i128)0x01020304050607ull << 64) | 0x08090a0b0c0d0e0full;
-static const int dummy = 0xdeadbeef;
-
-#define D(X) int X __attribute__((unused))
-
-static i128 f0(i128 x)
-{
- return x;
-}
-
-static i128 f1(D(a), i128 x)
-{
- return x;
-}
-
-static i128 f2(D(a), D(b), i128 x)
-{
- return x;
-}
-
-static i128 f3(D(a), D(b), D(c), i128 x)
-{
- return x;
-}
-
-static i128 f4(D(a), D(b), D(c), D(d), i128 x)
-{
- return x;
-}
-
-static i128 f5(D(a), D(b), D(c), D(d), D(e), i128 x)
-{
- return x;
-}
-
-static i128 f6(D(a), D(b), D(c), D(d), D(e), D(f), i128 x)
-{
- return x;
-}
-
-static i128 f7(D(a), D(b), D(c), D(d), D(e), D(f), D(g), i128 x)
-{
- return x;
-}
-
-static i128 f8(D(a), D(b), D(c), D(d), D(e), D(f), D(g), D(h), i128 x)
-{
- return x;
-}
-
-#define N 9
-
-static void * const funcs[N] = {
- f0, f1, f2, f3, f4, f5, f6, f7, f8
-};
-
-int main (void)
-{
- int i;
-
- for (i = 0; i < N; i++)
- {
- ffi_cif cif;
- ffi_status s;
- ffi_type *args[N];
- void *values[N];
- i128 ret;
- int j;
-
- for (j = 0; j < i; j++)
- {
- args[j] = &ffi_type_sint;
- values[j] = (void *)&dummy;
- }
- args[i] = &ffi_type_sint128;
- values[i] = (void *)&val;
-
- s = ffi_prep_cif(&cif, FFI_DEFAULT_ABI, i + 1,
- &ffi_type_sint128, args);
- CHECK(s == FFI_OK);
-
- ffi_call(&cif, FFI_FN(funcs[i]), &ret, values);
- CHECK(ret == val);
- }
-
- return 0;
-}
-
-#else
-int main (void) { return 0; }
-#endif
diff --git a/deps/libffi/testsuite/libffi.call/large_struct_by_value.c b/deps/libffi/testsuite/libffi.call/large_struct_by_value.c
deleted file mode 100644
index 016870dfe10..00000000000
--- a/deps/libffi/testsuite/libffi.call/large_struct_by_value.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Area: ffi_call
- Purpose: Pass a large struct by value (more words than arg registers).
- Limitations: none.
- PR: none.
- Originator: secscan regression (ARCompact used_stack overflow).
-
- Regression test: on ARCompact (ARC 32-bit), ffi_call_int sized the stack
- argument area at two words per argument, but a by-value struct is marshalled
- one word ("atom") at a time, and words beyond the argument registers were
- written to that under-sized area without bound. Passing a 64-byte struct by
- value (sixteen 32-bit words, eight more than the eight argument registers)
- must marshal correctly and return the expected sum. */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct { int v[8]; } big_struct;
-
-static int ABI_ATTR
-sum_big (big_struct s)
-{
- int i, sum = 0;
- for (i = 0; i < 8; i++)
- sum += s.v[i];
- return sum;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[1];
- void *values[1];
- ffi_type bs_type;
- ffi_type *bs_elements[9];
- big_struct in;
- ffi_arg result = 0;
- int i, expected = 0;
-
- bs_type.size = 0;
- bs_type.alignment = 0;
- bs_type.type = FFI_TYPE_STRUCT;
- for (i = 0; i < 8; i++)
- bs_elements[i] = &ffi_type_sint;
- bs_elements[8] = NULL;
- bs_type.elements = bs_elements;
-
- for (i = 0; i < 8; i++)
- {
- in.v[i] = 0x1111 * (i + 1);
- expected += in.v[i];
- }
-
- args[0] = &bs_type;
- values[0] = ∈
-
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ffi_type_sint, args) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(sum_big), &result, values);
-
- CHECK((int) result == expected);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/longjmp.c b/deps/libffi/testsuite/libffi.call/longjmp.c
deleted file mode 100644
index fc0c7ffd915..00000000000
--- a/deps/libffi/testsuite/libffi.call/longjmp.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Area: ffi_call
- Purpose: Test longjmp over ffi_call frames */
-
-/* Test code adapted from Lars Kanis' bug report:
- https://github.com/libffi/libffi/issues/905 */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-#include "ffi_common.h"
-
-#include <setjmp.h>
-
-static jmp_buf buf;
-
-static void ABI_ATTR lev2(const char *str) {
- printf("lev2 %s\n", str);
- // jumps back to where setjmp was called - making setjmp now return 1
- longjmp(buf, 1);
-}
-
-static void ABI_ATTR lev1(const char *str) {
- lev2(str);
-
- // will not be reached
- printf("lev1 %s\n", str);
-}
-
-int main()
-{
- ffi_cif cif;
- ffi_type *args[1];
- void *values[1];
- char *s;
- ffi_arg rc;
- /* Initialize the argument info vectors */
- args[0] = &ffi_type_pointer;
- values[0] = &s;
- /* Initialize the cif */
- if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_sint, args) == FFI_OK)
- {
- s = "direct call";
- if (!setjmp(buf)){
- // works on x64 and arm64
- lev1(s);
- } else {
- printf("back to main\n");
- }
-
- s = "through libffi";
- if (!setjmp(buf)){
- // works on x64 but segfaults on arm64
- ffi_call(&cif, (void (*)(void))lev1, &rc, values);
- } else {
- printf("back to main\n");
- }
- }
- return 0;
-}
diff --git a/deps/libffi/testsuite/libffi.call/many.c b/deps/libffi/testsuite/libffi.call/many.c
deleted file mode 100644
index 336968c77a2..00000000000
--- a/deps/libffi/testsuite/libffi.call/many.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value float, with many arguments
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-#include <stdlib.h>
-#include <float.h>
-#include <math.h>
-
-static float ABI_ATTR many(float f1, float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9, float f10, float f11, float f12, float f13)
-{
-#if 0
- printf("%f %f %f %f %f %f %f %f %f %f %f %f %f\n",
- (double) f1, (double) f2, (double) f3, (double) f4, (double) f5,
- (double) f6, (double) f7, (double) f8, (double) f9, (double) f10,
- (double) f11, (double) f12, (double) f13);
-#endif
-
- return f1+f2+f3+f4+f5+f6+f7+f8+f9+f10+f11+f12+f13;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[13];
- void *values[13];
- float fa[13];
- float f, ff;
- int i;
-
- for (i = 0; i < 13; i++)
- {
- args[i] = &ffi_type_float;
- values[i] = &fa[i];
- fa[i] = (float) i;
- }
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 13,
- &ffi_type_float, args) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(many), &f, values);
-
- ff = many(fa[0], fa[1],
- fa[2], fa[3],
- fa[4], fa[5],
- fa[6], fa[7],
- fa[8], fa[9],
- fa[10],fa[11],fa[12]);
-
- if (fabs(f - ff) < FLT_EPSILON)
- exit(0);
- else
- abort();
-}
diff --git a/deps/libffi/testsuite/libffi.call/many2.c b/deps/libffi/testsuite/libffi.call/many2.c
deleted file mode 100644
index 1c85746e4c4..00000000000
--- a/deps/libffi/testsuite/libffi.call/many2.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Area: ffi_call
- Purpose: Check uint8_t arguments.
- Limitations: none.
- PR: PR45677.
- Originator: Dan Witte <dwitte@gmail.com> 20100916 */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-#define NARGS 7
-
-typedef unsigned char u8;
-
-#ifdef __GNUC__
-__attribute__((noinline))
-#endif
-uint8_t
-foo (uint8_t a, uint8_t b, uint8_t c, uint8_t d,
- uint8_t e, uint8_t f, uint8_t g)
-{
- return a + b + c + d + e + f + g;
-}
-
-uint8_t ABI_ATTR
-bar (uint8_t a, uint8_t b, uint8_t c, uint8_t d,
- uint8_t e, uint8_t f, uint8_t g)
-{
- return foo (a, b, c, d, e, f, g);
-}
-
-int
-main (void)
-{
- ffi_type *ffitypes[NARGS];
- int i;
- ffi_cif cif;
- ffi_arg result = 0;
- uint8_t args[NARGS];
- void *argptrs[NARGS];
-
- for (i = 0; i < NARGS; ++i)
- ffitypes[i] = &ffi_type_uint8;
-
- CHECK (ffi_prep_cif (&cif, ABI_NUM, NARGS,
- &ffi_type_uint8, ffitypes) == FFI_OK);
-
- for (i = 0; i < NARGS; ++i)
- {
- args[i] = i;
- argptrs[i] = &args[i];
- }
- ffi_call (&cif, FFI_FN (bar), &result, argptrs);
-
- CHECK (result == 21);
- return 0;
-}
diff --git a/deps/libffi/testsuite/libffi.call/many_double.c b/deps/libffi/testsuite/libffi.call/many_double.c
deleted file mode 100644
index 4ef8c8ab28b..00000000000
--- a/deps/libffi/testsuite/libffi.call/many_double.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value double, with many arguments
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-#include <stdlib.h>
-#include <float.h>
-#include <math.h>
-
-static double many(double f1,
- double f2,
- double f3,
- double f4,
- double f5,
- double f6,
- double f7,
- double f8,
- double f9,
- double f10,
- double f11,
- double f12,
- double f13)
-{
-#if 0
- printf("%f %f %f %f %f %f %f %f %f %f %f %f %f\n",
- (double) f1, (double) f2, (double) f3, (double) f4, (double) f5,
- (double) f6, (double) f7, (double) f8, (double) f9, (double) f10,
- (double) f11, (double) f12, (double) f13);
-#endif
-
- return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13);
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[13];
- void *values[13];
- double fa[13];
- double f, ff;
- int i;
-
- for (i = 0; i < 13; i++)
- {
- args[i] = &ffi_type_double;
- values[i] = &fa[i];
- fa[i] = (double) i;
- }
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 13,
- &ffi_type_double, args) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(many), &f, values);
-
- ff = many(fa[0], fa[1],
- fa[2], fa[3],
- fa[4], fa[5],
- fa[6], fa[7],
- fa[8], fa[9],
- fa[10],fa[11],fa[12]);
- if (fabs(f - ff) < FLT_EPSILON)
- exit(0);
- else
- abort();
-}
diff --git a/deps/libffi/testsuite/libffi.call/many_large_structs.c b/deps/libffi/testsuite/libffi.call/many_large_structs.c
deleted file mode 100644
index 9f766a9113c..00000000000
--- a/deps/libffi/testsuite/libffi.call/many_large_structs.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Area: ffi_call
- Purpose: Pass many large by-value structs on AArch64.
- Limitations: none.
- PR: none.
- Originator: AArch64 large-struct stack accounting regression.
-
- Regression test: on AArch64, composites larger than 16 bytes are passed
- by invisible reference. ffi_call copies each payload into the argument
- slab (growing down from the top) and, once X0-X7 are exhausted, also
- spills the by-ref pointer into the same slab (the NSAA, growing up).
- The generic prep_cif budget in cif->bytes only charged the payload copy,
- not the 8-byte pointer slot, so with enough large structs the two regions
- collided and a later payload copy overwrote an already-spilled pointer,
- leaving the callee with a corrupt pointer for a by-value argument.
- Passing sixteen 32-byte (non-HFA) structs by value -- eight more than the
- argument registers -- must marshal every argument intact. */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-#define NARGS 16
-#define SSIZE 32
-
-typedef struct { unsigned char b[SSIZE]; } big_struct;
-
-/* Sum every byte of every argument. A corrupted by-ref pointer makes the
- callee read the wrong memory, so the sum no longer matches. */
-static int ABI_ATTR
-sum_bytes (big_struct s0, big_struct s1, big_struct s2, big_struct s3,
- big_struct s4, big_struct s5, big_struct s6, big_struct s7,
- big_struct s8, big_struct s9, big_struct s10, big_struct s11,
- big_struct s12, big_struct s13, big_struct s14, big_struct s15)
-{
- big_struct *all[NARGS];
- int i, j, sum = 0;
-
- all[0] = &s0; all[1] = &s1; all[2] = &s2; all[3] = &s3;
- all[4] = &s4; all[5] = &s5; all[6] = &s6; all[7] = &s7;
- all[8] = &s8; all[9] = &s9; all[10] = &s10; all[11] = &s11;
- all[12] = &s12; all[13] = &s13; all[14] = &s14; all[15] = &s15;
-
- for (i = 0; i < NARGS; i++)
- for (j = 0; j < SSIZE; j++)
- sum += all[i]->b[j];
-
- return sum;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[NARGS];
- void *values[NARGS];
- ffi_type bs_type;
- ffi_type *bs_elements[SSIZE + 1];
- big_struct in[NARGS];
- ffi_arg result = 0;
- int i, j, expected = 0;
-
- bs_type.size = 0;
- bs_type.alignment = 0;
- bs_type.type = FFI_TYPE_STRUCT;
- for (i = 0; i < SSIZE; i++)
- bs_elements[i] = &ffi_type_uchar;
- bs_elements[SSIZE] = NULL;
- bs_type.elements = bs_elements;
-
- /* Fill struct i with the distinct byte value (i + 1) so any pointer
- mix-up between arguments changes the total. */
- for (i = 0; i < NARGS; i++)
- {
- for (j = 0; j < SSIZE; j++)
- {
- in[i].b[j] = (unsigned char) (i + 1);
- expected += (i + 1);
- }
- args[i] = &bs_type;
- values[i] = &in[i];
- }
-
- CHECK(ffi_prep_cif(&cif, ABI_NUM, NARGS, &ffi_type_sint, args) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(sum_bytes), &result, values);
-
- CHECK((int) result == expected);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/many_mixed.c b/deps/libffi/testsuite/libffi.call/many_mixed.c
deleted file mode 100644
index 85ec36ecbef..00000000000
--- a/deps/libffi/testsuite/libffi.call/many_mixed.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value double, with many arguments
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-#include <stdlib.h>
-#include <float.h>
-#include <math.h>
-
-static double many(double f1,
- double f2,
- long int i1,
- double f3,
- double f4,
- long int i2,
- double f5,
- double f6,
- long int i3,
- double f7,
- double f8,
- long int i4,
- double f9,
- double f10,
- long int i5,
- double f11,
- double f12,
- long int i6,
- double f13)
-{
- return ((double) (i1 + i2 + i3 + i4 + i5 + i6) + (f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13);
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[19];
- void *values[19];
- double fa[19];
- long int la[19];
- double f, ff;
- int i;
-
- for (i = 0; i < 19; i++)
- {
- if( (i - 2) % 3 == 0) {
- args[i] = &ffi_type_slong;
- la[i] = (long int) i;
- values[i] = &la[i];
- }
- else {
- args[i] = &ffi_type_double;
- fa[i] = (double) i;
- values[i] = &fa[i];
- }
- }
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 19,
- &ffi_type_double, args) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(many), &f, values);
-
- ff = many(fa[0], fa[1], la[2],
- fa[3], fa[4], la[5],
- fa[6], fa[7], la[8],
- fa[9], fa[10], la[11],
- fa[12], fa[13], la[14],
- fa[15], fa[16], la[17],
- fa[18]);
- if (fabs(f - ff) < FLT_EPSILON)
- exit(0);
- else
- abort();
-}
diff --git a/deps/libffi/testsuite/libffi.call/many_small_structs.c b/deps/libffi/testsuite/libffi.call/many_small_structs.c
deleted file mode 100644
index 242c38cfc13..00000000000
--- a/deps/libffi/testsuite/libffi.call/many_small_structs.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Area: ffi_call
- Purpose: Pass many small (8-byte) structs by value.
- Limitations: none.
- PR: none.
- Originator: secscan regression (PA-RISC 32-bit slot under-count).
-
- Regression test: on PA-RISC 32-bit (FFI_PA32), ffi_size_stack_pa32 reserves
- one stack slot per struct (pa/ffi.c: "z += 1"), but ffi_prep_args_pa32
- consumes two slots for a 5-8 byte struct passed inline. ffi_call_pa32 sets
- the argument base to sp + cif->bytes and ffi_prep_args_pa32 writes each
- argument at (base - slot*4), so once the marshaller's slot count exceeds
- cif->bytes/4 the writes spill below sp -- first into the 64-byte register
- save area, then over ffi_call_pa32's own saved return pointer.
-
- A few small structs only overflow into harmless scratch (the call still
- returns correctly), so this uses enough 8-byte structs that the overflow
- reaches the saved return pointer and corrupts the return path. On a correct
- backend all arguments marshal within the allocated frame and the call simply
- returns the expected sums; the test passes everywhere except an unfixed
- FFI_PA32. */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct { int a; int b; } small_struct;
-
-#define NARGS 40
-
-static small_struct ABI_ATTR
-many_small (small_struct s0, small_struct s1, small_struct s2, small_struct s3,
- small_struct s4, small_struct s5, small_struct s6, small_struct s7,
- small_struct s8, small_struct s9, small_struct s10, small_struct s11,
- small_struct s12, small_struct s13, small_struct s14, small_struct s15,
- small_struct s16, small_struct s17, small_struct s18, small_struct s19,
- small_struct s20, small_struct s21, small_struct s22, small_struct s23,
- small_struct s24, small_struct s25, small_struct s26, small_struct s27,
- small_struct s28, small_struct s29, small_struct s30, small_struct s31,
- small_struct s32, small_struct s33, small_struct s34, small_struct s35,
- small_struct s36, small_struct s37, small_struct s38, small_struct s39)
-{
- small_struct r;
- r.a = s0.a + s1.a + s2.a + s3.a + s4.a + s5.a + s6.a + s7.a
- + s8.a + s9.a + s10.a + s11.a + s12.a + s13.a + s14.a + s15.a
- + s16.a + s17.a + s18.a + s19.a + s20.a + s21.a + s22.a + s23.a
- + s24.a + s25.a + s26.a + s27.a + s28.a + s29.a + s30.a + s31.a
- + s32.a + s33.a + s34.a + s35.a + s36.a + s37.a + s38.a + s39.a;
- r.b = s0.b + s1.b + s2.b + s3.b + s4.b + s5.b + s6.b + s7.b
- + s8.b + s9.b + s10.b + s11.b + s12.b + s13.b + s14.b + s15.b
- + s16.b + s17.b + s18.b + s19.b + s20.b + s21.b + s22.b + s23.b
- + s24.b + s25.b + s26.b + s27.b + s28.b + s29.b + s30.b + s31.b
- + s32.b + s33.b + s34.b + s35.b + s36.b + s37.b + s38.b + s39.b;
- return r;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[NARGS];
- void *values[NARGS];
- ffi_type ss_type;
- ffi_type *ss_elements[3];
- small_struct in[NARGS];
- small_struct result = { 0, 0 };
- int i, expected_a = 0, expected_b = 0;
-
- ss_type.size = 0;
- ss_type.alignment = 0;
- ss_type.type = FFI_TYPE_STRUCT;
- ss_type.elements = ss_elements;
- ss_elements[0] = &ffi_type_sint;
- ss_elements[1] = &ffi_type_sint;
- ss_elements[2] = NULL;
-
- for (i = 0; i < NARGS; i++)
- {
- in[i].a = i + 1;
- in[i].b = -(i + 1);
- expected_a += in[i].a;
- expected_b += in[i].b;
- args[i] = &ss_type;
- values[i] = &in[i];
- }
-
- CHECK(ffi_prep_cif(&cif, ABI_NUM, NARGS, &ss_type, args) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(many_small), &result, values);
-
- CHECK(result.a == expected_a);
- CHECK(result.b == expected_b);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/negint.c b/deps/libffi/testsuite/libffi.call/negint.c
deleted file mode 100644
index 6e2f26fc100..00000000000
--- a/deps/libffi/testsuite/libffi.call/negint.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Area: ffi_call
- Purpose: Check that negative integers are passed correctly.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-static int checking(int a, short b, signed char c)
-{
-
- return (a < 0 && b < 0 && c < 0);
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg rint;
-
- signed int si;
- signed short ss;
- signed char sc;
-
- args[0] = &ffi_type_sint;
- values[0] = &si;
- args[1] = &ffi_type_sshort;
- values[1] = &ss;
- args[2] = &ffi_type_schar;
- values[2] = ≻
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
- &ffi_type_sint, args) == FFI_OK);
-
- si = -6;
- ss = -12;
- sc = -1;
-
- checking (si, ss, sc);
-
- ffi_call(&cif, FFI_FN(checking), &rint, values);
-
- printf ("%d vs %d\n", (int)rint, checking (si, ss, sc));
-
- CHECK(rint != 0);
-
- exit (0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/offsets.c b/deps/libffi/testsuite/libffi.call/offsets.c
deleted file mode 100644
index 23d88b35d56..00000000000
--- a/deps/libffi/testsuite/libffi.call/offsets.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Area: Struct layout
- Purpose: Test ffi_get_struct_offsets
- Limitations: none.
- PR: none.
- Originator: Tom Tromey. */
-
-/* { dg-do run } */
-#include "ffitest.h"
-#include <stddef.h>
-
-struct test_1
-{
- char c;
- float f;
- char c2;
- int i;
-};
-
-int
-main (void)
-{
- ffi_type test_1_type;
- ffi_type *test_1_elements[5];
- size_t test_1_offsets[4];
-
- test_1_elements[0] = &ffi_type_schar;
- test_1_elements[1] = &ffi_type_float;
- test_1_elements[2] = &ffi_type_schar;
- test_1_elements[3] = &ffi_type_sint;
- test_1_elements[4] = NULL;
-
- test_1_type.size = 0;
- test_1_type.alignment = 0;
- test_1_type.type = FFI_TYPE_STRUCT;
- test_1_type.elements = test_1_elements;
-
- CHECK (ffi_get_struct_offsets (FFI_DEFAULT_ABI, &test_1_type, test_1_offsets)
- == FFI_OK);
- CHECK (test_1_type.size == sizeof (struct test_1));
- CHECK (offsetof (struct test_1, c) == test_1_offsets[0]);
- CHECK (offsetof (struct test_1, f) == test_1_offsets[1]);
- CHECK (offsetof (struct test_1, c2) == test_1_offsets[2]);
- CHECK (offsetof (struct test_1, i) == test_1_offsets[3]);
-
- return 0;
-}
diff --git a/deps/libffi/testsuite/libffi.call/overread.c b/deps/libffi/testsuite/libffi.call/overread.c
deleted file mode 100644
index 5ba10774c9f..00000000000
--- a/deps/libffi/testsuite/libffi.call/overread.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Area: ffi_call
- Purpose: Tests if ffi_call reads data beyond end.
- Limitations: needs mmap.
- PR: 887
- Originator: Mikulas Patocka <mikulas@twibright.com> */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-#ifdef __linux__
-#include <sys/mman.h>
-#include <unistd.h>
-
-static int ABI_ATTR fn(unsigned char a, unsigned short b, unsigned int c, unsigned long d)
-{
- return (int)(a + b + c + d);
-}
-#endif
-
-int main(void)
-{
-#ifdef __linux__
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg rint;
- char *m;
- int ps;
- args[0] = &ffi_type_uchar;
- args[1] = &ffi_type_ushort;
- args[2] = &ffi_type_uint;
- args[3] = &ffi_type_ulong;
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 4, &ffi_type_sint, args) == FFI_OK);
- ps = getpagesize();
- m = mmap(NULL, ps * 3, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
- CHECK(m != MAP_FAILED);
- CHECK(mprotect(m, ps, PROT_NONE) == 0);
- CHECK(mprotect(m + ps * 2, ps, PROT_NONE) == 0);
- values[0] = m + ps * 2 - sizeof(unsigned char);
- values[1] = m + ps * 2 - sizeof(unsigned short);
- values[2] = m + ps * 2 - sizeof(unsigned int);
- values[3] = m + ps * 2 - sizeof(unsigned long);
- ffi_call(&cif, FFI_FN(fn), &rint, values);
- CHECK((int)rint == 0);
- values[0] = m + ps;
- values[1] = m + ps;
- values[2] = m + ps;
- values[3] = m + ps;
- ffi_call(&cif, FFI_FN(fn), &rint, values);
- CHECK((int)rint == 0);
-#endif
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/plan.c b/deps/libffi/testsuite/libffi.call/plan.c
deleted file mode 100644
index afed0977e6b..00000000000
--- a/deps/libffi/testsuite/libffi.call/plan.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/* Area: ffi_call_plan
- Purpose: Check that a reusable call plan reproduces ffi_call for the
- pure-GP64 fast path, pointer arguments and repeated reuse,
- and that a signature with no fast path still yields a usable
- plan that falls back to ffi_call.
- Limitations: none.
- PR: none.
- Originator: ffi_call_plan tests */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static uint64_t gp6(uint64_t a, uint64_t b, uint64_t c,
- uint64_t d, uint64_t e, uint64_t f)
-{
- return a + b * 2 + c * 3 + d * 4 + e * 5 + f * 6;
-}
-
-static void *ptr_ident(void *p)
-{
- return p;
-}
-
-struct small_pair { long x; long y; };
-
-static long ssum(struct small_pair s)
-{
- return s.x - s.y;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[6];
- void *values[6];
- ffi_call_plan *plan;
- uint64_t a[6], r_call, r_plan;
- int i, k;
-
- /* Pure GP64: every argument is one 64-bit integer, so build_plan
- selects the ffi_plan_gpN direct thunk. Reuse the plan across many
- invocations with changing values. */
- for (i = 0; i < 6; i++)
- args[i] = &ffi_type_uint64;
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 6, &ffi_type_uint64, args)
- == FFI_OK);
- plan = ffi_call_plan_alloc(&cif);
- CHECK(plan != NULL);
-
- for (k = 0; k < 100; k++)
- {
- for (i = 0; i < 6; i++)
- {
- a[i] = (uint64_t) (k * 7 + i + 1);
- values[i] = &a[i];
- }
- ffi_call(&cif, FFI_FN(gp6), &r_call, values);
- ffi_call_plan_invoke(plan, FFI_FN(gp6), &r_plan, values);
- CHECK(r_call == r_plan);
- CHECK(r_plan == gp6(a[0], a[1], a[2], a[3], a[4], a[5]));
- }
- ffi_call_plan_free(plan);
-
- /* Pointer argument and pointer return. */
- {
- ffi_cif cifp;
- ffi_type *pargs[1];
- void *pvalues[1];
- void *in, *rc, *rp;
- ffi_call_plan *planp;
-
- pargs[0] = &ffi_type_pointer;
- CHECK(ffi_prep_cif(&cifp, FFI_DEFAULT_ABI, 1, &ffi_type_pointer, pargs)
- == FFI_OK);
- planp = ffi_call_plan_alloc(&cifp);
- CHECK(planp != NULL);
-
- in = &cifp;
- pvalues[0] = ∈
- ffi_call(&cifp, FFI_FN(ptr_ident), &rc, pvalues);
- ffi_call_plan_invoke(planp, FFI_FN(ptr_ident), &rp, pvalues);
- CHECK(rc == in);
- CHECK(rp == in);
- ffi_call_plan_free(planp);
- }
-
- /* No fast path: a struct-by-value argument. build_plan returns NULL for
- the fast plan, but ffi_call_plan_alloc must still hand back a valid plan
- whose invoke falls back to ffi_call and produces the same result. */
- {
- ffi_cif cifs;
- ffi_type *sargs[1];
- ffi_type stype;
- ffi_type *selements[3];
- void *svalues[1];
- struct small_pair s;
- ffi_arg rc, rp;
- ffi_call_plan *plans;
-
- selements[0] = &ffi_type_slong;
- selements[1] = &ffi_type_slong;
- selements[2] = NULL;
- stype.size = stype.alignment = 0;
- stype.type = FFI_TYPE_STRUCT;
- stype.elements = selements;
-
- sargs[0] = &stype;
- CHECK(ffi_prep_cif(&cifs, FFI_DEFAULT_ABI, 1, &ffi_type_slong, sargs)
- == FFI_OK);
- plans = ffi_call_plan_alloc(&cifs);
- CHECK(plans != NULL);
-
- s.x = 123;
- s.y = 45;
- svalues[0] = &s;
- ffi_call(&cifs, FFI_FN(ssum), &rc, svalues);
- ffi_call_plan_invoke(plans, FFI_FN(ssum), &rp, svalues);
- CHECK(rc == rp);
- CHECK((long) rp == ssum(s));
- ffi_call_plan_free(plans);
- }
-
- /* Freeing NULL is documented to be harmless. */
- ffi_call_plan_free(NULL);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/plan_mixed.c b/deps/libffi/testsuite/libffi.call/plan_mixed.c
deleted file mode 100644
index 54b1f6290c4..00000000000
--- a/deps/libffi/testsuite/libffi.call/plan_mixed.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/* Area: ffi_call_plan
- Purpose: Check that a reusable call plan reproduces ffi_call for
- signatures that mix general-purpose and SSE registers, for
- float and double returns, for signed narrow arguments, and
- for integer returns narrower than a register (which the plan
- must widen to ffi_arg exactly as ffi_call does).
- Limitations: none.
- PR: none.
- Originator: ffi_call_plan tests */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static double mixed(int a, double b, long c, float d,
- long long e, double f)
-{
- return (double) a + b + (double) c + (double) d + (double) e + f;
-}
-
-static float faddf(float a, float b)
-{
- return a + b;
-}
-
-static signed char ret_sc(signed char x)
-{
- return (signed char) (x + 1);
-}
-
-static unsigned char ret_uc(unsigned char x)
-{
- return (unsigned char) (x + 1);
-}
-
-int main (void)
-{
- /* Mixed GP + SSE arguments, double return: exercises the fast local-image
- path with both integer and SSE moves and the ssecount (al) setup. */
- {
- ffi_cif cif;
- ffi_type *args[6];
- void *values[6];
- ffi_call_plan *plan;
- int a = 3;
- double b = 1.5, f = -2.25, rc, rp;
- long c = 7;
- float d = 0.5f;
- long long e = -11;
-
- args[0] = &ffi_type_sint;
- args[1] = &ffi_type_double;
- args[2] = &ffi_type_slong;
- args[3] = &ffi_type_float;
- args[4] = &ffi_type_sint64;
- args[5] = &ffi_type_double;
- values[0] = &a; values[1] = &b; values[2] = &c;
- values[3] = &d; values[4] = &e; values[5] = &f;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 6, &ffi_type_double, args)
- == FFI_OK);
- plan = ffi_call_plan_alloc(&cif);
- CHECK(plan != NULL);
-
- ffi_call(&cif, FFI_FN(mixed), &rc, values);
- ffi_call_plan_invoke(plan, FFI_FN(mixed), &rp, values);
- CHECK_DOUBLE_EQ(rc, rp);
- CHECK_DOUBLE_EQ(rp, mixed(a, b, c, d, e, f));
- ffi_call_plan_free(plan);
- }
-
- /* Float arguments and float return. */
- {
- ffi_cif cif;
- ffi_type *args[2];
- void *values[2];
- ffi_call_plan *plan;
- float a = 1.25f, b = 2.5f, rc, rp;
-
- args[0] = &ffi_type_float;
- args[1] = &ffi_type_float;
- values[0] = &a;
- values[1] = &b;
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ffi_type_float, args)
- == FFI_OK);
- plan = ffi_call_plan_alloc(&cif);
- CHECK(plan != NULL);
-
- ffi_call(&cif, FFI_FN(faddf), &rc, values);
- ffi_call_plan_invoke(plan, FFI_FN(faddf), &rp, values);
- CHECK_FLOAT_EQ(rc, rp);
- CHECK_FLOAT_EQ(rp, faddf(a, b));
- ffi_call_plan_free(plan);
- }
-
- /* Signed narrow argument and signed narrow return: the plan sign-extends
- the argument and widens the return to ffi_arg just as ffi_call does. */
- {
- ffi_cif cif;
- ffi_type *args[1];
- void *values[1];
- ffi_call_plan *plan;
- signed char in;
- ffi_arg rc, rp;
- int v;
-
- args[0] = &ffi_type_schar;
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_schar, args)
- == FFI_OK);
- plan = ffi_call_plan_alloc(&cif);
- CHECK(plan != NULL);
-
- for (v = -128; v < 128; v++)
- {
- in = (signed char) v;
- values[0] = ∈
- ffi_call(&cif, FFI_FN(ret_sc), &rc, values);
- ffi_call_plan_invoke(plan, FFI_FN(ret_sc), &rp, values);
- CHECK(rc == rp);
- CHECK((signed char) rp == ret_sc(in));
- }
- ffi_call_plan_free(plan);
- }
-
- /* Unsigned narrow argument and unsigned narrow return. */
- {
- ffi_cif cif;
- ffi_type *args[1];
- void *values[1];
- ffi_call_plan *plan;
- unsigned char in;
- ffi_arg rc, rp;
- int v;
-
- args[0] = &ffi_type_uchar;
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_uchar, args)
- == FFI_OK);
- plan = ffi_call_plan_alloc(&cif);
- CHECK(plan != NULL);
-
- for (v = 0; v < 256; v++)
- {
- in = (unsigned char) v;
- values[0] = ∈
- ffi_call(&cif, FFI_FN(ret_uc), &rc, values);
- ffi_call_plan_invoke(plan, FFI_FN(ret_uc), &rp, values);
- CHECK(rc == rp);
- CHECK((unsigned char) rp == ret_uc(in));
- }
- ffi_call_plan_free(plan);
- }
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/plan_size.c b/deps/libffi/testsuite/libffi.call/plan_size.c
deleted file mode 100644
index b8398fbee99..00000000000
--- a/deps/libffi/testsuite/libffi.call/plan_size.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/* Area: ffi_call_plan_size
- Purpose: Check that a plan reports its own allocation size, that the
- size is stable across invocations, and that a NULL plan has
- no footprint.
- Limitations: The exact byte count is implementation defined, so this only
- checks the invariants callers may rely on.
- PR: none.
- Originator: ffi_call_plan tests */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static uint64_t gp2(uint64_t a, uint64_t b)
-{
- return a + b * 2;
-}
-
-static uint64_t gp6(uint64_t a, uint64_t b, uint64_t c,
- uint64_t d, uint64_t e, uint64_t f)
-{
- return a + b * 2 + c * 3 + d * 4 + e * 5 + f * 6;
-}
-
-int main (void)
-{
- ffi_cif cif2, cif6;
- ffi_type *args[6];
- void *values[6];
- ffi_call_plan *plan2, *plan6;
- size_t size2, size6;
- uint64_t a[6], r;
- int i;
-
- for (i = 0; i < 6; i++)
- {
- args[i] = &ffi_type_uint64;
- a[i] = (uint64_t) (i + 1);
- values[i] = &a[i];
- }
-
- CHECK(ffi_prep_cif(&cif2, FFI_DEFAULT_ABI, 2, &ffi_type_uint64, args)
- == FFI_OK);
- CHECK(ffi_prep_cif(&cif6, FFI_DEFAULT_ABI, 6, &ffi_type_uint64, args)
- == FFI_OK);
-
- /* A NULL plan has no footprint, mirroring ffi_call_plan_free(NULL). */
- CHECK(ffi_call_plan_size(NULL) == 0);
-
- plan2 = ffi_call_plan_alloc(&cif2);
- CHECK(plan2 != NULL);
- plan6 = ffi_call_plan_alloc(&cif6);
- CHECK(plan6 != NULL);
-
- size2 = ffi_call_plan_size(plan2);
- size6 = ffi_call_plan_size(plan6);
-
- /* Every plan owns at least its handle, and a wider signature never needs
- less memory than a narrower one of the same shape. Targets without a
- fast path report the same constant for both. */
- CHECK(size2 > 0);
- CHECK(size6 >= size2);
-
- /* The plan is immutable, so querying it must not disturb invocation and
- the reported size must not drift across calls. */
- ffi_call_plan_invoke(plan6, FFI_FN(gp6), &r, values);
- CHECK(r == gp6(a[0], a[1], a[2], a[3], a[4], a[5]));
- CHECK(ffi_call_plan_size(plan6) == size6);
-
- ffi_call_plan_invoke(plan2, FFI_FN(gp2), &r, values);
- CHECK(r == gp2(a[0], a[1]));
- CHECK(ffi_call_plan_size(plan2) == size2);
-
- ffi_call_plan_free(plan2);
- ffi_call_plan_free(plan6);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/plan_spill.c b/deps/libffi/testsuite/libffi.call/plan_spill.c
deleted file mode 100644
index c073c99142e..00000000000
--- a/deps/libffi/testsuite/libffi.call/plan_spill.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/* Area: ffi_call_plan
- Purpose: Check that a reusable call plan reproduces ffi_call when
- arguments spill past the argument registers onto the stack.
- This drives the non-fast plan path (a move list handed to
- ffi_call_unix64) for GP spill, SSE spill, and a mix of both.
- Limitations: none.
- PR: none.
- Originator: ffi_call_plan tests */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-/* 10 integers: 6 in registers, 4 spilled to the stack. */
-static long long gp10(long long a1, long long a2, long long a3, long long a4,
- long long a5, long long a6, long long a7, long long a8,
- long long a9, long long a10)
-{
- return a1 + a2 * 2 + a3 * 3 + a4 * 4 + a5 * 5
- + a6 * 6 + a7 * 7 + a8 * 8 + a9 * 9 + a10 * 10;
-}
-
-/* 12 doubles: 8 in SSE registers, 4 spilled to the stack. */
-static double sse12(double a1, double a2, double a3, double a4,
- double a5, double a6, double a7, double a8,
- double a9, double a10, double a11, double a12)
-{
- return a1 + a2 * 2 + a3 * 3 + a4 * 4 + a5 * 5 + a6 * 6
- + a7 * 7 + a8 * 8 + a9 * 9 + a10 * 10 + a11 * 11 + a12 * 12;
-}
-
-/* 8 ints + 8 doubles: both classes spill. */
-static double mix16(long i1, long i2, long i3, long i4,
- long i5, long i6, long i7, long i8,
- double d1, double d2, double d3, double d4,
- double d5, double d6, double d7, double d8)
-{
- double s = 0.0;
- s += (double) (i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8);
- s += d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8;
- return s;
-}
-
-int main (void)
-{
- /* GP spill. */
- {
- ffi_cif cif;
- ffi_type *args[10];
- void *values[10];
- long long a[10];
- long long rc, rp;
- ffi_call_plan *plan;
- int i;
-
- for (i = 0; i < 10; i++)
- {
- args[i] = &ffi_type_sint64;
- a[i] = (long long) (i + 1) * 100 - 3;
- values[i] = &a[i];
- }
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 10, &ffi_type_sint64, args)
- == FFI_OK);
- plan = ffi_call_plan_alloc(&cif);
- CHECK(plan != NULL);
-
- ffi_call(&cif, FFI_FN(gp10), &rc, values);
- ffi_call_plan_invoke(plan, FFI_FN(gp10), &rp, values);
- CHECK(rc == rp);
- CHECK(rp == gp10(a[0], a[1], a[2], a[3], a[4],
- a[5], a[6], a[7], a[8], a[9]));
- ffi_call_plan_free(plan);
- }
-
- /* SSE spill. */
- {
- ffi_cif cif;
- ffi_type *args[12];
- void *values[12];
- double a[12];
- double rc, rp;
- ffi_call_plan *plan;
- int i;
-
- for (i = 0; i < 12; i++)
- {
- args[i] = &ffi_type_double;
- a[i] = (double) i + 0.25;
- values[i] = &a[i];
- }
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 12, &ffi_type_double, args)
- == FFI_OK);
- plan = ffi_call_plan_alloc(&cif);
- CHECK(plan != NULL);
-
- ffi_call(&cif, FFI_FN(sse12), &rc, values);
- ffi_call_plan_invoke(plan, FFI_FN(sse12), &rp, values);
- CHECK_DOUBLE_EQ(rc, rp);
- CHECK_DOUBLE_EQ(rp, sse12(a[0], a[1], a[2], a[3], a[4], a[5],
- a[6], a[7], a[8], a[9], a[10], a[11]));
- ffi_call_plan_free(plan);
- }
-
- /* Both classes spill. */
- {
- ffi_cif cif;
- ffi_type *args[16];
- void *values[16];
- long iv[8];
- double dv[8];
- double rc, rp;
- ffi_call_plan *plan;
- int i;
-
- for (i = 0; i < 8; i++)
- {
- args[i] = &ffi_type_slong;
- iv[i] = (long) (i + 1);
- values[i] = &iv[i];
- }
- for (i = 0; i < 8; i++)
- {
- args[8 + i] = &ffi_type_double;
- dv[i] = (double) (i + 1) * 0.5;
- values[8 + i] = &dv[i];
- }
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16, &ffi_type_double, args)
- == FFI_OK);
- plan = ffi_call_plan_alloc(&cif);
- CHECK(plan != NULL);
-
- ffi_call(&cif, FFI_FN(mix16), &rc, values);
- ffi_call_plan_invoke(plan, FFI_FN(mix16), &rp, values);
- CHECK_DOUBLE_EQ(rc, rp);
- CHECK_DOUBLE_EQ(rp, mix16(iv[0], iv[1], iv[2], iv[3],
- iv[4], iv[5], iv[6], iv[7],
- dv[0], dv[1], dv[2], dv[3],
- dv[4], dv[5], dv[6], dv[7]));
- ffi_call_plan_free(plan);
- }
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/plan_struct.c b/deps/libffi/testsuite/libffi.call/plan_struct.c
deleted file mode 100644
index 816296d77a8..00000000000
--- a/deps/libffi/testsuite/libffi.call/plan_struct.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/* Area: ffi_call_plan
- Purpose: Check that a reusable call plan reproduces ffi_call for struct
- returns. A struct return does not disable planning (only a
- struct *argument* does), so this drives both the in-memory
- return path (RET_IN_MEM, including a NULL rvalue) and the
- register-pair struct return path, plus a large struct argument
- that forces the ffi_call by-value copy fallback.
- Limitations: none.
- PR: none.
- Originator: ffi_call_plan tests */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static int call_count = 0;
-
-/* 24 bytes: returned in memory (a hidden pointer in the first argument). */
-struct big3 { double a, b, c; };
-
-static struct big3 make_big3(double a, double b, double c)
-{
- struct big3 r;
- call_count++;
- r.a = a + 1.0;
- r.b = b + 2.0;
- r.c = c + 3.0;
- return r;
-}
-
-/* A struct larger than 16 bytes passed by value forces ffi_call to make a
- copy; build_plan has no fast path for a struct argument, so this exercises
- the plan's fallback to ffi_call. */
-static double sum_big3(struct big3 s)
-{
- return s.a + s.b + s.c;
-}
-
-/* 16 bytes: returned in a register pair (RAX:RDX on x86-64). */
-struct pair2 { long x, y; };
-
-static struct pair2 make_pair2(long x, long y)
-{
- struct pair2 r;
- r.x = x * 2;
- r.y = y * 3;
- return r;
-}
-
-int main (void)
-{
- ffi_type *big3_elements[4];
- ffi_type big3_t;
- ffi_type *pair2_elements[3];
- ffi_type pair2_t;
-
- big3_elements[0] = &ffi_type_double;
- big3_elements[1] = &ffi_type_double;
- big3_elements[2] = &ffi_type_double;
- big3_elements[3] = NULL;
- big3_t.size = big3_t.alignment = 0;
- big3_t.type = FFI_TYPE_STRUCT;
- big3_t.elements = big3_elements;
-
- pair2_elements[0] = &ffi_type_slong;
- pair2_elements[1] = &ffi_type_slong;
- pair2_elements[2] = NULL;
- pair2_t.size = pair2_t.alignment = 0;
- pair2_t.type = FFI_TYPE_STRUCT;
- pair2_t.elements = pair2_elements;
-
- /* In-memory struct return with scalar arguments. */
- {
- ffi_cif cif;
- ffi_type *args[3];
- void *values[3];
- ffi_call_plan *plan;
- double a = 10.0, b = 20.0, c = 30.0;
- struct big3 rc, rp;
- int before;
-
- args[0] = &ffi_type_double;
- args[1] = &ffi_type_double;
- args[2] = &ffi_type_double;
- values[0] = &a;
- values[1] = &b;
- values[2] = &c;
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &big3_t, args) == FFI_OK);
- plan = ffi_call_plan_alloc(&cif);
- CHECK(plan != NULL);
-
- ffi_call(&cif, FFI_FN(make_big3), &rc, values);
- ffi_call_plan_invoke(plan, FFI_FN(make_big3), &rp, values);
- CHECK_DOUBLE_EQ(rc.a, rp.a);
- CHECK_DOUBLE_EQ(rc.b, rp.b);
- CHECK_DOUBLE_EQ(rc.c, rp.c);
- CHECK_DOUBLE_EQ(rp.a, a + 1.0);
- CHECK_DOUBLE_EQ(rp.b, b + 2.0);
- CHECK_DOUBLE_EQ(rp.c, c + 3.0);
-
- /* A NULL rvalue for an in-memory struct return must not crash: libffi
- supplies scratch space and discards the result, but the callee still
- runs. Confirm the call actually happened. */
- before = call_count;
- ffi_call_plan_invoke(plan, FFI_FN(make_big3), NULL, values);
- CHECK(call_count == before + 1);
-
- ffi_call_plan_free(plan);
- }
-
- /* Large struct argument: no fast path, falls back to ffi_call. */
- {
- ffi_cif cif;
- ffi_type *args[1];
- void *values[1];
- ffi_call_plan *plan;
- struct big3 s;
- double rc, rp;
-
- s.a = 1.5;
- s.b = 2.5;
- s.c = 3.5;
- args[0] = &big3_t;
- values[0] = &s;
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_double, args)
- == FFI_OK);
- plan = ffi_call_plan_alloc(&cif);
- CHECK(plan != NULL);
-
- ffi_call(&cif, FFI_FN(sum_big3), &rc, values);
- ffi_call_plan_invoke(plan, FFI_FN(sum_big3), &rp, values);
- CHECK_DOUBLE_EQ(rc, rp);
- CHECK_DOUBLE_EQ(rp, sum_big3(s));
- ffi_call_plan_free(plan);
- }
-
- /* Register-pair struct return. */
- {
- ffi_cif cif;
- ffi_type *args[2];
- void *values[2];
- ffi_call_plan *plan;
- long x = 7, y = 11;
- struct pair2 rc, rp;
-
- args[0] = &ffi_type_slong;
- args[1] = &ffi_type_slong;
- values[0] = &x;
- values[1] = &y;
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &pair2_t, args) == FFI_OK);
- plan = ffi_call_plan_alloc(&cif);
- CHECK(plan != NULL);
-
- ffi_call(&cif, FFI_FN(make_pair2), &rc, values);
- ffi_call_plan_invoke(plan, FFI_FN(make_pair2), &rp, values);
- CHECK(rc.x == rp.x);
- CHECK(rc.y == rp.y);
- CHECK(rp.x == x * 2);
- CHECK(rp.y == y * 3);
- ffi_call_plan_free(plan);
- }
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/plan_var.c b/deps/libffi/testsuite/libffi.call/plan_var.c
deleted file mode 100644
index e630156b23f..00000000000
--- a/deps/libffi/testsuite/libffi.call/plan_var.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Area: ffi_call_plan
- Purpose: Check that a reusable call plan reproduces ffi_call for a
- variadic signature prepared with ffi_prep_cif_var. The
- variadic double arguments travel in SSE registers, so the
- fast path must set the vector-register count (al) correctly.
- Limitations: none.
- PR: none.
- Originator: ffi_call_plan tests */
-
-/* { dg-do run } */
-#include <stdarg.h>
-#include "ffitest.h"
-
-static double vsum(int n, ...)
-{
- va_list ap;
- double s = 0.0;
- int i;
-
- va_start(ap, n);
- for (i = 0; i < n; i++)
- s += va_arg(ap, double);
- va_end(ap);
- return s;
-}
-
-static void
-run (int nvar)
-{
- ffi_cif cif;
- ffi_type *args[1 + 8];
- void *values[1 + 8];
- double d[8];
- int n = nvar;
- double rc, rp, expect;
- ffi_call_plan *plan;
- int i;
-
- CHECK(nvar <= 8);
-
- args[0] = &ffi_type_sint;
- values[0] = &n;
- expect = 0.0;
- for (i = 0; i < nvar; i++)
- {
- d[i] = (double) (i + 1) * 1.5;
- args[1 + i] = &ffi_type_double;
- values[1 + i] = &d[i];
- expect += d[i];
- }
-
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 1 + nvar,
- &ffi_type_double, args) == FFI_OK);
- plan = ffi_call_plan_alloc(&cif);
- CHECK(plan != NULL);
-
- ffi_call(&cif, FFI_FN(vsum), &rc, values);
- ffi_call_plan_invoke(plan, FFI_FN(vsum), &rp, values);
- CHECK_DOUBLE_EQ(rc, rp);
- CHECK_DOUBLE_EQ(rp, expect);
-
- ffi_call_plan_free(plan);
-}
-
-int main (void)
-{
- run (0);
- run (1);
- run (3);
- run (5);
- run (8);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/pr1172638.c b/deps/libffi/testsuite/libffi.call/pr1172638.c
deleted file mode 100644
index 7da1621cd66..00000000000
--- a/deps/libffi/testsuite/libffi.call/pr1172638.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/* Area: ffi_call
- Purpose: Reproduce bug found in python ctypes
- Limitations: none.
- PR: Fedora 1174037 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct {
- long x;
- long y;
-} POINT;
-
-typedef struct {
- long left;
- long top;
- long right;
- long bottom;
-} RECT;
-
-static RECT ABI_ATTR pr_test(int i __UNUSED__, RECT ar __UNUSED__,
- RECT* br __UNUSED__, POINT cp __UNUSED__,
- RECT dr __UNUSED__, RECT *er __UNUSED__,
- POINT fp, RECT gr __UNUSED__)
-{
- RECT result;
-
- result.left = fp.x;
- result.right = fp.y;
- result.top = fp.x;
- result.bottom = fp.y;
-
- return result;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type point_type, rect_type;
- ffi_type *point_type_elements[3];
- ffi_type *rect_type_elements[5];
-
- int i;
- POINT cp, fp;
- RECT ar, br, dr, er, gr;
- RECT *p1, *p2;
-
- /* This is a hack to get a properly aligned result buffer */
- RECT *rect_result =
- (RECT *) malloc (sizeof(RECT));
-
- point_type.size = 0;
- point_type.alignment = 0;
- point_type.type = FFI_TYPE_STRUCT;
- point_type.elements = point_type_elements;
- point_type_elements[0] = &ffi_type_slong;
- point_type_elements[1] = &ffi_type_slong;
- point_type_elements[2] = NULL;
-
- rect_type.size = 0;
- rect_type.alignment = 0;
- rect_type.type = FFI_TYPE_STRUCT;
- rect_type.elements = rect_type_elements;
- rect_type_elements[0] = &ffi_type_slong;
- rect_type_elements[1] = &ffi_type_slong;
- rect_type_elements[2] = &ffi_type_slong;
- rect_type_elements[3] = &ffi_type_slong;
- rect_type_elements[4] = NULL;
-
- args[0] = &ffi_type_sint;
- args[1] = &rect_type;
- args[2] = &ffi_type_pointer;
- args[3] = &point_type;
- args[4] = &rect_type;
- args[5] = &ffi_type_pointer;
- args[6] = &point_type;
- args[7] = &rect_type;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 8, &rect_type, args) == FFI_OK);
-
- i = 1;
- ar.left = 2;
- ar.right = 3;
- ar.top = 4;
- ar.bottom = 5;
- br.left = 6;
- br.right = 7;
- br.top = 8;
- br.bottom = 9;
- cp.x = 10;
- cp.y = 11;
- dr.left = 12;
- dr.right = 13;
- dr.top = 14;
- dr.bottom = 15;
- er.left = 16;
- er.right = 17;
- er.top = 18;
- er.bottom = 19;
- fp.x = 20;
- fp.y = 21;
- gr.left = 22;
- gr.right = 23;
- gr.top = 24;
- gr.bottom = 25;
-
- values[0] = &i;
- values[1] = &ar;
- p1 = &br;
- values[2] = &p1;
- values[3] = &cp;
- values[4] = &dr;
- p2 = &er;
- values[5] = &p2;
- values[6] = &fp;
- values[7] = &gr;
-
- ffi_call (&cif, FFI_FN(pr_test), rect_result, values);
-
- CHECK(rect_result->top == 20);
-
- free (rect_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/promotion.c b/deps/libffi/testsuite/libffi.call/promotion.c
deleted file mode 100644
index 44561615dd4..00000000000
--- a/deps/libffi/testsuite/libffi.call/promotion.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Area: ffi_call
- Purpose: Promotion test.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-static int promotion(signed char sc, signed short ss,
- unsigned char uc, unsigned short us)
-{
- int r = (int) sc + (int) ss + (int) uc + (int) us;
-
- return r;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg rint;
- signed char sc;
- unsigned char uc;
- signed short ss;
- unsigned short us;
- unsigned long ul;
-
- args[0] = &ffi_type_schar;
- args[1] = &ffi_type_sshort;
- args[2] = &ffi_type_uchar;
- args[3] = &ffi_type_ushort;
- values[0] = ≻
- values[1] = &ss;
- values[2] = &uc;
- values[3] = &us;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &ffi_type_sint, args) == FFI_OK);
-
- us = 0;
- ul = 0;
-
- for (sc = (signed char) -127;
- sc <= (signed char) 120; sc += 1)
- for (ss = -30000; ss <= 30000; ss += 10000)
- for (uc = (unsigned char) 0;
- uc <= (unsigned char) 200; uc += 20)
- for (us = 0; us <= 60000; us += 10000)
- {
- ul++;
- ffi_call(&cif, FFI_FN(promotion), &rint, values);
- CHECK((int)rint == (signed char) sc + (signed short) ss +
- (unsigned char) uc + (unsigned short) us);
- }
- printf("%lu promotion tests run\n", ul);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/pyobjc_tc.c b/deps/libffi/testsuite/libffi.call/pyobjc_tc.c
deleted file mode 100644
index e29bd6c2836..00000000000
--- a/deps/libffi/testsuite/libffi.call/pyobjc_tc.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Area: ffi_call
- Purpose: Check different structures.
- Limitations: none.
- PR: none.
- Originator: Ronald Oussoren <oussoren@cistron.nl> 20030824 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct Point {
- float x;
- float y;
-} Point;
-
-typedef struct Size {
- float h;
- float w;
-} Size;
-
-typedef struct Rect {
- Point o;
- Size s;
-} Rect;
-
-int doit(int o, char* s, Point p, Rect r, int last)
-{
- printf("CALLED WITH %d %s {%f %f} {{%f %f} {%f %f}} %d\n",
- o, s, p.x, p.y, r.o.x, r.o.y, r.s.h, r.s.w, last);
- return 42;
-}
-
-
-int main(void)
-{
- ffi_type point_type;
- ffi_type size_type;
- ffi_type rect_type;
- ffi_cif cif;
- ffi_type* arglist[6];
- void* values[6];
- int r;
-
- /*
- * First set up FFI types for the 3 struct types
- */
-
- point_type.size = 0; /*sizeof(Point);*/
- point_type.alignment = 0; /*__alignof__(Point);*/
- point_type.type = FFI_TYPE_STRUCT;
- point_type.elements = malloc(3 * sizeof(ffi_type*));
- point_type.elements[0] = &ffi_type_float;
- point_type.elements[1] = &ffi_type_float;
- point_type.elements[2] = NULL;
-
- size_type.size = 0;/* sizeof(Size);*/
- size_type.alignment = 0;/* __alignof__(Size);*/
- size_type.type = FFI_TYPE_STRUCT;
- size_type.elements = malloc(3 * sizeof(ffi_type*));
- size_type.elements[0] = &ffi_type_float;
- size_type.elements[1] = &ffi_type_float;
- size_type.elements[2] = NULL;
-
- rect_type.size = 0;/*sizeof(Rect);*/
- rect_type.alignment =0;/* __alignof__(Rect);*/
- rect_type.type = FFI_TYPE_STRUCT;
- rect_type.elements = malloc(3 * sizeof(ffi_type*));
- rect_type.elements[0] = &point_type;
- rect_type.elements[1] = &size_type;
- rect_type.elements[2] = NULL;
-
- /*
- * Create a CIF
- */
- arglist[0] = &ffi_type_sint;
- arglist[1] = &ffi_type_pointer;
- arglist[2] = &point_type;
- arglist[3] = &rect_type;
- arglist[4] = &ffi_type_sint;
- arglist[5] = NULL;
-
- r = ffi_prep_cif(&cif, FFI_DEFAULT_ABI,
- 5, &ffi_type_sint, arglist);
- if (r != FFI_OK) {
- abort();
- }
-
-
- /* And call the function through the CIF */
-
- {
- Point p = { 1.0, 2.0 };
- Rect r = { { 9.0, 10.0}, { -1.0, -2.0 } };
- int o = 0;
- int l = 42;
- char* m = "myMethod";
- ffi_arg result;
-
- values[0] = &o;
- values[1] = &m;
- values[2] = &p;
- values[3] = &r;
- values[4] = &l;
- values[5] = NULL;
-
- printf("CALLING WITH %d %s {%f %f} {{%f %f} {%f %f}} %d\n",
- o, m, p.x, p.y, r.o.x, r.o.y, r.s.h, r.s.w, l);
-
- ffi_call(&cif, FFI_FN(doit), &result, values);
-
- printf ("The result is %d\n", (int)result);
-
- }
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/return_dbl.c b/deps/libffi/testsuite/libffi.call/return_dbl.c
deleted file mode 100644
index fd07e501794..00000000000
--- a/deps/libffi/testsuite/libffi.call/return_dbl.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value double.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20050212 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static double return_dbl(double dbl)
-{
- printf ("%f\n", dbl);
- return 2 * dbl;
-}
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- double dbl, rdbl;
-
- args[0] = &ffi_type_double;
- values[0] = &dbl;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_double, args) == FFI_OK);
-
- for (dbl = -127.3; dbl < 127; dbl++)
- {
- ffi_call(&cif, FFI_FN(return_dbl), &rdbl, values);
- printf ("%f vs %f\n", rdbl, return_dbl(dbl));
- CHECK(rdbl == 2 * dbl);
- }
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/return_dbl1.c b/deps/libffi/testsuite/libffi.call/return_dbl1.c
deleted file mode 100644
index 0ea5d50551a..00000000000
--- a/deps/libffi/testsuite/libffi.call/return_dbl1.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value double.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20050212 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static double return_dbl(double dbl1, float fl2, unsigned int in3, double dbl4)
-{
- return dbl1 + fl2 + in3 + dbl4;
-}
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- double dbl1, dbl4, rdbl;
- float fl2;
- unsigned int in3;
- args[0] = &ffi_type_double;
- args[1] = &ffi_type_float;
- args[2] = &ffi_type_uint;
- args[3] = &ffi_type_double;
- values[0] = &dbl1;
- values[1] = &fl2;
- values[2] = &in3;
- values[3] = &dbl4;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &ffi_type_double, args) == FFI_OK);
- dbl1 = 127.0;
- fl2 = 128.0;
- in3 = 255;
- dbl4 = 512.7;
-
- ffi_call(&cif, FFI_FN(return_dbl), &rdbl, values);
- printf ("%f vs %f\n", rdbl, return_dbl(dbl1, fl2, in3, dbl4));
- CHECK(rdbl == dbl1 + fl2 + in3 + dbl4);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/return_dbl2.c b/deps/libffi/testsuite/libffi.call/return_dbl2.c
deleted file mode 100644
index b3818f866b5..00000000000
--- a/deps/libffi/testsuite/libffi.call/return_dbl2.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value double.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20050212 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static double return_dbl(double dbl1, double dbl2, unsigned int in3, double dbl4)
-{
- return dbl1 + dbl2 + in3 + dbl4;
-}
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- double dbl1, dbl2, dbl4, rdbl;
- unsigned int in3;
- args[0] = &ffi_type_double;
- args[1] = &ffi_type_double;
- args[2] = &ffi_type_uint;
- args[3] = &ffi_type_double;
- values[0] = &dbl1;
- values[1] = &dbl2;
- values[2] = &in3;
- values[3] = &dbl4;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &ffi_type_double, args) == FFI_OK);
- dbl1 = 127.0;
- dbl2 = 128.0;
- in3 = 255;
- dbl4 = 512.7;
-
- ffi_call(&cif, FFI_FN(return_dbl), &rdbl, values);
- printf ("%f vs %f\n", rdbl, return_dbl(dbl1, dbl2, in3, dbl4));
- CHECK(rdbl == dbl1 + dbl2 + in3 + dbl4);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/return_fl.c b/deps/libffi/testsuite/libffi.call/return_fl.c
deleted file mode 100644
index fb8a09e32ab..00000000000
--- a/deps/libffi/testsuite/libffi.call/return_fl.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value float.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20050212 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static float return_fl(float fl)
-{
- return 2 * fl;
-}
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- float fl, rfl;
-
- args[0] = &ffi_type_float;
- values[0] = &fl;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_float, args) == FFI_OK);
-
- for (fl = -127.0; fl < 127; fl++)
- {
- ffi_call(&cif, FFI_FN(return_fl), &rfl, values);
- printf ("%f vs %f\n", rfl, return_fl(fl));
- CHECK(rfl == 2 * fl);
- }
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/return_fl1.c b/deps/libffi/testsuite/libffi.call/return_fl1.c
deleted file mode 100644
index c3d92c283d0..00000000000
--- a/deps/libffi/testsuite/libffi.call/return_fl1.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value float.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20050212 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static float return_fl(float fl1, float fl2)
-{
- return fl1 + fl2;
-}
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- float fl1, fl2, rfl;
-
- args[0] = &ffi_type_float;
- args[1] = &ffi_type_float;
- values[0] = &fl1;
- values[1] = &fl2;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
- &ffi_type_float, args) == FFI_OK);
- fl1 = 127.0;
- fl2 = 128.0;
-
- ffi_call(&cif, FFI_FN(return_fl), &rfl, values);
- printf ("%f vs %f\n", rfl, return_fl(fl1, fl2));
- CHECK(rfl == fl1 + fl2);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/return_fl2.c b/deps/libffi/testsuite/libffi.call/return_fl2.c
deleted file mode 100644
index ddb976cc2bb..00000000000
--- a/deps/libffi/testsuite/libffi.call/return_fl2.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value float.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20050212 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-/* Use volatile float to avoid false negative on ix86. See PR target/323. */
-static float return_fl(float fl1, float fl2, float fl3, float fl4)
-{
- volatile float sum;
-
- sum = fl1 + fl2 + fl3 + fl4;
- return sum;
-}
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- float fl1, fl2, fl3, fl4, rfl;
- volatile float sum;
-
- args[0] = &ffi_type_float;
- args[1] = &ffi_type_float;
- args[2] = &ffi_type_float;
- args[3] = &ffi_type_float;
- values[0] = &fl1;
- values[1] = &fl2;
- values[2] = &fl3;
- values[3] = &fl4;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &ffi_type_float, args) == FFI_OK);
- fl1 = 127.0;
- fl2 = 128.0;
- fl3 = 255.1;
- fl4 = 512.7;
-
- ffi_call(&cif, FFI_FN(return_fl), &rfl, values);
- printf ("%f vs %f\n", rfl, return_fl(fl1, fl2, fl3, fl4));
-
- sum = fl1 + fl2 + fl3 + fl4;
- CHECK(rfl == sum);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/return_fl3.c b/deps/libffi/testsuite/libffi.call/return_fl3.c
deleted file mode 100644
index c37877b18ec..00000000000
--- a/deps/libffi/testsuite/libffi.call/return_fl3.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value float.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20050212 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static float return_fl(float fl1, float fl2, unsigned int in3, float fl4)
-{
- return fl1 + fl2 + in3 + fl4;
-}
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- float fl1, fl2, fl4, rfl;
- unsigned int in3;
- args[0] = &ffi_type_float;
- args[1] = &ffi_type_float;
- args[2] = &ffi_type_uint;
- args[3] = &ffi_type_float;
- values[0] = &fl1;
- values[1] = &fl2;
- values[2] = &in3;
- values[3] = &fl4;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &ffi_type_float, args) == FFI_OK);
- fl1 = 127.0;
- fl2 = 128.0;
- in3 = 255;
- fl4 = 512.7;
-
- ffi_call(&cif, FFI_FN(return_fl), &rfl, values);
- printf ("%f vs %f\n", rfl, return_fl(fl1, fl2, in3, fl4));
- CHECK(rfl == fl1 + fl2 + in3 + fl4);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/return_ldl.c b/deps/libffi/testsuite/libffi.call/return_ldl.c
deleted file mode 100644
index 52a92fe0711..00000000000
--- a/deps/libffi/testsuite/libffi.call/return_ldl.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value long double.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20071113 */
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-static long double return_ldl(long double ldl)
-{
- return 2*ldl;
-}
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- long double ldl, rldl;
-
- args[0] = &ffi_type_longdouble;
- values[0] = &ldl;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_longdouble, args) == FFI_OK);
-
- for (ldl = -127.0; ldl < 127.0; ldl++)
- {
- ffi_call(&cif, FFI_FN(return_ldl), &rldl, values);
- CHECK(rldl == 2 * ldl);
- }
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/return_ll.c b/deps/libffi/testsuite/libffi.call/return_ll.c
deleted file mode 100644
index ea4a1e44780..00000000000
--- a/deps/libffi/testsuite/libffi.call/return_ll.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value long long.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-static long long return_ll(long long ll)
-{
- return ll;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- long long rlonglong;
- long long ll;
-
- args[0] = &ffi_type_sint64;
- values[0] = ≪
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_sint64, args) == FFI_OK);
-
- for (ll = 0LL; ll < 100LL; ll++)
- {
- ffi_call(&cif, FFI_FN(return_ll), &rlonglong, values);
- CHECK(rlonglong == ll);
- }
-
- for (ll = 55555555555000LL; ll < 55555555555100LL; ll++)
- {
- ffi_call(&cif, FFI_FN(return_ll), &rlonglong, values);
- CHECK(rlonglong == ll);
- }
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/return_ll1.c b/deps/libffi/testsuite/libffi.call/return_ll1.c
deleted file mode 100644
index a2426ec9354..00000000000
--- a/deps/libffi/testsuite/libffi.call/return_ll1.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Area: ffi_call
- Purpose: Check if long long are passed in the corresponding regs on ppc.
- Limitations: none.
- PR: 20104.
- Originator: <andreast@gcc.gnu.org> 20050222 */
-
-/* { dg-do run } */
-/* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
-#include "ffitest.h"
-static long long return_ll(int ll0, long long ll1, int ll2)
-{
- CHECK(ll0 == 11111111);
- CHECK(ll1 == 11111111111000LL);
- CHECK(ll2 == 11111111);
- return ll0 + ll1 + ll2;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- long long rlonglong;
- long long ll1;
- unsigned ll0, ll2;
-
- args[0] = &ffi_type_sint;
- args[1] = &ffi_type_sint64;
- args[2] = &ffi_type_sint;
- values[0] = &ll0;
- values[1] = &ll1;
- values[2] = &ll2;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
- &ffi_type_sint64, args) == FFI_OK);
-
- ll0 = 11111111;
- ll1 = 11111111111000LL;
- ll2 = 11111111;
-
- ffi_call(&cif, FFI_FN(return_ll), &rlonglong, values);
- printf("res: %" PRIdLL ", %" PRIdLL "\n", rlonglong, ll0 + ll1 + ll2);
- /* { dg-output "res: 11111133333222, 11111133333222" } */
- CHECK(rlonglong == 11111133333222);
- CHECK(ll0 + ll1 + ll2 == 11111133333222);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/return_sc.c b/deps/libffi/testsuite/libffi.call/return_sc.c
deleted file mode 100644
index a36cf3eb880..00000000000
--- a/deps/libffi/testsuite/libffi.call/return_sc.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value signed char.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static signed char return_sc(signed char sc)
-{
- return sc;
-}
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg rint;
- signed char sc;
-
- args[0] = &ffi_type_schar;
- values[0] = ≻
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_schar, args) == FFI_OK);
-
- for (sc = (signed char) -127;
- sc < (signed char) 127; sc++)
- {
- ffi_call(&cif, FFI_FN(return_sc), &rint, values);
- CHECK((signed char)rint == sc);
- }
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/return_sl.c b/deps/libffi/testsuite/libffi.call/return_sl.c
deleted file mode 100644
index 51bfb49459b..00000000000
--- a/deps/libffi/testsuite/libffi.call/return_sl.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Area: ffi_call
- Purpose: Check if long as return type is handled correctly.
- Limitations: none.
- PR: none.
- */
-
-/* { dg-do run } */
-#include "ffitest.h"
-static long return_sl(long l1, long l2)
-{
- CHECK(l1 == 1073741823L);
- CHECK(l2 == 1073741824L);
- return l1 - l2;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg res;
- unsigned long l1, l2;
-
- args[0] = &ffi_type_slong;
- args[1] = &ffi_type_slong;
- values[0] = &l1;
- values[1] = &l2;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
- &ffi_type_slong, args) == FFI_OK);
-
- l1 = 1073741823L;
- l2 = 1073741824L;
-
- ffi_call(&cif, FFI_FN(return_sl), &res, values);
- printf("res: %ld, %ld\n", (long)res, l1 - l2);
- /* { dg-output "res: -1, -1" } */
- CHECK((long)res == -1);
- CHECK(l1 + 1 == l2);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/return_uc.c b/deps/libffi/testsuite/libffi.call/return_uc.c
deleted file mode 100644
index 6fe554619d5..00000000000
--- a/deps/libffi/testsuite/libffi.call/return_uc.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value unsigned char.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static unsigned char return_uc(unsigned char uc)
-{
- return uc;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg rint;
-
- unsigned char uc;
-
- args[0] = &ffi_type_uchar;
- values[0] = &uc;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_uchar, args) == FFI_OK);
-
- for (uc = (unsigned char) '\x00';
- uc < (unsigned char) '\xff'; uc++)
- {
- ffi_call(&cif, FFI_FN(return_uc), &rint, values);
- CHECK((unsigned char)rint == uc);
- }
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/return_ul.c b/deps/libffi/testsuite/libffi.call/return_ul.c
deleted file mode 100644
index fedcc25abd1..00000000000
--- a/deps/libffi/testsuite/libffi.call/return_ul.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Area: ffi_call
- Purpose: Check if unsigned long as return type is handled correctly.
- Limitations: none.
- PR: none.
- Originator: <kaffeetisch at gmx dot de> 20060724 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-static unsigned long return_ul(unsigned long ul1, unsigned long ul2)
-{
- CHECK(ul1 == 1073741823L);
- CHECK(ul2 == 1073741824L);
- return ul1 + ul2;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg res;
- unsigned long ul1, ul2;
-
- args[0] = &ffi_type_ulong;
- args[1] = &ffi_type_ulong;
- values[0] = &ul1;
- values[1] = &ul2;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
- &ffi_type_ulong, args) == FFI_OK);
-
- ul1 = 1073741823L;
- ul2 = 1073741824L;
-
- ffi_call(&cif, FFI_FN(return_ul), &res, values);
- printf("res: %lu, %lu\n", (unsigned long)res, ul1 + ul2);
- /* { dg-output "res: 2147483647, 2147483647" } */
- CHECK(res == 2147483647L);
- CHECK(ul1 + ul2 == 2147483647L);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/return_void.c b/deps/libffi/testsuite/libffi.call/return_void.c
deleted file mode 100644
index abc3c198e56..00000000000
--- a/deps/libffi/testsuite/libffi.call/return_void.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Area: ffi_call
- Purpose: Check that a void call ignores its return buffer.
- Limitations: none. */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static unsigned int called;
-
-static void
-return_void (unsigned int value)
-{
- called = value;
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- ffi_type *args[1] = { &ffi_type_uint };
- unsigned int value = 42;
- void *values[1] = { &value };
- ffi_arg result = ~(ffi_arg)0;
-
- CHECK(ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_void, args) == FFI_OK);
-
- ffi_call (&cif, FFI_FN(return_void), &result, values);
- CHECK(called == value);
- CHECK(result == ~(ffi_arg)0);
-
- value = 43;
- ffi_call (&cif, FFI_FN(return_void), NULL, values);
- CHECK(called == value);
-
- exit (0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/s55.c b/deps/libffi/testsuite/libffi.call/s55.c
deleted file mode 100644
index 94dfd5f87ca..00000000000
--- a/deps/libffi/testsuite/libffi.call/s55.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct
-{
- float f;
-} s55;
-
-static s55 ABI_ATTR f55(s55 ts, float f)
-{
- s55 r;
- r.f = ts.f + f;
- printf ("f55>> %g + %g = %g\n", ts.f, f, r.f);
- return r;
-}
-
-int main (void)
-{
- ffi_cif cif;
- s55 F, Fr;
- float f;
- void *values[] = { &F, &f };
- ffi_type s55_type;
- ffi_type *args[] = { &s55_type, &ffi_type_float };
- ffi_type *s55_type_elements[] = { &ffi_type_float, NULL };
-
- /* This is a hack to get a properly aligned result buffer */
- s55 *s55_result =
- (s55 *) malloc (sizeof(s55));
-
- s55_type.size = 0;
- s55_type.alignment = 0;
- s55_type.type = FFI_TYPE_STRUCT;
- s55_type.elements = s55_type_elements;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 2, &s55_type, args) == FFI_OK);
-
- F.f = 1;
- Fr = f55(F, 2.14);
- printf ("%g\n", Fr.f);
-
- F.f = 1;
- f = 2.14;
- ffi_call(&cif, FFI_FN(f55), s55_result, values);
- printf ("%g\n", s55_result->f);
-
- fflush(0);
-
- CHECK(fabs(Fr.f - s55_result->f) < FLT_EPSILON);
-
- free (s55_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/strlen.c b/deps/libffi/testsuite/libffi.call/strlen.c
deleted file mode 100644
index 3ed53d55802..00000000000
--- a/deps/libffi/testsuite/libffi.call/strlen.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Area: ffi_call
- Purpose: Check strlen function call.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static unsigned int ABI_ATTR my_strlen(char *s)
-{
- return (unsigned int) (strlen(s));
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg rint;
- char *s;
-
- args[0] = &ffi_type_pointer;
- values[0] = (void*) &s;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1,
- &ffi_type_uint, args) == FFI_OK);
-
- s = "a";
- ffi_call(&cif, FFI_FN(my_strlen), &rint, values);
- CHECK(rint == 1);
-
- s = "1234567";
- ffi_call(&cif, FFI_FN(my_strlen), &rint, values);
- CHECK(rint == 7);
-
- s = "1234567890123456789012345";
- ffi_call(&cif, FFI_FN(my_strlen), &rint, values);
- CHECK(rint == 25);
-
- exit (0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/strlen2.c b/deps/libffi/testsuite/libffi.call/strlen2.c
deleted file mode 100644
index 93e5a33028c..00000000000
--- a/deps/libffi/testsuite/libffi.call/strlen2.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Area: ffi_call
- Purpose: Check strlen function call with additional arguments.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-static int ABI_ATTR my_f(char *s, float a)
-{
- return (int) strlen(s) + (int) a;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg rint;
- char *s;
- float v2;
- args[0] = &ffi_type_pointer;
- args[1] = &ffi_type_float;
- values[0] = (void*) &s;
- values[1] = (void*) &v2;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 2,
- &ffi_type_sint, args) == FFI_OK);
-
- s = "a";
- v2 = 0.0;
- ffi_call(&cif, FFI_FN(my_f), &rint, values);
- CHECK(rint == 1);
-
- s = "1234567";
- v2 = -1.0;
- ffi_call(&cif, FFI_FN(my_f), &rint, values);
- CHECK(rint == 6);
-
- s = "1234567890123456789012345";
- v2 = 1.0;
- ffi_call(&cif, FFI_FN(my_f), &rint, values);
- CHECK(rint == 26);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/strlen3.c b/deps/libffi/testsuite/libffi.call/strlen3.c
deleted file mode 100644
index c7d472d22d8..00000000000
--- a/deps/libffi/testsuite/libffi.call/strlen3.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Area: ffi_call
- Purpose: Check strlen function call with additional arguments.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-static int ABI_ATTR my_f(float a, char *s)
-{
- return (int) strlen(s) + (int) a;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg rint;
- char *s;
- float v2;
- args[1] = &ffi_type_pointer;
- args[0] = &ffi_type_float;
- values[1] = (void*) &s;
- values[0] = (void*) &v2;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 2,
- &ffi_type_sint, args) == FFI_OK);
-
- s = "a";
- v2 = 0.0;
- ffi_call(&cif, FFI_FN(my_f), &rint, values);
- CHECK(rint == 1);
-
- s = "1234567";
- v2 = -1.0;
- ffi_call(&cif, FFI_FN(my_f), &rint, values);
- CHECK(rint == 6);
-
- s = "1234567890123456789012345";
- v2 = 1.0;
- ffi_call(&cif, FFI_FN(my_f), &rint, values);
- CHECK(rint == 26);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/strlen4.c b/deps/libffi/testsuite/libffi.call/strlen4.c
deleted file mode 100644
index ba5c2740ec0..00000000000
--- a/deps/libffi/testsuite/libffi.call/strlen4.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Area: ffi_call
- Purpose: Check strlen function call with additional arguments.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-static int ABI_ATTR my_f(float a, char *s, int i)
-{
- return (int) strlen(s) + (int) a + i;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg rint;
- char *s;
- int v1;
- float v2;
- args[2] = &ffi_type_sint;
- args[1] = &ffi_type_pointer;
- args[0] = &ffi_type_float;
- values[2] = (void*) &v1;
- values[1] = (void*) &s;
- values[0] = (void*) &v2;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 3,
- &ffi_type_sint, args) == FFI_OK);
-
- s = "a";
- v1 = 1;
- v2 = 0.0;
- ffi_call(&cif, FFI_FN(my_f), &rint, values);
- CHECK(rint == 2);
-
- s = "1234567";
- v2 = -1.0;
- v1 = -2;
- ffi_call(&cif, FFI_FN(my_f), &rint, values);
- CHECK(rint == 4);
-
- s = "1234567890123456789012345";
- v2 = 1.0;
- v1 = 2;
- ffi_call(&cif, FFI_FN(my_f), &rint, values);
- CHECK(rint == 28);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/struct1.c b/deps/libffi/testsuite/libffi.call/struct1.c
deleted file mode 100644
index c13e23f8727..00000000000
--- a/deps/libffi/testsuite/libffi.call/struct1.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct
-{
- unsigned char uc;
- double d;
- unsigned int ui;
-} test_structure_1;
-
-static test_structure_1 ABI_ATTR struct1(test_structure_1 ts)
-{
- ts.uc++;
- ts.d--;
- ts.ui++;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts1_type;
- ffi_type *ts1_type_elements[4];
-
- test_structure_1 ts1_arg;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_1 *ts1_result =
- (test_structure_1 *) malloc (sizeof(test_structure_1));
-
- ts1_type.size = 0;
- ts1_type.alignment = 0;
- ts1_type.type = FFI_TYPE_STRUCT;
- ts1_type.elements = ts1_type_elements;
- ts1_type_elements[0] = &ffi_type_uchar;
- ts1_type_elements[1] = &ffi_type_double;
- ts1_type_elements[2] = &ffi_type_uint;
- ts1_type_elements[3] = NULL;
-
- args[0] = &ts1_type;
- values[0] = &ts1_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1,
- &ts1_type, args) == FFI_OK);
-
- ts1_arg.uc = '\x01';
- ts1_arg.d = 3.14159;
- ts1_arg.ui = 555;
-
- ffi_call(&cif, FFI_FN(struct1), ts1_result, values);
-
- CHECK(ts1_result->ui == 556);
- CHECK(ts1_result->d == 3.14159 - 1);
-
- free (ts1_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/struct10.c b/deps/libffi/testsuite/libffi.call/struct10.c
deleted file mode 100644
index 1edbd5ffb98..00000000000
--- a/deps/libffi/testsuite/libffi.call/struct10.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: Sergei Trofimovich <slyfox@gentoo.org>
-
- The test originally discovered in ruby's bindings
- for ffi in https://bugs.gentoo.org/634190 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-struct s {
- int s32;
- float f32;
- signed char s8;
-};
-
-struct s ABI_ATTR make_s(void) {
- struct s r;
- r.s32 = 0x1234;
- r.f32 = 7.0;
- r.s8 = 0x78;
- return r;
-}
-
-int main() {
- ffi_cif cif;
- struct s r;
- ffi_type rtype;
- ffi_type* s_fields[] = {
- &ffi_type_sint,
- &ffi_type_float,
- &ffi_type_schar,
- NULL,
- };
-
- rtype.size = 0;
- rtype.alignment = 0,
- rtype.type = FFI_TYPE_STRUCT,
- rtype.elements = s_fields,
-
- r.s32 = 0xbad;
- r.f32 = 999.999;
- r.s8 = 0x51;
-
- // Here we emulate the following call:
- //r = make_s();
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, &rtype, NULL) == FFI_OK);
- ffi_call(&cif, FFI_FN(make_s), &r, NULL);
-
- CHECK(r.s32 == 0x1234);
- CHECK(r.f32 == 7.0);
- CHECK(r.s8 == 0x78);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/struct2.c b/deps/libffi/testsuite/libffi.call/struct2.c
deleted file mode 100644
index 5077a5ee45a..00000000000
--- a/deps/libffi/testsuite/libffi.call/struct2.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct
-{
- double d1;
- double d2;
-} test_structure_2;
-
-static test_structure_2 ABI_ATTR struct2(test_structure_2 ts)
-{
- ts.d1--;
- ts.d2--;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- test_structure_2 ts2_arg;
- ffi_type ts2_type;
- ffi_type *ts2_type_elements[3];
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_2 *ts2_result =
- (test_structure_2 *) malloc (sizeof(test_structure_2));
-
- ts2_type.size = 0;
- ts2_type.alignment = 0;
- ts2_type.type = FFI_TYPE_STRUCT;
- ts2_type.elements = ts2_type_elements;
- ts2_type_elements[0] = &ffi_type_double;
- ts2_type_elements[1] = &ffi_type_double;
- ts2_type_elements[2] = NULL;
-
- args[0] = &ts2_type;
- values[0] = &ts2_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts2_type, args) == FFI_OK);
-
- ts2_arg.d1 = 5.55;
- ts2_arg.d2 = 6.66;
-
- printf ("%g\n", ts2_arg.d1);
- printf ("%g\n", ts2_arg.d2);
-
- ffi_call(&cif, FFI_FN(struct2), ts2_result, values);
-
- printf ("%g\n", ts2_result->d1);
- printf ("%g\n", ts2_result->d2);
-
- CHECK(ts2_result->d1 == 5.55 - 1);
- CHECK(ts2_result->d2 == 6.66 - 1);
-
- free (ts2_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/struct3.c b/deps/libffi/testsuite/libffi.call/struct3.c
deleted file mode 100644
index 7eba0ead6d6..00000000000
--- a/deps/libffi/testsuite/libffi.call/struct3.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct
-{
- int si;
-} test_structure_3;
-
-static test_structure_3 ABI_ATTR struct3(test_structure_3 ts)
-{
- ts.si = -(ts.si*2);
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- int compare_value;
- ffi_type ts3_type;
- ffi_type *ts3_type_elements[2];
-
- test_structure_3 ts3_arg;
- test_structure_3 *ts3_result =
- (test_structure_3 *) malloc (sizeof(test_structure_3));
-
- ts3_type.size = 0;
- ts3_type.alignment = 0;
- ts3_type.type = FFI_TYPE_STRUCT;
- ts3_type.elements = ts3_type_elements;
- ts3_type_elements[0] = &ffi_type_sint;
- ts3_type_elements[1] = NULL;
-
- args[0] = &ts3_type;
- values[0] = &ts3_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1,
- &ts3_type, args) == FFI_OK);
-
- ts3_arg.si = -123;
- compare_value = ts3_arg.si;
-
- ffi_call(&cif, FFI_FN(struct3), ts3_result, values);
-
- printf ("%d %d\n", ts3_result->si, -(compare_value*2));
-
- CHECK(ts3_result->si == -(compare_value*2));
-
- free (ts3_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/struct4.c b/deps/libffi/testsuite/libffi.call/struct4.c
deleted file mode 100644
index 66a9551dd65..00000000000
--- a/deps/libffi/testsuite/libffi.call/struct4.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct
-{
- unsigned ui1;
- unsigned ui2;
- unsigned ui3;
-} test_structure_4;
-
-static test_structure_4 ABI_ATTR struct4(test_structure_4 ts)
-{
- ts.ui3 = ts.ui1 * ts.ui2 * ts.ui3;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts4_type;
- ffi_type *ts4_type_elements[4];
-
- test_structure_4 ts4_arg;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_4 *ts4_result =
- (test_structure_4 *) malloc (sizeof(test_structure_4));
-
- ts4_type.size = 0;
- ts4_type.alignment = 0;
- ts4_type.type = FFI_TYPE_STRUCT;
- ts4_type.elements = ts4_type_elements;
- ts4_type_elements[0] = &ffi_type_uint;
- ts4_type_elements[1] = &ffi_type_uint;
- ts4_type_elements[2] = &ffi_type_uint;
- ts4_type_elements[3] = NULL;
-
- args[0] = &ts4_type;
- values[0] = &ts4_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts4_type, args) == FFI_OK);
-
- ts4_arg.ui1 = 2;
- ts4_arg.ui2 = 3;
- ts4_arg.ui3 = 4;
-
- ffi_call (&cif, FFI_FN(struct4), ts4_result, values);
-
- CHECK(ts4_result->ui3 == 2U * 3U * 4U);
-
-
- free (ts4_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/struct5.c b/deps/libffi/testsuite/libffi.call/struct5.c
deleted file mode 100644
index 23e2a3f745c..00000000000
--- a/deps/libffi/testsuite/libffi.call/struct5.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-typedef struct
-{
- char c1;
- char c2;
-} test_structure_5;
-
-static test_structure_5 ABI_ATTR struct5(test_structure_5 ts1, test_structure_5 ts2)
-{
- ts1.c1 += ts2.c1;
- ts1.c2 -= ts2.c2;
-
- return ts1;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts5_type;
- ffi_type *ts5_type_elements[3];
-
- test_structure_5 ts5_arg1, ts5_arg2;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_5 *ts5_result =
- (test_structure_5 *) malloc (sizeof(test_structure_5));
-
- ts5_type.size = 0;
- ts5_type.alignment = 0;
- ts5_type.type = FFI_TYPE_STRUCT;
- ts5_type.elements = ts5_type_elements;
- ts5_type_elements[0] = &ffi_type_schar;
- ts5_type_elements[1] = &ffi_type_schar;
- ts5_type_elements[2] = NULL;
-
- args[0] = &ts5_type;
- args[1] = &ts5_type;
- values[0] = &ts5_arg1;
- values[1] = &ts5_arg2;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 2, &ts5_type, args) == FFI_OK);
-
- ts5_arg1.c1 = 2;
- ts5_arg1.c2 = 6;
- ts5_arg2.c1 = 5;
- ts5_arg2.c2 = 3;
-
- ffi_call (&cif, FFI_FN(struct5), ts5_result, values);
-
- CHECK(ts5_result->c1 == 7);
- CHECK(ts5_result->c2 == 3);
-
-
- free (ts5_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/struct6.c b/deps/libffi/testsuite/libffi.call/struct6.c
deleted file mode 100644
index 173c66eb4d2..00000000000
--- a/deps/libffi/testsuite/libffi.call/struct6.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-typedef struct
-{
- float f;
- double d;
-} test_structure_6;
-
-static test_structure_6 ABI_ATTR struct6 (test_structure_6 ts)
-{
- ts.f += 1;
- ts.d += 1;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts6_type;
- ffi_type *ts6_type_elements[3];
-
- test_structure_6 ts6_arg;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_6 *ts6_result =
- (test_structure_6 *) malloc (sizeof(test_structure_6));
-
- ts6_type.size = 0;
- ts6_type.alignment = 0;
- ts6_type.type = FFI_TYPE_STRUCT;
- ts6_type.elements = ts6_type_elements;
- ts6_type_elements[0] = &ffi_type_float;
- ts6_type_elements[1] = &ffi_type_double;
- ts6_type_elements[2] = NULL;
-
- args[0] = &ts6_type;
- values[0] = &ts6_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts6_type, args) == FFI_OK);
-
- ts6_arg.f = 5.55f;
- ts6_arg.d = 6.66;
-
- printf ("%g\n", ts6_arg.f);
- printf ("%g\n", ts6_arg.d);
-
- ffi_call(&cif, FFI_FN(struct6), ts6_result, values);
-
- CHECK(ts6_result->f == 5.55f + 1);
- CHECK(ts6_result->d == 6.66 + 1);
-
- free (ts6_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/struct7.c b/deps/libffi/testsuite/libffi.call/struct7.c
deleted file mode 100644
index badc7e05560..00000000000
--- a/deps/libffi/testsuite/libffi.call/struct7.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-typedef struct
-{
- float f1;
- float f2;
- double d;
-} test_structure_7;
-
-static test_structure_7 ABI_ATTR struct7 (test_structure_7 ts)
-{
- ts.f1 += 1;
- ts.f2 += 1;
- ts.d += 1;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts7_type;
- ffi_type *ts7_type_elements[4];
-
- test_structure_7 ts7_arg;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_7 *ts7_result =
- (test_structure_7 *) malloc (sizeof(test_structure_7));
-
- ts7_type.size = 0;
- ts7_type.alignment = 0;
- ts7_type.type = FFI_TYPE_STRUCT;
- ts7_type.elements = ts7_type_elements;
- ts7_type_elements[0] = &ffi_type_float;
- ts7_type_elements[1] = &ffi_type_float;
- ts7_type_elements[2] = &ffi_type_double;
- ts7_type_elements[3] = NULL;
-
- args[0] = &ts7_type;
- values[0] = &ts7_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts7_type, args) == FFI_OK);
-
- ts7_arg.f1 = 5.55f;
- ts7_arg.f2 = 55.5f;
- ts7_arg.d = 6.66;
-
- printf ("%g\n", ts7_arg.f1);
- printf ("%g\n", ts7_arg.f2);
- printf ("%g\n", ts7_arg.d);
-
- ffi_call(&cif, FFI_FN(struct7), ts7_result, values);
-
- printf ("%g\n", ts7_result->f1);
- printf ("%g\n", ts7_result->f2);
- printf ("%g\n", ts7_result->d);
-
- CHECK(ts7_result->f1 == 5.55f + 1);
- CHECK(ts7_result->f2 == 55.5f + 1);
- CHECK(ts7_result->d == 6.66 + 1);
-
- free (ts7_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/struct8.c b/deps/libffi/testsuite/libffi.call/struct8.c
deleted file mode 100644
index ef204ecbbce..00000000000
--- a/deps/libffi/testsuite/libffi.call/struct8.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-typedef struct
-{
- float f1;
- float f2;
- float f3;
- float f4;
-} test_structure_8;
-
-static test_structure_8 ABI_ATTR struct8 (test_structure_8 ts)
-{
- ts.f1 += 1;
- ts.f2 += 1;
- ts.f3 += 1;
- ts.f4 += 1;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts8_type;
- ffi_type *ts8_type_elements[5];
-
- test_structure_8 ts8_arg;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_8 *ts8_result =
- (test_structure_8 *) malloc (sizeof(test_structure_8));
-
- ts8_type.size = 0;
- ts8_type.alignment = 0;
- ts8_type.type = FFI_TYPE_STRUCT;
- ts8_type.elements = ts8_type_elements;
- ts8_type_elements[0] = &ffi_type_float;
- ts8_type_elements[1] = &ffi_type_float;
- ts8_type_elements[2] = &ffi_type_float;
- ts8_type_elements[3] = &ffi_type_float;
- ts8_type_elements[4] = NULL;
-
- args[0] = &ts8_type;
- values[0] = &ts8_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts8_type, args) == FFI_OK);
-
- ts8_arg.f1 = 5.55f;
- ts8_arg.f2 = 55.5f;
- ts8_arg.f3 = -5.55f;
- ts8_arg.f4 = -55.5f;
-
- printf ("%g\n", ts8_arg.f1);
- printf ("%g\n", ts8_arg.f2);
- printf ("%g\n", ts8_arg.f3);
- printf ("%g\n", ts8_arg.f4);
-
- ffi_call(&cif, FFI_FN(struct8), ts8_result, values);
-
- printf ("%g\n", ts8_result->f1);
- printf ("%g\n", ts8_result->f2);
- printf ("%g\n", ts8_result->f3);
- printf ("%g\n", ts8_result->f4);
-
- CHECK(ts8_result->f1 == 5.55f + 1);
- CHECK(ts8_result->f2 == 55.5f + 1);
- CHECK(ts8_result->f3 == -5.55f + 1);
- CHECK(ts8_result->f4 == -55.5f + 1);
-
- free (ts8_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/struct9.c b/deps/libffi/testsuite/libffi.call/struct9.c
deleted file mode 100644
index 4a13b818c4e..00000000000
--- a/deps/libffi/testsuite/libffi.call/struct9.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct
-{
- float f;
- int i;
-} test_structure_9;
-
-static test_structure_9 ABI_ATTR struct9 (test_structure_9 ts)
-{
- ts.f += 1;
- ts.i += 1;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts9_type;
- ffi_type *ts9_type_elements[3];
-
- test_structure_9 ts9_arg;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_9 *ts9_result =
- (test_structure_9 *) malloc (sizeof(test_structure_9));
-
- ts9_type.size = 0;
- ts9_type.alignment = 0;
- ts9_type.type = FFI_TYPE_STRUCT;
- ts9_type.elements = ts9_type_elements;
- ts9_type_elements[0] = &ffi_type_float;
- ts9_type_elements[1] = &ffi_type_sint;
- ts9_type_elements[2] = NULL;
-
- args[0] = &ts9_type;
- values[0] = &ts9_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts9_type, args) == FFI_OK);
-
- ts9_arg.f = 5.55f;
- ts9_arg.i = 5;
-
- printf ("%g\n", ts9_arg.f);
- printf ("%d\n", ts9_arg.i);
-
- ffi_call(&cif, FFI_FN(struct9), ts9_result, values);
-
- printf ("%g\n", ts9_result->f);
- printf ("%d\n", ts9_result->i);
-
- CHECK(ts9_result->f == 5.55f + 1);
- CHECK(ts9_result->i == 5 + 1);
-
- free (ts9_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/struct_by_value_2.c b/deps/libffi/testsuite/libffi.call/struct_by_value_2.c
deleted file mode 100644
index f170289d1d3..00000000000
--- a/deps/libffi/testsuite/libffi.call/struct_by_value_2.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct
-{
- unsigned int ui01;
- unsigned int ui02;
-} test_structure_1;
-
-static test_structure_1 ABI_ATTR struct1(test_structure_1 ts)
-{
- ts.ui02++;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts1_type;
- ffi_type *ts1_type_elements[3];
-
- test_structure_1 ts1_arg;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_1 *ts1_result =
- (test_structure_1 *) malloc (sizeof(test_structure_1));
-
- ts1_type.size = 0;
- ts1_type.alignment = 0;
- ts1_type.type = FFI_TYPE_STRUCT;
- ts1_type.elements = ts1_type_elements;
- ts1_type_elements[0] = &ffi_type_uint;
- ts1_type_elements[1] = &ffi_type_uint;
- ts1_type_elements[2] = NULL;
-
- args[0] = &ts1_type;
- values[0] = &ts1_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1,
- &ts1_type, args) == FFI_OK);
-
- ts1_arg.ui02 = 555;
-
- ffi_call(&cif, FFI_FN(struct1), ts1_result, values);
-
- CHECK(ts1_result->ui02 == 556);
-
- /* This will fail if ffi_call isn't passing the struct by value. */
- CHECK(ts1_arg.ui02 == 555);
-
- free (ts1_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/struct_by_value_3.c b/deps/libffi/testsuite/libffi.call/struct_by_value_3.c
deleted file mode 100644
index 55cf113e582..00000000000
--- a/deps/libffi/testsuite/libffi.call/struct_by_value_3.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct
-{
- unsigned int ui01;
- unsigned int ui02;
- unsigned int ui03;
-} test_structure_1;
-
-static test_structure_1 ABI_ATTR struct1(test_structure_1 ts)
-{
- ts.ui03++;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts1_type;
- ffi_type *ts1_type_elements[4];
-
- test_structure_1 ts1_arg;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_1 *ts1_result =
- (test_structure_1 *) malloc (sizeof(test_structure_1));
-
- ts1_type.size = 0;
- ts1_type.alignment = 0;
- ts1_type.type = FFI_TYPE_STRUCT;
- ts1_type.elements = ts1_type_elements;
- ts1_type_elements[0] = &ffi_type_uint;
- ts1_type_elements[1] = &ffi_type_uint;
- ts1_type_elements[2] = &ffi_type_uint;
- ts1_type_elements[3] = NULL;
-
- args[0] = &ts1_type;
- values[0] = &ts1_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1,
- &ts1_type, args) == FFI_OK);
-
- ts1_arg.ui03 = 555;
-
- ffi_call(&cif, FFI_FN(struct1), ts1_result, values);
-
- CHECK(ts1_result->ui03 == 556);
-
- /* This will fail if ffi_call isn't passing the struct by value. */
- CHECK(ts1_arg.ui03 == 555);
-
- free (ts1_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/struct_by_value_3f.c b/deps/libffi/testsuite/libffi.call/struct_by_value_3f.c
deleted file mode 100644
index 8b5b1db7595..00000000000
--- a/deps/libffi/testsuite/libffi.call/struct_by_value_3f.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct
-{
- float f01;
- float f02;
- float f03;
-} test_structure_1;
-
-static test_structure_1 ABI_ATTR struct1(test_structure_1 ts)
-{
- ts.f03++;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts1_type;
- ffi_type *ts1_type_elements[5];
-
- test_structure_1 ts1_arg;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_1 *ts1_result =
- (test_structure_1 *) malloc (sizeof(test_structure_1));
-
- ts1_type.size = 0;
- ts1_type.alignment = 0;
- ts1_type.type = FFI_TYPE_STRUCT;
- ts1_type.elements = ts1_type_elements;
- ts1_type_elements[0] = &ffi_type_float;
- ts1_type_elements[1] = &ffi_type_float;
- ts1_type_elements[2] = &ffi_type_float;
- ts1_type_elements[3] = NULL;
-
- args[0] = &ts1_type;
- values[0] = &ts1_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1,
- &ts1_type, args) == FFI_OK);
-
- ts1_arg.f03 = 555.5;
-
- ffi_call(&cif, FFI_FN(struct1), ts1_result, values);
-
- CHECK(fabs(ts1_result->f03 - 556.5) < FLT_EPSILON);
-
- /* This will fail if ffi_call isn't passing the struct by value. */
- CHECK(fabs(ts1_arg.f03 - 555.5) < FLT_EPSILON);
-
- free (ts1_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/struct_by_value_4.c b/deps/libffi/testsuite/libffi.call/struct_by_value_4.c
deleted file mode 100644
index 768650fca17..00000000000
--- a/deps/libffi/testsuite/libffi.call/struct_by_value_4.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct
-{
- unsigned int ui01;
- unsigned int ui02;
- unsigned int ui03;
- unsigned int ui04;
-} test_structure_1;
-
-static test_structure_1 ABI_ATTR struct1(test_structure_1 ts)
-{
- ts.ui04++;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts1_type;
- ffi_type *ts1_type_elements[5];
-
- test_structure_1 ts1_arg;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_1 *ts1_result =
- (test_structure_1 *) malloc (sizeof(test_structure_1));
-
- ts1_type.size = 0;
- ts1_type.alignment = 0;
- ts1_type.type = FFI_TYPE_STRUCT;
- ts1_type.elements = ts1_type_elements;
- ts1_type_elements[0] = &ffi_type_uint;
- ts1_type_elements[1] = &ffi_type_uint;
- ts1_type_elements[2] = &ffi_type_uint;
- ts1_type_elements[3] = &ffi_type_uint;
- ts1_type_elements[4] = NULL;
-
- args[0] = &ts1_type;
- values[0] = &ts1_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1,
- &ts1_type, args) == FFI_OK);
-
- ts1_arg.ui04 = 555;
-
- ffi_call(&cif, FFI_FN(struct1), ts1_result, values);
-
- CHECK(ts1_result->ui04 == 556);
-
- /* This will fail if ffi_call isn't passing the struct by value. */
- CHECK(ts1_arg.ui04 == 555);
-
- free (ts1_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/struct_by_value_4f.c b/deps/libffi/testsuite/libffi.call/struct_by_value_4f.c
deleted file mode 100644
index bf6775ac457..00000000000
--- a/deps/libffi/testsuite/libffi.call/struct_by_value_4f.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct
-{
- float f01;
- float f02;
- float f03;
- float f04;
-} test_structure_1;
-
-static test_structure_1 ABI_ATTR struct1(test_structure_1 ts)
-{
- ts.f04++;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts1_type;
- ffi_type *ts1_type_elements[5];
-
- test_structure_1 ts1_arg;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_1 *ts1_result =
- (test_structure_1 *) malloc (sizeof(test_structure_1));
-
- ts1_type.size = 0;
- ts1_type.alignment = 0;
- ts1_type.type = FFI_TYPE_STRUCT;
- ts1_type.elements = ts1_type_elements;
- ts1_type_elements[0] = &ffi_type_float;
- ts1_type_elements[1] = &ffi_type_float;
- ts1_type_elements[2] = &ffi_type_float;
- ts1_type_elements[3] = &ffi_type_float;
- ts1_type_elements[4] = NULL;
-
- args[0] = &ts1_type;
- values[0] = &ts1_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1,
- &ts1_type, args) == FFI_OK);
-
- ts1_arg.f04 = 555.5;
-
- ffi_call(&cif, FFI_FN(struct1), ts1_result, values);
-
- CHECK(fabs(ts1_result->f04 - 556.5) < FLT_EPSILON);
-
- /* This will fail if ffi_call isn't passing the struct by value. */
- CHECK(fabs(ts1_arg.f04 - 555.5) < FLT_EPSILON);
-
- free (ts1_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/struct_by_value_big.c b/deps/libffi/testsuite/libffi.call/struct_by_value_big.c
deleted file mode 100644
index 06422cac2e1..00000000000
--- a/deps/libffi/testsuite/libffi.call/struct_by_value_big.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct
-{
- unsigned int ui01;
- unsigned int ui02;
- unsigned int ui03;
- unsigned int ui04;
- unsigned int ui05;
- unsigned int ui06;
- unsigned int ui07;
- unsigned int ui08;
- unsigned int ui09;
- unsigned int ui10;
- unsigned int ui11;
- unsigned int ui12;
- unsigned int ui13;
- unsigned int ui14;
- unsigned int ui15;
- unsigned int ui16;
- unsigned int ui17;
-} test_structure_1;
-
-static test_structure_1 ABI_ATTR struct1(test_structure_1 ts)
-{
- ts.ui17++;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts1_type;
- ffi_type *ts1_type_elements[18];
-
- test_structure_1 ts1_arg;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_1 *ts1_result =
- (test_structure_1 *) malloc (sizeof(test_structure_1));
-
- ts1_type.size = 0;
- ts1_type.alignment = 0;
- ts1_type.type = FFI_TYPE_STRUCT;
- ts1_type.elements = ts1_type_elements;
- ts1_type_elements[0] = &ffi_type_uint;
- ts1_type_elements[1] = &ffi_type_uint;
- ts1_type_elements[2] = &ffi_type_uint;
- ts1_type_elements[3] = &ffi_type_uint;
- ts1_type_elements[4] = &ffi_type_uint;
- ts1_type_elements[5] = &ffi_type_uint;
- ts1_type_elements[6] = &ffi_type_uint;
- ts1_type_elements[7] = &ffi_type_uint;
- ts1_type_elements[8] = &ffi_type_uint;
- ts1_type_elements[9] = &ffi_type_uint;
- ts1_type_elements[10] = &ffi_type_uint;
- ts1_type_elements[11] = &ffi_type_uint;
- ts1_type_elements[12] = &ffi_type_uint;
- ts1_type_elements[13] = &ffi_type_uint;
- ts1_type_elements[14] = &ffi_type_uint;
- ts1_type_elements[15] = &ffi_type_uint;
- ts1_type_elements[16] = &ffi_type_uint;
- ts1_type_elements[17] = NULL;
-
- args[0] = &ts1_type;
- values[0] = &ts1_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1,
- &ts1_type, args) == FFI_OK);
-
- ts1_arg.ui17 = 555;
-
- ffi_call(&cif, FFI_FN(struct1), ts1_result, values);
-
- CHECK(ts1_result->ui17 == 556);
-
- /* This will fail if ffi_call isn't passing the struct by value. */
- CHECK(ts1_arg.ui17 == 555);
-
- free (ts1_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/struct_by_value_small.c b/deps/libffi/testsuite/libffi.call/struct_by_value_small.c
deleted file mode 100644
index 19613f8b080..00000000000
--- a/deps/libffi/testsuite/libffi.call/struct_by_value_small.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct
-{
- unsigned int ui17;
-} test_structure_1;
-
-static test_structure_1 ABI_ATTR struct1(test_structure_1 ts)
-{
- ts.ui17++;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts1_type;
- ffi_type *ts1_type_elements[2];
-
- test_structure_1 ts1_arg;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_1 *ts1_result =
- (test_structure_1 *) malloc (sizeof(test_structure_1));
-
- ts1_type.size = 0;
- ts1_type.alignment = 0;
- ts1_type.type = FFI_TYPE_STRUCT;
- ts1_type.elements = ts1_type_elements;
- ts1_type_elements[0] = &ffi_type_uint;
- ts1_type_elements[1] = NULL;
-
- args[0] = &ts1_type;
- values[0] = &ts1_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1,
- &ts1_type, args) == FFI_OK);
-
- ts1_arg.ui17 = 555;
-
- ffi_call(&cif, FFI_FN(struct1), ts1_result, values);
-
- CHECK(ts1_result->ui17 == 556);
-
- /* This will fail if ffi_call isn't passing the struct by value. */
- CHECK(ts1_arg.ui17 == 555);
-
- free (ts1_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/struct_int_float.c b/deps/libffi/testsuite/libffi.call/struct_int_float.c
deleted file mode 100644
index 66ef6c458da..00000000000
--- a/deps/libffi/testsuite/libffi.call/struct_int_float.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Area: ffi_call
- Purpose: Demonstrate structures with integers corrupting earlier floats
- Limitations: none.
- PR: #848
- Originator: kellda */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct
-{
- unsigned long i;
- float f;
-} test_structure_int_float;
-
-static float ABI_ATTR struct_int_float(test_structure_int_float ts1,
- test_structure_int_float ts2 __UNUSED__,
- test_structure_int_float ts3 __UNUSED__,
- test_structure_int_float ts4 __UNUSED__,
- test_structure_int_float ts5 __UNUSED__,
- test_structure_int_float ts6 __UNUSED__)
-{
- return ts1.f;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts_type;
- ffi_type *ts_type_elements[3];
- float rfloat;
-
- test_structure_int_float ts_arg[6];
-
- ts_type.size = 0;
- ts_type.alignment = 0;
- ts_type.type = FFI_TYPE_STRUCT;
- ts_type.elements = ts_type_elements;
- ts_type_elements[0] = &ffi_type_ulong;
- ts_type_elements[1] = &ffi_type_float;
- ts_type_elements[2] = NULL;
-
- args[0] = &ts_type;
- values[0] = &ts_arg[0];
- args[1] = &ts_type;
- values[1] = &ts_arg[1];
- args[2] = &ts_type;
- values[2] = &ts_arg[2];
- args[3] = &ts_type;
- values[3] = &ts_arg[3];
- args[4] = &ts_type;
- values[4] = &ts_arg[4];
- args[5] = &ts_type;
- values[5] = &ts_arg[5];
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 6, &ffi_type_float, args) == FFI_OK);
-
- ts_arg[0].i = 1;
- ts_arg[0].f = 11.11f;
- ts_arg[1].i = 2;
- ts_arg[1].f = 22.22f;
- ts_arg[2].i = 3;
- ts_arg[2].f = 33.33f;
- ts_arg[3].i = 4;
- ts_arg[3].f = 44.44f;
- ts_arg[4].i = 5;
- ts_arg[4].f = 55.55f;
- ts_arg[5].i = 6;
- ts_arg[5].f = 66.66f;
-
- printf ("%g\n", ts_arg[0].f);
- printf ("%g\n", ts_arg[1].f);
- printf ("%g\n", ts_arg[2].f);
- printf ("%g\n", ts_arg[3].f);
- printf ("%g\n", ts_arg[4].f);
- printf ("%g\n", ts_arg[5].f);
-
- ffi_call(&cif, FFI_FN(struct_int_float), &rfloat, values);
-
- printf ("%g\n", rfloat);
-
- CHECK(fabs(rfloat - 11.11) < 3 * FLT_EPSILON);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/struct_return_2H.c b/deps/libffi/testsuite/libffi.call/struct_return_2H.c
deleted file mode 100644
index 27735503508..00000000000
--- a/deps/libffi/testsuite/libffi.call/struct_return_2H.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-typedef struct
-{
- short x;
- short y;
-} test_structure_5;
-
-static test_structure_5 ABI_ATTR struct5(test_structure_5 inp)
-{
- inp.x *= 2;
- inp.y *= 3;
-
- return inp;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts5_type;
- ffi_type *ts5_type_elements[3];
-
- test_structure_5 ts5_arg1;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_5 *ts5_result =
- (test_structure_5 *) malloc (sizeof(test_structure_5));
-
- ts5_type.size = 0;
- ts5_type.alignment = 0;
- ts5_type.type = FFI_TYPE_STRUCT;
- ts5_type.elements = ts5_type_elements;
- ts5_type_elements[0] = &ffi_type_sshort;
- ts5_type_elements[1] = &ffi_type_sshort;
- ts5_type_elements[2] = NULL;
-
- args[0] = &ts5_type;
- values[0] = &ts5_arg1;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts5_type, args) == FFI_OK);
-
- ts5_arg1.x = 99;
- ts5_arg1.y = 88;
-
- ffi_call (&cif, FFI_FN(struct5), ts5_result, values);
-
- CHECK(ts5_result->x == 99*2);
- CHECK(ts5_result->y == 88*3);
- CHECK(ts5_arg1.x == 99);
- CHECK(ts5_arg1.y == 88);
-
- free (ts5_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/struct_return_8H.c b/deps/libffi/testsuite/libffi.call/struct_return_8H.c
deleted file mode 100644
index 5018daa1fee..00000000000
--- a/deps/libffi/testsuite/libffi.call/struct_return_8H.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-typedef struct
-{
- int a;
- int b;
- int c;
- int d;
- int e;
- int f;
- int g;
- int h;
-} test_structure_5;
-
-static test_structure_5 ABI_ATTR struct5(test_structure_5 inp)
-{
- inp.a *= 2;
- inp.b *= 3;
- inp.c *= 4;
- inp.d *= 5;
- inp.e *= 6;
- inp.f *= 7;
- inp.g *= 8;
- inp.h *= 9;
- return inp;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts5_type;
- ffi_type *ts5_type_elements[9];
-
- test_structure_5 ts5_arg1;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_5 *ts5_result =
- (test_structure_5 *) malloc (sizeof(test_structure_5));
-
- ts5_type.size = 0;
- ts5_type.alignment = 0;
- ts5_type.type = FFI_TYPE_STRUCT;
- ts5_type.elements = ts5_type_elements;
- ts5_type_elements[0] = &ffi_type_sint;
- ts5_type_elements[1] = &ffi_type_sint;
- ts5_type_elements[2] = &ffi_type_sint;
- ts5_type_elements[3] = &ffi_type_sint;
- ts5_type_elements[4] = &ffi_type_sint;
- ts5_type_elements[5] = &ffi_type_sint;
- ts5_type_elements[6] = &ffi_type_sint;
- ts5_type_elements[7] = &ffi_type_sint;
- ts5_type_elements[8] = NULL;
-
- args[0] = &ts5_type;
- values[0] = &ts5_arg1;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts5_type, args) == FFI_OK);
-
- ts5_arg1.a = 9;
- ts5_arg1.b = 8;
- ts5_arg1.c = 7;
- ts5_arg1.d = 6;
- ts5_arg1.e = 5;
- ts5_arg1.f = 4;
- ts5_arg1.g = 3;
- ts5_arg1.h = 2;
-
- ffi_call (&cif, FFI_FN(struct5), ts5_result, values);
-
- CHECK(ts5_result->a == 9*2);
- CHECK(ts5_result->b == 8*3);
- CHECK(ts5_result->c == 7*4);
- CHECK(ts5_result->d == 6*5);
- CHECK(ts5_result->e == 5*6);
- CHECK(ts5_result->f == 4*7);
- CHECK(ts5_result->g == 3*8);
- CHECK(ts5_result->h == 2*9);
-
- free (ts5_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/struct_stack_small.c b/deps/libffi/testsuite/libffi.call/struct_stack_small.c
deleted file mode 100644
index e55646adae7..00000000000
--- a/deps/libffi/testsuite/libffi.call/struct_stack_small.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check a small struct passed on the stack and the argument
- following it.
- Limitations: none.
- PR: none. */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-/* A two-byte struct after eight ints goes to the stack on targets with
- eight argument registers, followed by a short that must land in the slot
- the ABI assigns after the struct. */
-
-typedef struct
-{
- unsigned char a;
- unsigned char b;
-} small_struct;
-
-static int ABI_ATTR
-f_stack (int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8,
- small_struct s, short t)
-{
- return i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8
- + s.a * 10 + s.b * 100 + t * 1000;
-}
-
-#if FFI_CLOSURES
-static void
-cls_stack (ffi_cif *cif __UNUSED__, void *resp, void **args,
- void *userdata __UNUSED__)
-{
- *(ffi_arg *) resp = f_stack (*(int *) args[0], *(int *) args[1],
- *(int *) args[2], *(int *) args[3],
- *(int *) args[4], *(int *) args[5],
- *(int *) args[6], *(int *) args[7],
- *(small_struct *) args[8],
- *(short *) args[9]);
-}
-#endif
-
-int
-main (void)
-{
- ffi_cif cif;
- ffi_type small_struct_type;
- ffi_type *small_struct_elements[3];
- ffi_type *types[10];
- void *values[10];
-#if FFI_CLOSURES
- ffi_closure *pcl;
- void *code;
-#endif
- int ints[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
- small_struct s = { 3, 5 };
- short t = 7;
- ffi_arg result;
- int i;
-
- small_struct_elements[0] = &ffi_type_uchar;
- small_struct_elements[1] = &ffi_type_uchar;
- small_struct_elements[2] = NULL;
- small_struct_type.size = 0;
- small_struct_type.alignment = 0;
- small_struct_type.type = FFI_TYPE_STRUCT;
- small_struct_type.elements = small_struct_elements;
-
- for (i = 0; i < 8; i++)
- {
- types[i] = &ffi_type_sint;
- values[i] = &ints[i];
- }
- types[8] = &small_struct_type;
- values[8] = &s;
- types[9] = &ffi_type_sshort;
- values[9] = &t;
-
- CHECK (ffi_prep_cif (&cif, ABI_NUM, 10, &ffi_type_sint, types) == FFI_OK);
- ffi_call (&cif, FFI_FN (f_stack), &result, values);
- printf ("stack: %d\n", (int) result);
- CHECK ((int) result == 7566);
-
-#if FFI_CLOSURES
- pcl = ffi_closure_alloc (sizeof (ffi_closure), &code);
- CHECK (pcl != NULL);
- CHECK (ffi_prep_closure_loc (pcl, &cif, cls_stack, NULL, code) == FFI_OK);
- result = ((int (ABI_ATTR *) (int, int, int, int, int, int, int, int,
- small_struct, short)) code)
- (1, 2, 3, 4, 5, 6, 7, 8, s, t);
- printf ("closure stack: %d\n", (int) result);
- CHECK ((int) result == 7566);
- ffi_closure_free (pcl);
-#endif
-
- exit (0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/uninitialized.c b/deps/libffi/testsuite/libffi.call/uninitialized.c
deleted file mode 100644
index f00d8302349..00000000000
--- a/deps/libffi/testsuite/libffi.call/uninitialized.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct
-{
- unsigned char uc;
- double d;
- unsigned int ui;
-} test_structure_1;
-
-static test_structure_1 struct1(test_structure_1 ts)
-{
- ts.uc++;
- ts.d--;
- ts.ui++;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts1_type;
- ffi_type *ts1_type_elements[4];
-
- memset(&cif, 1, sizeof(cif));
- ts1_type.size = 0;
- ts1_type.alignment = 0;
- ts1_type.type = FFI_TYPE_STRUCT;
- ts1_type.elements = ts1_type_elements;
- ts1_type_elements[0] = &ffi_type_uchar;
- ts1_type_elements[1] = &ffi_type_double;
- ts1_type_elements[2] = &ffi_type_uint;
- ts1_type_elements[3] = NULL;
-
- test_structure_1 ts1_arg;
- /* This is a hack to get a properly aligned result buffer */
- test_structure_1 *ts1_result =
- (test_structure_1 *) malloc (sizeof(test_structure_1));
-
- args[0] = &ts1_type;
- values[0] = &ts1_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ts1_type, args) == FFI_OK);
-
- ts1_arg.uc = '\x01';
- ts1_arg.d = 3.14159;
- ts1_arg.ui = 555;
-
- ffi_call(&cif, FFI_FN(struct1), ts1_result, values);
-
- CHECK(ts1_result->ui == 556);
- CHECK(ts1_result->d == 3.14159 - 1);
-
- free (ts1_result);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.call/va_1.c b/deps/libffi/testsuite/libffi.call/va_1.c
deleted file mode 100644
index ccc6faf5c93..00000000000
--- a/deps/libffi/testsuite/libffi.call/va_1.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Area: ffi_call
- Purpose: Test passing struct in variable argument lists.
- Limitations: none.
- PR: none.
- Originator: ARM Ltd. */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-#include <stdarg.h>
-
-struct small_tag
-{
- unsigned char a;
- unsigned char b;
-};
-
-struct large_tag
-{
- unsigned a;
- unsigned b;
- unsigned c;
- unsigned d;
- unsigned e;
-};
-
-int
-main (void)
-{
- ffi_cif cif;
- ffi_type* arg_types[15];
-
- ffi_type s_type;
- ffi_type *s_type_elements[3];
-
- ffi_type l_type;
- ffi_type *l_type_elements[6];
-
- s_type.size = 0;
- s_type.alignment = 0;
- s_type.type = FFI_TYPE_STRUCT;
- s_type.elements = s_type_elements;
-
- s_type_elements[0] = &ffi_type_uchar;
- s_type_elements[1] = &ffi_type_uchar;
- s_type_elements[2] = NULL;
-
- l_type.size = 0;
- l_type.alignment = 0;
- l_type.type = FFI_TYPE_STRUCT;
- l_type.elements = l_type_elements;
-
- l_type_elements[0] = &ffi_type_uint;
- l_type_elements[1] = &ffi_type_uint;
- l_type_elements[2] = &ffi_type_uint;
- l_type_elements[3] = &ffi_type_uint;
- l_type_elements[4] = &ffi_type_uint;
- l_type_elements[5] = NULL;
-
- arg_types[0] = &ffi_type_sint;
- arg_types[1] = &s_type;
- arg_types[2] = &l_type;
- arg_types[3] = &s_type;
- arg_types[4] = &ffi_type_uchar;
- arg_types[5] = &ffi_type_schar;
- arg_types[6] = &ffi_type_ushort;
- arg_types[7] = &ffi_type_sshort;
- arg_types[8] = &ffi_type_uint;
- arg_types[9] = &ffi_type_sint;
- arg_types[10] = &ffi_type_ulong;
- arg_types[11] = &ffi_type_slong;
- arg_types[12] = &ffi_type_double;
- arg_types[13] = &ffi_type_double;
- arg_types[14] = NULL;
-
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 14, &ffi_type_sint, arg_types) == FFI_BAD_ARGTYPE);
- return 0;
-}
diff --git a/deps/libffi/testsuite/libffi.call/va_2.c b/deps/libffi/testsuite/libffi.call/va_2.c
deleted file mode 100644
index 75d4dfc3dda..00000000000
--- a/deps/libffi/testsuite/libffi.call/va_2.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/* Area: ffi_call
- Purpose: Test passing struct in variable argument lists.
- Limitations: none.
- PR: none.
- Originator: ARM Ltd. */
-
-/* { dg-do run } */
-/* { dg-output "" { xfail avr32*-*-* m68k-*-* } } */
-
-#include "ffitest.h"
-#include <stdarg.h>
-
-struct small_tag
-{
- unsigned char a;
- unsigned char b;
-};
-
-struct large_tag
-{
- unsigned a;
- unsigned b;
- unsigned c;
- unsigned d;
- unsigned e;
-};
-
-
-static int
-test_fn (int n, ...)
-{
- va_list ap;
- struct small_tag s1;
- struct small_tag s2;
- struct large_tag l;
- unsigned char uc;
- signed char sc;
- unsigned short us;
- signed short ss;
- unsigned int ui;
- signed int si;
- unsigned long ul;
- signed long sl;
- float f;
- double d;
-
- va_start (ap, n);
- s1 = va_arg (ap, struct small_tag);
- l = va_arg (ap, struct large_tag);
- s2 = va_arg (ap, struct small_tag);
-
- uc = va_arg (ap, unsigned);
- sc = va_arg (ap, signed);
-
- us = va_arg (ap, unsigned);
- ss = va_arg (ap, signed);
-
- ui = va_arg (ap, unsigned int);
- si = va_arg (ap, signed int);
-
- ul = va_arg (ap, unsigned long);
- sl = va_arg (ap, signed long);
-
- f = va_arg (ap, double); /* C standard promotes float->double
- when anonymous */
- d = va_arg (ap, double);
-
- printf ("%u %u %u %u %u %u %u %u %u uc=%u sc=%d %u %d %u %d %lu %ld %f %f\n",
- s1.a, s1.b, l.a, l.b, l.c, l.d, l.e,
- s2.a, s2.b,
- uc, sc,
- us, ss,
- ui, si,
- ul, sl,
- f, d);
-
- va_end (ap);
-
- CHECK(s1.a == 5);
- CHECK(s1.b == 6);
- CHECK(l.a == 10);
- CHECK(l.b == 11);
- CHECK(l.c == 12);
- CHECK(l.d == 13);
- CHECK(l.e == 14);
- CHECK(s2.a == 7);
- CHECK(s2.b == 8);
- CHECK(uc == 9);
- CHECK(sc == 10);
- CHECK(us == 11);
- CHECK(ss == 12);
- CHECK(ui == 13);
- CHECK(si == 14);
- CHECK(ul == 15);
- CHECK(sl == 16);
- CHECK((int)f == 2);
- CHECK((int)d == 3);
-
- return n + 1;
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- void* args[15];
- ffi_type* arg_types[15];
-
- ffi_type s_type;
- ffi_type *s_type_elements[3];
-
- ffi_type l_type;
- ffi_type *l_type_elements[6];
-
- struct small_tag s1;
- struct small_tag s2;
- struct large_tag l1;
-
- int n;
- ffi_arg res;
-
- unsigned int uc;
- signed int sc;
- unsigned int us;
- signed int ss;
- unsigned int ui;
- signed int si;
- unsigned long ul;
- signed long sl;
- double d1;
- double f1;
-
- s_type.size = 0;
- s_type.alignment = 0;
- s_type.type = FFI_TYPE_STRUCT;
- s_type.elements = s_type_elements;
-
- s_type_elements[0] = &ffi_type_uchar;
- s_type_elements[1] = &ffi_type_uchar;
- s_type_elements[2] = NULL;
-
- l_type.size = 0;
- l_type.alignment = 0;
- l_type.type = FFI_TYPE_STRUCT;
- l_type.elements = l_type_elements;
-
- l_type_elements[0] = &ffi_type_uint;
- l_type_elements[1] = &ffi_type_uint;
- l_type_elements[2] = &ffi_type_uint;
- l_type_elements[3] = &ffi_type_uint;
- l_type_elements[4] = &ffi_type_uint;
- l_type_elements[5] = NULL;
-
- arg_types[0] = &ffi_type_sint;
- arg_types[1] = &s_type;
- arg_types[2] = &l_type;
- arg_types[3] = &s_type;
- arg_types[4] = &ffi_type_uint;
- arg_types[5] = &ffi_type_sint;
- arg_types[6] = &ffi_type_uint;
- arg_types[7] = &ffi_type_sint;
- arg_types[8] = &ffi_type_uint;
- arg_types[9] = &ffi_type_sint;
- arg_types[10] = &ffi_type_ulong;
- arg_types[11] = &ffi_type_slong;
- arg_types[12] = &ffi_type_double;
- arg_types[13] = &ffi_type_double;
- arg_types[14] = NULL;
-
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 14, &ffi_type_sint, arg_types) == FFI_OK);
-
- s1.a = 5;
- s1.b = 6;
-
- l1.a = 10;
- l1.b = 11;
- l1.c = 12;
- l1.d = 13;
- l1.e = 14;
-
- s2.a = 7;
- s2.b = 8;
-
- n = 41;
-
- uc = 9;
- sc = 10;
- us = 11;
- ss = 12;
- ui = 13;
- si = 14;
- ul = 15;
- sl = 16;
- f1 = 2.12;
- d1 = 3.13;
-
- args[0] = &n;
- args[1] = &s1;
- args[2] = &l1;
- args[3] = &s2;
- args[4] = &uc;
- args[5] = ≻
- args[6] = &us;
- args[7] = &ss;
- args[8] = &ui;
- args[9] = &si;
- args[10] = &ul;
- args[11] = &sl;
- args[12] = &f1;
- args[13] = &d1;
- args[14] = NULL;
-
- ffi_call(&cif, FFI_FN(test_fn), &res, args);
- /* { dg-output "5 6 10 11 12 13 14 7 8 uc=9 sc=10 11 12 13 14 15 16 2.120000 3.130000" } */
- printf("res: %d\n", (int) res);
- /* { dg-output "\nres: 42" } */
- CHECK(res == 42);
-
- return 0;
-}
diff --git a/deps/libffi/testsuite/libffi.call/va_3.c b/deps/libffi/testsuite/libffi.call/va_3.c
deleted file mode 100644
index b3e73b50c5c..00000000000
--- a/deps/libffi/testsuite/libffi.call/va_3.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/* Area: ffi_call
- Purpose: Test function with multiple fixed args and variable argument list.
- Limitations: none.
- PR: none.
- Originator: ARM Ltd., Oracle */
-
-/* { dg-do run } */
-/* { dg-output "" { xfail avr32*-*-* m68k-*-* } } */
-
-#include "ffitest.h"
-#include <stdarg.h>
-
-/*
- * This is a modified version of va_2.c that has fixed arguments with "small" types that
- * are not allowed as variable arguments, but they should be still allowed as fixed args.
- */
-
-static int
-test_fn (char a1, float a2, int n, ...)
-{
- va_list ap;
- unsigned char uc;
- signed char sc;
- unsigned short us;
- signed short ss;
- unsigned int ui;
- signed int si;
- unsigned long ul;
- signed long sl;
- float f;
- double d;
-
- va_start (ap, n);
-
- uc = va_arg (ap, unsigned);
- sc = va_arg (ap, signed);
-
- us = va_arg (ap, unsigned);
- ss = va_arg (ap, signed);
-
- ui = va_arg (ap, unsigned int);
- si = va_arg (ap, signed int);
-
- ul = va_arg (ap, unsigned long);
- sl = va_arg (ap, signed long);
-
- f = va_arg (ap, double); /* C standard promotes float->double
- when anonymous */
- d = va_arg (ap, double);
-
- printf ("%d %f uc=%u sc=%d %u %d %u %d %lu %ld %f %f\n",
- a1, a2,
- uc, sc,
- us, ss,
- ui, si,
- ul, sl,
- f, d);
-
- va_end (ap);
-
- CHECK(a1 == 1);
- CHECK((int)a2 == 2);
- CHECK(uc == 9);
- CHECK(sc == 10);
- CHECK(us == 11);
- CHECK(ss == 12);
- CHECK(ui == 13);
- CHECK(si == 14);
- CHECK(ul == 15);
- CHECK(sl == 16);
- CHECK((int)f == 2);
- CHECK((int)d == 3);
-
- return n + 1;
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- void* args[14];
- ffi_type* arg_types[14];
-
- char a1;
- float a2;
- int n;
- ffi_arg res;
-
- unsigned int uc;
- signed int sc;
- unsigned int us;
- signed int ss;
- unsigned int ui;
- signed int si;
- unsigned long ul;
- signed long sl;
- double d1;
- double f1;
-
- arg_types[0] = &ffi_type_schar;
- arg_types[1] = &ffi_type_float;
- arg_types[2] = &ffi_type_sint;
- arg_types[3] = &ffi_type_uint;
- arg_types[4] = &ffi_type_sint;
- arg_types[5] = &ffi_type_uint;
- arg_types[6] = &ffi_type_sint;
- arg_types[7] = &ffi_type_uint;
- arg_types[8] = &ffi_type_sint;
- arg_types[9] = &ffi_type_ulong;
- arg_types[10] = &ffi_type_slong;
- arg_types[11] = &ffi_type_double;
- arg_types[12] = &ffi_type_double;
- arg_types[13] = NULL;
-
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 3, 13, &ffi_type_sint, arg_types) == FFI_OK);
-
- a1 = 1;
- a2 = 2.0f;
- n = 41;
-
- uc = 9;
- sc = 10;
- us = 11;
- ss = 12;
- ui = 13;
- si = 14;
- ul = 15;
- sl = 16;
- f1 = 2.12;
- d1 = 3.13;
-
- args[0] = &a1;
- args[1] = &a2;
- args[2] = &n;
- args[3] = &uc;
- args[4] = ≻
- args[5] = &us;
- args[6] = &ss;
- args[7] = &ui;
- args[8] = &si;
- args[9] = &ul;
- args[10] = &sl;
- args[11] = &f1;
- args[12] = &d1;
- args[13] = NULL;
-
- ffi_call(&cif, FFI_FN(test_fn), &res, args);
- /* { dg-output "1 2.000000 uc=9 sc=10 11 12 13 14 15 16 2.120000 3.130000" } */
- printf("res: %d\n", (int) res);
- /* { dg-output "\nres: 42" } */
- CHECK(res == 42);
-
- return 0;
-}
diff --git a/deps/libffi/testsuite/libffi.call/va_struct1.c b/deps/libffi/testsuite/libffi.call/va_struct1.c
deleted file mode 100644
index fff5c9accfd..00000000000
--- a/deps/libffi/testsuite/libffi.call/va_struct1.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/* Area: ffi_call
- Purpose: Test passing struct in variable argument lists.
- Limitations: none.
- PR: none.
- Originator: ARM Ltd. */
-
-/* { dg-do run } */
-/* { dg-output "" { xfail avr32*-*-* } } */
-
-#include "ffitest.h"
-#include <stdarg.h>
-
-struct small_tag
-{
- unsigned char a;
- unsigned char b;
-};
-
-struct large_tag
-{
- unsigned a;
- unsigned b;
- unsigned c;
- unsigned d;
- unsigned e;
-};
-
-static int
-test_fn (int n, ...)
-{
- va_list ap;
- struct small_tag s1;
- struct small_tag s2;
- struct large_tag l;
-
- va_start (ap, n);
- s1 = va_arg (ap, struct small_tag);
- l = va_arg (ap, struct large_tag);
- s2 = va_arg (ap, struct small_tag);
- printf ("%u %u %u %u %u %u %u %u %u\n", s1.a, s1.b, l.a, l.b, l.c, l.d, l.e,
- s2.a, s2.b);
- va_end (ap);
-
- CHECK(s1.a == 5);
- CHECK(s1.b == 6);
-
- CHECK(l.a == 10);
- CHECK(l.b == 11);
- CHECK(l.c == 12);
- CHECK(l.d == 13);
- CHECK(l.e == 14);
-
- CHECK(s2.a == 7);
- CHECK(s2.b == 8);
- return n + 1;
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- void* args[5];
- ffi_type* arg_types[5];
-
- ffi_type s_type;
- ffi_type *s_type_elements[3];
-
- ffi_type l_type;
- ffi_type *l_type_elements[6];
-
- struct small_tag s1;
- struct small_tag s2;
- struct large_tag l1;
-
- int n;
- ffi_arg res;
-
- s_type.size = 0;
- s_type.alignment = 0;
- s_type.type = FFI_TYPE_STRUCT;
- s_type.elements = s_type_elements;
-
- s_type_elements[0] = &ffi_type_uchar;
- s_type_elements[1] = &ffi_type_uchar;
- s_type_elements[2] = NULL;
-
- l_type.size = 0;
- l_type.alignment = 0;
- l_type.type = FFI_TYPE_STRUCT;
- l_type.elements = l_type_elements;
-
- l_type_elements[0] = &ffi_type_uint;
- l_type_elements[1] = &ffi_type_uint;
- l_type_elements[2] = &ffi_type_uint;
- l_type_elements[3] = &ffi_type_uint;
- l_type_elements[4] = &ffi_type_uint;
- l_type_elements[5] = NULL;
-
- arg_types[0] = &ffi_type_sint;
- arg_types[1] = &s_type;
- arg_types[2] = &l_type;
- arg_types[3] = &s_type;
- arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 4, &ffi_type_sint, arg_types) == FFI_OK);
-
- s1.a = 5;
- s1.b = 6;
-
- l1.a = 10;
- l1.b = 11;
- l1.c = 12;
- l1.d = 13;
- l1.e = 14;
-
- s2.a = 7;
- s2.b = 8;
-
- n = 41;
-
- args[0] = &n;
- args[1] = &s1;
- args[2] = &l1;
- args[3] = &s2;
- args[4] = NULL;
-
- ffi_call(&cif, FFI_FN(test_fn), &res, args);
- /* { dg-output "5 6 10 11 12 13 14 7 8" } */
- printf("res: %d\n", (int) res);
- /* { dg-output "\nres: 42" } */
- CHECK(res == 42);
-
- return 0;
-}
diff --git a/deps/libffi/testsuite/libffi.call/va_struct2.c b/deps/libffi/testsuite/libffi.call/va_struct2.c
deleted file mode 100644
index a0340870775..00000000000
--- a/deps/libffi/testsuite/libffi.call/va_struct2.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/* Area: ffi_call
- Purpose: Test passing struct in variable argument lists.
- Limitations: none.
- PR: none.
- Originator: ARM Ltd. */
-
-/* { dg-do run } */
-/* { dg-output "" { xfail avr32*-*-* } } */
-
-#include "ffitest.h"
-#include <stdarg.h>
-
-struct small_tag
-{
- unsigned char a;
- unsigned char b;
-};
-
-struct large_tag
-{
- unsigned a;
- unsigned b;
- unsigned c;
- unsigned d;
- unsigned e;
-};
-
-static struct small_tag
-test_fn (int n, ...)
-{
- va_list ap;
- struct small_tag s1;
- struct small_tag s2;
- struct large_tag l;
-
- (void) n;
- va_start (ap, n);
- s1 = va_arg (ap, struct small_tag);
- l = va_arg (ap, struct large_tag);
- s2 = va_arg (ap, struct small_tag);
- printf ("%u %u %u %u %u %u %u %u %u\n", s1.a, s1.b, l.a, l.b, l.c, l.d, l.e,
- s2.a, s2.b);
- CHECK(s1.a == 5);
- CHECK(s1.b == 6);
- CHECK(l.a == 10);
- CHECK(l.b == 11);
- CHECK(l.c == 12);
- CHECK(l.d == 13);
- CHECK(l.e == 14);
- CHECK(s2.a == 7);
- CHECK(s2.b == 8);
- va_end (ap);
- s1.a += s2.a;
- s1.b += s2.b;
- return s1;
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- void* args[5];
- ffi_type* arg_types[5];
-
- ffi_type s_type;
- ffi_type *s_type_elements[3];
-
- ffi_type l_type;
- ffi_type *l_type_elements[6];
-
- struct small_tag s1;
- struct small_tag s2;
- struct large_tag l1;
-
- int n;
- struct small_tag res;
-
- s_type.size = 0;
- s_type.alignment = 0;
- s_type.type = FFI_TYPE_STRUCT;
- s_type.elements = s_type_elements;
-
- s_type_elements[0] = &ffi_type_uchar;
- s_type_elements[1] = &ffi_type_uchar;
- s_type_elements[2] = NULL;
-
- l_type.size = 0;
- l_type.alignment = 0;
- l_type.type = FFI_TYPE_STRUCT;
- l_type.elements = l_type_elements;
-
- l_type_elements[0] = &ffi_type_uint;
- l_type_elements[1] = &ffi_type_uint;
- l_type_elements[2] = &ffi_type_uint;
- l_type_elements[3] = &ffi_type_uint;
- l_type_elements[4] = &ffi_type_uint;
- l_type_elements[5] = NULL;
-
- arg_types[0] = &ffi_type_sint;
- arg_types[1] = &s_type;
- arg_types[2] = &l_type;
- arg_types[3] = &s_type;
- arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 4, &s_type, arg_types) == FFI_OK);
-
- s1.a = 5;
- s1.b = 6;
-
- l1.a = 10;
- l1.b = 11;
- l1.c = 12;
- l1.d = 13;
- l1.e = 14;
-
- s2.a = 7;
- s2.b = 8;
-
- n = 41;
-
- args[0] = &n;
- args[1] = &s1;
- args[2] = &l1;
- args[3] = &s2;
- args[4] = NULL;
-
- ffi_call(&cif, FFI_FN(test_fn), &res, args);
- /* { dg-output "5 6 10 11 12 13 14 7 8" } */
- printf("res: %d %d\n", res.a, res.b);
- /* { dg-output "\nres: 12 14" } */
- CHECK(res.a == 12);
- CHECK(res.b == 14);
-
- return 0;
-}
diff --git a/deps/libffi/testsuite/libffi.call/va_struct3.c b/deps/libffi/testsuite/libffi.call/va_struct3.c
deleted file mode 100644
index 5a52c9f23e2..00000000000
--- a/deps/libffi/testsuite/libffi.call/va_struct3.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/* Area: ffi_call
- Purpose: Test passing struct in variable argument lists.
- Limitations: none.
- PR: none.
- Originator: ARM Ltd. */
-
-/* { dg-do run } */
-/* { dg-output "" { xfail avr32*-*-* } } */
-
-#include "ffitest.h"
-#include <stdarg.h>
-
-struct small_tag
-{
- unsigned char a;
- unsigned char b;
-};
-
-struct large_tag
-{
- unsigned a;
- unsigned b;
- unsigned c;
- unsigned d;
- unsigned e;
-};
-
-static struct large_tag
-test_fn (int n, ...)
-{
- va_list ap;
- struct small_tag s1;
- struct small_tag s2;
- struct large_tag l;
-
- (void) n;
- va_start (ap, n);
- s1 = va_arg (ap, struct small_tag);
- l = va_arg (ap, struct large_tag);
- s2 = va_arg (ap, struct small_tag);
- printf ("%u %u %u %u %u %u %u %u %u\n", s1.a, s1.b, l.a, l.b, l.c, l.d, l.e,
- s2.a, s2.b);
-
- CHECK(s1.a == 5);
- CHECK(s1.b == 6);
- CHECK(l.a == 10);
- CHECK(l.b == 11);
- CHECK(l.c == 12);
- CHECK(l.d == 13);
- CHECK(l.e == 14);
- CHECK(s2.a == 7);
- CHECK(s2.b == 8);
- va_end (ap);
- l.a += s1.a;
- l.b += s1.b;
- l.c += s2.a;
- l.d += s2.b;
- return l;
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- void* args[5];
- ffi_type* arg_types[5];
-
- ffi_type s_type;
- ffi_type *s_type_elements[3];
-
- ffi_type l_type;
- ffi_type *l_type_elements[6];
-
- struct small_tag s1;
- struct small_tag s2;
- struct large_tag l1;
-
- int n;
- struct large_tag res;
-
- s_type.size = 0;
- s_type.alignment = 0;
- s_type.type = FFI_TYPE_STRUCT;
- s_type.elements = s_type_elements;
-
- s_type_elements[0] = &ffi_type_uchar;
- s_type_elements[1] = &ffi_type_uchar;
- s_type_elements[2] = NULL;
-
- l_type.size = 0;
- l_type.alignment = 0;
- l_type.type = FFI_TYPE_STRUCT;
- l_type.elements = l_type_elements;
-
- l_type_elements[0] = &ffi_type_uint;
- l_type_elements[1] = &ffi_type_uint;
- l_type_elements[2] = &ffi_type_uint;
- l_type_elements[3] = &ffi_type_uint;
- l_type_elements[4] = &ffi_type_uint;
- l_type_elements[5] = NULL;
-
- arg_types[0] = &ffi_type_sint;
- arg_types[1] = &s_type;
- arg_types[2] = &l_type;
- arg_types[3] = &s_type;
- arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 4, &l_type, arg_types) == FFI_OK);
-
- s1.a = 5;
- s1.b = 6;
-
- l1.a = 10;
- l1.b = 11;
- l1.c = 12;
- l1.d = 13;
- l1.e = 14;
-
- s2.a = 7;
- s2.b = 8;
-
- n = 41;
-
- args[0] = &n;
- args[1] = &s1;
- args[2] = &l1;
- args[3] = &s2;
- args[4] = NULL;
-
- ffi_call(&cif, FFI_FN(test_fn), &res, args);
- /* { dg-output "5 6 10 11 12 13 14 7 8" } */
- printf("res: %d %d %d %d %d\n", res.a, res.b, res.c, res.d, res.e);
- /* { dg-output "\nres: 15 17 19 21 14" } */
- CHECK(res.a == 15);
- CHECK(res.b == 17);
- CHECK(res.c == 19);
- CHECK(res.d == 21);
- CHECK(res.e == 14);
-
- return 0;
-}
diff --git a/deps/libffi/testsuite/libffi.call/x32.c b/deps/libffi/testsuite/libffi.call/x32.c
deleted file mode 100644
index 9c380a52922..00000000000
--- a/deps/libffi/testsuite/libffi.call/x32.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Area: ffi_call
- Purpose: Check zero-extension of pointers on x32.
- Limitations: none.
- PR: 887
- Originator: Mikulas Patocka <mikulas@twibright.com> */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-static int ABI_ATTR fn(int *a)
-{
- if (a)
- return *a;
- return -1;
-}
-
-int main(void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- void *z[2] = { (void *)0, (void *)1 };
- ffi_arg rint;
- args[0] = &ffi_type_pointer;
- values[0] = z;
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ffi_type_sint, args) == FFI_OK);
- ffi_call(&cif, FFI_FN(fn), &rint, values);
- CHECK((int)rint == -1);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/closure.exp b/deps/libffi/testsuite/libffi.closures/closure.exp
deleted file mode 100644
index 9d53294909e..00000000000
--- a/deps/libffi/testsuite/libffi.closures/closure.exp
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright (C) 2003, 2006, 2009, 2010, 2014, 2019 Free Software Foundation, Inc.
-# Copyright (C) 2019 Anthony Green
-
-# This program 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 3 of the License, or
-# (at your option) any later version.
-#
-# This program 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; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-dg-init
-libffi-init
-
-global srcdir subdir
-
-if { [string match $compiler_vendor "microsoft"] } {
- # -wd4005 macro redefinition
- # -wd4244 implicit conversion to type of smaller size
- # -wd4305 truncation to smaller type
- # -wd4477 printf %lu of uintptr_t
- # -wd4312 implicit conversion to type of greater size
- # -wd4311 pointer truncation to unsigned long
- # -EHsc C++ Exception Handling (no SEH exceptions)
- set additional_options "-wd4005 -wd4244 -wd4305 -wd4477 -wd4312 -wd4311 -EHsc";
-} else {
- set additional_options "";
-}
-
-set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.c]]
-
-if { [libffi_feature_test "#if FFI_CLOSURES"] } {
- run-many-tests $tlist $additional_options
-} else {
- foreach test $tlist {
- unsupported "$test"
- }
-}
-
-set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.cc]]
-
-# No C++ for or1k
-if { [istarget "or1k-*-*"] } {
- foreach test $tlist {
- unsupported "$test"
- }
-} else {
- if { [libffi_feature_test "#if FFI_CLOSURES"] } {
- run-many-tests $tlist $additional_options
- } else {
- foreach test $tlist {
- unsupported "$test"
- }
- }
-}
-
-dg-finish
-
-# Local Variables:
-# tcl-indent-level:4
-# End:
diff --git a/deps/libffi/testsuite/libffi.closures/closure_fn0.c b/deps/libffi/testsuite/libffi.closures/closure_fn0.c
deleted file mode 100644
index dfadb05563d..00000000000
--- a/deps/libffi/testsuite/libffi.closures/closure_fn0.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Area: closure_call
- Purpose: Check multiple values passing from different type.
- Also, exceed the limit of gpr and fpr registers on PowerPC
- Darwin.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-
-
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void
-closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata)
-{
- *(ffi_arg*)resp =
- (int)*(unsigned long long *)args[0] + (int)(*(int *)args[1]) +
- (int)(*(unsigned long long *)args[2]) + (int)*(int *)args[3] +
- (int)(*(signed short *)args[4]) +
- (int)(*(unsigned long long *)args[5]) +
- (int)*(int *)args[6] + (int)(*(int *)args[7]) +
- (int)(*(double *)args[8]) + (int)*(int *)args[9] +
- (int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
- (int)*(int *)args[12] + (int)(*(int *)args[13]) +
- (int)(*(int *)args[14]) + *(int *)args[15] + (intptr_t)userdata;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
- (int)*(unsigned long long *)args[0], (int)(*(int *)args[1]),
- (int)(*(unsigned long long *)args[2]),
- (int)*(int *)args[3], (int)(*(signed short *)args[4]),
- (int)(*(unsigned long long *)args[5]),
- (int)*(int *)args[6], (int)(*(int *)args[7]),
- (int)(*(double *)args[8]), (int)*(int *)args[9],
- (int)(*(int *)args[10]), (int)(*(float *)args[11]),
- (int)*(int *)args[12], (int)(*(int *)args[13]),
- (int)(*(int *)args[14]),*(int *)args[15],
- (int)(intptr_t)userdata, (int)*(ffi_arg *)resp);
- CHECK((int)*(ffi_arg *)resp == 680);
-}
-
-typedef int (*closure_test_type0)(unsigned long long, int, unsigned long long,
- int, signed short, unsigned long long, int,
- int, double, int, int, float, int, int,
- int, int);
-
-int main (void)
-{
- ffi_cif cif;
- void * code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[17];
- int res;
-
- cl_arg_types[0] = &ffi_type_uint64;
- cl_arg_types[1] = &ffi_type_sint;
- cl_arg_types[2] = &ffi_type_uint64;
- cl_arg_types[3] = &ffi_type_sint;
- cl_arg_types[4] = &ffi_type_sshort;
- cl_arg_types[5] = &ffi_type_uint64;
- cl_arg_types[6] = &ffi_type_sint;
- cl_arg_types[7] = &ffi_type_sint;
- cl_arg_types[8] = &ffi_type_double;
- cl_arg_types[9] = &ffi_type_sint;
- cl_arg_types[10] = &ffi_type_sint;
- cl_arg_types[11] = &ffi_type_float;
- cl_arg_types[12] = &ffi_type_sint;
- cl_arg_types[13] = &ffi_type_sint;
- cl_arg_types[14] = &ffi_type_sint;
- cl_arg_types[15] = &ffi_type_sint;
- cl_arg_types[16] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn0,
- (void *) 3 /* userdata */, code) == FFI_OK);
-
- res = (*((closure_test_type0)code))
- (1LL, 2, 3LL, 4, 127, 429LL, 7, 8, 9.5, 10, 11, 12, 13,
- 19, 21, 1);
- /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 680" } */
- CHECK(res == 680);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/closure_fn1.c b/deps/libffi/testsuite/libffi.closures/closure_fn1.c
deleted file mode 100644
index a90bb291b5b..00000000000
--- a/deps/libffi/testsuite/libffi.closures/closure_fn1.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Area: closure_call.
- Purpose: Check multiple values passing from different type.
- Also, exceed the limit of gpr and fpr registers on PowerPC
- Darwin.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-
-static void closure_test_fn1(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata)
-{
- *(ffi_arg*)resp =
- (int)*(float *)args[0] +(int)(*(float *)args[1]) +
- (int)(*(float *)args[2]) + (int)*(float *)args[3] +
- (int)(*(signed short *)args[4]) + (int)(*(float *)args[5]) +
- (int)*(float *)args[6] + (int)(*(int *)args[7]) +
- (int)(*(double*)args[8]) + (int)*(int *)args[9] +
- (int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
- (int)*(int *)args[12] + (int)(*(int *)args[13]) +
- (int)(*(int *)args[14]) + *(int *)args[15] + (intptr_t)userdata;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
- (int)*(float *)args[0], (int)(*(float *)args[1]),
- (int)(*(float *)args[2]), (int)*(float *)args[3],
- (int)(*(signed short *)args[4]), (int)(*(float *)args[5]),
- (int)*(float *)args[6], (int)(*(int *)args[7]),
- (int)(*(double *)args[8]), (int)*(int *)args[9],
- (int)(*(int *)args[10]), (int)(*(float *)args[11]),
- (int)*(int *)args[12], (int)(*(int *)args[13]),
- (int)(*(int *)args[14]), *(int *)args[15],
- (int)(intptr_t)userdata, (int)*(ffi_arg *)resp);
- CHECK((int)*(ffi_arg *)resp == 255);
-}
-
-typedef int (*closure_test_type1)(float, float, float, float, signed short,
- float, float, int, double, int, int, float,
- int, int, int, int);
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[17];
- int res;
-
- cl_arg_types[0] = &ffi_type_float;
- cl_arg_types[1] = &ffi_type_float;
- cl_arg_types[2] = &ffi_type_float;
- cl_arg_types[3] = &ffi_type_float;
- cl_arg_types[4] = &ffi_type_sshort;
- cl_arg_types[5] = &ffi_type_float;
- cl_arg_types[6] = &ffi_type_float;
- cl_arg_types[7] = &ffi_type_sint;
- cl_arg_types[8] = &ffi_type_double;
- cl_arg_types[9] = &ffi_type_sint;
- cl_arg_types[10] = &ffi_type_sint;
- cl_arg_types[11] = &ffi_type_float;
- cl_arg_types[12] = &ffi_type_sint;
- cl_arg_types[13] = &ffi_type_sint;
- cl_arg_types[14] = &ffi_type_sint;
- cl_arg_types[15] = &ffi_type_sint;
- cl_arg_types[16] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn1,
- (void *) 3 /* userdata */, code) == FFI_OK);
-
- res = (*((closure_test_type1)code))
- (1.1, 2.2, 3.3, 4.4, 127, 5.5, 6.6, 8, 9, 10, 11, 12.0, 13,
- 19, 21, 1);
- /* { dg-output "1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 255" } */
- CHECK(res == 255);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/closure_fn2.c b/deps/libffi/testsuite/libffi.closures/closure_fn2.c
deleted file mode 100644
index 7d7af4b59ba..00000000000
--- a/deps/libffi/testsuite/libffi.closures/closure_fn2.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Area: closure_call
- Purpose: Check multiple values passing from different type.
- Also, exceed the limit of gpr and fpr registers on PowerPC
- Darwin.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void closure_test_fn2(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata)
-{
- *(ffi_arg*)resp =
- (int)*(double *)args[0] +(int)(*(double *)args[1]) +
- (int)(*(double *)args[2]) + (int)*(double *)args[3] +
- (int)(*(signed short *)args[4]) + (int)(*(double *)args[5]) +
- (int)*(double *)args[6] + (int)(*(int *)args[7]) +
- (int)(*(double *)args[8]) + (int)*(int *)args[9] +
- (int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
- (int)*(int *)args[12] + (int)(*(float *)args[13]) +
- (int)(*(int *)args[14]) + *(int *)args[15] + (intptr_t)userdata;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
- (int)*(double *)args[0], (int)(*(double *)args[1]),
- (int)(*(double *)args[2]), (int)*(double *)args[3],
- (int)(*(signed short *)args[4]), (int)(*(double *)args[5]),
- (int)*(double *)args[6], (int)(*(int *)args[7]),
- (int)(*(double*)args[8]), (int)*(int *)args[9],
- (int)(*(int *)args[10]), (int)(*(float *)args[11]),
- (int)*(int *)args[12], (int)(*(float *)args[13]),
- (int)(*(int *)args[14]), *(int *)args[15], (int)(intptr_t)userdata,
- (int)*(ffi_arg *)resp);
- CHECK((int)*(ffi_arg *)resp == 255);
-}
-
-typedef int (*closure_test_type2)(double, double, double, double, signed short,
- double, double, int, double, int, int, float,
- int, float, int, int);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[17];
- int res;
-
- cl_arg_types[0] = &ffi_type_double;
- cl_arg_types[1] = &ffi_type_double;
- cl_arg_types[2] = &ffi_type_double;
- cl_arg_types[3] = &ffi_type_double;
- cl_arg_types[4] = &ffi_type_sshort;
- cl_arg_types[5] = &ffi_type_double;
- cl_arg_types[6] = &ffi_type_double;
- cl_arg_types[7] = &ffi_type_sint;
- cl_arg_types[8] = &ffi_type_double;
- cl_arg_types[9] = &ffi_type_sint;
- cl_arg_types[10] = &ffi_type_sint;
- cl_arg_types[11] = &ffi_type_float;
- cl_arg_types[12] = &ffi_type_sint;
- cl_arg_types[13] = &ffi_type_float;
- cl_arg_types[14] = &ffi_type_sint;
- cl_arg_types[15] = &ffi_type_sint;
- cl_arg_types[16] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn2,
- (void *) 3 /* userdata */, code) == FFI_OK);
-
- res = (*((closure_test_type2)code))
- (1, 2, 3, 4, 127, 5, 6, 8, 9, 10, 11, 12.0, 13,
- 19.0, 21, 1);
- /* { dg-output "1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 255" } */
- CHECK(res == 255);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/closure_fn3.c b/deps/libffi/testsuite/libffi.closures/closure_fn3.c
deleted file mode 100644
index 1ad8f9d86f4..00000000000
--- a/deps/libffi/testsuite/libffi.closures/closure_fn3.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Area: closure_call
- Purpose: Check multiple values passing from different type.
- Also, exceed the limit of gpr and fpr registers on PowerPC
- Darwin.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void closure_test_fn3(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata)
- {
- *(ffi_arg*)resp =
- (int)*(float *)args[0] +(int)(*(float *)args[1]) +
- (int)(*(float *)args[2]) + (int)*(float *)args[3] +
- (int)(*(float *)args[4]) + (int)(*(float *)args[5]) +
- (int)*(float *)args[6] + (int)(*(float *)args[7]) +
- (int)(*(double *)args[8]) + (int)*(int *)args[9] +
- (int)(*(float *)args[10]) + (int)(*(float *)args[11]) +
- (int)*(int *)args[12] + (int)(*(float *)args[13]) +
- (int)(*(float *)args[14]) + *(int *)args[15] + (intptr_t)userdata;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
- (int)*(float *)args[0], (int)(*(float *)args[1]),
- (int)(*(float *)args[2]), (int)*(float *)args[3],
- (int)(*(float *)args[4]), (int)(*(float *)args[5]),
- (int)*(float *)args[6], (int)(*(float *)args[7]),
- (int)(*(double *)args[8]), (int)*(int *)args[9],
- (int)(*(float *)args[10]), (int)(*(float *)args[11]),
- (int)*(int *)args[12], (int)(*(float *)args[13]),
- (int)(*(float *)args[14]), *(int *)args[15], (int)(intptr_t)userdata,
- (int)*(ffi_arg *)resp);
-
- CHECK((int)*(float *)args[0] == 1);
- CHECK((int)(*(float *)args[1]) == 2);
- CHECK((int)(*(float *)args[2]) == 3);
- CHECK((int)(*(float *)args[3]) == 4);
- CHECK((int)(*(float *)args[4]) == 5);
- CHECK((int)(*(float *)args[5]) == 6);
- CHECK((int)*(float *)args[6] == 7);
- CHECK((int)(*(float *)args[7]) == 8);
- CHECK((int)(*(double *)args[8]) == 9);
- CHECK((int)*(int *)args[9] == 10);
- CHECK((int)(*(float *)args[10]) == 11);
- CHECK((int)(*(float *)args[11]) == 12);
- CHECK((int)*(int *)args[12] == 13);
- CHECK((int)(*(float *)args[13]) == 19);
- CHECK((int)(*(float *)args[14]) == 21);
- CHECK(*(int *)args[15] == 1);
- CHECK((int)(intptr_t)userdata == 3);
-
- CHECK((int)*(ffi_arg *)resp == 135);
- }
-
-typedef int (*closure_test_type3)(float, float, float, float, float, float,
- float, float, double, int, float, float, int,
- float, float, int);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[17];
- int res;
-
- cl_arg_types[0] = &ffi_type_float;
- cl_arg_types[1] = &ffi_type_float;
- cl_arg_types[2] = &ffi_type_float;
- cl_arg_types[3] = &ffi_type_float;
- cl_arg_types[4] = &ffi_type_float;
- cl_arg_types[5] = &ffi_type_float;
- cl_arg_types[6] = &ffi_type_float;
- cl_arg_types[7] = &ffi_type_float;
- cl_arg_types[8] = &ffi_type_double;
- cl_arg_types[9] = &ffi_type_sint;
- cl_arg_types[10] = &ffi_type_float;
- cl_arg_types[11] = &ffi_type_float;
- cl_arg_types[12] = &ffi_type_sint;
- cl_arg_types[13] = &ffi_type_float;
- cl_arg_types[14] = &ffi_type_float;
- cl_arg_types[15] = &ffi_type_sint;
- cl_arg_types[16] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn3,
- (void *) 3 /* userdata */, code) == FFI_OK);
-
- res = (*((closure_test_type3)code))
- (1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9, 10, 11.11, 12.0, 13,
- 19.19, 21.21, 1);
- /* { dg-output "1 2 3 4 5 6 7 8 9 10 11 12 13 19 21 1 3: 135" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 135" } */
- CHECK(res == 135);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/closure_fn4.c b/deps/libffi/testsuite/libffi.closures/closure_fn4.c
deleted file mode 100644
index e5f1f53d1c7..00000000000
--- a/deps/libffi/testsuite/libffi.closures/closure_fn4.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* Area: closure_call
- Purpose: Check multiple long long values passing.
- Also, exceed the limit of gpr and fpr registers on PowerPC
- Darwin.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20031026 */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-static void
-closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata)
-{
- *(ffi_arg*)resp =
- (int)*(unsigned long long *)args[0] + (int)*(unsigned long long *)args[1] +
- (int)*(unsigned long long *)args[2] + (int)*(unsigned long long *)args[3] +
- (int)*(unsigned long long *)args[4] + (int)*(unsigned long long *)args[5] +
- (int)*(unsigned long long *)args[6] + (int)*(unsigned long long *)args[7] +
- (int)*(unsigned long long *)args[8] + (int)*(unsigned long long *)args[9] +
- (int)*(unsigned long long *)args[10] +
- (int)*(unsigned long long *)args[11] +
- (int)*(unsigned long long *)args[12] +
- (int)*(unsigned long long *)args[13] +
- (int)*(unsigned long long *)args[14] +
- *(int *)args[15] + (intptr_t)userdata;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
- (int)*(unsigned long long *)args[0],
- (int)*(unsigned long long *)args[1],
- (int)*(unsigned long long *)args[2],
- (int)*(unsigned long long *)args[3],
- (int)*(unsigned long long *)args[4],
- (int)*(unsigned long long *)args[5],
- (int)*(unsigned long long *)args[6],
- (int)*(unsigned long long *)args[7],
- (int)*(unsigned long long *)args[8],
- (int)*(unsigned long long *)args[9],
- (int)*(unsigned long long *)args[10],
- (int)*(unsigned long long *)args[11],
- (int)*(unsigned long long *)args[12],
- (int)*(unsigned long long *)args[13],
- (int)*(unsigned long long *)args[14],
- *(int *)args[15],
- (int)(intptr_t)userdata, (int)*(ffi_arg *)resp);
- CHECK((int)*(ffi_arg *)resp == 680);
-
-}
-
-typedef int (*closure_test_type0)(unsigned long long, unsigned long long,
- unsigned long long, unsigned long long,
- unsigned long long, unsigned long long,
- unsigned long long, unsigned long long,
- unsigned long long, unsigned long long,
- unsigned long long, unsigned long long,
- unsigned long long, unsigned long long,
- unsigned long long, int);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[17];
- int i, res;
-
- for (i = 0; i < 15; i++) {
- cl_arg_types[i] = &ffi_type_uint64;
- }
- cl_arg_types[15] = &ffi_type_sint;
- cl_arg_types[16] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn0,
- (void *) 3 /* userdata */, code) == FFI_OK);
-
- res = (*((closure_test_type0)code))
- (1LL, 2LL, 3LL, 4LL, 127LL, 429LL, 7LL, 8LL, 9LL, 10LL, 11LL, 12LL,
- 13LL, 19LL, 21LL, 1);
- /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 680" } */
- CHECK(res == 680);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/closure_fn5.c b/deps/libffi/testsuite/libffi.closures/closure_fn5.c
deleted file mode 100644
index 97277f5c318..00000000000
--- a/deps/libffi/testsuite/libffi.closures/closure_fn5.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/* Area: closure_call
- Purpose: Check multiple long long values passing.
- Exceed the limit of gpr registers on PowerPC
- Darwin.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20031026 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void
-closure_test_fn5(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata)
-{
- *(ffi_arg*)resp =
- (int)*(unsigned long long *)args[0] + (int)*(unsigned long long *)args[1] +
- (int)*(unsigned long long *)args[2] + (int)*(unsigned long long *)args[3] +
- (int)*(unsigned long long *)args[4] + (int)*(unsigned long long *)args[5] +
- (int)*(unsigned long long *)args[6] + (int)*(unsigned long long *)args[7] +
- (int)*(unsigned long long *)args[8] + (int)*(unsigned long long *)args[9] +
- (int)*(int *)args[10] +
- (int)*(unsigned long long *)args[11] +
- (int)*(unsigned long long *)args[12] +
- (int)*(unsigned long long *)args[13] +
- (int)*(unsigned long long *)args[14] +
- *(int *)args[15] + (intptr_t)userdata;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
- (int)*(unsigned long long *)args[0],
- (int)*(unsigned long long *)args[1],
- (int)*(unsigned long long *)args[2],
- (int)*(unsigned long long *)args[3],
- (int)*(unsigned long long *)args[4],
- (int)*(unsigned long long *)args[5],
- (int)*(unsigned long long *)args[6],
- (int)*(unsigned long long *)args[7],
- (int)*(unsigned long long *)args[8],
- (int)*(unsigned long long *)args[9],
- (int)*(int *)args[10],
- (int)*(unsigned long long *)args[11],
- (int)*(unsigned long long *)args[12],
- (int)*(unsigned long long *)args[13],
- (int)*(unsigned long long *)args[14],
- *(int *)args[15],
- (int)(intptr_t)userdata, (int)*(ffi_arg *)resp);
- CHECK((int)*(ffi_arg *)resp == 680);
-
-}
-
-typedef int (*closure_test_type0)(unsigned long long, unsigned long long,
- unsigned long long, unsigned long long,
- unsigned long long, unsigned long long,
- unsigned long long, unsigned long long,
- unsigned long long, unsigned long long,
- int, unsigned long long,
- unsigned long long, unsigned long long,
- unsigned long long, int);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[17];
- int i, res;
-
- for (i = 0; i < 10; i++) {
- cl_arg_types[i] = &ffi_type_uint64;
- }
- cl_arg_types[10] = &ffi_type_sint;
- for (i = 11; i < 15; i++) {
- cl_arg_types[i] = &ffi_type_uint64;
- }
- cl_arg_types[15] = &ffi_type_sint;
- cl_arg_types[16] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn5,
- (void *) 3 /* userdata */, code) == FFI_OK);
-
- res = (*((closure_test_type0)code))
- (1LL, 2LL, 3LL, 4LL, 127LL, 429LL, 7LL, 8LL, 9LL, 10LL, 11, 12LL,
- 13LL, 19LL, 21LL, 1);
- /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 680" } */
- CHECK(res == 680);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/closure_fn6.c b/deps/libffi/testsuite/libffi.closures/closure_fn6.c
deleted file mode 100644
index fb079e2efcd..00000000000
--- a/deps/libffi/testsuite/libffi.closures/closure_fn6.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Area: closure_call
- Purpose: Check multiple values passing from different type.
- Also, exceed the limit of gpr and fpr registers on PowerPC.
- Limitations: none.
- PR: PR23404
- Originator: <andreast@gcc.gnu.org> 20050830 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void
-closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata)
-{
- *(ffi_arg*)resp =
- (int)*(unsigned long long *)args[0] +
- (int)(*(unsigned long long *)args[1]) +
- (int)(*(unsigned long long *)args[2]) +
- (int)*(unsigned long long *)args[3] +
- (int)(*(int *)args[4]) + (int)(*(double *)args[5]) +
- (int)*(double *)args[6] + (int)(*(float *)args[7]) +
- (int)(*(double *)args[8]) + (int)*(double *)args[9] +
- (int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
- (int)*(int *)args[12] + (int)(*(int *)args[13]) +
- (int)(*(double *)args[14]) + (int)*(double *)args[15] +
- (intptr_t)userdata;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
- (int)*(unsigned long long *)args[0],
- (int)(*(unsigned long long *)args[1]),
- (int)(*(unsigned long long *)args[2]),
- (int)*(unsigned long long *)args[3],
- (int)(*(int *)args[4]), (int)(*(double *)args[5]),
- (int)*(double *)args[6], (int)(*(float *)args[7]),
- (int)(*(double *)args[8]), (int)*(double *)args[9],
- (int)(*(int *)args[10]), (int)(*(float *)args[11]),
- (int)*(int *)args[12], (int)(*(int *)args[13]),
- (int)(*(double *)args[14]), (int)(*(double *)args[15]),
- (int)(intptr_t)userdata, (int)*(ffi_arg *)resp);
- CHECK((int)*(ffi_arg *)resp == 680);
-
-}
-
-typedef int (*closure_test_type0)(unsigned long long,
- unsigned long long,
- unsigned long long,
- unsigned long long,
- int, double, double, float, double, double,
- int, float, int, int, double, double);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[17];
- int res;
-
- cl_arg_types[0] = &ffi_type_uint64;
- cl_arg_types[1] = &ffi_type_uint64;
- cl_arg_types[2] = &ffi_type_uint64;
- cl_arg_types[3] = &ffi_type_uint64;
- cl_arg_types[4] = &ffi_type_sint;
- cl_arg_types[5] = &ffi_type_double;
- cl_arg_types[6] = &ffi_type_double;
- cl_arg_types[7] = &ffi_type_float;
- cl_arg_types[8] = &ffi_type_double;
- cl_arg_types[9] = &ffi_type_double;
- cl_arg_types[10] = &ffi_type_sint;
- cl_arg_types[11] = &ffi_type_float;
- cl_arg_types[12] = &ffi_type_sint;
- cl_arg_types[13] = &ffi_type_sint;
- cl_arg_types[14] = &ffi_type_double;
- cl_arg_types[15] = &ffi_type_double;
- cl_arg_types[16] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn0,
- (void *) 3 /* userdata */, code) == FFI_OK);
-
- res = (*((closure_test_type0)code))
- (1, 2, 3, 4, 127, 429., 7., 8., 9.5, 10., 11, 12., 13,
- 19, 21., 1.);
- /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 680" } */
- CHECK(res == 680);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/closure_int128.c b/deps/libffi/testsuite/libffi.closures/closure_int128.c
deleted file mode 100644
index a1c8ea155c3..00000000000
--- a/deps/libffi/testsuite/libffi.closures/closure_int128.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Area: ffi_closure
- Purpose: Check that a closure receives a 128-bit integer argument, and
- the argument after it, correctly. On s390x the closure path
- had no SINT128/UINT128 case, so it left the argument's avalue[]
- slot uninitialised and shifted every later argument
- (GHSA-wf8m-qr3x-cch4).
- Limitations: none.
- PR: GHSA-wf8m-qr3x-cch4. */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-#if defined(FFI_TARGET_HAS_INT128) && defined(__SIZEOF_INT128__)
-
-typedef __int128_t i128;
-
-static const i128 VAL =
- ((i128)0x0102030405060708ull << 64) | 0x090a0b0c0d0e0f10ull;
-#define TAIL 0x5a5a5a5aL
-
-/* long f(i128 x, long b) => low64(x) + b */
-static void h_xb (ffi_cif *cif, void *ret, void **args, void *ud)
-{
- i128 x = *(i128 *) args[0];
- long b = *(long *) args[1];
- (void) cif; (void) ud;
- *(ffi_arg *) ret = (ffi_arg) ((long) x + b);
-}
-
-/* long g(long a, i128 x, long b) => a + low64(x) + b */
-static void h_axb (ffi_cif *cif, void *ret, void **args, void *ud)
-{
- long a = *(long *) args[0];
- i128 x = *(i128 *) args[1];
- long b = *(long *) args[2];
- (void) cif; (void) ud;
- *(ffi_arg *) ret = (ffi_arg) (a + (long) x + b);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *cl;
-
- {
- ffi_type *args[2] = { &ffi_type_sint128, &ffi_type_sint64 };
- long (*f) (i128, long);
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 2, &ffi_type_sint64, args)
- == FFI_OK);
- cl = ffi_closure_alloc (sizeof (ffi_closure), &code);
- CHECK (cl != NULL);
- CHECK (ffi_prep_closure_loc (cl, &cif, h_xb, NULL, code) == FFI_OK);
- f = (long (*) (i128, long)) code;
- CHECK (f (VAL, TAIL) == (long) ((long) VAL + TAIL));
- ffi_closure_free (cl);
- }
-
- {
- ffi_type *args[3] =
- { &ffi_type_sint64, &ffi_type_sint128, &ffi_type_sint64 };
- long (*g) (long, i128, long);
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 3, &ffi_type_sint64, args)
- == FFI_OK);
- cl = ffi_closure_alloc (sizeof (ffi_closure), &code);
- CHECK (cl != NULL);
- CHECK (ffi_prep_closure_loc (cl, &cif, h_axb, NULL, code) == FFI_OK);
- g = (long (*) (long, i128, long)) code;
- CHECK (g (11, VAL, TAIL) == (long) (11 + (long) VAL + TAIL));
- ffi_closure_free (cl);
- }
-
- printf ("closure int128 ok\n");
- exit (0);
-}
-
-#else
-int main (void) { return 0; }
-#endif
diff --git a/deps/libffi/testsuite/libffi.closures/closure_loc_fn0.c b/deps/libffi/testsuite/libffi.closures/closure_loc_fn0.c
deleted file mode 100644
index 179485d9b57..00000000000
--- a/deps/libffi/testsuite/libffi.closures/closure_loc_fn0.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Area: closure_call
- Purpose: Check multiple values passing from different type.
- Also, exceed the limit of gpr and fpr registers on PowerPC
- Darwin.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-static void
-closure_loc_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata)
-{
- *(ffi_arg*)resp =
- (int)*(unsigned long long *)args[0] + (int)(*(int *)args[1]) +
- (int)(*(unsigned long long *)args[2]) + (int)*(int *)args[3] +
- (int)(*(signed short *)args[4]) +
- (int)(*(unsigned long long *)args[5]) +
- (int)*(int *)args[6] + (int)(*(int *)args[7]) +
- (int)(*(double *)args[8]) + (int)*(int *)args[9] +
- (int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
- (int)*(int *)args[12] + (int)(*(int *)args[13]) +
- (int)(*(int *)args[14]) + *(int *)args[15] + (intptr_t)userdata;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
- (int)*(unsigned long long *)args[0], (int)(*(int *)args[1]),
- (int)(*(unsigned long long *)args[2]),
- (int)*(int *)args[3], (int)(*(signed short *)args[4]),
- (int)(*(unsigned long long *)args[5]),
- (int)*(int *)args[6], (int)(*(int *)args[7]),
- (int)(*(double *)args[8]), (int)*(int *)args[9],
- (int)(*(int *)args[10]), (int)(*(float *)args[11]),
- (int)*(int *)args[12], (int)(*(int *)args[13]),
- (int)(*(int *)args[14]),*(int *)args[15],
- (int)(intptr_t)userdata, (int)*(ffi_arg *)resp);
-
-}
-
-typedef int (*closure_loc_test_type0)(unsigned long long, int, unsigned long long,
- int, signed short, unsigned long long, int,
- int, double, int, int, float, int, int,
- int, int);
-
-int main (void)
-{
- ffi_cif cif;
- ffi_closure *pcl;
- ffi_type * cl_arg_types[17];
- int res;
- void *codeloc;
-
- cl_arg_types[0] = &ffi_type_uint64;
- cl_arg_types[1] = &ffi_type_sint;
- cl_arg_types[2] = &ffi_type_uint64;
- cl_arg_types[3] = &ffi_type_sint;
- cl_arg_types[4] = &ffi_type_sshort;
- cl_arg_types[5] = &ffi_type_uint64;
- cl_arg_types[6] = &ffi_type_sint;
- cl_arg_types[7] = &ffi_type_sint;
- cl_arg_types[8] = &ffi_type_double;
- cl_arg_types[9] = &ffi_type_sint;
- cl_arg_types[10] = &ffi_type_sint;
- cl_arg_types[11] = &ffi_type_float;
- cl_arg_types[12] = &ffi_type_sint;
- cl_arg_types[13] = &ffi_type_sint;
- cl_arg_types[14] = &ffi_type_sint;
- cl_arg_types[15] = &ffi_type_sint;
- cl_arg_types[16] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- pcl = ffi_closure_alloc(sizeof(ffi_closure), &codeloc);
- CHECK(pcl != NULL);
- CHECK(codeloc != NULL);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_loc_test_fn0,
- (void *) 3 /* userdata */, codeloc) == FFI_OK);
-
-#if !defined(FFI_EXEC_STATIC_TRAMP) && !defined(__EMSCRIPTEN__) \
- && !(defined(FFI_EXEC_TRAMPOLINE_TABLE) && FFI_EXEC_TRAMPOLINE_TABLE)
- /* With static trampolines or a trampoline table (Apple aarch64), the
- codeloc does not point to the closure */
- CHECK(memcmp(pcl, FFI_CL(codeloc), sizeof(*pcl)) == 0);
-#endif
-
- res = (*((closure_loc_test_type0)codeloc))
- (1LL, 2, 3LL, 4, 127, 429LL, 7, 8, 9.5, 10, 11, 12, 13,
- 19, 21, 1);
- /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 680" } */
- CHECK(res == 680);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/closure_mmap_failure.c b/deps/libffi/testsuite/libffi.closures/closure_mmap_failure.c
deleted file mode 100644
index 14317470860..00000000000
--- a/deps/libffi/testsuite/libffi.closures/closure_mmap_failure.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Area: closures */
-/* { dg-do run { target x86_64-*-linux-gnu* } } */
-/* { dg-options "-Wl,--export-dynamic" { target x86_64-*-linux-gnu* } } */
-
-#define _GNU_SOURCE 1
-#include "ffitest.h"
-
-/* The Emscripten browser harness compiles every testcase and ignores the
- dg-do target above. This test interposes mmap through RTLD_NEXT and needs
- dlsym on a glibc/ELF system; on wasm, dlsym from an unopened handle aborts.
- Guard the body so it is a harmless no-op anywhere it cannot run. */
-#if defined(__GLIBC__)
-
-#include <dlfcn.h>
-#include <errno.h>
-#include <sys/mman.h>
-#include <unistd.h>
-
-typedef void *(*mmap_fn) (void *, size_t, int, int, int, off_t);
-
-static mmap_fn real_mmap;
-static int reject_exec_mappings;
-
-/* Model a hardened runtime that rejects every executable mapping. */
-void *
-mmap (void *addr, size_t length, int prot, int flags, int fd, off_t offset)
-{
- if (reject_exec_mappings && (prot & PROT_EXEC))
- {
- errno = EPERM;
- return MAP_FAILED;
- }
-
- return real_mmap (addr, length, prot, flags, fd, offset);
-}
-
-int
-main (void)
-{
- ffi_closure *closure;
- void *code = NULL;
-
- real_mmap = (mmap_fn) dlsym (RTLD_NEXT, "mmap");
- CHECK (real_mmap != NULL);
-
- reject_exec_mappings = 1;
-
- /* The failure path must terminate instead of cycling through temporary
- backing files forever. */
- alarm (5);
- closure = ffi_closure_alloc (sizeof (ffi_closure), &code);
- alarm (0);
-
- CHECK (closure == NULL);
- CHECK (code == NULL);
-
- exit (0);
-}
-
-#else
-int main (void) { return 0; }
-#endif
diff --git a/deps/libffi/testsuite/libffi.closures/closure_simple.c b/deps/libffi/testsuite/libffi.closures/closure_simple.c
deleted file mode 100644
index a18b4a4ff83..00000000000
--- a/deps/libffi/testsuite/libffi.closures/closure_simple.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Area: closure_call
- Purpose: Check simple closure handling with all ABIs
- Limitations: none.
- PR: none.
- Originator: <twalljava@dev.java.net> */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void
-closure_test(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata)
-{
- *(ffi_arg*)resp =
- (int)*(int *)args[0] + (int)(*(int *)args[1])
- + (int)(*(int *)args[2]) + (int)(*(int *)args[3])
- + (int)(intptr_t)userdata;
-
- printf("%d %d %d %d: %d\n",
- (int)*(int *)args[0], (int)(*(int *)args[1]),
- (int)(*(int *)args[2]), (int)(*(int *)args[3]),
- (int)*(ffi_arg *)resp);
-
- CHECK((int)*(int *)args[0] == 0);
- CHECK((int)*(int *)args[1] == 1);
- CHECK((int)*(int *)args[2] == 2);
- CHECK((int)*(int *)args[3] == 3);
- CHECK((int)*(ffi_arg *)resp == 9);
-}
-
-typedef int (ABI_ATTR *closure_test_type0)(int, int, int, int);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[17];
- int res;
-
- cl_arg_types[0] = &ffi_type_uint;
- cl_arg_types[1] = &ffi_type_uint;
- cl_arg_types[2] = &ffi_type_uint;
- cl_arg_types[3] = &ffi_type_uint;
- cl_arg_types[4] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 4,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test,
- (void *) 3 /* userdata */, code) == FFI_OK);
-
- res = (*(closure_test_type0)code)(0, 1, 2, 3);
- /* { dg-output "0 1 2 3: 9" } */
-
- printf("res: %d\n",res);
- /* { dg-output "\nres: 9" } */
- CHECK(res == 9);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/closure_trampoline_table.c b/deps/libffi/testsuite/libffi.closures/closure_trampoline_table.c
deleted file mode 100644
index c293ba78ba7..00000000000
--- a/deps/libffi/testsuite/libffi.closures/closure_trampoline_table.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Area: ffi_closure_alloc, ffi_closure_free
- Purpose: Churn the closure allocator across many live closures.
- On targets that use the Darwin trampoline-table allocator
- this spans several trampoline tables and exercises the
- allocator's internal table list. Freeing a partially used
- non-head table moved it to the head of the list without
- unlinking it first, corrupting the doubly-linked list; a
- later free then wrote through the stale links into freed
- table memory, a heap use-after-free (GHSA-23hx-9rxv-9qfp).
- The sequence is harmless on every other allocator.
- Limitations: Only the Darwin trampoline-table allocator keeps such a
- list, so elsewhere this is just an allocator stress test.
- PR: GHSA-23hx-9rxv-9qfp */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-/* Enough closures to span several trampoline tables on the Darwin
- allocator (at most 1024 entries per table), so that the interleaved
- free order below forces non-head tables to be bumped to the front of
- the list and later emptied and freed. */
-#define N 4096
-
-int
-main (void)
-{
- ffi_closure **closures;
- void *code;
- int round, i;
-
- closures = malloc (N * sizeof (*closures));
- CHECK (closures != NULL);
-
- for (round = 0; round < 3; round++)
- {
- for (i = 0; i < N; i++)
- {
- code = NULL;
- closures[i] = ffi_closure_alloc (sizeof (ffi_closure), &code);
- CHECK (closures[i] != NULL);
- CHECK (code != NULL);
- }
-
- /* Interleave the frees: the first pass returns one entry from
- many different tables, bumping partially used non-head tables
- to the head of the list; the second pass then empties and frees
- tables while the list is in that state. Before the fix this
- walked stale prev/next links and wrote into freed memory. */
- for (i = 0; i < N; i += 2)
- ffi_closure_free (closures[i]);
- for (i = 1; i < N; i += 2)
- ffi_closure_free (closures[i]);
- }
-
- free (closures);
-
- printf ("closure trampoline table ok\n");
- exit (0);
-}
-
-/* { dg-output "closure trampoline table ok" } */
diff --git a/deps/libffi/testsuite/libffi.closures/cls_12byte.c b/deps/libffi/testsuite/libffi.closures/cls_12byte.c
deleted file mode 100644
index a1fdcd76f43..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_12byte.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_12byte {
- int a;
- int b;
- int c;
-} cls_struct_12byte;
-
-cls_struct_12byte cls_struct_12byte_fn(struct cls_struct_12byte b1,
- struct cls_struct_12byte b2)
-{
- struct cls_struct_12byte result;
-
- result.a = b1.a + b2.a;
- result.b = b1.b + b2.b;
- result.c = b1.c + b2.c;
-
- printf("%d %d %d %d %d %d: %d %d %d\n", b1.a, b1.b, b1.c, b2.a, b2.b, b2.c,
- result.a, result.b, result.c);
-
- CHECK(b1.a == 7);
- CHECK(b1.b == 4);
- CHECK(b1.c == 9);
-
- CHECK(b2.a == 1);
- CHECK(b2.b == 5);
- CHECK(b2.c == 3);
-
- CHECK(result.a == 8);
- CHECK(result.b == 9);
- CHECK(result.c == 12);
- return result;
-}
-
-static void cls_struct_12byte_gn(ffi_cif* cif __UNUSED__, void* resp,
- void** args , void* userdata __UNUSED__)
-{
- struct cls_struct_12byte b1, b2;
-
- b1 = *(struct cls_struct_12byte*)(args[0]);
- b2 = *(struct cls_struct_12byte*)(args[1]);
-
- *(cls_struct_12byte*)resp = cls_struct_12byte_fn(b1, b2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_12byte h_dbl = { 7, 4, 9 };
- struct cls_struct_12byte j_dbl = { 1, 5, 3 };
- struct cls_struct_12byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_sint;
- cls_struct_fields[1] = &ffi_type_sint;
- cls_struct_fields[2] = &ffi_type_sint;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &h_dbl;
- args_dbl[1] = &j_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_12byte_fn), &res_dbl, args_dbl);
- /* { dg-output "7 4 9 1 5 3: 8 9 12" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 8 9 12" } */
- CHECK(res_dbl.a == 8);
- CHECK(res_dbl.b == 9);
- CHECK(res_dbl.c == 12);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_12byte_gn, NULL, code) == FFI_OK);
-
- res_dbl.a = 0;
- res_dbl.b = 0;
- res_dbl.c = 0;
-
- res_dbl = ((cls_struct_12byte(*)(cls_struct_12byte, cls_struct_12byte))(code))(h_dbl, j_dbl);
- /* { dg-output "\n7 4 9 1 5 3: 8 9 12" } */
-
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 8 9 12" } */
- CHECK(res_dbl.a == 8);
- CHECK(res_dbl.b == 9);
- CHECK(res_dbl.c == 12);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_16byte.c b/deps/libffi/testsuite/libffi.closures/cls_16byte.c
deleted file mode 100644
index 57fe8737b1e..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_16byte.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_16byte {
- int a;
- double b;
- int c;
-} cls_struct_16byte;
-
-cls_struct_16byte cls_struct_16byte_fn(struct cls_struct_16byte b1,
- struct cls_struct_16byte b2)
-{
- struct cls_struct_16byte result;
-
- result.a = b1.a + b2.a;
- result.b = b1.b + b2.b;
- result.c = b1.c + b2.c;
-
- printf("%d %g %d %d %g %d: %d %g %d\n", b1.a, b1.b, b1.c, b2.a, b2.b, b2.c,
- result.a, result.b, result.c);
-
- CHECK(b1.a == 7);
- CHECK(b1.b == 8);
- CHECK(b1.c == 9);
-
- CHECK(b2.a == 1);
- CHECK(b2.b == 9);
- CHECK(b2.c == 3);
-
- CHECK(result.a == 8);
- CHECK(result.b == 17);
- CHECK(result.c == 12);
-
-
- return result;
-}
-
-static void cls_struct_16byte_gn(ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
-{
- struct cls_struct_16byte b1, b2;
-
- b1 = *(struct cls_struct_16byte*)(args[0]);
- b2 = *(struct cls_struct_16byte*)(args[1]);
-
- *(cls_struct_16byte*)resp = cls_struct_16byte_fn(b1, b2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_16byte h_dbl = { 7, 8.0, 9 };
- struct cls_struct_16byte j_dbl = { 1, 9.0, 3 };
- struct cls_struct_16byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_sint;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_sint;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &h_dbl;
- args_dbl[1] = &j_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_16byte_fn), &res_dbl, args_dbl);
- /* { dg-output "7 8 9 1 9 3: 8 17 12" } */
- printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 8 17 12" } */
-
- CHECK(res_dbl.a == 8);
- CHECK(res_dbl.b == 17);
- CHECK(res_dbl.c == 12);
-
- res_dbl.a = 0;
- res_dbl.b = 0.0;
- res_dbl.c = 0;
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_16byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_16byte(*)(cls_struct_16byte, cls_struct_16byte))(code))(h_dbl, j_dbl);
- /* { dg-output "\n7 8 9 1 9 3: 8 17 12" } */
- printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 8 17 12" } */
-
- CHECK(res_dbl.a == 8);
- CHECK(res_dbl.b == 17);
- CHECK(res_dbl.c == 12);
-
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_18byte.c b/deps/libffi/testsuite/libffi.closures/cls_18byte.c
deleted file mode 100644
index 3783121b9fe..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_18byte.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Double alignment check on darwin.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030915 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_18byte {
- double a;
- unsigned char b;
- unsigned char c;
- double d;
-} cls_struct_18byte;
-
-cls_struct_18byte cls_struct_18byte_fn(struct cls_struct_18byte a1,
- struct cls_struct_18byte a2)
-{
- struct cls_struct_18byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
- result.d = a1.d + a2.d;
-
-
- printf("%g %d %d %g %g %d %d %g: %g %d %d %g\n", a1.a, a1.b, a1.c, a1.d,
- a2.a, a2.b, a2.c, a2.d,
- result.a, result.b, result.c, result.d);
-
- CHECK(a1.a == 1);
- CHECK(a1.b == 127);
- CHECK(a1.c == 126);
- CHECK(a1.d == 3);
-
- CHECK(a2.a == 4);
- CHECK(a2.b == 125);
- CHECK(a2.c == 124);
- CHECK(a2.d == 5);
-
- CHECK(result.a == 5);
- CHECK(result.b == 252);
- CHECK(result.c == 250);
- CHECK(result.d == 8);
-
- return result;
-}
-
-static void
-cls_struct_18byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct cls_struct_18byte a1, a2;
-
- a1 = *(struct cls_struct_18byte*)(args[0]);
- a2 = *(struct cls_struct_18byte*)(args[1]);
-
- *(cls_struct_18byte*)resp = cls_struct_18byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[5];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[3];
-
- struct cls_struct_18byte g_dbl = { 1.0, 127, 126, 3.0 };
- struct cls_struct_18byte f_dbl = { 4.0, 125, 124, 5.0 };
- struct cls_struct_18byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = &ffi_type_double;
- cls_struct_fields[4] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_18byte_fn), &res_dbl, args_dbl);
- /* { dg-output "1 127 126 3 4 125 124 5: 5 252 250 8" } */
- printf("res: %g %d %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
- /* { dg-output "\nres: 5 252 250 8" } */
- CHECK(res_dbl.a == 5);
- CHECK(res_dbl.b == 252);
- CHECK(res_dbl.c == 250);
- CHECK(res_dbl.d == 8);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_18byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_18byte(*)(cls_struct_18byte, cls_struct_18byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n1 127 126 3 4 125 124 5: 5 252 250 8" } */
- printf("res: %g %d %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
- /* { dg-output "\nres: 5 252 250 8" } */
- CHECK(res_dbl.a == 5);
- CHECK(res_dbl.b == 252);
- CHECK(res_dbl.c == 250);
- CHECK(res_dbl.d == 8);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_19byte.c b/deps/libffi/testsuite/libffi.closures/cls_19byte.c
deleted file mode 100644
index 98ce65a48a2..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_19byte.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Double alignment check on darwin.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030915 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_19byte {
- double a;
- unsigned char b;
- unsigned char c;
- double d;
- unsigned char e;
-} cls_struct_19byte;
-
-cls_struct_19byte cls_struct_19byte_fn(struct cls_struct_19byte a1,
- struct cls_struct_19byte a2)
-{
- struct cls_struct_19byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
- result.d = a1.d + a2.d;
- result.e = a1.e + a2.e;
-
-
- printf("%g %d %d %g %d %g %d %d %g %d: %g %d %d %g %d\n",
- a1.a, a1.b, a1.c, a1.d, a1.e,
- a2.a, a2.b, a2.c, a2.d, a2.e,
- result.a, result.b, result.c, result.d, result.e);
-
- CHECK(a1.a == 1);
- CHECK(a1.b == 127);
- CHECK(a1.c == 126);
- CHECK(a1.d == 3);
- CHECK(a1.e == 120);
-
- CHECK(a2.a == 4);
- CHECK(a2.b == 125);
- CHECK(a2.c == 124);
- CHECK(a2.d == 5);
- CHECK(a2.e == 119);
-
- CHECK(result.a == 5);
- CHECK(result.b == 252);
- CHECK(result.c == 250);
- CHECK(result.d == 8);
- CHECK(result.e == 239);
-
- return result;
-}
-
-static void
-cls_struct_19byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct cls_struct_19byte a1, a2;
-
- a1 = *(struct cls_struct_19byte*)(args[0]);
- a2 = *(struct cls_struct_19byte*)(args[1]);
-
- *(cls_struct_19byte*)resp = cls_struct_19byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[6];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[3];
-
- struct cls_struct_19byte g_dbl = { 1.0, 127, 126, 3.0, 120 };
- struct cls_struct_19byte f_dbl = { 4.0, 125, 124, 5.0, 119 };
- struct cls_struct_19byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = &ffi_type_double;
- cls_struct_fields[4] = &ffi_type_uchar;
- cls_struct_fields[5] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_19byte_fn), &res_dbl, args_dbl);
- /* { dg-output "1 127 126 3 120 4 125 124 5 119: 5 252 250 8 239" } */
- printf("res: %g %d %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e);
- /* { dg-output "\nres: 5 252 250 8 239" } */
- CHECK(res_dbl.a == 5);
- CHECK(res_dbl.b == 252);
- CHECK(res_dbl.c == 250);
- CHECK(res_dbl.d == 8);
- CHECK(res_dbl.e == 239);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_19byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_19byte(*)(cls_struct_19byte, cls_struct_19byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n1 127 126 3 120 4 125 124 5 119: 5 252 250 8 239" } */
- printf("res: %g %d %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e);
- /* { dg-output "\nres: 5 252 250 8 239" } */
- CHECK(res_dbl.a == 5);
- CHECK(res_dbl.b == 252);
- CHECK(res_dbl.c == 250);
- CHECK(res_dbl.d == 8);
- CHECK(res_dbl.e == 239);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_1_1byte.c b/deps/libffi/testsuite/libffi.closures/cls_1_1byte.c
deleted file mode 100644
index 49e33b9bac9..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_1_1byte.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Especially with small structures which may fit in one
- register. Depending on the ABI.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030902 */
-
-
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_1_1byte {
- unsigned char a;
-} cls_struct_1_1byte;
-
-cls_struct_1_1byte cls_struct_1_1byte_fn(struct cls_struct_1_1byte a1,
- struct cls_struct_1_1byte a2)
-{
- struct cls_struct_1_1byte result;
-
- result.a = a1.a + a2.a;
-
- printf("%d %d: %d\n", a1.a, a2.a, result.a);
- CHECK(a1.a == 12);
- CHECK(a2.a == 178);
- CHECK(result.a == 190);
-
- return result;
-}
-
-static void
-cls_struct_1_1byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_1_1byte a1, a2;
-
- a1 = *(struct cls_struct_1_1byte*)(args[0]);
- a2 = *(struct cls_struct_1_1byte*)(args[1]);
-
- *(cls_struct_1_1byte*)resp = cls_struct_1_1byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[2];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_1_1byte g_dbl = { 12 };
- struct cls_struct_1_1byte f_dbl = { 178 };
- struct cls_struct_1_1byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_1_1byte_fn), &res_dbl, args_dbl);
- /* { dg-output "12 178: 190" } */
- printf("res: %d\n", res_dbl.a);
- /* { dg-output "\nres: 190" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_1_1byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_1_1byte(*)(cls_struct_1_1byte, cls_struct_1_1byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 178: 190" } */
- printf("res: %d\n", res_dbl.a);
- /* { dg-output "\nres: 190" } */
- CHECK(res_dbl.a == 190);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_20byte.c b/deps/libffi/testsuite/libffi.closures/cls_20byte.c
deleted file mode 100644
index fdae6f7236a..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_20byte.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_20byte {
- double a;
- double b;
- int c;
-} cls_struct_20byte;
-
-static cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
- struct cls_struct_20byte a2)
-{
- struct cls_struct_20byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%g %g %d %g %g %d: %g %g %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c,
- result.a, result.b, result.c);
-
- CHECK(a1.a == 1);
- CHECK(a1.b == 2);
- CHECK(a1.c == 3);
-
- CHECK(a2.a == 4);
- CHECK(a2.b == 5);
- CHECK(a2.c == 7);
-
- CHECK(result.a == 5);
- CHECK(result.b == 7);
- CHECK(result.c == 10);
- return result;
-}
-
-static void
-cls_struct_20byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct cls_struct_20byte a1, a2;
-
- a1 = *(struct cls_struct_20byte*)(args[0]);
- a2 = *(struct cls_struct_20byte*)(args[1]);
-
- *(cls_struct_20byte*)resp = cls_struct_20byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_20byte g_dbl = { 1.0, 2.0, 3 };
- struct cls_struct_20byte f_dbl = { 4.0, 5.0, 7 };
- struct cls_struct_20byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_sint;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_20byte_fn), &res_dbl, args_dbl);
- /* { dg-output "1 2 3 4 5 7: 5 7 10" } */
- printf("res: %g %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 5 7 10" } */
- CHECK(res_dbl.a == 5);
- CHECK(res_dbl.b == 7);
- CHECK(res_dbl.c == 10);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_20byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_20byte(*)(cls_struct_20byte, cls_struct_20byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n1 2 3 4 5 7: 5 7 10" } */
- printf("res: %g %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 5 7 10" } */
- CHECK(res_dbl.a == 5);
- CHECK(res_dbl.b == 7);
- CHECK(res_dbl.c == 10);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_20byte1.c b/deps/libffi/testsuite/libffi.closures/cls_20byte1.c
deleted file mode 100644
index e6979b5620a..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_20byte1.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_20byte {
- int a;
- double b;
- double c;
-} cls_struct_20byte;
-
-static cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
- struct cls_struct_20byte a2)
-{
- struct cls_struct_20byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %g %g %d %g %g: %d %g %g\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c,
- result.a, result.b, result.c);
-
- CHECK(a1.a == 1);
- CHECK(a1.b == 2);
- CHECK(a1.c == 3);
-
- CHECK(a2.a == 4);
- CHECK(a2.b == 5);
- CHECK(a2.c == 7);
-
- CHECK(result.a == 5);
- CHECK(result.b == 7);
- CHECK(result.c == 10);
-
- return result;
-}
-
-static void
-cls_struct_20byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct cls_struct_20byte a1, a2;
-
- a1 = *(struct cls_struct_20byte*)(args[0]);
- a2 = *(struct cls_struct_20byte*)(args[1]);
-
- *(cls_struct_20byte*)resp = cls_struct_20byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[3];
-
- struct cls_struct_20byte g_dbl = { 1, 2.0, 3.0 };
- struct cls_struct_20byte f_dbl = { 4, 5.0, 7.0 };
- struct cls_struct_20byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_sint;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_double;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_20byte_fn), &res_dbl, args_dbl);
- /* { dg-output "1 2 3 4 5 7: 5 7 10" } */
- printf("res: %d %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 5 7 10" } */
- CHECK(res_dbl.a == 5);
- CHECK(res_dbl.b == 7);
- CHECK(res_dbl.c == 10);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_20byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_20byte(*)(cls_struct_20byte, cls_struct_20byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n1 2 3 4 5 7: 5 7 10" } */
- printf("res: %d %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 5 7 10" } */
-
- CHECK(res_dbl.a == 5);
- CHECK(res_dbl.b == 7);
- CHECK(res_dbl.c == 10);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_24byte.c b/deps/libffi/testsuite/libffi.closures/cls_24byte.c
deleted file mode 100644
index b204966e7ed..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_24byte.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_24byte {
- double a;
- double b;
- int c;
- float d;
-} cls_struct_24byte;
-
-cls_struct_24byte cls_struct_24byte_fn(struct cls_struct_24byte b0,
- struct cls_struct_24byte b1,
- struct cls_struct_24byte b2,
- struct cls_struct_24byte b3)
-{
- struct cls_struct_24byte result;
-
- result.a = b0.a + b1.a + b2.a + b3.a;
- result.b = b0.b + b1.b + b2.b + b3.b;
- result.c = b0.c + b1.c + b2.c + b3.c;
- result.d = b0.d + b1.d + b2.d + b3.d;
-
- printf("%g %g %d %g %g %g %d %g %g %g %d %g %g %g %d %g: %g %g %d %g\n",
- b0.a, b0.b, b0.c, b0.d,
- b1.a, b1.b, b1.c, b1.d,
- b2.a, b2.b, b2.c, b2.d,
- b3.a, b3.b, b3.c, b3.d,
- result.a, result.b, result.c, result.d);
- CHECK_DOUBLE_EQ(b0.a, 9);
- CHECK_DOUBLE_EQ(b0.b, 2);
- CHECK(b0.c == 6);
- CHECK_FLOAT_EQ(b0.d, 5);
-
- CHECK_DOUBLE_EQ(b1.a, 1);
- CHECK_DOUBLE_EQ(b1.b, 2);
- CHECK(b1.c == 3);
- CHECK_FLOAT_EQ(b1.d, 7);
-
- CHECK_DOUBLE_EQ(b2.a, 4);
- CHECK_DOUBLE_EQ(b2.b, 5);
- CHECK(b2.c == 7);
- CHECK_FLOAT_EQ(b2.d, 9);
-
- CHECK_DOUBLE_EQ(b3.a, 8);
- CHECK_DOUBLE_EQ(b3.b, 6);
- CHECK(b3.c == 1);
- CHECK_FLOAT_EQ(b3.d, 4);
-
- CHECK_DOUBLE_EQ(result.a, 22);
- CHECK_DOUBLE_EQ(result.b, 15);
- CHECK(result.c == 17);
- CHECK_FLOAT_EQ(result.d, 25);
-
- return result;
-}
-
-static void
-cls_struct_24byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct cls_struct_24byte b0, b1, b2, b3;
-
- b0 = *(struct cls_struct_24byte*)(args[0]);
- b1 = *(struct cls_struct_24byte*)(args[1]);
- b2 = *(struct cls_struct_24byte*)(args[2]);
- b3 = *(struct cls_struct_24byte*)(args[3]);
-
- *(cls_struct_24byte*)resp = cls_struct_24byte_fn(b0, b1, b2, b3);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[5];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_24byte e_dbl = { 9.0, 2.0, 6, 5.0 };
- struct cls_struct_24byte f_dbl = { 1.0, 2.0, 3, 7.0 };
- struct cls_struct_24byte g_dbl = { 4.0, 5.0, 7, 9.0 };
- struct cls_struct_24byte h_dbl = { 8.0, 6.0, 1, 4.0 };
- struct cls_struct_24byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_sint;
- cls_struct_fields[3] = &ffi_type_float;
- cls_struct_fields[4] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = &cls_struct_type;
- dbl_arg_types[3] = &cls_struct_type;
- dbl_arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = &h_dbl;
- args_dbl[4] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_24byte_fn), &res_dbl, args_dbl);
- /* { dg-output "9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 4: 22 15 17 25" } */
- printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
- /* { dg-output "\nres: 22 15 17 25" } */
- CHECK_DOUBLE_EQ(res_dbl.a, 22);
- CHECK_DOUBLE_EQ(res_dbl.b, 15);
- CHECK(res_dbl.c == 17);
- CHECK_FLOAT_EQ(res_dbl.d, 25);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_24byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_24byte(*)(cls_struct_24byte,
- cls_struct_24byte,
- cls_struct_24byte,
- cls_struct_24byte))
- (code))(e_dbl, f_dbl, g_dbl, h_dbl);
- /* { dg-output "\n9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 4: 22 15 17 25" } */
- printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
- /* { dg-output "\nres: 22 15 17 25" } */
- CHECK_DOUBLE_EQ(res_dbl.a, 22);
- CHECK_DOUBLE_EQ(res_dbl.b, 15);
- CHECK(res_dbl.c == 17);
- CHECK_FLOAT_EQ(res_dbl.d, 25);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_2byte.c b/deps/libffi/testsuite/libffi.closures/cls_2byte.c
deleted file mode 100644
index c5209b78341..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_2byte.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Especially with small structures which may fit in one
- register. Depending on the ABI.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_2byte {
- unsigned char a;
- unsigned char b;
-} cls_struct_2byte;
-
-cls_struct_2byte cls_struct_2byte_fn(struct cls_struct_2byte a1,
- struct cls_struct_2byte a2)
-{
- struct cls_struct_2byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
-
- printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
-
- CHECK(a1.a == 12);
- CHECK(a1.b == 127);
-
- CHECK(a2.a == 1);
- CHECK(a2.b == 13);
-
- CHECK(result.a == 13);
- CHECK(result.b == 140);
-
- return result;
-}
-
-static void
-cls_struct_2byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_2byte a1, a2;
-
- a1 = *(struct cls_struct_2byte*)(args[0]);
- a2 = *(struct cls_struct_2byte*)(args[1]);
-
- *(cls_struct_2byte*)resp = cls_struct_2byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_2byte g_dbl = { 12, 127 };
- struct cls_struct_2byte f_dbl = { 1, 13 };
- struct cls_struct_2byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_2byte_fn), &res_dbl, args_dbl);
- /* { dg-output "12 127 1 13: 13 140" } */
- printf("res: %d %d\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 13 140" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == 140);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_2byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_2byte(*)(cls_struct_2byte, cls_struct_2byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 127 1 13: 13 140" } */
- printf("res: %d %d\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 13 140" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == 140);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_3_1byte.c b/deps/libffi/testsuite/libffi.closures/cls_3_1byte.c
deleted file mode 100644
index aaa7ccc5c16..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_3_1byte.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Especially with small structures which may fit in one
- register. Depending on the ABI.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030902 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_3_1byte {
- unsigned char a;
- unsigned char b;
- unsigned char c;
-} cls_struct_3_1byte;
-
-cls_struct_3_1byte cls_struct_3_1byte_fn(struct cls_struct_3_1byte a1,
- struct cls_struct_3_1byte a2)
-{
- struct cls_struct_3_1byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c,
- a2.a, a2.b, a2.c,
- result.a, result.b, result.c);
-
- CHECK(a1.a == 12);
- CHECK(a1.b == 13);
- CHECK(a1.c == 14);
-
- CHECK(a2.a == 178);
- CHECK(a2.b == 179);
- CHECK(a2.c == 180);
-
- CHECK(result.a == 190);
- CHECK(result.b == 192);
- CHECK(result.c == 194);
-
- return result;
-}
-
-static void
-cls_struct_3_1byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_3_1byte a1, a2;
-
- a1 = *(struct cls_struct_3_1byte*)(args[0]);
- a2 = *(struct cls_struct_3_1byte*)(args[1]);
-
- *(cls_struct_3_1byte*)resp = cls_struct_3_1byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_3_1byte g_dbl = { 12, 13, 14 };
- struct cls_struct_3_1byte f_dbl = { 178, 179, 180 };
- struct cls_struct_3_1byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_3_1byte_fn), &res_dbl, args_dbl);
- /* { dg-output "12 13 14 178 179 180: 190 192 194" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 190 192 194" } */
- CHECK(res_dbl.a == 190);
- CHECK(res_dbl.b == 192);
- CHECK(res_dbl.c == 194);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3_1byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_3_1byte(*)(cls_struct_3_1byte, cls_struct_3_1byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 13 14 178 179 180: 190 192 194" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 190 192 194" } */
-
- CHECK(res_dbl.a == 190);
- CHECK(res_dbl.b == 192);
- CHECK(res_dbl.c == 194);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_3byte1.c b/deps/libffi/testsuite/libffi.closures/cls_3byte1.c
deleted file mode 100644
index b4249175443..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_3byte1.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Especially with small structures which may fit in one
- register. Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_3byte {
- unsigned short a;
- unsigned char b;
-} cls_struct_3byte;
-
-cls_struct_3byte cls_struct_3byte_fn(struct cls_struct_3byte a1,
- struct cls_struct_3byte a2)
-{
- struct cls_struct_3byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
-
- printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
-
- CHECK(a1.a == 12);
- CHECK(a1.b == 119);
-
- CHECK(a2.a == 1);
- CHECK(a2.b == 15);
-
- CHECK(result.a == 13);
- CHECK(result.b == 134);
-
- return result;
-}
-
-static void
-cls_struct_3byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_3byte a1, a2;
-
- a1 = *(struct cls_struct_3byte*)(args[0]);
- a2 = *(struct cls_struct_3byte*)(args[1]);
-
- *(cls_struct_3byte*)resp = cls_struct_3byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_3byte g_dbl = { 12, 119 };
- struct cls_struct_3byte f_dbl = { 1, 15 };
- struct cls_struct_3byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_ushort;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_3byte_fn), &res_dbl, args_dbl);
- /* { dg-output "12 119 1 15: 13 134" } */
- printf("res: %d %d\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 13 134" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == 134);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_3byte(*)(cls_struct_3byte, cls_struct_3byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 119 1 15: 13 134" } */
- printf("res: %d %d\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 13 134" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == 134);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_3byte2.c b/deps/libffi/testsuite/libffi.closures/cls_3byte2.c
deleted file mode 100644
index f13590e4b5b..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_3byte2.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Especially with small structures which may fit in one
- register. Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_3byte_1 {
- unsigned char a;
- unsigned short b;
-} cls_struct_3byte_1;
-
-cls_struct_3byte_1 cls_struct_3byte_fn1(struct cls_struct_3byte_1 a1,
- struct cls_struct_3byte_1 a2)
-{
- struct cls_struct_3byte_1 result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
-
- printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
-
- CHECK(a1.a == 15);
- CHECK(a1.b == 125);
-
- CHECK(a2.a == 9);
- CHECK(a2.b == 19);
-
- CHECK(result.a == 24);
- CHECK(result.b == 144);
-
- return result;
-}
-
-static void
-cls_struct_3byte_gn1(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_3byte_1 a1, a2;
-
- a1 = *(struct cls_struct_3byte_1*)(args[0]);
- a2 = *(struct cls_struct_3byte_1*)(args[1]);
-
- *(cls_struct_3byte_1*)resp = cls_struct_3byte_fn1(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_3byte_1 g_dbl = { 15, 125 };
- struct cls_struct_3byte_1 f_dbl = { 9, 19 };
- struct cls_struct_3byte_1 res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_ushort;
- cls_struct_fields[2] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_3byte_fn1), &res_dbl, args_dbl);
- /* { dg-output "15 125 9 19: 24 144" } */
- printf("res: %d %d\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 24 144" } */
- CHECK(res_dbl.a == 24);
- CHECK(res_dbl.b == 144);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3byte_gn1, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_3byte_1(*)(cls_struct_3byte_1, cls_struct_3byte_1))(code))(g_dbl, f_dbl);
- /* { dg-output "\n15 125 9 19: 24 144" } */
- printf("res: %d %d\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 24 144" } */
- CHECK(res_dbl.a == 24);
- CHECK(res_dbl.b == 144);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_3float.c b/deps/libffi/testsuite/libffi.closures/cls_3float.c
deleted file mode 100644
index 63171bc7fd8..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_3float.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations:>none.
- PR: none.
- Originator: <compnerd@compnerd.org> 20171026 */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-typedef struct cls_struct_3float {
- float f;
- float g;
- float h;
-} cls_struct_3float;
-
-cls_struct_3float cls_struct_3float_fn(struct cls_struct_3float a1,
- struct cls_struct_3float a2)
-{
- struct cls_struct_3float result;
-
- result.f = a1.f + a2.f;
- result.g = a1.g + a2.g;
- result.h = a1.h + a2.h;
-
- printf("%g %g %g %g %g %g: %g %g %g\n", a1.f, a1.g, a1.h,
- a2.f, a2.g, a2.h, result.f, result.g, result.h);
-
- CHECK_FLOAT_EQ(a1.f, 1);
- CHECK_FLOAT_EQ(a1.g, 2);
- CHECK_FLOAT_EQ(a1.h, 3);
-
- CHECK_FLOAT_EQ(a2.f, 1);
- CHECK_FLOAT_EQ(a2.g, 2);
- CHECK_FLOAT_EQ(a2.h, 3);
-
- CHECK_FLOAT_EQ(result.f, 2);
- CHECK_FLOAT_EQ(result.g, 4);
- CHECK_FLOAT_EQ(result.h, 6);
-
- return result;
-}
-
-static void
-cls_struct_3float_gn(ffi_cif *cif __UNUSED__, void* resp, void **args,
- void* userdata __UNUSED__)
-{
- struct cls_struct_3float a1, a2;
-
- a1 = *(struct cls_struct_3float*)(args[0]);
- a2 = *(struct cls_struct_3float*)(args[1]);
-
- *(cls_struct_3float*)resp = cls_struct_3float_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void *args_dbl[3];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[3];
-
- struct cls_struct_3float g_dbl = { 1.0f, 2.0f, 3.0f };
- struct cls_struct_3float f_dbl = { 1.0f, 2.0f, 3.0f };
- struct cls_struct_3float res_dbl;
-
- cls_struct_fields[0] = &ffi_type_float;
- cls_struct_fields[1] = &ffi_type_float;
- cls_struct_fields[2] = &ffi_type_float;
- cls_struct_fields[3] = NULL;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_3float_fn), &res_dbl, args_dbl);
- /* { dg-output "1 2 3 1 2 3: 2 4 6" } */
- printf("res: %g %g %g\n", res_dbl.f, res_dbl.g, res_dbl.h);
- /* { dg-output "\nres: 2 4 6" } */
- CHECK_FLOAT_EQ(res_dbl.f, 2);
- CHECK_FLOAT_EQ(res_dbl.g, 4);
- CHECK_FLOAT_EQ(res_dbl.h, 6);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3float_gn, NULL, code) ==
- FFI_OK);
-
- res_dbl = ((cls_struct_3float(*)(cls_struct_3float,
- cls_struct_3float))(code))(g_dbl, f_dbl);
- /* { dg-output "\n1 2 3 1 2 3: 2 4 6" } */
- printf("res: %g %g %g\n", res_dbl.f, res_dbl.g, res_dbl.h);
- /* { dg-output "\nres: 2 4 6" } */
- CHECK_FLOAT_EQ(res_dbl.f, 2);
- CHECK_FLOAT_EQ(res_dbl.g, 4);
- CHECK_FLOAT_EQ(res_dbl.h, 6);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_4_1byte.c b/deps/libffi/testsuite/libffi.closures/cls_4_1byte.c
deleted file mode 100644
index b5d3f70320a..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_4_1byte.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Especially with small structures which may fit in one
- register. Depending on the ABI.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030902 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_4_1byte {
- unsigned char a;
- unsigned char b;
- unsigned char c;
- unsigned char d;
-} cls_struct_4_1byte;
-
-cls_struct_4_1byte cls_struct_4_1byte_fn(struct cls_struct_4_1byte a1,
- struct cls_struct_4_1byte a2)
-{
- struct cls_struct_4_1byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
- result.d = a1.d + a2.d;
-
- printf("%d %d %d %d %d %d %d %d: %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d,
- a2.a, a2.b, a2.c, a2.d,
- result.a, result.b, result.c, result.d);
-
- CHECK(a1.a == 12);
- CHECK(a1.b == 13);
- CHECK(a1.c == 14);
- CHECK(a1.d == 15);
-
- CHECK(a2.a == 178);
- CHECK(a2.b == 179);
- CHECK(a2.c == 180);
- CHECK(a2.d == 181);
-
- CHECK(result.a == 190);
- CHECK(result.b == 192);
- CHECK(result.c == 194);
- CHECK(result.d == 196);
- return result;
-}
-
-static void
-cls_struct_4_1byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_4_1byte a1, a2;
-
- a1 = *(struct cls_struct_4_1byte*)(args[0]);
- a2 = *(struct cls_struct_4_1byte*)(args[1]);
-
- *(cls_struct_4_1byte*)resp = cls_struct_4_1byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[5];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_4_1byte g_dbl = { 12, 13, 14, 15 };
- struct cls_struct_4_1byte f_dbl = { 178, 179, 180, 181 };
- struct cls_struct_4_1byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = &ffi_type_uchar;
- cls_struct_fields[4] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_4_1byte_fn), &res_dbl, args_dbl);
- /* { dg-output "12 13 14 15 178 179 180 181: 190 192 194 196" } */
- printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
- /* { dg-output "\nres: 190 192 194 196" } */
- CHECK(res_dbl.a == 190);
- CHECK(res_dbl.b == 192);
- CHECK(res_dbl.c == 194);
- CHECK(res_dbl.d == 196);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_4_1byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_4_1byte(*)(cls_struct_4_1byte, cls_struct_4_1byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 13 14 15 178 179 180 181: 190 192 194 196" } */
- printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
- /* { dg-output "\nres: 190 192 194 196" } */
- CHECK(res_dbl.a == 190);
- CHECK(res_dbl.b == 192);
- CHECK(res_dbl.c == 194);
- CHECK(res_dbl.d == 196);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_4byte.c b/deps/libffi/testsuite/libffi.closures/cls_4byte.c
deleted file mode 100644
index 4f8d173bf94..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_4byte.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-typedef struct cls_struct_4byte {
- unsigned short a;
- unsigned short b;
-} cls_struct_4byte;
-
-cls_struct_4byte cls_struct_4byte_fn(struct cls_struct_4byte a1,
- struct cls_struct_4byte a2)
-{
- struct cls_struct_4byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
-
- printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
-
- CHECK(a1.a == 127);
- CHECK(a1.b == 120);
-
- CHECK(a2.a == 12);
- CHECK(a2.b == 128);
-
- CHECK(result.a == 139);
- CHECK(result.b == 248);
-
- return result;
-}
-
-static void
-cls_struct_4byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_4byte a1, a2;
-
- a1 = *(struct cls_struct_4byte*)(args[0]);
- a2 = *(struct cls_struct_4byte*)(args[1]);
-
- *(cls_struct_4byte*)resp = cls_struct_4byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_4byte g_dbl = { 127, 120 };
- struct cls_struct_4byte f_dbl = { 12, 128 };
- struct cls_struct_4byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_ushort;
- cls_struct_fields[1] = &ffi_type_ushort;
- cls_struct_fields[2] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_4byte_fn), &res_dbl, args_dbl);
- /* { dg-output "127 120 12 128: 139 248" } */
- printf("res: %d %d\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 139 248" } */
- CHECK(res_dbl.a == 139);
- CHECK(res_dbl.b == 248);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_4byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_4byte(*)(cls_struct_4byte, cls_struct_4byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n127 120 12 128: 139 248" } */
- printf("res: %d %d\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 139 248" } */
- CHECK(res_dbl.a == 139);
- CHECK(res_dbl.b == 248);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_5_1_byte.c b/deps/libffi/testsuite/libffi.closures/cls_5_1_byte.c
deleted file mode 100644
index 07552cde776..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_5_1_byte.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20050708 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_5byte {
- unsigned char a;
- unsigned char b;
- unsigned char c;
- unsigned char d;
- unsigned char e;
-} cls_struct_5byte;
-
-static cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
- struct cls_struct_5byte a2)
-{
- struct cls_struct_5byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
- result.d = a1.d + a2.d;
- result.e = a1.e + a2.e;
-
- printf("%d %d %d %d %d %d %d %d %d %d: %d %d %d %d %d\n",
- a1.a, a1.b, a1.c, a1.d, a1.e,
- a2.a, a2.b, a2.c, a2.d, a2.e,
- result.a, result.b, result.c, result.d, result.e);
-
- CHECK(a1.a == 127);
- CHECK(a1.b == 120);
- CHECK(a1.c == 1);
- CHECK(a1.d == 3);
- CHECK(a1.e == 4);
-
- CHECK(a2.a == 12);
- CHECK(a2.b == 128);
- CHECK(a2.c == 9);
- CHECK(a2.d == 3);
- CHECK(a2.e == 4);
-
- CHECK(result.a == 139);
- CHECK(result.b == 248);
- CHECK(result.c == 10);
- CHECK(result.d == 6);
- CHECK(result.e == 8);
-
- return result;
-}
-
-static void
-cls_struct_5byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_5byte a1, a2;
-
- a1 = *(struct cls_struct_5byte*)(args[0]);
- a2 = *(struct cls_struct_5byte*)(args[1]);
-
- *(cls_struct_5byte*)resp = cls_struct_5byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[6];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_5byte g_dbl = { 127, 120, 1, 3, 4 };
- struct cls_struct_5byte f_dbl = { 12, 128, 9, 3, 4 };
- struct cls_struct_5byte res_dbl = { 0, 0, 0, 0, 0 };
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = &ffi_type_uchar;
- cls_struct_fields[4] = &ffi_type_uchar;
- cls_struct_fields[5] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_5byte_fn), &res_dbl, args_dbl);
- /* { dg-output "127 120 1 3 4 12 128 9 3 4: 139 248 10 6 8" } */
- printf("res: %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e);
- /* { dg-output "\nres: 139 248 10 6 8" } */
- CHECK(res_dbl.a == 139);
- CHECK(res_dbl.b == 248);
- CHECK(res_dbl.c == 10);
- CHECK(res_dbl.d == 6);
- CHECK(res_dbl.e == 8);
-
- res_dbl.a = 0;
- res_dbl.b = 0;
- res_dbl.c = 0;
- res_dbl.d = 0;
- res_dbl.e = 0;
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_5byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_5byte(*)(cls_struct_5byte, cls_struct_5byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n127 120 1 3 4 12 128 9 3 4: 139 248 10 6 8" } */
- printf("res: %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e);
- /* { dg-output "\nres: 139 248 10 6 8" } */
- CHECK(res_dbl.a == 139);
- CHECK(res_dbl.b == 248);
- CHECK(res_dbl.c == 10);
- CHECK(res_dbl.d == 6);
- CHECK(res_dbl.e == 8);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_5byte.c b/deps/libffi/testsuite/libffi.closures/cls_5byte.c
deleted file mode 100644
index 9f8936b5909..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_5byte.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_5byte {
- unsigned short a;
- unsigned short b;
- unsigned char c;
-} cls_struct_5byte;
-
-static cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
- struct cls_struct_5byte a2)
-{
- struct cls_struct_5byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c,
- a2.a, a2.b, a2.c,
- result.a, result.b, result.c);
-
- CHECK(a1.a == 127);
- CHECK(a1.b == 120);
- CHECK(a1.c == 1);
-
- CHECK(a2.a == 12);
- CHECK(a2.b == 128);
- CHECK(a2.c == 9);
-
- CHECK(result.a == 139);
- CHECK(result.b == 248);
- CHECK(result.c == 10);
-
- return result;
-}
-
-static void
-cls_struct_5byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_5byte a1, a2;
-
- a1 = *(struct cls_struct_5byte*)(args[0]);
- a2 = *(struct cls_struct_5byte*)(args[1]);
-
- *(cls_struct_5byte*)resp = cls_struct_5byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_5byte g_dbl = { 127, 120, 1 };
- struct cls_struct_5byte f_dbl = { 12, 128, 9 };
- struct cls_struct_5byte res_dbl = { 0, 0, 0 };
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_ushort;
- cls_struct_fields[1] = &ffi_type_ushort;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_5byte_fn), &res_dbl, args_dbl);
- /* { dg-output "127 120 1 12 128 9: 139 248 10" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 139 248 10" } */
- CHECK(res_dbl.a == 139);
- CHECK(res_dbl.b == 248);
- CHECK(res_dbl.c == 10);
-
- res_dbl.a = 0;
- res_dbl.b = 0;
- res_dbl.c = 0;
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_5byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_5byte(*)(cls_struct_5byte, cls_struct_5byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n127 120 1 12 128 9: 139 248 10" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 139 248 10" } */
- CHECK(res_dbl.a == 139);
- CHECK(res_dbl.b == 248);
- CHECK(res_dbl.c == 10);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_64byte.c b/deps/libffi/testsuite/libffi.closures/cls_64byte.c
deleted file mode 100644
index 5adedc944c9..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_64byte.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check bigger struct which overlaps
- the gp and fp register count on Darwin/AIX/ppc64.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_64byte {
- double a;
- double b;
- double c;
- double d;
- double e;
- double f;
- double g;
- double h;
-} cls_struct_64byte;
-
-cls_struct_64byte cls_struct_64byte_fn(struct cls_struct_64byte b0,
- struct cls_struct_64byte b1,
- struct cls_struct_64byte b2,
- struct cls_struct_64byte b3)
-{
- struct cls_struct_64byte result;
-
- result.a = b0.a + b1.a + b2.a + b3.a;
- result.b = b0.b + b1.b + b2.b + b3.b;
- result.c = b0.c + b1.c + b2.c + b3.c;
- result.d = b0.d + b1.d + b2.d + b3.d;
- result.e = b0.e + b1.e + b2.e + b3.e;
- result.f = b0.f + b1.f + b2.f + b3.f;
- result.g = b0.g + b1.g + b2.g + b3.g;
- result.h = b0.h + b1.h + b2.h + b3.h;
-
- printf("%g %g %g %g %g %g %g %g\n", result.a, result.b, result.c,
- result.d, result.e, result.f, result.g, result.h);
- CHECK(result.a == 22);
- CHECK(result.b == 15);
- CHECK(result.c == 17);
- CHECK(result.d == 25);
- CHECK(result.e == 6);
- CHECK(result.f == 13);
- CHECK(result.g == 19);
- CHECK(result.h == 18);
-
- return result;
-}
-
-static void
-cls_struct_64byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct cls_struct_64byte b0, b1, b2, b3;
-
- b0 = *(struct cls_struct_64byte*)(args[0]);
- b1 = *(struct cls_struct_64byte*)(args[1]);
- b2 = *(struct cls_struct_64byte*)(args[2]);
- b3 = *(struct cls_struct_64byte*)(args[3]);
-
- *(cls_struct_64byte*)resp = cls_struct_64byte_fn(b0, b1, b2, b3);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[9];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_64byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0 };
- struct cls_struct_64byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0 };
- struct cls_struct_64byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0 };
- struct cls_struct_64byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0 };
- struct cls_struct_64byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_double;
- cls_struct_fields[3] = &ffi_type_double;
- cls_struct_fields[4] = &ffi_type_double;
- cls_struct_fields[5] = &ffi_type_double;
- cls_struct_fields[6] = &ffi_type_double;
- cls_struct_fields[7] = &ffi_type_double;
- cls_struct_fields[8] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = &cls_struct_type;
- dbl_arg_types[3] = &cls_struct_type;
- dbl_arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = &h_dbl;
- args_dbl[4] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_64byte_fn), &res_dbl, args_dbl);
- /* { dg-output "22 15 17 25 6 13 19 18" } */
- printf("res: %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h);
- /* { dg-output "\nres: 22 15 17 25 6 13 19 18" } */
- CHECK(res_dbl.a == 22);
- CHECK(res_dbl.b == 15);
- CHECK(res_dbl.c == 17);
- CHECK(res_dbl.d == 25);
- CHECK(res_dbl.e == 6);
- CHECK(res_dbl.f == 13);
- CHECK(res_dbl.g == 19);
- CHECK(res_dbl.h == 18);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_64byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_64byte(*)(cls_struct_64byte,
- cls_struct_64byte,
- cls_struct_64byte,
- cls_struct_64byte))
- (code))(e_dbl, f_dbl, g_dbl, h_dbl);
- /* { dg-output "\n22 15 17 25 6 13 19 18" } */
- printf("res: %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h);
- /* { dg-output "\nres: 22 15 17 25 6 13 19 18" } */
- CHECK(res_dbl.a == 22);
- CHECK(res_dbl.b == 15);
- CHECK(res_dbl.c == 17);
- CHECK(res_dbl.d == 25);
- CHECK(res_dbl.e == 6);
- CHECK(res_dbl.f == 13);
- CHECK(res_dbl.g == 19);
- CHECK(res_dbl.h == 18);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_6_1_byte.c b/deps/libffi/testsuite/libffi.closures/cls_6_1_byte.c
deleted file mode 100644
index 05e2945b680..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_6_1_byte.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20050708 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_6byte {
- unsigned char a;
- unsigned char b;
- unsigned char c;
- unsigned char d;
- unsigned char e;
- unsigned char f;
-} cls_struct_6byte;
-
-static cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
- struct cls_struct_6byte a2)
-{
- struct cls_struct_6byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
- result.d = a1.d + a2.d;
- result.e = a1.e + a2.e;
- result.f = a1.f + a2.f;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d: %d %d %d %d %d %d\n",
- a1.a, a1.b, a1.c, a1.d, a1.e, a1.f,
- a2.a, a2.b, a2.c, a2.d, a2.e, a2.f,
- result.a, result.b, result.c, result.d, result.e, result.f);
-
- CHECK(a1.a == 127);
- CHECK(a1.b == 120);
- CHECK(a1.c == 1);
- CHECK(a1.d == 3);
- CHECK(a1.e == 4);
- CHECK(a1.f == 5);
-
- CHECK(a2.a == 12);
- CHECK(a2.b == 128);
- CHECK(a2.c == 9);
- CHECK(a2.d == 3);
- CHECK(a2.e == 4);
- CHECK(a2.f == 5);
-
- CHECK(result.a == 139);
- CHECK(result.b == 248);
- CHECK(result.c == 10);
- CHECK(result.d == 6);
- CHECK(result.e == 8);
- CHECK(result.f == 10);
-
- return result;
-}
-
-static void
-cls_struct_6byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_6byte a1, a2;
-
- a1 = *(struct cls_struct_6byte*)(args[0]);
- a2 = *(struct cls_struct_6byte*)(args[1]);
-
- *(cls_struct_6byte*)resp = cls_struct_6byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[7];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_6byte g_dbl = { 127, 120, 1, 3, 4, 5 };
- struct cls_struct_6byte f_dbl = { 12, 128, 9, 3, 4, 5 };
- struct cls_struct_6byte res_dbl = { 0, 0, 0, 0, 0, 0 };
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = &ffi_type_uchar;
- cls_struct_fields[4] = &ffi_type_uchar;
- cls_struct_fields[5] = &ffi_type_uchar;
- cls_struct_fields[6] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_6byte_fn), &res_dbl, args_dbl);
- /* { dg-output "127 120 1 3 4 5 12 128 9 3 4 5: 139 248 10 6 8 10" } */
- printf("res: %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e, res_dbl.f);
- /* { dg-output "\nres: 139 248 10 6 8 10" } */
-
- res_dbl.a = 0;
- res_dbl.b = 0;
- res_dbl.c = 0;
- res_dbl.d = 0;
- res_dbl.e = 0;
- res_dbl.f = 0;
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_6byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_6byte(*)(cls_struct_6byte, cls_struct_6byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n127 120 1 3 4 5 12 128 9 3 4 5: 139 248 10 6 8 10" } */
- printf("res: %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e, res_dbl.f);
- /* { dg-output "\nres: 139 248 10 6 8 10" } */
-
- CHECK(res_dbl.a == 139);
- CHECK(res_dbl.b == 248);
- CHECK(res_dbl.c == 10);
- CHECK(res_dbl.d == 6);
- CHECK(res_dbl.e == 8);
- CHECK(res_dbl.f == 10);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_6byte.c b/deps/libffi/testsuite/libffi.closures/cls_6byte.c
deleted file mode 100644
index a8e3ea0716f..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_6byte.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_6byte {
- unsigned short a;
- unsigned short b;
- unsigned char c;
- unsigned char d;
-} cls_struct_6byte;
-
-static cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
- struct cls_struct_6byte a2)
-{
- struct cls_struct_6byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
- result.d = a1.d + a2.d;
-
- printf("%d %d %d %d %d %d %d %d: %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d,
- a2.a, a2.b, a2.c, a2.d,
- result.a, result.b, result.c, result.d);
-
- CHECK(a1.a == 127);
- CHECK(a1.b == 120);
- CHECK(a1.c == 1);
- CHECK(a1.d == 128);
-
- CHECK(a2.a == 12);
- CHECK(a2.b == 128);
- CHECK(a2.c == 9);
- CHECK(a2.d == 127);
-
- CHECK(result.a == 139);
- CHECK(result.b == 248);
- CHECK(result.c == 10);
- CHECK(result.d == 255);
-
- return result;
-}
-
-static void
-cls_struct_6byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_6byte a1, a2;
-
- a1 = *(struct cls_struct_6byte*)(args[0]);
- a2 = *(struct cls_struct_6byte*)(args[1]);
-
- *(cls_struct_6byte*)resp = cls_struct_6byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[5];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_6byte g_dbl = { 127, 120, 1, 128 };
- struct cls_struct_6byte f_dbl = { 12, 128, 9, 127 };
- struct cls_struct_6byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_ushort;
- cls_struct_fields[1] = &ffi_type_ushort;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = &ffi_type_uchar;
- cls_struct_fields[4] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_6byte_fn), &res_dbl, args_dbl);
- /* { dg-output "127 120 1 128 12 128 9 127: 139 248 10 255" } */
- printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
- /* { dg-output "\nres: 139 248 10 255" } */
- CHECK(res_dbl.a == 139);
- CHECK(res_dbl.b == 248);
- CHECK(res_dbl.c == 10);
- CHECK(res_dbl.d == 255);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_6byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_6byte(*)(cls_struct_6byte, cls_struct_6byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n127 120 1 128 12 128 9 127: 139 248 10 255" } */
- printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
- /* { dg-output "\nres: 139 248 10 255" } */
- CHECK(res_dbl.a == 139);
- CHECK(res_dbl.b == 248);
- CHECK(res_dbl.c == 10);
- CHECK(res_dbl.d == 255);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_7_1_byte.c b/deps/libffi/testsuite/libffi.closures/cls_7_1_byte.c
deleted file mode 100644
index 3f17964833e..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_7_1_byte.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20050708 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_7byte {
- unsigned char a;
- unsigned char b;
- unsigned char c;
- unsigned char d;
- unsigned char e;
- unsigned char f;
- unsigned char g;
-} cls_struct_7byte;
-
-static cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
- struct cls_struct_7byte a2)
-{
- struct cls_struct_7byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
- result.d = a1.d + a2.d;
- result.e = a1.e + a2.e;
- result.f = a1.f + a2.f;
- result.g = a1.g + a2.g;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d %d %d %d %d %d %d\n",
- a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, a1.g,
- a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, a2.g,
- result.a, result.b, result.c, result.d, result.e, result.f, result.g);
-
- CHECK(a1.a == 127);
- CHECK(a1.b == 120);
- CHECK(a1.c == 1);
- CHECK(a1.d == 3);
- CHECK(a1.e == 4);
- CHECK(a1.f == 5);
- CHECK(a1.g == 6);
-
- CHECK(a2.a == 12);
- CHECK(a2.b == 128);
- CHECK(a2.c == 9);
- CHECK(a2.d == 3);
- CHECK(a2.e == 4);
- CHECK(a2.f == 5);
- CHECK(a2.g == 6);
-
- CHECK(result.a == 139);
- CHECK(result.b == 248);
- CHECK(result.c == 10);
- CHECK(result.d == 6);
- CHECK(result.e == 8);
- CHECK(result.f == 10);
- CHECK(result.g == 12);
-
- return result;
-}
-
-static void
-cls_struct_7byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_7byte a1, a2;
-
- a1 = *(struct cls_struct_7byte*)(args[0]);
- a2 = *(struct cls_struct_7byte*)(args[1]);
-
- *(cls_struct_7byte*)resp = cls_struct_7byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[8];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_7byte g_dbl = { 127, 120, 1, 3, 4, 5, 6 };
- struct cls_struct_7byte f_dbl = { 12, 128, 9, 3, 4, 5, 6 };
- struct cls_struct_7byte res_dbl = { 0, 0, 0, 0, 0, 0, 0 };
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = &ffi_type_uchar;
- cls_struct_fields[4] = &ffi_type_uchar;
- cls_struct_fields[5] = &ffi_type_uchar;
- cls_struct_fields[6] = &ffi_type_uchar;
- cls_struct_fields[7] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_7byte_fn), &res_dbl, args_dbl);
- /* { dg-output "127 120 1 3 4 5 6 12 128 9 3 4 5 6: 139 248 10 6 8 10 12" } */
- printf("res: %d %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
- /* { dg-output "\nres: 139 248 10 6 8 10 12" } */
- CHECK(res_dbl.a == 139);
- CHECK(res_dbl.b == 248);
- CHECK(res_dbl.c == 10);
- CHECK(res_dbl.d == 6);
- CHECK(res_dbl.e == 8);
- CHECK(res_dbl.f == 10);
- CHECK(res_dbl.g == 12);
-
- res_dbl.a = 0;
- res_dbl.b = 0;
- res_dbl.c = 0;
- res_dbl.d = 0;
- res_dbl.e = 0;
- res_dbl.f = 0;
- res_dbl.g = 0;
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_7byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_7byte(*)(cls_struct_7byte, cls_struct_7byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n127 120 1 3 4 5 6 12 128 9 3 4 5 6: 139 248 10 6 8 10 12" } */
- printf("res: %d %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
- /* { dg-output "\nres: 139 248 10 6 8 10 12" } */
- CHECK(res_dbl.a == 139);
- CHECK(res_dbl.b == 248);
- CHECK(res_dbl.c == 10);
- CHECK(res_dbl.d == 6);
- CHECK(res_dbl.e == 8);
- CHECK(res_dbl.f == 10);
- CHECK(res_dbl.g == 12);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_7byte.c b/deps/libffi/testsuite/libffi.closures/cls_7byte.c
deleted file mode 100644
index dcfc29b82a5..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_7byte.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_7byte {
- unsigned short a;
- unsigned short b;
- unsigned char c;
- unsigned short d;
-} cls_struct_7byte;
-
-static cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
- struct cls_struct_7byte a2)
-{
- struct cls_struct_7byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
- result.d = a1.d + a2.d;
-
- printf("%d %d %d %d %d %d %d %d: %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d,
- a2.a, a2.b, a2.c, a2.d,
- result.a, result.b, result.c, result.d);
-
- CHECK(a1.a == 127);
- CHECK(a1.b == 120);
- CHECK(a1.c == 1);
- CHECK(a1.d == 254);
-
- CHECK(a2.a == 12);
- CHECK(a2.b == 128);
- CHECK(a2.c == 9);
- CHECK(a2.d == 255);
-
- CHECK(result.a == 139);
- CHECK(result.b == 248);
- CHECK(result.c == 10);
- CHECK(result.d == 509);
-
-
- return result;
-}
-
-static void
-cls_struct_7byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_7byte a1, a2;
-
- a1 = *(struct cls_struct_7byte*)(args[0]);
- a2 = *(struct cls_struct_7byte*)(args[1]);
-
- *(cls_struct_7byte*)resp = cls_struct_7byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[5];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_7byte g_dbl = { 127, 120, 1, 254 };
- struct cls_struct_7byte f_dbl = { 12, 128, 9, 255 };
- struct cls_struct_7byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_ushort;
- cls_struct_fields[1] = &ffi_type_ushort;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = &ffi_type_ushort;
- cls_struct_fields[4] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_7byte_fn), &res_dbl, args_dbl);
- /* { dg-output "127 120 1 254 12 128 9 255: 139 248 10 509" } */
- printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
- /* { dg-output "\nres: 139 248 10 509" } */
- CHECK(res_dbl.a == 139);
- CHECK(res_dbl.b == 248);
- CHECK(res_dbl.c == 10);
- CHECK(res_dbl.d == 509);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_7byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_7byte(*)(cls_struct_7byte, cls_struct_7byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n127 120 1 254 12 128 9 255: 139 248 10 509" } */
- printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
- /* { dg-output "\nres: 139 248 10 509" } */
- CHECK(res_dbl.a == 139);
- CHECK(res_dbl.b == 248);
- CHECK(res_dbl.c == 10);
- CHECK(res_dbl.d == 509);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_8byte.c b/deps/libffi/testsuite/libffi.closures/cls_8byte.c
deleted file mode 100644
index 7a519e95e3e..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_8byte.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_8byte {
- int a;
- float b;
-} cls_struct_8byte;
-
-cls_struct_8byte cls_struct_8byte_fn(struct cls_struct_8byte a1,
- struct cls_struct_8byte a2)
-{
- struct cls_struct_8byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
-
- printf("%d %g %d %g: %d %g\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
-
- CHECK(a1.a == 1);
- CHECK_FLOAT_EQ(a1.b, 2);
-
- CHECK(a2.a == 4);
- CHECK_FLOAT_EQ(a2.b, 5);
-
- CHECK(result.a == 5);
- CHECK_FLOAT_EQ(result.b, 7);
-
- return result;
-}
-
-static void
-cls_struct_8byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_8byte a1, a2;
-
- a1 = *(struct cls_struct_8byte*)(args[0]);
- a2 = *(struct cls_struct_8byte*)(args[1]);
-
- *(cls_struct_8byte*)resp = cls_struct_8byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_8byte g_dbl = { 1, 2.0 };
- struct cls_struct_8byte f_dbl = { 4, 5.0 };
- struct cls_struct_8byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_sint;
- cls_struct_fields[1] = &ffi_type_float;
- cls_struct_fields[2] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_8byte_fn), &res_dbl, args_dbl);
- /* { dg-output "1 2 4 5: 5 7" } */
- printf("res: %d %g\n", res_dbl.a, res_dbl.b);
- CHECK(res_dbl.a == 5);
- CHECK_FLOAT_EQ(res_dbl.b, 7);
-
- /* { dg-output "\nres: 5 7" } */
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_8byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_8byte(*)(cls_struct_8byte, cls_struct_8byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n1 2 4 5: 5 7" } */
- printf("res: %d %g\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 5 7" } */
- CHECK(res_dbl.a == 5);
- CHECK_FLOAT_EQ(res_dbl.b, 7);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_9byte1.c b/deps/libffi/testsuite/libffi.closures/cls_9byte1.c
deleted file mode 100644
index 9d3b609d3f8..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_9byte1.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Darwin/AIX do double-word
- alignment of the struct if the first element is a double.
- Check that it does not here.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030914 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_9byte {
- int a;
- double b;
-} cls_struct_9byte;
-
-static cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
- struct cls_struct_9byte b2)
-{
- struct cls_struct_9byte result;
-
- result.a = b1.a + b2.a;
- result.b = b1.b + b2.b;
-
- printf("%d %g %d %g: %d %g\n", b1.a, b1.b, b2.a, b2.b,
- result.a, result.b);
-
- CHECK(b1.a == 7);
- CHECK(b1.b == 8);
-
- CHECK(b2.a == 1);
- CHECK(b2.b == 9);
-
- CHECK(result.a == 8);
- CHECK(result.b == 17);
-
- return result;
-}
-
-static void cls_struct_9byte_gn(ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
-{
- struct cls_struct_9byte b1, b2;
-
- b1 = *(struct cls_struct_9byte*)(args[0]);
- b2 = *(struct cls_struct_9byte*)(args[1]);
-
- *(cls_struct_9byte*)resp = cls_struct_9byte_fn(b1, b2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[3];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[3];
-
- struct cls_struct_9byte h_dbl = { 7, 8.0};
- struct cls_struct_9byte j_dbl = { 1, 9.0};
- struct cls_struct_9byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_sint;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &h_dbl;
- args_dbl[1] = &j_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_9byte_fn), &res_dbl, args_dbl);
- /* { dg-output "7 8 1 9: 8 17" } */
- printf("res: %d %g\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 8 17" } */
- CHECK(res_dbl.a == 8);
- CHECK(res_dbl.b == 17);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_9byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_9byte(*)(cls_struct_9byte, cls_struct_9byte))(code))(h_dbl, j_dbl);
- /* { dg-output "\n7 8 1 9: 8 17" } */
- printf("res: %d %g\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 8 17" } */
- CHECK(res_dbl.a == 8);
- CHECK(res_dbl.b == 17);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_9byte2.c b/deps/libffi/testsuite/libffi.closures/cls_9byte2.c
deleted file mode 100644
index 6cfaaf39722..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_9byte2.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Darwin/AIX do double-word
- alignment of the struct if the first element is a double.
- Check that it does here.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030914 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_9byte {
- double a;
- int b;
-} cls_struct_9byte;
-
-static cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
- struct cls_struct_9byte b2)
-{
- struct cls_struct_9byte result;
-
- result.a = b1.a + b2.a;
- result.b = b1.b + b2.b;
-
- printf("%g %d %g %d: %g %d\n", b1.a, b1.b, b2.a, b2.b,
- result.a, result.b);
-
- CHECK(b1.a == 7);
- CHECK(b1.b == 8);
-
- CHECK(b2.a == 1);
- CHECK(b2.b == 9);
-
- CHECK(result.a == 8);
- CHECK(result.b == 17);
-
- return result;
-}
-
-static void cls_struct_9byte_gn(ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
-{
- struct cls_struct_9byte b1, b2;
-
- b1 = *(struct cls_struct_9byte*)(args[0]);
- b2 = *(struct cls_struct_9byte*)(args[1]);
-
- *(cls_struct_9byte*)resp = cls_struct_9byte_fn(b1, b2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[3];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[3];
-
- struct cls_struct_9byte h_dbl = { 7.0, 8};
- struct cls_struct_9byte j_dbl = { 1.0, 9};
- struct cls_struct_9byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_sint;
- cls_struct_fields[2] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &h_dbl;
- args_dbl[1] = &j_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_9byte_fn), &res_dbl, args_dbl);
- /* { dg-output "7 8 1 9: 8 17" } */
- printf("res: %g %d\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 8 17" } */
- CHECK(res_dbl.a == 8);
- CHECK(res_dbl.b == 17);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_9byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_9byte(*)(cls_struct_9byte, cls_struct_9byte))(code))(h_dbl, j_dbl);
- /* { dg-output "\n7 8 1 9: 8 17" } */
- printf("res: %g %d\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 8 17" } */
- CHECK(res_dbl.a == 8);
- CHECK(res_dbl.b == 17);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_align_double.c b/deps/libffi/testsuite/libffi.closures/cls_align_double.c
deleted file mode 100644
index 036cca37f11..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_align_double.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of double.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- unsigned char a;
- double b;
- unsigned char c;
-} cls_struct_align;
-
-static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
- struct cls_struct_align a2)
-{
- struct cls_struct_align result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
-
- CHECK(a1.a == 12);
- CHECK(a1.b == 4951);
- CHECK(a1.c == 127);
-
- CHECK(a2.a == 1);
- CHECK(a2.b == 9320);
- CHECK(a2.c == 13);
-
- CHECK(result.a == 13);
- CHECK(result.b == 14271);
- CHECK(result.c == 140);
-
- return result;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_align g_dbl = { 12, 4951, 127 };
- struct cls_struct_align f_dbl = { 1, 9320, 13 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == 14271);
- CHECK(res_dbl.c == 140);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == 14271);
- CHECK(res_dbl.c == 140);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_align_float.c b/deps/libffi/testsuite/libffi.closures/cls_align_float.c
deleted file mode 100644
index c7dbdfd8f69..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_align_float.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of float.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- unsigned char a;
- float b;
- unsigned char c;
-} cls_struct_align;
-
-static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
- struct cls_struct_align a2)
-{
- struct cls_struct_align result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, (double)a1.b, a1.c, a2.a, (double)a2.b, a2.c, result.a, (double)result.b, result.c);
-
- CHECK(a1.a == 12);
- CHECK_FLOAT_EQ(a1.b, 4951);
- CHECK(a1.c == 127);
-
- CHECK(a2.a == 1);
- CHECK_FLOAT_EQ(a2.b, 9320);
- CHECK(a2.c == 13);
-
- CHECK(result.a == 13);
- CHECK_FLOAT_EQ(result.b, 14271);
- CHECK(result.c == 140);
-
- return result;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_align g_dbl = { 12, 4951, 127 };
- struct cls_struct_align f_dbl = { 1, 9320, 13 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_float;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
- CHECK(res_dbl.a == 13);
- CHECK_FLOAT_EQ(res_dbl.b, 14271);
- CHECK(res_dbl.c == 140);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
- CHECK(res_dbl.a == 13);
- CHECK_FLOAT_EQ(res_dbl.b, 14271);
- CHECK(res_dbl.c == 140);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_align_longdouble.c b/deps/libffi/testsuite/libffi.closures/cls_align_longdouble.c
deleted file mode 100644
index 1cdb10bdbec..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_align_longdouble.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of long double.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- unsigned char a;
- long double b;
- unsigned char c;
-} cls_struct_align;
-
-static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
- struct cls_struct_align a2)
-{
- struct cls_struct_align result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, (double)a1.b, a1.c, a2.a, (double)a2.b, a2.c, result.a, (double)result.b, result.c);
-
- CHECK(a1.a == 12);
- CHECK(a1.b == 4951);
- CHECK(a1.c == 127);
-
- CHECK(a2.a == 1);
- CHECK(a2.b == 9320);
- CHECK(a2.c == 13);
-
- CHECK(result.a == 13);
- CHECK(result.b == 14271);
- CHECK(result.c == 140);
-
- return result;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_align g_dbl = { 12, 4951, 127 };
- struct cls_struct_align f_dbl = { 1, 9320, 13 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_longdouble;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == 14271);
- CHECK(res_dbl.c == 140);
-
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == 14271);
- CHECK(res_dbl.c == 140);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_align_longdouble_split.c b/deps/libffi/testsuite/libffi.closures/cls_align_longdouble_split.c
deleted file mode 100644
index 8988b5d6197..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_align_longdouble_split.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of long double.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-/* { dg-options -mlong-double-128 { target ppc64_longdouble128 } } */
-
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- long double a;
- long double b;
- long double c;
- long double d;
- long double e;
- long double f;
- long double g;
-} cls_struct_align;
-
-static cls_struct_align cls_struct_align_fn(
- cls_struct_align a1,
- cls_struct_align a2)
-{
- struct cls_struct_align r;
-
- r.a = a1.a + a2.a;
- r.b = a1.b + a2.b;
- r.c = a1.c + a2.c;
- r.d = a1.d + a2.d;
- r.e = a1.e + a2.e;
- r.f = a1.f + a2.f;
- r.g = a1.g + a2.g;
-
- printf("%Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg: "
- "%Lg %Lg %Lg %Lg %Lg %Lg %Lg\n",
- a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, a1.g,
- a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, a2.g,
- r.a, r.b, r.c, r.d, r.e, r.f, r.g);
-
- CHECK(a1.a == 1);
- CHECK(a1.b == 2);
- CHECK(a1.c == 3);
- CHECK(a1.d == 4);
- CHECK(a1.e == 5);
- CHECK(a1.f == 6);
- CHECK(a1.g == 7);
-
- CHECK(a2.a == 8);
- CHECK(a2.b == 9);
- CHECK(a2.c == 10);
- CHECK(a2.d == 11);
- CHECK(a2.e == 12);
- CHECK(a2.f == 13);
- CHECK(a2.g == 14);
-
- CHECK(r.a == 9);
- CHECK(r.b == 11);
- CHECK(r.c == 13);
- CHECK(r.d == 15);
- CHECK(r.e == 17);
- CHECK(r.f == 19);
- CHECK(r.g == 21);
- return r;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[8];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[3];
-
- struct cls_struct_align g_dbl = { 1, 2, 3, 4, 5, 6, 7 };
- struct cls_struct_align f_dbl = { 8, 9, 10, 11, 12, 13, 14 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_longdouble;
- cls_struct_fields[1] = &ffi_type_longdouble;
- cls_struct_fields[2] = &ffi_type_longdouble;
- cls_struct_fields[3] = &ffi_type_longdouble;
- cls_struct_fields[4] = &ffi_type_longdouble;
- cls_struct_fields[5] = &ffi_type_longdouble;
- cls_struct_fields[6] = &ffi_type_longdouble;
- cls_struct_fields[7] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21" } */
- printf("res: %Lg %Lg %Lg %Lg %Lg %Lg %Lg\n", res_dbl.a, res_dbl.b,
- res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
- /* { dg-output "\nres: 9 11 13 15 17 19 21" } */
- CHECK(res_dbl.a == 9);
- CHECK(res_dbl.b == 11);
- CHECK(res_dbl.c == 13);
- CHECK(res_dbl.d == 15);
- CHECK(res_dbl.e == 17);
- CHECK(res_dbl.f == 19);
- CHECK(res_dbl.g == 21);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21" } */
- printf("res: %Lg %Lg %Lg %Lg %Lg %Lg %Lg\n", res_dbl.a, res_dbl.b,
- res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
- /* { dg-output "\nres: 9 11 13 15 17 19 21" } */
- CHECK(res_dbl.a == 9);
- CHECK(res_dbl.b == 11);
- CHECK(res_dbl.c == 13);
- CHECK(res_dbl.d == 15);
- CHECK(res_dbl.e == 17);
- CHECK(res_dbl.f == 19);
- CHECK(res_dbl.g == 21);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_align_longdouble_split2.c b/deps/libffi/testsuite/libffi.closures/cls_align_longdouble_split2.c
deleted file mode 100644
index edf21b7f926..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_align_longdouble_split2.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of long double.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/18/2007
-*/
-
-/* { dg-do run { xfail strongarm*-*-* } } */
-/* { dg-options -mlong-double-128 { target ppc64_longdouble128 } } */
-
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- long double a;
- long double b;
- long double c;
- long double d;
- long double e;
- double f;
- long double g;
-} cls_struct_align;
-
-static cls_struct_align cls_struct_align_fn(
- cls_struct_align a1,
- cls_struct_align a2)
-{
- struct cls_struct_align r;
-
- r.a = a1.a + a2.a;
- r.b = a1.b + a2.b;
- r.c = a1.c + a2.c;
- r.d = a1.d + a2.d;
- r.e = a1.e + a2.e;
- r.f = a1.f + a2.f;
- r.g = a1.g + a2.g;
-
- printf("%Lg %Lg %Lg %Lg %Lg %g %Lg %Lg %Lg %Lg %Lg %Lg %g %Lg: "
- "%Lg %Lg %Lg %Lg %Lg %g %Lg\n",
- a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, a1.g,
- a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, a2.g,
- r.a, r.b, r.c, r.d, r.e, r.f, r.g);
-
- CHECK(a1.a == 1);
- CHECK(a1.b == 2);
- CHECK(a1.c == 3);
- CHECK(a1.d == 4);
- CHECK(a1.e == 5);
- CHECK(a1.f == 6);
- CHECK(a1.g == 7);
-
- CHECK(a2.a == 8);
- CHECK(a2.b == 9);
- CHECK(a2.c == 10);
- CHECK(a2.d == 11);
- CHECK(a2.e == 12);
- CHECK(a2.f == 13);
- CHECK(a2.g == 14);
-
- CHECK(r.a == 9);
- CHECK(r.b == 11);
- CHECK(r.c == 13);
- CHECK(r.d == 15);
- CHECK(r.e == 17);
- CHECK(r.f == 19);
- CHECK(r.g == 21);
-
- return r;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[8];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[3];
-
- struct cls_struct_align g_dbl = { 1, 2, 3, 4, 5, 6, 7 };
- struct cls_struct_align f_dbl = { 8, 9, 10, 11, 12, 13, 14 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_longdouble;
- cls_struct_fields[1] = &ffi_type_longdouble;
- cls_struct_fields[2] = &ffi_type_longdouble;
- cls_struct_fields[3] = &ffi_type_longdouble;
- cls_struct_fields[4] = &ffi_type_longdouble;
- cls_struct_fields[5] = &ffi_type_double;
- cls_struct_fields[6] = &ffi_type_longdouble;
- cls_struct_fields[7] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21" } */
- printf("res: %Lg %Lg %Lg %Lg %Lg %g %Lg\n", res_dbl.a, res_dbl.b,
- res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
- /* { dg-output "\nres: 9 11 13 15 17 19 21" } */
- CHECK(res_dbl.a == 9);
- CHECK(res_dbl.b == 11);
- CHECK(res_dbl.c == 13);
- CHECK(res_dbl.d == 15);
- CHECK(res_dbl.e == 17);
- CHECK(res_dbl.f == 19);
- CHECK(res_dbl.g == 21);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21" } */
- printf("res: %Lg %Lg %Lg %Lg %Lg %g %Lg\n", res_dbl.a, res_dbl.b,
- res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
- /* { dg-output "\nres: 9 11 13 15 17 19 21" } */
- CHECK(res_dbl.a == 9);
- CHECK(res_dbl.b == 11);
- CHECK(res_dbl.c == 13);
- CHECK(res_dbl.d == 15);
- CHECK(res_dbl.e == 17);
- CHECK(res_dbl.f == 19);
- CHECK(res_dbl.g == 21);
- exit(0);
-}
-
-
-
diff --git a/deps/libffi/testsuite/libffi.closures/cls_align_pointer.c b/deps/libffi/testsuite/libffi.closures/cls_align_pointer.c
deleted file mode 100644
index 5fb3f09ac38..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_align_pointer.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of pointer.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- unsigned char a;
- void *b;
- unsigned char c;
-} cls_struct_align;
-
-static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
- struct cls_struct_align a2)
-{
- struct cls_struct_align result;
-
- result.a = a1.a + a2.a;
- result.b = (void *)((uintptr_t)a1.b + (uintptr_t)a2.b);
- result.c = a1.c + a2.c;
-
- printf("%d %" PRIuPTR " %d %d %" PRIuPTR " %d: %d %" PRIuPTR " %d\n",
- a1.a, (uintptr_t)a1.b, a1.c,
- a2.a, (uintptr_t)a2.b, a2.c,
- result.a, (uintptr_t)result.b,
- result.c);
-
- CHECK(a1.a == 12);
- CHECK(a1.b == (void *)4951);
- CHECK(a1.c == 127);
-
- CHECK(a2.a == 1);
- CHECK(a2.b == (void *)9320);
- CHECK(a2.c == 13);
-
- CHECK(result.a == 13);
- CHECK(result.b == (void *)14271);
- CHECK(result.c == 140);
-
- return result;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_align g_dbl = { 12, (void *)4951, 127 };
- struct cls_struct_align f_dbl = { 1, (void *)9320, 13 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_pointer;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %" PRIuPTR " %d\n", res_dbl.a, (uintptr_t)res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == (void *)14271);
- CHECK(res_dbl.c == 140);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %" PRIuPTR " %d\n", res_dbl.a, (uintptr_t)res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == (void *)14271);
- CHECK(res_dbl.c == 140);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_align_sint16.c b/deps/libffi/testsuite/libffi.closures/cls_align_sint16.c
deleted file mode 100644
index d2c9bf40fe9..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_align_sint16.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of sint16.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- unsigned char a;
- signed short b;
- unsigned char c;
-} cls_struct_align;
-
-static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
- struct cls_struct_align a2)
-{
- struct cls_struct_align result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
- CHECK(a1.a == 12);
- CHECK(a1.b == 4951);
- CHECK(a1.c == 127);
-
- CHECK(a2.a == 1);
- CHECK(a2.b == 9320);
- CHECK(a2.c == 13);
-
- CHECK(result.a == 13);
- CHECK(result.b == 14271);
- CHECK(result.c == 140);
-
- return result;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_align g_dbl = { 12, 4951, 127 };
- struct cls_struct_align f_dbl = { 1, 9320, 13 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_sshort;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == 14271);
- CHECK(res_dbl.c == 140);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == 14271);
- CHECK(res_dbl.c == 140);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_align_sint32.c b/deps/libffi/testsuite/libffi.closures/cls_align_sint32.c
deleted file mode 100644
index 570f45ffd6c..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_align_sint32.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of sint32.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- unsigned char a;
- signed int b;
- unsigned char c;
-} cls_struct_align;
-
-static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
- struct cls_struct_align a2)
-{
- struct cls_struct_align result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
- CHECK(a1.a == 12);
- CHECK(a1.b == 4951);
- CHECK(a1.c == 127);
-
- CHECK(a2.a == 1);
- CHECK(a2.b == 9320);
- CHECK(a2.c == 13);
-
- CHECK(result.a == 13);
- CHECK(result.b == 14271);
- CHECK(result.c == 140);
-
- return result;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_align g_dbl = { 12, 4951, 127 };
- struct cls_struct_align f_dbl = { 1, 9320, 13 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_sint;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == 14271);
- CHECK(res_dbl.c == 140);
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == 14271);
- CHECK(res_dbl.c == 140);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_align_sint64.c b/deps/libffi/testsuite/libffi.closures/cls_align_sint64.c
deleted file mode 100644
index 49ee5612b1f..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_align_sint64.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of sint64.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-/* { dg-do run } */
-/* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- unsigned char a;
- signed long long b;
- unsigned char c;
-} cls_struct_align;
-
-static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
- struct cls_struct_align a2)
-{
- struct cls_struct_align result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %" PRIdLL " %d %d %" PRIdLL " %d: %d %" PRIdLL " %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
- CHECK(a1.a == 12);
- CHECK(a1.b == 4951);
- CHECK(a1.c == 127);
-
- CHECK(a2.a == 1);
- CHECK(a2.b == 9320);
- CHECK(a2.c == 13);
-
- CHECK(result.a == 13);
- CHECK(result.b == 14271);
- CHECK(result.c == 140);
-
- return result;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_align g_dbl = { 12, 4951, 127 };
- struct cls_struct_align f_dbl = { 1, 9320, 13 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_sint64;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == 14271);
- CHECK(res_dbl.c == 140);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == 14271);
- CHECK(res_dbl.c == 140);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_align_uint16.c b/deps/libffi/testsuite/libffi.closures/cls_align_uint16.c
deleted file mode 100644
index 2204dff92bf..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_align_uint16.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of uint16.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- unsigned char a;
- unsigned short b;
- unsigned char c;
-} cls_struct_align;
-
-static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
- struct cls_struct_align a2)
-{
- struct cls_struct_align result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
- CHECK(a1.a == 12);
- CHECK(a1.b == 4951);
- CHECK(a1.c == 127);
-
- CHECK(a2.a == 1);
- CHECK(a2.b == 9320);
- CHECK(a2.c == 13);
-
- CHECK(result.a == 13);
- CHECK(result.b == 14271);
- CHECK(result.c == 140);
-
- return result;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_align g_dbl = { 12, 4951, 127 };
- struct cls_struct_align f_dbl = { 1, 9320, 13 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_ushort;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == 14271);
- CHECK(res_dbl.c == 140);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == 14271);
- CHECK(res_dbl.c == 140);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_align_uint32.c b/deps/libffi/testsuite/libffi.closures/cls_align_uint32.c
deleted file mode 100644
index 1ce23daf5d2..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_align_uint32.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of uint32.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- unsigned char a;
- unsigned int b;
- unsigned char c;
-} cls_struct_align;
-
-static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
- struct cls_struct_align a2)
-{
- struct cls_struct_align result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
-
- CHECK(a1.a == 12);
- CHECK(a1.b == 4951);
- CHECK(a1.c == 127);
-
- CHECK(a2.a == 1);
- CHECK(a2.b == 9320);
- CHECK(a2.c == 13);
-
- CHECK(result.a == 13);
- CHECK(result.b == 14271);
- CHECK(result.c == 140);
-
- return result;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_align g_dbl = { 12, 4951, 127 };
- struct cls_struct_align f_dbl = { 1, 9320, 13 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_uint;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == 14271);
- CHECK(res_dbl.c == 140);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == 14271);
- CHECK(res_dbl.c == 140);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_align_uint64.c b/deps/libffi/testsuite/libffi.closures/cls_align_uint64.c
deleted file mode 100644
index aee958a86d0..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_align_uint64.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of uint64.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-
-/* { dg-do run } */
-/* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- unsigned char a;
- unsigned long long b;
- unsigned char c;
-} cls_struct_align;
-
-static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
- struct cls_struct_align a2)
-{
- struct cls_struct_align result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %" PRIdLL " %d %d %" PRIdLL " %d: %d %" PRIdLL " %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
-
- CHECK(a1.a == 12);
- CHECK(a1.b == 4951);
- CHECK(a1.c == 127);
-
- CHECK(a2.a == 1);
- CHECK(a2.b == 9320);
- CHECK(a2.c == 13);
-
- CHECK(result.a == 13);
- CHECK(result.b == 14271);
- CHECK(result.c == 140);
-
- return result;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_align g_dbl = { 12, 4951, 127 };
- struct cls_struct_align f_dbl = { 1, 9320, 13 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_uint64;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == 14271);
- CHECK(res_dbl.c == 140);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
- CHECK(res_dbl.a == 13);
- CHECK(res_dbl.b == 14271);
- CHECK(res_dbl.c == 140);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_dbls_struct.c b/deps/libffi/testsuite/libffi.closures/cls_dbls_struct.c
deleted file mode 100644
index d0c206c0487..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_dbls_struct.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check double arguments in structs.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/23/2007 */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-typedef struct Dbls {
- double x;
- double y;
-} Dbls;
-
-void
-closure_test_fn(Dbls p)
-{
- printf("%.1f %.1f\n", p.x, p.y);
- CHECK(p.x == 1);
- CHECK(p.y == 2);
-}
-
-void
-closure_test_gn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__,
- void** args, void* userdata __UNUSED__)
-{
- closure_test_fn(*(Dbls*)args[0]);
-}
-
-int main(void)
-{
- ffi_cif cif;
-
- void *code;
- ffi_closure* pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type* cl_arg_types[1];
-
- ffi_type ts1_type;
- ffi_type* ts1_type_elements[4];
-
- Dbls arg = { 1.0, 2.0 };
-
- ts1_type.size = 0;
- ts1_type.alignment = 0;
- ts1_type.type = FFI_TYPE_STRUCT;
- ts1_type.elements = ts1_type_elements;
-
- ts1_type_elements[0] = &ffi_type_double;
- ts1_type_elements[1] = &ffi_type_double;
- ts1_type_elements[2] = NULL;
-
- cl_arg_types[0] = &ts1_type;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_void, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_gn, NULL, code) == FFI_OK);
-
- ((void (*)(Dbls))(code))(arg);
- /* { dg-output "1.0 2.0" } */
-
- closure_test_fn(arg);
- /* { dg-output "\n1.0 2.0" } */
-
- return 0;
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_double.c b/deps/libffi/testsuite/libffi.closures/cls_double.c
deleted file mode 100644
index 84ad4cb7d92..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_double.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value double.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void cls_ret_double_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
- {
- *(double *)resp = *(double *)args[0];
-
- printf("%f: %f\n",*(double *)args[0],
- *(double *)resp);
- }
-typedef double (*cls_ret_double)(double);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[2];
- double res;
-
- cl_arg_types[0] = &ffi_type_double;
- cl_arg_types[1] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_double, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_double_fn, NULL, code) == FFI_OK);
-
- res = (*((cls_ret_double)code))(21474.789);
- /* { dg-output "21474.789000: 21474.789000" } */
- printf("res: %.6f\n", res);
- /* { dg-output "\nres: 21474.789000" } */
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_double_va.c b/deps/libffi/testsuite/libffi.closures/cls_double_va.c
deleted file mode 100644
index a6c445b826e..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_double_va.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Test doubles passed in variable argument lists.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/6/2007 */
-
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-/* { dg-output "" { xfail avr32*-*-* } } */
-/* { dg-output "" { xfail mips-sgi-irix6* } } PR libffi/46660 */
-
-#include "ffitest.h"
-
-#define BUF_SIZE 50
-static char buffer[BUF_SIZE];
-
-static void
-cls_double_va_fn(ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
-{
- char* format = *(char**)args[0];
- double doubleValue = *(double*)args[1];
-
- *(ffi_arg*)resp = printf(format, doubleValue);
- CHECK(*(ffi_arg*)resp == 4);
- snprintf(buffer, BUF_SIZE, format, doubleValue);
- CHECK(strncmp(buffer, "7.0\n", 4) == 0);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args[3];
- ffi_type* arg_types[3];
-
- char* format = "%.1f\n";
- double doubleArg = 7;
- ffi_arg res = 0;
-
- arg_types[0] = &ffi_type_pointer;
- arg_types[1] = &ffi_type_double;
- arg_types[2] = NULL;
-
- /* This printf call is variadic */
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2, &ffi_type_sint,
- arg_types) == FFI_OK);
-
- args[0] = &format;
- args[1] = &doubleArg;
- args[2] = NULL;
-
- ffi_call(&cif, FFI_FN(printf), &res, args);
- /* { dg-output "7.0" } */
- printf("res: %d\n", (int) res);
- /* { dg-output "\nres: 4" } */
- CHECK(res == 4);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_double_va_fn, NULL,
- code) == FFI_OK);
-
- res = ((int(*)(char*, ...))(code))(format, doubleArg);
- /* { dg-output "\n7.0" } */
- printf("res: %d\n", (int) res);
- /* { dg-output "\nres: 4" } */
- CHECK(res == 4);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_float.c b/deps/libffi/testsuite/libffi.closures/cls_float.c
deleted file mode 100644
index 97c2ac02b7a..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_float.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value float.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void cls_ret_float_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
- {
- *(float *)resp = *(float *)args[0];
-
- printf("%g: %g\n",*(float *)args[0],
- *(float *)resp);
-
- CHECK((int)(*(float *)args[0]) == -2122);
- CHECK((int)(*(float *)resp) == -2122);
- }
-
-typedef float (*cls_ret_float)(float);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[2];
- float res;
-
- cl_arg_types[0] = &ffi_type_float;
- cl_arg_types[1] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_float, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_float_fn, NULL, code) == FFI_OK);
- res = ((((cls_ret_float)code)(-2122.12)));
- /* { dg-output "\\-2122.12: \\-2122.12" } */
- printf("res: %.6f\n", res);
- /* { dg-output "\nres: \-2122.120117" } */
- CHECK((int)res == -2122);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_longdouble.c b/deps/libffi/testsuite/libffi.closures/cls_longdouble.c
deleted file mode 100644
index ea2985f6f49..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_longdouble.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check long double arguments.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin */
-
-/* This test is known to PASS on armv7l-unknown-linux-gnueabihf, so I have
- remove the xfail for arm*-*-* below, until we know more. */
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-/* { dg-options -mlong-double-128 { target ppc64_longdouble128 } } */
-
-#include "ffitest.h"
-
-long double cls_ldouble_fn(
- long double a1,
- long double a2,
- long double a3,
- long double a4,
- long double a5,
- long double a6,
- long double a7,
- long double a8)
-{
- long double r = a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8;
-
- printf("%Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg: %Lg\n",
- a1, a2, a3, a4, a5, a6, a7, a8, r);
- CHECK(a1 == 1);
- CHECK(a2 == 2);
- CHECK(a3 == 3);
- CHECK(a4 == 4);
- CHECK(a5 == 5);
- CHECK(a6 == 6);
- CHECK(a7 == 7);
- CHECK(a8 == 8);
-
- return r;
-}
-
-static void
-cls_ldouble_gn(ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
-{
- long double a1 = *(long double*)args[0];
- long double a2 = *(long double*)args[1];
- long double a3 = *(long double*)args[2];
- long double a4 = *(long double*)args[3];
- long double a5 = *(long double*)args[4];
- long double a6 = *(long double*)args[5];
- long double a7 = *(long double*)args[6];
- long double a8 = *(long double*)args[7];
-
- *(long double*)resp = cls_ldouble_fn(
- a1, a2, a3, a4, a5, a6, a7, a8);
-}
-
-int main(void)
-{
- ffi_cif cif;
- void* code;
- ffi_closure* pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args[9];
- ffi_type* arg_types[9];
- long double res = 0;
-
- long double arg1 = 1;
- long double arg2 = 2;
- long double arg3 = 3;
- long double arg4 = 4;
- long double arg5 = 5;
- long double arg6 = 6;
- long double arg7 = 7;
- long double arg8 = 8;
-
- arg_types[0] = &ffi_type_longdouble;
- arg_types[1] = &ffi_type_longdouble;
- arg_types[2] = &ffi_type_longdouble;
- arg_types[3] = &ffi_type_longdouble;
- arg_types[4] = &ffi_type_longdouble;
- arg_types[5] = &ffi_type_longdouble;
- arg_types[6] = &ffi_type_longdouble;
- arg_types[7] = &ffi_type_longdouble;
- arg_types[8] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 8, &ffi_type_longdouble,
- arg_types) == FFI_OK);
-
- args[0] = &arg1;
- args[1] = &arg2;
- args[2] = &arg3;
- args[3] = &arg4;
- args[4] = &arg5;
- args[5] = &arg6;
- args[6] = &arg7;
- args[7] = &arg8;
- args[8] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_ldouble_fn), &res, args);
- /* { dg-output "1 2 3 4 5 6 7 8: 36" } */
- printf("res: %Lg\n", res);
- /* { dg-output "\nres: 36" } */
- CHECK(res == 36);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ldouble_gn, NULL, code) == FFI_OK);
-
- res = ((long double(*)(long double, long double, long double, long double,
- long double, long double, long double, long double))(code))(arg1, arg2,
- arg3, arg4, arg5, arg6, arg7, arg8);
- /* { dg-output "\n1 2 3 4 5 6 7 8: 36" } */
- printf("res: %Lg\n", res);
- /* { dg-output "\nres: 36" } */
- CHECK(res == 36);
-
- return 0;
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_longdouble_va.c b/deps/libffi/testsuite/libffi.closures/cls_longdouble_va.c
deleted file mode 100644
index ba32f5c8513..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_longdouble_va.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Test long doubles passed in variable argument lists.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/6/2007 */
-
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-/* { dg-output "" { xfail avr32*-*-* } } */
-/* { dg-output "" { xfail mips-sgi-irix6* } } PR libffi/46660 */
-
-#include "ffitest.h"
-#include <stdarg.h>
-
-#define BUF_SIZE 50
-static char buffer[BUF_SIZE];
-
-static int
-wrap_printf(char* fmt, ...) {
- va_list ap;
- va_start(ap, fmt);
- long double ldArg = va_arg(ap, long double);
- va_end(ap);
- CHECK((int)ldArg == 7);
- return printf(fmt, ldArg);
-}
-
-static void
-cls_longdouble_va_fn(ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
-{
- char* format = *(char**)args[0];
- long double ldValue = *(long double*)args[1];
-
- *(ffi_arg*)resp = printf(format, ldValue);
- CHECK(*(ffi_arg*)resp == 4);
- snprintf(buffer, BUF_SIZE, format, ldValue);
- CHECK(strncmp(buffer, "7.0\n", BUF_SIZE) == 0);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args[3];
- ffi_type* arg_types[3];
-
- char* format = "%.1Lf\n";
- long double ldArg = 7;
- ffi_arg res = 0;
-
- arg_types[0] = &ffi_type_pointer;
- arg_types[1] = &ffi_type_longdouble;
- arg_types[2] = NULL;
-
- /* This printf call is variadic */
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2, &ffi_type_sint,
- arg_types) == FFI_OK);
-
- args[0] = &format;
- args[1] = &ldArg;
- args[2] = NULL;
-
- ffi_call(&cif, FFI_FN(wrap_printf), &res, args);
- /* { dg-output "7.0" } */
- printf("res: %d\n", (int) res);
- /* { dg-output "\nres: 4" } */
- CHECK(res == 4);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_longdouble_va_fn, NULL,
- code) == FFI_OK);
-
- res = ((int(*)(char*, ...))(code))(format, ldArg);
- /* { dg-output "\n7.0" } */
- printf("res: %d\n", (int) res);
- /* { dg-output "\nres: 4" } */
- CHECK(res == 4);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_many_mixed_args.c b/deps/libffi/testsuite/libffi.closures/cls_many_mixed_args.c
deleted file mode 100644
index 7fd6c8207ac..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_many_mixed_args.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Area: closure_call
- Purpose: Check closures called with many args of mixed types
- Limitations: none.
- PR: none.
- Originator: <david.schneider@picle.org> */
-
-/* { dg-do run } */
-#include "ffitest.h"
-#include <float.h>
-#include <math.h>
-
-#define NARGS 16
-
-static void cls_ret_double_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- int i;
- double r = 0;
- double t;
- for(i = 0; i < NARGS; i++)
- {
- if(i == 4 || i == 9 || i == 11 || i == 13 || i == 15)
- {
- t = *(long int *)args[i];
- CHECK(t == i+1);
- }
- else
- {
- t = *(double *)args[i];
- CHECK(fabs(t - ((i+1) * 0.1)) < FLT_EPSILON);
- }
- r += t;
- }
- *(double *)resp = r;
-}
-typedef double (*cls_ret_double)(double, double, double, double, long int,
-double, double, double, double, long int, double, long int, double, long int,
-double, long int);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[NARGS];
- double res;
- int i;
- double expected = 64.9;
-
- for(i = 0; i < NARGS; i++)
- {
- if(i == 4 || i == 9 || i == 11 || i == 13 || i == 15)
- cl_arg_types[i] = &ffi_type_slong;
- else
- cl_arg_types[i] = &ffi_type_double;
- }
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, NARGS,
- &ffi_type_double, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_double_fn, NULL, code) == FFI_OK);
-
- res = (((cls_ret_double)code))(0.1, 0.2, 0.3, 0.4, 5, 0.6, 0.7, 0.8, 0.9, 10,
- 1.1, 12, 1.3, 14, 1.5, 16);
- if (fabs(res - expected) < FLT_EPSILON)
- exit(0);
- else
- abort();
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_many_mixed_float_double.c b/deps/libffi/testsuite/libffi.closures/cls_many_mixed_float_double.c
deleted file mode 100644
index 62b0697ac01..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_many_mixed_float_double.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Area: closure_call
- Purpose: Check register allocation for closure calls with many float and double arguments
- Limitations: none.
- PR: none.
- Originator: <david.schneider@picle.org> */
-
-/* { dg-do run } */
-#include "ffitest.h"
-#include <float.h>
-#include <math.h>
-
-#define NARGS 16
-
-static void cls_mixed_float_double_fn(ffi_cif* cif , void* ret, void** args,
- void* userdata __UNUSED__)
-{
- double r = 0;
- unsigned int i;
- double t;
- for(i=0; i < cif->nargs; i++)
- {
- if(cif->arg_types[i] == &ffi_type_double) {
- t = *(((double**)(args))[i]);
- } else {
- t = *(((float**)(args))[i]);
- }
- r += t;
- }
- *((double*)ret) = r;
-}
-typedef double (*cls_mixed)(double, float, double, double, double, double, double, float, float, double, float, float);
-
-int main (void)
-{
- ffi_cif cif;
- ffi_closure *closure;
- void* code;
- ffi_type *argtypes[12] = {&ffi_type_double, &ffi_type_float, &ffi_type_double,
- &ffi_type_double, &ffi_type_double, &ffi_type_double,
- &ffi_type_double, &ffi_type_float, &ffi_type_float,
- &ffi_type_double, &ffi_type_float, &ffi_type_float};
-
-
- closure = ffi_closure_alloc(sizeof(ffi_closure), (void**)&code);
- if(closure ==NULL)
- abort();
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 12, &ffi_type_double, argtypes) == FFI_OK);
- CHECK(ffi_prep_closure_loc(closure, &cif, cls_mixed_float_double_fn, NULL, code) == FFI_OK);
- double ret = ((cls_mixed)code)(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2);
- ffi_closure_free(closure);
- if(fabs(ret - 7.8) < FLT_EPSILON)
- exit(0);
- else
- abort();
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_multi_schar.c b/deps/libffi/testsuite/libffi.closures/cls_multi_schar.c
deleted file mode 100644
index 9eb02f9e3c0..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_multi_schar.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check passing of multiple signed char values.
- Limitations: none.
- PR: PR13221.
- Originator: <hos@tamanegi.org> 20031129 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static signed char test_func_fn(signed char a1, signed char a2)
-{
- signed char result;
-
- result = a1 + a2;
-
- printf("%d %d: %d\n", a1, a2, result);
-
- return result;
-
-}
-
-static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
- void *data __UNUSED__)
-{
- signed char a1, a2;
-
- a1 = *(signed char *)avals[0];
- a2 = *(signed char *)avals[1];
- CHECK(a1 == 2);
- CHECK(a2 == 125);
-
- *(ffi_arg *)rval = test_func_fn(a1, a2);
-
-}
-
-typedef signed char (*test_type)(signed char, signed char);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void * args_dbl[3];
- ffi_type * cl_arg_types[3];
- ffi_arg res_call;
- signed char a, b, res_closure;
-
- a = 2;
- b = 125;
-
- args_dbl[0] = &a;
- args_dbl[1] = &b;
- args_dbl[2] = NULL;
-
- cl_arg_types[0] = &ffi_type_schar;
- cl_arg_types[1] = &ffi_type_schar;
- cl_arg_types[2] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
- &ffi_type_schar, cl_arg_types) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
- /* { dg-output "2 125: 127" } */
- printf("res: %d\n", (signed char)res_call);
- /* { dg-output "\nres: 127" } */
- CHECK((signed char)res_call == 127);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
-
- res_closure = (*((test_type)code))(2, 125);
- /* { dg-output "\n2 125: 127" } */
- printf("res: %d\n", res_closure);
- /* { dg-output "\nres: 127" } */
- CHECK(res_closure == 127);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_multi_sshort.c b/deps/libffi/testsuite/libffi.closures/cls_multi_sshort.c
deleted file mode 100644
index 9d4db5b6c85..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_multi_sshort.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check passing of multiple signed short values.
- Limitations: none.
- PR: PR13221.
- Originator: <andreast@gcc.gnu.org> 20031129 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static signed short test_func_fn(signed short a1, signed short a2)
-{
- signed short result;
-
- result = a1 + a2;
-
- printf("%d %d: %d\n", a1, a2, result);
- CHECK(a1 == 2);
- CHECK(a2 == 32765);
- CHECK(result == 32767);
-
- return result;
-
-}
-
-static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
- void *data __UNUSED__)
-{
- signed short a1, a2;
-
- a1 = *(signed short *)avals[0];
- a2 = *(signed short *)avals[1];
-
- *(ffi_arg *)rval = test_func_fn(a1, a2);
-
-}
-
-typedef signed short (*test_type)(signed short, signed short);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void * args_dbl[3];
- ffi_type * cl_arg_types[3];
- ffi_arg res_call;
- unsigned short a, b, res_closure;
-
- a = 2;
- b = 32765;
-
- args_dbl[0] = &a;
- args_dbl[1] = &b;
- args_dbl[2] = NULL;
-
- cl_arg_types[0] = &ffi_type_sshort;
- cl_arg_types[1] = &ffi_type_sshort;
- cl_arg_types[2] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
- &ffi_type_sshort, cl_arg_types) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
- /* { dg-output "2 32765: 32767" } */
- printf("res: %d\n", (unsigned short)res_call);
- /* { dg-output "\nres: 32767" } */
- CHECK((unsigned short)res_call == 32767);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
-
- res_closure = (*((test_type)code))(2, 32765);
- /* { dg-output "\n2 32765: 32767" } */
- printf("res: %d\n", res_closure);
- /* { dg-output "\nres: 32767" } */
- CHECK(res_closure == 32767);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_multi_sshortchar.c b/deps/libffi/testsuite/libffi.closures/cls_multi_sshortchar.c
deleted file mode 100644
index 42f3ddeee8a..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_multi_sshortchar.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check passing of multiple signed short/char values.
- Limitations: none.
- PR: PR13221.
- Originator: <andreast@gcc.gnu.org> 20031129 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static signed short test_func_fn(signed char a1, signed short a2,
- signed char a3, signed short a4)
-{
- signed short result;
-
- result = a1 + a2 + a3 + a4;
-
- printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result);
-
- CHECK(a1 == 1);
- CHECK(a2 == 32765);
- CHECK(a3 == 127);
- CHECK(a4 == -128);
- CHECK(result == 32765);
-
- return result;
-
-}
-
-static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
- void *data __UNUSED__)
-{
- signed char a1, a3;
- signed short a2, a4;
-
- a1 = *(signed char *)avals[0];
- a2 = *(signed short *)avals[1];
- a3 = *(signed char *)avals[2];
- a4 = *(signed short *)avals[3];
-
- *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4);
-
-}
-
-typedef signed short (*test_type)(signed char, signed short,
- signed char, signed short);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void * args_dbl[5];
- ffi_type * cl_arg_types[5];
- ffi_arg res_call;
- signed char a, c;
- signed short b, d, res_closure;
-
- a = 1;
- b = 32765;
- c = 127;
- d = -128;
-
- args_dbl[0] = &a;
- args_dbl[1] = &b;
- args_dbl[2] = &c;
- args_dbl[3] = &d;
- args_dbl[4] = NULL;
-
- cl_arg_types[0] = &ffi_type_schar;
- cl_arg_types[1] = &ffi_type_sshort;
- cl_arg_types[2] = &ffi_type_schar;
- cl_arg_types[3] = &ffi_type_sshort;
- cl_arg_types[4] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &ffi_type_sshort, cl_arg_types) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
- /* { dg-output "1 32765 127 -128: 32765" } */
- printf("res: %d\n", (signed short)res_call);
- /* { dg-output "\nres: 32765" } */
- CHECK((signed short)res_call == 32765);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
-
- res_closure = (*((test_type)code))(1, 32765, 127, -128);
- /* { dg-output "\n1 32765 127 -128: 32765" } */
- printf("res: %d\n", res_closure);
- /* { dg-output "\nres: 32765" } */
- CHECK(res_closure == 32765);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_multi_uchar.c b/deps/libffi/testsuite/libffi.closures/cls_multi_uchar.c
deleted file mode 100644
index 76f90a02453..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_multi_uchar.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check passing of multiple unsigned char values.
- Limitations: none.
- PR: PR13221.
- Originator: <andreast@gcc.gnu.org> 20031129 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static unsigned char test_func_fn(unsigned char a1, unsigned char a2,
- unsigned char a3, unsigned char a4)
-{
- unsigned char result;
-
- result = a1 + a2 + a3 + a4;
-
- printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result);
-
- CHECK(a1 == 1);
- CHECK(a2 == 2);
- CHECK(a3 == 127);
- CHECK(a4 == 125);
- CHECK(result == 255);
-
- return result;
-
-}
-
-static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
- void *data __UNUSED__)
-{
- unsigned char a1, a2, a3, a4;
-
- a1 = *(unsigned char *)avals[0];
- a2 = *(unsigned char *)avals[1];
- a3 = *(unsigned char *)avals[2];
- a4 = *(unsigned char *)avals[3];
-
- *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4);
-
-}
-
-typedef unsigned char (*test_type)(unsigned char, unsigned char,
- unsigned char, unsigned char);
-
-void test_func(ffi_cif *cif __UNUSED__, void *rval __UNUSED__, void **avals,
- void *data __UNUSED__)
-{
- printf("%d %d %d %d\n", *(unsigned char *)avals[0],
- *(unsigned char *)avals[1], *(unsigned char *)avals[2],
- *(unsigned char *)avals[3]);
-}
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void * args_dbl[5];
- ffi_type * cl_arg_types[5];
- ffi_arg res_call;
- unsigned char a, b, c, d, res_closure;
-
- a = 1;
- b = 2;
- c = 127;
- d = 125;
-
- args_dbl[0] = &a;
- args_dbl[1] = &b;
- args_dbl[2] = &c;
- args_dbl[3] = &d;
- args_dbl[4] = NULL;
-
- cl_arg_types[0] = &ffi_type_uchar;
- cl_arg_types[1] = &ffi_type_uchar;
- cl_arg_types[2] = &ffi_type_uchar;
- cl_arg_types[3] = &ffi_type_uchar;
- cl_arg_types[4] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &ffi_type_uchar, cl_arg_types) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
- /* { dg-output "1 2 127 125: 255" } */
- printf("res: %d\n", (unsigned char)res_call);
- /* { dg-output "\nres: 255" } */
- CHECK((unsigned char)res_call == 255);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
-
- res_closure = (*((test_type)code))(1, 2, 127, 125);
- /* { dg-output "\n1 2 127 125: 255" } */
- printf("res: %d\n", res_closure);
- /* { dg-output "\nres: 255" } */
- CHECK(res_closure == 255);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_multi_ushort.c b/deps/libffi/testsuite/libffi.closures/cls_multi_ushort.c
deleted file mode 100644
index f61a62793dc..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_multi_ushort.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check passing of multiple unsigned short values.
- Limitations: none.
- PR: PR13221.
- Originator: <andreast@gcc.gnu.org> 20031129 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static unsigned short test_func_fn(unsigned short a1, unsigned short a2)
-{
- unsigned short result;
-
- result = a1 + a2;
-
- printf("%d %d: %d\n", a1, a2, result);
-
- CHECK(a1 == 2);
- CHECK(a2 == 32765);
- CHECK(result == 32767);
-
- return result;
-}
-
-static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
- void *data __UNUSED__)
-{
- unsigned short a1, a2;
-
- a1 = *(unsigned short *)avals[0];
- a2 = *(unsigned short *)avals[1];
-
- *(ffi_arg *)rval = test_func_fn(a1, a2);
-
-}
-
-typedef unsigned short (*test_type)(unsigned short, unsigned short);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void * args_dbl[3];
- ffi_type * cl_arg_types[3];
- ffi_arg res_call;
- unsigned short a, b, res_closure;
-
- a = 2;
- b = 32765;
-
- args_dbl[0] = &a;
- args_dbl[1] = &b;
- args_dbl[2] = NULL;
-
- cl_arg_types[0] = &ffi_type_ushort;
- cl_arg_types[1] = &ffi_type_ushort;
- cl_arg_types[2] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
- &ffi_type_ushort, cl_arg_types) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
- /* { dg-output "2 32765: 32767" } */
- printf("res: %d\n", (unsigned short)res_call);
- /* { dg-output "\nres: 32767" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
-
- res_closure = (*((test_type)code))(2, 32765);
- /* { dg-output "\n2 32765: 32767" } */
- printf("res: %d\n", res_closure);
- /* { dg-output "\nres: 32767" } */
- CHECK(res_closure == 32767);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_multi_ushortchar.c b/deps/libffi/testsuite/libffi.closures/cls_multi_ushortchar.c
deleted file mode 100644
index c5af5765b36..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_multi_ushortchar.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check passing of multiple unsigned short/char values.
- Limitations: none.
- PR: PR13221.
- Originator: <andreast@gcc.gnu.org> 20031129 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static unsigned short test_func_fn(unsigned char a1, unsigned short a2,
- unsigned char a3, unsigned short a4)
-{
- unsigned short result;
-
- result = a1 + a2 + a3 + a4;
-
- printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result);
-
- CHECK(a1 == 1);
- CHECK(a2 == 2);
- CHECK(a3 == 127);
- CHECK(a4 == 128);
- CHECK(result == 258);
-
- return result;
-
-}
-
-static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
- void *data __UNUSED__)
-{
- unsigned char a1, a3;
- unsigned short a2, a4;
-
- a1 = *(unsigned char *)avals[0];
- a2 = *(unsigned short *)avals[1];
- a3 = *(unsigned char *)avals[2];
- a4 = *(unsigned short *)avals[3];
-
- *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4);
-
-}
-
-typedef unsigned short (*test_type)(unsigned char, unsigned short,
- unsigned char, unsigned short);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void * args_dbl[5];
- ffi_type * cl_arg_types[5];
- ffi_arg res_call;
- unsigned char a, c;
- unsigned short b, d, res_closure;
-
- a = 1;
- b = 2;
- c = 127;
- d = 128;
-
- args_dbl[0] = &a;
- args_dbl[1] = &b;
- args_dbl[2] = &c;
- args_dbl[3] = &d;
- args_dbl[4] = NULL;
-
- cl_arg_types[0] = &ffi_type_uchar;
- cl_arg_types[1] = &ffi_type_ushort;
- cl_arg_types[2] = &ffi_type_uchar;
- cl_arg_types[3] = &ffi_type_ushort;
- cl_arg_types[4] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &ffi_type_ushort, cl_arg_types) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
- /* { dg-output "1 2 127 128: 258" } */
- printf("res: %d\n", (unsigned short)res_call);
- /* { dg-output "\nres: 258" } */
- CHECK((unsigned short)res_call == 258);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
-
- res_closure = (*((test_type)code))(1, 2, 127, 128);
- /* { dg-output "\n1 2 127 128: 258" } */
- printf("res: %d\n", res_closure);
- /* { dg-output "\nres: 258" } */
- CHECK(res_closure == 258);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_pointer.c b/deps/libffi/testsuite/libffi.closures/cls_pointer.c
deleted file mode 100644
index 73a4cba7864..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_pointer.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check pointer arguments.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/6/2007 */
-
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-#include "ffitest.h"
-
-void* cls_pointer_fn(void* a1, void* a2)
-{
- void* result = (void*)((intptr_t)a1 + (intptr_t)a2);
-
- printf("0x%08x 0x%08x: 0x%08x\n",
- (unsigned int)(uintptr_t) a1,
- (unsigned int)(uintptr_t) a2,
- (unsigned int)(uintptr_t) result);
-
- CHECK((unsigned int)(uintptr_t) a1 == 0x12345678);
- CHECK((unsigned int)(uintptr_t) a2 == 0x89abcdef);
- CHECK((unsigned int)(uintptr_t) result == 0x9be02467);
-
- return result;
-}
-
-static void
-cls_pointer_gn(ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
-{
- void* a1 = *(void**)(args[0]);
- void* a2 = *(void**)(args[1]);
-
- *(void**)resp = cls_pointer_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure* pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args[3];
- /* ffi_type cls_pointer_type; */
- ffi_type* arg_types[3];
-
-/* cls_pointer_type.size = sizeof(void*);
- cls_pointer_type.alignment = 0;
- cls_pointer_type.type = FFI_TYPE_POINTER;
- cls_pointer_type.elements = NULL;*/
-
- void* arg1 = (void*)0x12345678;
- void* arg2 = (void*)0x89abcdef;
- ffi_arg res = 0;
-
- arg_types[0] = &ffi_type_pointer;
- arg_types[1] = &ffi_type_pointer;
- arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ffi_type_pointer,
- arg_types) == FFI_OK);
-
- args[0] = &arg1;
- args[1] = &arg2;
- args[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_pointer_fn), &res, args);
- /* { dg-output "0x12345678 0x89abcdef: 0x9be02467" } */
- printf("res: 0x%08x\n", (unsigned int) res);
- /* { dg-output "\nres: 0x9be02467" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_pointer_gn, NULL, code) == FFI_OK);
-
- res = (ffi_arg)(uintptr_t)((void*(*)(void*, void*))(code))(arg1, arg2);
- /* { dg-output "\n0x12345678 0x89abcdef: 0x9be02467" } */
- printf("res: 0x%08x\n", (unsigned int) res);
- /* { dg-output "\nres: 0x9be02467" } */
- CHECK(res == 0x9be02467);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_pointer_stack.c b/deps/libffi/testsuite/libffi.closures/cls_pointer_stack.c
deleted file mode 100644
index 2054f254766..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_pointer_stack.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check pointer arguments across multiple hideous stack frames.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/7/2007 */
-
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-#include "ffitest.h"
-
-static long dummyVar;
-
-long dummy_func(
- long double a1, char b1,
- long double a2, char b2,
- long double a3, char b3,
- long double a4, char b4)
-{
- return a1 + b1 + a2 + b2 + a3 + b3 + a4 + b4;
-}
-
-void* cls_pointer_fn2(void* a1, void* a2)
-{
- long double trample1 = (intptr_t)a1 + (intptr_t)a2;
- char trample2 = ((char*)&a1)[0] + ((char*)&a2)[0];
- long double trample3 = (intptr_t)trample1 + (intptr_t)a1;
- char trample4 = trample2 + ((char*)&a1)[1];
- long double trample5 = (intptr_t)trample3 + (intptr_t)a2;
- char trample6 = trample4 + ((char*)&a2)[1];
- long double trample7 = (intptr_t)trample5 + (intptr_t)trample1;
- char trample8 = trample6 + trample2;
- void* result;
-
- dummyVar = dummy_func(trample1, trample2, trample3, trample4,
- trample5, trample6, trample7, trample8);
-
- result = (void*)((intptr_t)a1 + (intptr_t)a2);
-
- printf("0x%08x 0x%08x: 0x%08x\n",
- (unsigned int)(uintptr_t) a1,
- (unsigned int)(uintptr_t) a2,
- (unsigned int)(uintptr_t) result);
-
- CHECK((unsigned int)(uintptr_t) a1 == 0x8acf1356);
- CHECK((unsigned int)(uintptr_t) a2 == 0x01234567);
- CHECK((unsigned int)(uintptr_t) result == 0x8bf258bd);
-
- return result;
-}
-
-void* cls_pointer_fn1(void* a1, void* a2)
-{
- long double trample1 = (intptr_t)a1 + (intptr_t)a2;
- char trample2 = ((char*)&a1)[0] + ((char*)&a2)[0];
- long double trample3 = (intptr_t)trample1 + (intptr_t)a1;
- char trample4 = trample2 + ((char*)&a1)[1];
- long double trample5 = (intptr_t)trample3 + (intptr_t)a2;
- char trample6 = trample4 + ((char*)&a2)[1];
- long double trample7 = (intptr_t)trample5 + (intptr_t)trample1;
- char trample8 = trample6 + trample2;
- void* result;
-
- dummyVar = dummy_func(trample1, trample2, trample3, trample4,
- trample5, trample6, trample7, trample8);
-
- result = (void*)((intptr_t)a1 + (intptr_t)a2);
-
- printf("0x%08x 0x%08x: 0x%08x\n",
- (unsigned int)(intptr_t) a1,
- (unsigned int)(intptr_t) a2,
- (unsigned int)(intptr_t) result);
-
- CHECK((unsigned int)(uintptr_t) a1 == 0x01234567);
- CHECK((unsigned int)(uintptr_t) a2 == 0x89abcdef);
- CHECK((unsigned int)(uintptr_t) result == 0x8acf1356);
-
- result = cls_pointer_fn2(result, a1);
-
- return result;
-}
-
-static void
-cls_pointer_gn(ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
-{
- void* a1 = *(void**)(args[0]);
- void* a2 = *(void**)(args[1]);
-
- long double trample1 = (intptr_t)a1 + (intptr_t)a2;
- char trample2 = ((char*)&a1)[0] + ((char*)&a2)[0];
- long double trample3 = (intptr_t)trample1 + (intptr_t)a1;
- char trample4 = trample2 + ((char*)&a1)[1];
- long double trample5 = (intptr_t)trample3 + (intptr_t)a2;
- char trample6 = trample4 + ((char*)&a2)[1];
- long double trample7 = (intptr_t)trample5 + (intptr_t)trample1;
- char trample8 = trample6 + trample2;
-
- dummyVar = dummy_func(trample1, trample2, trample3, trample4,
- trample5, trample6, trample7, trample8);
-
- *(void**)resp = cls_pointer_fn1(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure* pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args[3];
- /* ffi_type cls_pointer_type; */
- ffi_type* arg_types[3];
-
-/* cls_pointer_type.size = sizeof(void*);
- cls_pointer_type.alignment = 0;
- cls_pointer_type.type = FFI_TYPE_POINTER;
- cls_pointer_type.elements = NULL;*/
-
- void* arg1 = (void*)0x01234567;
- void* arg2 = (void*)0x89abcdef;
- ffi_arg res = 0;
-
- arg_types[0] = &ffi_type_pointer;
- arg_types[1] = &ffi_type_pointer;
- arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ffi_type_pointer,
- arg_types) == FFI_OK);
-
- args[0] = &arg1;
- args[1] = &arg2;
- args[2] = NULL;
-
- printf("\n");
- ffi_call(&cif, FFI_FN(cls_pointer_fn1), &res, args);
-
- printf("res: 0x%08x\n", (unsigned int) res);
- /* { dg-output "\n0x01234567 0x89abcdef: 0x8acf1356" } */
- /* { dg-output "\n0x8acf1356 0x01234567: 0x8bf258bd" } */
- /* { dg-output "\nres: 0x8bf258bd" } */
- CHECK(res == 0x8bf258bd);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_pointer_gn, NULL, code) == FFI_OK);
-
- res = (ffi_arg)(uintptr_t)((void*(*)(void*, void*))(code))(arg1, arg2);
-
- printf("res: 0x%08x\n", (unsigned int) res);
- /* { dg-output "\n0x01234567 0x89abcdef: 0x8acf1356" } */
- /* { dg-output "\n0x8acf1356 0x01234567: 0x8bf258bd" } */
- /* { dg-output "\nres: 0x8bf258bd" } */
- CHECK(res == 0x8bf258bd);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_schar.c b/deps/libffi/testsuite/libffi.closures/cls_schar.c
deleted file mode 100644
index 22446c3171c..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_schar.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value schar.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20031108 */
-
-
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void cls_ret_schar_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- *(ffi_arg*)resp = *(signed char *)args[0];
- printf("%d: %d\n",*(signed char *)args[0],
- (int)*(ffi_arg *)(resp));
- CHECK(*(signed char *)args[0] == 127);
- CHECK((int)*(ffi_arg *)(resp) == 127);
-}
-typedef signed char (*cls_ret_schar)(signed char);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[2];
- signed char res;
-
- cl_arg_types[0] = &ffi_type_schar;
- cl_arg_types[1] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_schar, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_schar_fn, NULL, code) == FFI_OK);
-
- res = (*((cls_ret_schar)code))(127);
- /* { dg-output "127: 127" } */
- printf("res: %d\n", res);
- /* { dg-output "\nres: 127" } */
- CHECK(res == 127);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_sint.c b/deps/libffi/testsuite/libffi.closures/cls_sint.c
deleted file mode 100644
index a3f72c1298a..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_sint.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value sint32.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20031108 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void cls_ret_sint_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- *(ffi_arg*)resp = *(signed int *)args[0];
- printf("%d: %d\n",*(signed int *)args[0],
- (int)*(ffi_arg *)(resp));
- CHECK(*(signed int *)args[0] == 65534);
- CHECK((int)*(ffi_arg *)(resp) == 65534);
-}
-typedef signed int (*cls_ret_sint)(signed int);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[2];
- signed int res;
-
- cl_arg_types[0] = &ffi_type_sint;
- cl_arg_types[1] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_sint_fn, NULL, code) == FFI_OK);
-
- res = (*((cls_ret_sint)code))(65534);
- /* { dg-output "65534: 65534" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 65534" } */
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_sshort.c b/deps/libffi/testsuite/libffi.closures/cls_sshort.c
deleted file mode 100644
index 8061a0296da..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_sshort.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value sshort.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20031108 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void cls_ret_sshort_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- *(ffi_arg*)resp = *(signed short *)args[0];
- printf("%d: %d\n",*(signed short *)args[0],
- (int)*(ffi_arg *)(resp));
- CHECK(*(signed short *)args[0] == 255);
- CHECK((int)*(ffi_arg *)(resp) == 255);
-}
-typedef signed short (*cls_ret_sshort)(signed short);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[2];
- signed short res;
-
- cl_arg_types[0] = &ffi_type_sshort;
- cl_arg_types[1] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_sshort, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_sshort_fn, NULL, code) == FFI_OK);
-
- res = (*((cls_ret_sshort)code))(255);
- /* { dg-output "255: 255" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 255" } */
- CHECK(res == 255);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_struct_fp_return.c b/deps/libffi/testsuite/libffi.closures/cls_struct_fp_return.c
deleted file mode 100644
index 35583b6ed18..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_struct_fp_return.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check return values of structs with one or two floating-point
- fields.
- Limitations: none.
- PR: none. */
-
-/* { dg-do run { xfail mips64*-*-* } } */
-/* XFAIL: mips N64 ABI bug in complex-float/longdouble args and fp-struct
- returns; see libffi issue #1071. */
-
-#include "ffitest.h"
-
-/* Several ABIs return these structs in floating-point registers, or with
- soft float in pairs of GPRs that differ from those used for other small
- structs, so they need their own return paths in ffi_call and in
- closures. */
-
-typedef struct { float a; } s_f;
-typedef struct { double a; } s_d;
-typedef struct { float a; float b; } s_ff;
-typedef struct { double a; double b; } s_dd;
-typedef struct { float a; double b; } s_fd;
-typedef struct { double a; float b; } s_df;
-
-#define DEFINE(name, eq, ...) \
-static name ABI_ATTR \
-fn_##name (int k) \
-{ \
- name r = { __VA_ARGS__ }; \
- return r; \
-} \
- \
-static void \
-cls_##name (ffi_cif *cif __UNUSED__, void *resp, void **argv, \
- void *userdata __UNUSED__) \
-{ \
- *(name *) resp = fn_##name (*(int *) argv[0]); \
-} \
- \
-static int \
-eq_##name (name x, name y) \
-{ \
- return eq; \
-}
-
-#define EQ1 (x.a == y.a)
-#define EQ2 (x.a == y.a && x.b == y.b)
-
-DEFINE (s_f, EQ1, 1.5f * k)
-DEFINE (s_d, EQ1, 2.5 * k)
-DEFINE (s_ff, EQ2, 1.5f * k, -0.25f * k)
-DEFINE (s_dd, EQ2, 2.5 * k, -0.75 * k)
-DEFINE (s_fd, EQ2, 1.5f * k, -0.75 * k)
-DEFINE (s_df, EQ2, 2.5 * k, -0.25f * k)
-
-#define CHECK_ONE(name, type1, type2) \
- do { \
- ffi_type *elements[3] = { type1, type2, NULL }; \
- ffi_type type; \
- ffi_type *args[1] = { &ffi_type_sint }; \
- void *values[1] = { &k }; \
- ffi_cif cif; \
- ffi_closure *pcl; \
- void *code; \
- union { ffi_arg align; name value; } result; \
- name want = fn_##name (k), got; \
- \
- type.size = 0; \
- type.alignment = 0; \
- type.type = FFI_TYPE_STRUCT; \
- type.elements = elements; \
- CHECK (ffi_prep_cif (&cif, ABI_NUM, 1, &type, args) == FFI_OK); \
- \
- memset (&result, 0, sizeof (result)); \
- ffi_call (&cif, FFI_FN (fn_##name), &result, values); \
- CHECK (eq_##name (result.value, want)); \
- \
- pcl = ffi_closure_alloc (sizeof (ffi_closure), &code); \
- CHECK (pcl != NULL); \
- CHECK (ffi_prep_closure_loc (pcl, &cif, cls_##name, NULL, code) \
- == FFI_OK); \
- memset (&got, 0, sizeof (got)); \
- got = ((name (ABI_ATTR *)(int)) code) (k); \
- CHECK (eq_##name (got, want)); \
- ffi_closure_free (pcl); \
- printf ("%s: ok\n", #name); \
- } while (0)
-
-int
-main (void)
-{
- int k = 3;
-
- CHECK_ONE (s_f, &ffi_type_float, NULL);
- CHECK_ONE (s_d, &ffi_type_double, NULL);
- CHECK_ONE (s_ff, &ffi_type_float, &ffi_type_float);
- CHECK_ONE (s_dd, &ffi_type_double, &ffi_type_double);
- CHECK_ONE (s_fd, &ffi_type_float, &ffi_type_double);
- CHECK_ONE (s_df, &ffi_type_double, &ffi_type_float);
-
- exit (0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_struct_ld_return.c b/deps/libffi/testsuite/libffi.closures/cls_struct_ld_return.c
deleted file mode 100644
index cb831d65b69..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_struct_ld_return.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check the return value of a struct with one long double field.
- Limitations: none.
- PR: none. */
-
-/* { dg-do run { xfail mips64*-*-* x86_64-*-linux-android* } } */
-/* XFAIL: mips N64 mishandles long-double struct returns (libffi issue
- #1071). x86_64 Android mishandles the long-double struct return where
- x86_64-linux-gnu does not (libffi issue #1076). */
-/* { dg-options -mlong-double-128 { target ppc64_longdouble128 } } */
-
-#include "ffitest.h"
-
-/* x86-64 returns this struct in %st(0), like a plain long double. */
-
-typedef struct { long double a; } s_ld;
-
-static s_ld ABI_ATTR
-fn_s_ld (int k)
-{
- s_ld r = { 1.5L * k };
- return r;
-}
-
-static void
-cls_s_ld (ffi_cif *cif __UNUSED__, void *resp, void **argv,
- void *userdata __UNUSED__)
-{
- *(s_ld *) resp = fn_s_ld (*(int *) argv[0]);
-}
-
-int
-main (void)
-{
- ffi_type *elements[2] = { &ffi_type_longdouble, NULL };
- ffi_type type;
- ffi_type *args[1] = { &ffi_type_sint };
- int k = 3;
- void *values[1] = { &k };
- ffi_cif cif;
- ffi_closure *pcl;
- void *code;
- s_ld got;
-
- type.size = 0;
- type.alignment = 0;
- type.type = FFI_TYPE_STRUCT;
- type.elements = elements;
- CHECK (ffi_prep_cif (&cif, ABI_NUM, 1, &type, args) == FFI_OK);
-
- memset (&got, 0, sizeof (got));
- ffi_call (&cif, FFI_FN (fn_s_ld), &got, values);
- printf ("ffi_call: %Lg\n", got.a);
- CHECK (got.a == 4.5L);
-
- pcl = ffi_closure_alloc (sizeof (ffi_closure), &code);
- CHECK (pcl != NULL);
- CHECK (ffi_prep_closure_loc (pcl, &cif, cls_s_ld, NULL, code) == FFI_OK);
- memset (&got, 0, sizeof (got));
- got = ((s_ld (ABI_ATTR *)(int)) code) (k + 1);
- printf ("closure: %Lg\n", got.a);
- CHECK (got.a == 6.0L);
- ffi_closure_free (pcl);
-
- exit (0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_struct_va1.c b/deps/libffi/testsuite/libffi.closures/cls_struct_va1.c
deleted file mode 100644
index c59a27f3d91..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_struct_va1.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Test doubles passed in variable argument lists.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/6/2007 */
-
-/* { dg-do run } */
-/* { dg-output "" { xfail avr32*-*-* } } */
-#include "ffitest.h"
-
-struct small_tag
-{
- unsigned char a;
- unsigned char b;
-};
-
-struct large_tag
-{
- unsigned a;
- unsigned b;
- unsigned c;
- unsigned d;
- unsigned e;
-};
-
-static void
-test_fn (ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
-{
- int n = *(int*)args[0];
- struct small_tag s1 = * (struct small_tag *) args[1];
- struct large_tag l1 = * (struct large_tag *) args[2];
- struct small_tag s2 = * (struct small_tag *) args[3];
-
- printf ("%d %d %d %d %d %d %d %d %d %d\n", n, s1.a, s1.b,
- l1.a, l1.b, l1.c, l1.d, l1.e,
- s2.a, s2.b);
- CHECK(n == 4);
- CHECK(s1.a == 5);
- CHECK(s1.b == 6);
- CHECK(l1.a == 10);
- CHECK(l1.b == 11);
- CHECK(l1.c == 12);
- CHECK(l1.d == 13);
- CHECK(l1.e == 14);
- CHECK(s2.a == 20);
- CHECK(s2.b == 21);
- * (ffi_arg*) resp = 42;
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc (sizeof (ffi_closure), &code);
- ffi_type* arg_types[5];
-
- ffi_arg res = 0;
-
- ffi_type s_type;
- ffi_type *s_type_elements[3];
-
- ffi_type l_type;
- ffi_type *l_type_elements[6];
-
- struct small_tag s1;
- struct small_tag s2;
- struct large_tag l1;
-
- int si;
-
- s_type.size = 0;
- s_type.alignment = 0;
- s_type.type = FFI_TYPE_STRUCT;
- s_type.elements = s_type_elements;
-
- s_type_elements[0] = &ffi_type_uchar;
- s_type_elements[1] = &ffi_type_uchar;
- s_type_elements[2] = NULL;
-
- l_type.size = 0;
- l_type.alignment = 0;
- l_type.type = FFI_TYPE_STRUCT;
- l_type.elements = l_type_elements;
-
- l_type_elements[0] = &ffi_type_uint;
- l_type_elements[1] = &ffi_type_uint;
- l_type_elements[2] = &ffi_type_uint;
- l_type_elements[3] = &ffi_type_uint;
- l_type_elements[4] = &ffi_type_uint;
- l_type_elements[5] = NULL;
-
- arg_types[0] = &ffi_type_sint;
- arg_types[1] = &s_type;
- arg_types[2] = &l_type;
- arg_types[3] = &s_type;
- arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 4, &ffi_type_sint,
- arg_types) == FFI_OK);
-
- si = 4;
- s1.a = 5;
- s1.b = 6;
-
- s2.a = 20;
- s2.b = 21;
-
- l1.a = 10;
- l1.b = 11;
- l1.c = 12;
- l1.d = 13;
- l1.e = 14;
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, test_fn, NULL, code) == FFI_OK);
-
- res = ((int (*)(int, ...))(code))(si, s1, l1, s2);
- /* { dg-output "4 5 6 10 11 12 13 14 20 21" } */
- printf("res: %d\n", (int) res);
- /* { dg-output "\nres: 42" } */
- CHECK(res == 42);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_uchar.c b/deps/libffi/testsuite/libffi.closures/cls_uchar.c
deleted file mode 100644
index aa2023ffd85..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_uchar.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value uchar.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void cls_ret_uchar_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- *(ffi_arg*)resp = *(unsigned char *)args[0];
- printf("%d: %d\n",*(unsigned char *)args[0],
- (int)*(ffi_arg *)(resp));
- CHECK(*(unsigned char *)args[0] == 127);
- CHECK((int)*(ffi_arg *)(resp) == 127);
-}
-typedef unsigned char (*cls_ret_uchar)(unsigned char);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[2];
- unsigned char res;
-
- cl_arg_types[0] = &ffi_type_uchar;
- cl_arg_types[1] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_uchar, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_uchar_fn, NULL, code) == FFI_OK);
-
- res = (*((cls_ret_uchar)code))(127);
- /* { dg-output "127: 127" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 127" } */
- CHECK(res == 127);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_uint.c b/deps/libffi/testsuite/libffi.closures/cls_uint.c
deleted file mode 100644
index 23b88de2d0f..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_uint.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value uint.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void cls_ret_uint_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- *(ffi_arg *)resp = *(unsigned int *)args[0];
-
- printf("%d: %d\n",*(unsigned int *)args[0],
- (int)*(ffi_arg *)(resp));
-
- CHECK(*(unsigned int *)args[0] == 2147483647);
- CHECK((int)*(ffi_arg *)(resp) == 2147483647);
-}
-typedef unsigned int (*cls_ret_uint)(unsigned int);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[2];
- unsigned int res;
-
- cl_arg_types[0] = &ffi_type_uint;
- cl_arg_types[1] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_uint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_uint_fn, NULL, code) == FFI_OK);
-
- res = (*((cls_ret_uint)code))(2147483647);
- /* { dg-output "2147483647: 2147483647" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 2147483647" } */
- CHECK(res == 2147483647);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_uint_va.c b/deps/libffi/testsuite/libffi.closures/cls_uint_va.c
deleted file mode 100644
index 0048a02d489..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_uint_va.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Area: closure_call
- Purpose: Test anonymous unsigned int argument.
- Limitations: none.
- PR: none.
- Originator: ARM Ltd. */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-typedef unsigned int T;
-
-static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
- {
- *(ffi_arg *)resp = *(T *)args[0];
-
- printf("%d: %d %d\n", (int)*(ffi_arg *)resp, *(T *)args[0], *(T *)args[1]);
- CHECK(*(T *)args[0] == 67);
- CHECK(*(T *)args[1] == 4);
- CHECK((int)*(ffi_arg *)resp == 67);
- }
-
-typedef T (*cls_ret_T)(T, ...);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[3];
- T res;
-
- cl_arg_types[0] = &ffi_type_uint;
- cl_arg_types[1] = &ffi_type_uint;
- cl_arg_types[2] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2,
- &ffi_type_uint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_T_fn, NULL, code) == FFI_OK);
- res = ((((cls_ret_T)code)(67, 4)));
- /* { dg-output "67: 67 4" } */
- printf("res: %d\n", res);
- /* { dg-output "\nres: 67" } */
- CHECK(res == 67);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_ulong_va.c b/deps/libffi/testsuite/libffi.closures/cls_ulong_va.c
deleted file mode 100644
index 79f41706a3c..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_ulong_va.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Area: closure_call
- Purpose: Test anonymous unsigned long argument.
- Limitations: none.
- PR: none.
- Originator: ARM Ltd. */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-typedef unsigned long T;
-
-static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
- {
- *(T *)resp = *(T *)args[0];
-
- printf("%ld: %ld %ld\n", *(T *)resp, *(T *)args[0], *(T *)args[1]);
- CHECK(*(T *)args[0] == 67);
- CHECK(*(T *)args[1] == 4);
- CHECK(*(T *)resp == 67);
- }
-
-typedef T (*cls_ret_T)(T, ...);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[3];
- T res;
-
- cl_arg_types[0] = &ffi_type_ulong;
- cl_arg_types[1] = &ffi_type_ulong;
- cl_arg_types[2] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2,
- &ffi_type_ulong, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_T_fn, NULL, code) == FFI_OK);
- res = ((((cls_ret_T)code)(67, 4)));
- /* { dg-output "67: 67 4" } */
- printf("res: %ld\n", res);
- /* { dg-output "\nres: 67" } */
- CHECK(res == 67);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_ulonglong.c b/deps/libffi/testsuite/libffi.closures/cls_ulonglong.c
deleted file mode 100644
index 813bb2eff03..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_ulonglong.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value long long.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-/* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
-#include "ffitest.h"
-
-static void cls_ret_ulonglong_fn(ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
-{
- *(unsigned long long *)resp= 0xfffffffffffffffLL ^ *(unsigned long long *)args[0];
-
- printf("%" PRIuLL ": %" PRIuLL "\n",*(unsigned long long *)args[0],
- *(unsigned long long *)(resp));
-}
-typedef unsigned long long (*cls_ret_ulonglong)(unsigned long long);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[2];
- unsigned long long res;
-
- cl_arg_types[0] = &ffi_type_uint64;
- cl_arg_types[1] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_uint64, cl_arg_types) == FFI_OK);
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_ulonglong_fn, NULL, code) == FFI_OK);
- res = (*((cls_ret_ulonglong)code))(214LL);
- /* { dg-output "214: 1152921504606846761" } */
- printf("res: %" PRIdLL "\n", res);
- /* { dg-output "\nres: 1152921504606846761" } */
- CHECK(res == 1152921504606846761LL);
-
- res = (*((cls_ret_ulonglong)code))(9223372035854775808LL);
- /* { dg-output "\n9223372035854775808: 8070450533247928831" } */
- printf("res: %" PRIdLL "\n", res);
- /* { dg-output "\nres: 8070450533247928831" } */
- CHECK(res == 8070450533247928831LL);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/cls_ushort.c b/deps/libffi/testsuite/libffi.closures/cls_ushort.c
deleted file mode 100644
index bfe5e657c17..00000000000
--- a/deps/libffi/testsuite/libffi.closures/cls_ushort.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value ushort.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void cls_ret_ushort_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- *(ffi_arg*)resp = *(unsigned short *)args[0];
-
- printf("%d: %d\n",*(unsigned short *)args[0],
- (int)*(ffi_arg *)(resp));
- CHECK(*(unsigned short *)args[0] == 65535);
- CHECK((int)*(ffi_arg *)(resp) == 65535);
-}
-typedef unsigned short (*cls_ret_ushort)(unsigned short);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[2];
- unsigned short res;
-
- cl_arg_types[0] = &ffi_type_ushort;
- cl_arg_types[1] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_ushort, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_ushort_fn, NULL, code) == FFI_OK);
-
- res = (*((cls_ret_ushort)code))(65535);
- /* { dg-output "65535: 65535" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 65535" } */
- CHECK(res == 65535);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/err_bad_abi.c b/deps/libffi/testsuite/libffi.closures/err_bad_abi.c
deleted file mode 100644
index f5a73179ec9..00000000000
--- a/deps/libffi/testsuite/libffi.closures/err_bad_abi.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Area: ffi_prep_cif, ffi_prep_closure
- Purpose: Test error return for bad ABIs.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/6/2007 */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-static void
-dummy_fn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__,
- void** args __UNUSED__, void* userdata __UNUSED__)
-{}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type* arg_types[1];
-
- arg_types[0] = NULL;
-
- CHECK(ffi_prep_cif(&cif, 255, 0, &ffi_type_void,
- arg_types) == FFI_BAD_ABI);
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, &ffi_type_void,
- arg_types) == FFI_OK);
-
- cif.abi= 255;
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, dummy_fn, NULL, code) == FFI_BAD_ABI);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/ffitest.h b/deps/libffi/testsuite/libffi.closures/ffitest.h
deleted file mode 100644
index d27d362d6a6..00000000000
--- a/deps/libffi/testsuite/libffi.closures/ffitest.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../libffi.call/ffitest.h"
diff --git a/deps/libffi/testsuite/libffi.closures/huge_struct.c b/deps/libffi/testsuite/libffi.closures/huge_struct.c
deleted file mode 100644
index 040973d37ea..00000000000
--- a/deps/libffi/testsuite/libffi.closures/huge_struct.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check large structure returns.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/18/2007
-*/
-
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-/* { dg-options -mlong-double-128 { target ppc64_longdouble128 } } */
-/* { dg-options -Wformat=0 { target moxie*-*-elf or1k-*-* } } */
-
-#include <inttypes.h>
-
-#include "ffitest.h"
-
-typedef struct BigStruct{
- uint8_t a;
- int8_t b;
- uint16_t c;
- int16_t d;
- uint32_t e;
- int32_t f;
- uint64_t g;
- int64_t h;
- float i;
- double j;
- long double k;
- char* l;
- uint8_t m;
- int8_t n;
- uint16_t o;
- int16_t p;
- uint32_t q;
- int32_t r;
- uint64_t s;
- int64_t t;
- float u;
- double v;
- long double w;
- char* x;
- uint8_t y;
- int8_t z;
- uint16_t aa;
- int16_t bb;
- uint32_t cc;
- int32_t dd;
- uint64_t ee;
- int64_t ff;
- float gg;
- double hh;
- long double ii;
- char* jj;
- uint8_t kk;
- int8_t ll;
- uint16_t mm;
- int16_t nn;
- uint32_t oo;
- int32_t pp;
- uint64_t qq;
- int64_t rr;
- float ss;
- double tt;
- long double uu;
- char* vv;
- uint8_t ww;
- int8_t xx;
-} BigStruct;
-
-BigStruct
-test_large_fn(
- uint8_t ui8_1,
- int8_t si8_1,
- uint16_t ui16_1,
- int16_t si16_1,
- uint32_t ui32_1,
- int32_t si32_1,
- uint64_t ui64_1,
- int64_t si64_1,
- float f_1,
- double d_1,
- long double ld_1,
- char* p_1,
- uint8_t ui8_2,
- int8_t si8_2,
- uint16_t ui16_2,
- int16_t si16_2,
- uint32_t ui32_2,
- int32_t si32_2,
- uint64_t ui64_2,
- int64_t si64_2,
- float f_2,
- double d_2,
- long double ld_2,
- char* p_2,
- uint8_t ui8_3,
- int8_t si8_3,
- uint16_t ui16_3,
- int16_t si16_3,
- uint32_t ui32_3,
- int32_t si32_3,
- uint64_t ui64_3,
- int64_t si64_3,
- float f_3,
- double d_3,
- long double ld_3,
- char* p_3,
- uint8_t ui8_4,
- int8_t si8_4,
- uint16_t ui16_4,
- int16_t si16_4,
- uint32_t ui32_4,
- int32_t si32_4,
- uint64_t ui64_4,
- int64_t si64_4,
- float f_4,
- double d_4,
- long double ld_4,
- char* p_4,
- uint8_t ui8_5,
- int8_t si8_5)
-{
- BigStruct retVal = {
- ui8_1 + 1, si8_1 + 1, ui16_1 + 1, si16_1 + 1, ui32_1 + 1, si32_1 + 1,
- ui64_1 + 1, si64_1 + 1, f_1 + 1, d_1 + 1, ld_1 + 1, (char*)((intptr_t)p_1 + 1),
- ui8_2 + 2, si8_2 + 2, ui16_2 + 2, si16_2 + 2, ui32_2 + 2, si32_2 + 2,
- ui64_2 + 2, si64_2 + 2, f_2 + 2, d_2 + 2, ld_2 + 2, (char*)((intptr_t)p_2 + 2),
- ui8_3 + 3, si8_3 + 3, ui16_3 + 3, si16_3 + 3, ui32_3 + 3, si32_3 + 3,
- ui64_3 + 3, si64_3 + 3, f_3 + 3, d_3 + 3, ld_3 + 3, (char*)((intptr_t)p_3 + 3),
- ui8_4 + 4, si8_4 + 4, ui16_4 + 4, si16_4 + 4, ui32_4 + 4, si32_4 + 4,
- ui64_4 + 4, si64_4 + 4, f_4 + 4, d_4 + 4, ld_4 + 4, (char*)((intptr_t)p_4 + 4),
- ui8_5 + 5, si8_5 + 5};
-
- printf("%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 ": "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 "\n",
- ui8_1, si8_1, ui16_1, si16_1, ui32_1, si32_1, ui64_1, si64_1, f_1, d_1, ld_1, (long)(intptr_t)p_1,
- ui8_2, si8_2, ui16_2, si16_2, ui32_2, si32_2, ui64_2, si64_2, f_2, d_2, ld_2, (long)(intptr_t)p_2,
- ui8_3, si8_3, ui16_3, si16_3, ui32_3, si32_3, ui64_3, si64_3, f_3, d_3, ld_3, (long)(intptr_t)p_3,
- ui8_4, si8_4, ui16_4, si16_4, ui32_4, si32_4, ui64_4, si64_4, f_4, d_4, ld_4, (long)(intptr_t)p_4, ui8_5, si8_5,
- retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f,
- retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (long)(intptr_t)retVal.l,
- retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r,
- retVal.s, retVal.t, retVal.u, retVal.v, retVal.w, (long)(intptr_t)retVal.x,
- retVal.y, retVal.z, retVal.aa, retVal.bb, retVal.cc, retVal.dd,
- retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (long)(intptr_t)retVal.jj,
- retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp,
- retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (long)(intptr_t)retVal.vv, retVal.ww, retVal.xx);
-
- return retVal;
-}
-
-static void
-cls_large_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__)
-{
- uint8_t ui8_1 = *(uint8_t*)args[0];
- int8_t si8_1 = *(int8_t*)args[1];
- uint16_t ui16_1 = *(uint16_t*)args[2];
- int16_t si16_1 = *(int16_t*)args[3];
- uint32_t ui32_1 = *(uint32_t*)args[4];
- int32_t si32_1 = *(int32_t*)args[5];
- uint64_t ui64_1 = *(uint64_t*)args[6];
- int64_t si64_1 = *(int64_t*)args[7];
- float f_1 = *(float*)args[8];
- double d_1 = *(double*)args[9];
- long double ld_1 = *(long double*)args[10];
- char* p_1 = *(char**)args[11];
- uint8_t ui8_2 = *(uint8_t*)args[12];
- int8_t si8_2 = *(int8_t*)args[13];
- uint16_t ui16_2 = *(uint16_t*)args[14];
- int16_t si16_2 = *(int16_t*)args[15];
- uint32_t ui32_2 = *(uint32_t*)args[16];
- int32_t si32_2 = *(int32_t*)args[17];
- uint64_t ui64_2 = *(uint64_t*)args[18];
- int64_t si64_2 = *(int64_t*)args[19];
- float f_2 = *(float*)args[20];
- double d_2 = *(double*)args[21];
- long double ld_2 = *(long double*)args[22];
- char* p_2 = *(char**)args[23];
- uint8_t ui8_3 = *(uint8_t*)args[24];
- int8_t si8_3 = *(int8_t*)args[25];
- uint16_t ui16_3 = *(uint16_t*)args[26];
- int16_t si16_3 = *(int16_t*)args[27];
- uint32_t ui32_3 = *(uint32_t*)args[28];
- int32_t si32_3 = *(int32_t*)args[29];
- uint64_t ui64_3 = *(uint64_t*)args[30];
- int64_t si64_3 = *(int64_t*)args[31];
- float f_3 = *(float*)args[32];
- double d_3 = *(double*)args[33];
- long double ld_3 = *(long double*)args[34];
- char* p_3 = *(char**)args[35];
- uint8_t ui8_4 = *(uint8_t*)args[36];
- int8_t si8_4 = *(int8_t*)args[37];
- uint16_t ui16_4 = *(uint16_t*)args[38];
- int16_t si16_4 = *(int16_t*)args[39];
- uint32_t ui32_4 = *(uint32_t*)args[40];
- int32_t si32_4 = *(int32_t*)args[41];
- uint64_t ui64_4 = *(uint64_t*)args[42];
- int64_t si64_4 = *(int64_t*)args[43];
- float f_4 = *(float*)args[44];
- double d_4 = *(double*)args[45];
- long double ld_4 = *(long double*)args[46];
- char* p_4 = *(char**)args[47];
- uint8_t ui8_5 = *(uint8_t*)args[48];
- int8_t si8_5 = *(int8_t*)args[49];
-
- *(BigStruct*)resp = test_large_fn(
- ui8_1, si8_1, ui16_1, si16_1, ui32_1, si32_1, ui64_1, si64_1, f_1, d_1, ld_1, p_1,
- ui8_2, si8_2, ui16_2, si16_2, ui32_2, si32_2, ui64_2, si64_2, f_2, d_2, ld_2, p_2,
- ui8_3, si8_3, ui16_3, si16_3, ui32_3, si32_3, ui64_3, si64_3, f_3, d_3, ld_3, p_3,
- ui8_4, si8_4, ui16_4, si16_4, ui32_4, si32_4, ui64_4, si64_4, f_4, d_4, ld_4, p_4,
- ui8_5, si8_5);
-}
-
-int main (void)
-{
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
-
- ffi_cif cif;
- ffi_type* argTypes[51];
- void* argValues[51];
-
- ffi_type ret_struct_type;
- ffi_type* st_fields[51];
- BigStruct retVal;
-
- uint8_t ui8 = 1;
- int8_t si8 = 2;
- uint16_t ui16 = 3;
- int16_t si16 = 4;
- uint32_t ui32 = 5;
- int32_t si32 = 6;
- uint64_t ui64 = 7;
- int64_t si64 = 8;
- float f = 9;
- double d = 10;
- long double ld = 11;
- char* p = (char*)0x12345678;
-
- memset (&retVal, 0, sizeof(retVal));
-
- ret_struct_type.size = 0;
- ret_struct_type.alignment = 0;
- ret_struct_type.type = FFI_TYPE_STRUCT;
- ret_struct_type.elements = st_fields;
-
- st_fields[0] = st_fields[12] = st_fields[24] = st_fields[36] = st_fields[48] = &ffi_type_uint8;
- st_fields[1] = st_fields[13] = st_fields[25] = st_fields[37] = st_fields[49] = &ffi_type_sint8;
- st_fields[2] = st_fields[14] = st_fields[26] = st_fields[38] = &ffi_type_uint16;
- st_fields[3] = st_fields[15] = st_fields[27] = st_fields[39] = &ffi_type_sint16;
- st_fields[4] = st_fields[16] = st_fields[28] = st_fields[40] = &ffi_type_uint32;
- st_fields[5] = st_fields[17] = st_fields[29] = st_fields[41] = &ffi_type_sint32;
- st_fields[6] = st_fields[18] = st_fields[30] = st_fields[42] = &ffi_type_uint64;
- st_fields[7] = st_fields[19] = st_fields[31] = st_fields[43] = &ffi_type_sint64;
- st_fields[8] = st_fields[20] = st_fields[32] = st_fields[44] = &ffi_type_float;
- st_fields[9] = st_fields[21] = st_fields[33] = st_fields[45] = &ffi_type_double;
- st_fields[10] = st_fields[22] = st_fields[34] = st_fields[46] = &ffi_type_longdouble;
- st_fields[11] = st_fields[23] = st_fields[35] = st_fields[47] = &ffi_type_pointer;
-
- st_fields[50] = NULL;
-
- argTypes[0] = argTypes[12] = argTypes[24] = argTypes[36] = argTypes[48] = &ffi_type_uint8;
- argValues[0] = argValues[12] = argValues[24] = argValues[36] = argValues[48] = &ui8;
- argTypes[1] = argTypes[13] = argTypes[25] = argTypes[37] = argTypes[49] = &ffi_type_sint8;
- argValues[1] = argValues[13] = argValues[25] = argValues[37] = argValues[49] = &si8;
- argTypes[2] = argTypes[14] = argTypes[26] = argTypes[38] = &ffi_type_uint16;
- argValues[2] = argValues[14] = argValues[26] = argValues[38] = &ui16;
- argTypes[3] = argTypes[15] = argTypes[27] = argTypes[39] = &ffi_type_sint16;
- argValues[3] = argValues[15] = argValues[27] = argValues[39] = &si16;
- argTypes[4] = argTypes[16] = argTypes[28] = argTypes[40] = &ffi_type_uint32;
- argValues[4] = argValues[16] = argValues[28] = argValues[40] = &ui32;
- argTypes[5] = argTypes[17] = argTypes[29] = argTypes[41] = &ffi_type_sint32;
- argValues[5] = argValues[17] = argValues[29] = argValues[41] = &si32;
- argTypes[6] = argTypes[18] = argTypes[30] = argTypes[42] = &ffi_type_uint64;
- argValues[6] = argValues[18] = argValues[30] = argValues[42] = &ui64;
- argTypes[7] = argTypes[19] = argTypes[31] = argTypes[43] = &ffi_type_sint64;
- argValues[7] = argValues[19] = argValues[31] = argValues[43] = &si64;
- argTypes[8] = argTypes[20] = argTypes[32] = argTypes[44] = &ffi_type_float;
- argValues[8] = argValues[20] = argValues[32] = argValues[44] = &f;
- argTypes[9] = argTypes[21] = argTypes[33] = argTypes[45] = &ffi_type_double;
- argValues[9] = argValues[21] = argValues[33] = argValues[45] = &d;
- argTypes[10] = argTypes[22] = argTypes[34] = argTypes[46] = &ffi_type_longdouble;
- argValues[10] = argValues[22] = argValues[34] = argValues[46] = &ld;
- argTypes[11] = argTypes[23] = argTypes[35] = argTypes[47] = &ffi_type_pointer;
- argValues[11] = argValues[23] = argValues[35] = argValues[47] = &p;
-
- argTypes[50] = NULL;
- argValues[50] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 50, &ret_struct_type, argTypes) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(test_large_fn), &retVal, argValues);
- /* { dg-output "1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */
- printf("res: %" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 "\n",
- retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f,
- retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (long)(intptr_t)retVal.l,
- retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r,
- retVal.s, retVal.t, retVal.u, retVal.v, retVal.w, (long)(intptr_t)retVal.x,
- retVal.y, retVal.z, retVal.aa, retVal.bb, retVal.cc, retVal.dd,
- retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (long)(intptr_t)retVal.jj,
- retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp,
- retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (long)(intptr_t)retVal.vv, retVal.ww, retVal.xx);
- /* { dg-output "\nres: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_large_fn, NULL, code) == FFI_OK);
-
- retVal = ((BigStruct(*)(
- uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, long double, char*,
- uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, long double, char*,
- uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, long double, char*,
- uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, long double, char*,
- uint8_t, int8_t))(code))(
- ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
- ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
- ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
- ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
- ui8, si8);
- /* { dg-output "\n1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */
- printf("res: %" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 "\n",
- retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f,
- retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (long)(intptr_t)retVal.l,
- retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r,
- retVal.s, retVal.t, retVal.u, retVal.v, retVal.w, (long)(intptr_t)retVal.x,
- retVal.y, retVal.z, retVal.aa, retVal.bb, retVal.cc, retVal.dd,
- retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (long)(intptr_t)retVal.jj,
- retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp,
- retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (long)(intptr_t)retVal.vv, retVal.ww, retVal.xx);
- /* { dg-output "\nres: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */
-
- return 0;
-}
diff --git a/deps/libffi/testsuite/libffi.closures/nested_struct.c b/deps/libffi/testsuite/libffi.closures/nested_struct.c
deleted file mode 100644
index 8b1b4ba79c1..00000000000
--- a/deps/libffi/testsuite/libffi.closures/nested_struct.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_16byte1 {
- double a;
- float b;
- int c;
-} cls_struct_16byte1;
-
-typedef struct cls_struct_16byte2 {
- int ii;
- double dd;
- float ff;
-} cls_struct_16byte2;
-
-typedef struct cls_struct_combined {
- cls_struct_16byte1 d;
- cls_struct_16byte2 e;
-} cls_struct_combined;
-
-static cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0,
- struct cls_struct_16byte2 b1,
- struct cls_struct_combined b2)
-{
- struct cls_struct_combined result;
-
- result.d.a = b0.a + b1.dd + b2.d.a;
- result.d.b = b0.b + b1.ff + b2.d.b;
- result.d.c = b0.c + b1.ii + b2.d.c;
- result.e.ii = b0.c + b1.ii + b2.e.ii;
- result.e.dd = b0.a + b1.dd + b2.e.dd;
- result.e.ff = b0.b + b1.ff + b2.e.ff;
-
- printf("%g %g %d %d %g %g %g %g %d %d %g %g: %g %g %d %d %g %g\n",
- b0.a, b0.b, b0.c,
- b1.ii, b1.dd, b1.ff,
- b2.d.a, b2.d.b, b2.d.c,
- b2.e.ii, b2.e.dd, b2.e.ff,
- result.d.a, result.d.b, result.d.c,
- result.e.ii, result.e.dd, result.e.ff);
-
- CHECK_DOUBLE_EQ(b0.a, 9);
- CHECK_FLOAT_EQ(b0.b, 2);
- CHECK(b0.c == 6);
-
- CHECK(b1.ii == 1);
- CHECK_DOUBLE_EQ(b1.dd, 2);
- CHECK_FLOAT_EQ(b1.ff, 3);
-
- CHECK_DOUBLE_EQ(b2.d.a, 4);
- CHECK_FLOAT_EQ(b2.d.b, 5);
- CHECK(b2.d.c == 6);
-
- CHECK(b2.e.ii == 3);
- CHECK_DOUBLE_EQ(b2.e.dd, 1);
- CHECK_FLOAT_EQ(b2.e.ff, 8);
-
- CHECK_DOUBLE_EQ(result.d.a, 15);
- CHECK_FLOAT_EQ(result.d.b, 10);
- CHECK(result.d.c == 13);
- CHECK(result.e.ii == 10);
- CHECK_DOUBLE_EQ(result.e.dd, 12);
- CHECK_FLOAT_EQ(result.e.ff, 13);
-
- return result;
-}
-
-static void
-cls_struct_combined_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct cls_struct_16byte1 b0;
- struct cls_struct_16byte2 b1;
- struct cls_struct_combined b2;
-
- b0 = *(struct cls_struct_16byte1*)(args[0]);
- b1 = *(struct cls_struct_16byte2*)(args[1]);
- b2 = *(struct cls_struct_combined*)(args[2]);
-
-
- *(cls_struct_combined*)resp = cls_struct_combined_fn(b0, b1, b2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[5];
- ffi_type* cls_struct_fields1[5];
- ffi_type* cls_struct_fields2[5];
- ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_16byte1 e_dbl = { 9.0, 2.0, 6};
- struct cls_struct_16byte2 f_dbl = { 1, 2.0, 3.0};
- struct cls_struct_combined g_dbl = {{4.0, 5.0, 6},
- {3, 1.0, 8.0}};
- struct cls_struct_combined res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_type2.size = 0;
- cls_struct_type2.alignment = 0;
- cls_struct_type2.type = FFI_TYPE_STRUCT;
- cls_struct_type2.elements = cls_struct_fields2;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_float;
- cls_struct_fields[2] = &ffi_type_sint;
- cls_struct_fields[3] = NULL;
-
- cls_struct_fields1[0] = &ffi_type_sint;
- cls_struct_fields1[1] = &ffi_type_double;
- cls_struct_fields1[2] = &ffi_type_float;
- cls_struct_fields1[3] = NULL;
-
- cls_struct_fields2[0] = &cls_struct_type;
- cls_struct_fields2[1] = &cls_struct_type1;
- cls_struct_fields2[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = &cls_struct_type2;
- dbl_arg_types[3] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type2,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_combined_fn), &res_dbl, args_dbl);
- /* { dg-output "9 2 6 1 2 3 4 5 6 3 1 8: 15 10 13 10 12 13" } */
- CHECK_DOUBLE_EQ( res_dbl.d.a, (e_dbl.a + f_dbl.dd + g_dbl.d.a));
- CHECK_FLOAT_EQ( res_dbl.d.b, (e_dbl.b + f_dbl.ff + g_dbl.d.b));
- CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c));
- CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii));
- CHECK_DOUBLE_EQ( res_dbl.e.dd, (e_dbl.a + f_dbl.dd + g_dbl.e.dd));
- CHECK_FLOAT_EQ( res_dbl.e.ff, (e_dbl.b + f_dbl.ff + g_dbl.e.ff));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_combined_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_combined(*)(cls_struct_16byte1,
- cls_struct_16byte2,
- cls_struct_combined))
- (code))(e_dbl, f_dbl, g_dbl);
- /* { dg-output "\n9 2 6 1 2 3 4 5 6 3 1 8: 15 10 13 10 12 13" } */
- CHECK_DOUBLE_EQ( res_dbl.d.a, (e_dbl.a + f_dbl.dd + g_dbl.d.a));
- CHECK_FLOAT_EQ( res_dbl.d.b, (e_dbl.b + f_dbl.ff + g_dbl.d.b));
- CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c));
- CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii));
- CHECK_DOUBLE_EQ( res_dbl.e.dd, (e_dbl.a + f_dbl.dd + g_dbl.e.dd));
- CHECK_FLOAT_EQ( res_dbl.e.ff, (e_dbl.b + f_dbl.ff + g_dbl.e.ff));
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/nested_struct1.c b/deps/libffi/testsuite/libffi.closures/nested_struct1.c
deleted file mode 100644
index df8ab5973d1..00000000000
--- a/deps/libffi/testsuite/libffi.closures/nested_struct1.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_16byte1 {
- double a;
- float b;
- int c;
-} cls_struct_16byte1;
-
-typedef struct cls_struct_16byte2 {
- int ii;
- double dd;
- float ff;
-} cls_struct_16byte2;
-
-typedef struct cls_struct_combined {
- cls_struct_16byte1 d;
- cls_struct_16byte2 e;
-} cls_struct_combined;
-
-static cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0,
- struct cls_struct_16byte2 b1,
- struct cls_struct_combined b2,
- struct cls_struct_16byte1 b3)
-{
- struct cls_struct_combined result;
-
- result.d.a = b0.a + b1.dd + b2.d.a;
- result.d.b = b0.b + b1.ff + b2.d.b;
- result.d.c = b0.c + b1.ii + b2.d.c;
- result.e.ii = b0.c + b1.ii + b2.e.ii;
- result.e.dd = b0.a + b1.dd + b2.e.dd;
- result.e.ff = b0.b + b1.ff + b2.e.ff;
-
- printf("%g %g %d %d %g %g %g %g %d %d %g %g %g %g %d: %g %g %d %d %g %g\n",
- b0.a, b0.b, b0.c,
- b1.ii, b1.dd, b1.ff,
- b2.d.a, b2.d.b, b2.d.c,
- b2.e.ii, b2.e.dd, b2.e.ff,
- b3.a, b3.b, b3.c,
- result.d.a, result.d.b, result.d.c,
- result.e.ii, result.e.dd, result.e.ff);
-
- return result;
-}
-
-static void
-cls_struct_combined_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct cls_struct_16byte1 b0;
- struct cls_struct_16byte2 b1;
- struct cls_struct_combined b2;
- struct cls_struct_16byte1 b3;
-
- b0 = *(struct cls_struct_16byte1*)(args[0]);
- b1 = *(struct cls_struct_16byte2*)(args[1]);
- b2 = *(struct cls_struct_combined*)(args[2]);
- b3 = *(struct cls_struct_16byte1*)(args[3]);
-
-
- *(cls_struct_combined*)resp = cls_struct_combined_fn(b0, b1, b2, b3);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[5];
- ffi_type* cls_struct_fields1[5];
- ffi_type* cls_struct_fields2[5];
- ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_16byte1 e_dbl = { 9.0, 2.0, 6};
- struct cls_struct_16byte2 f_dbl = { 1, 2.0, 3.0};
- struct cls_struct_combined g_dbl = {{4.0, 5.0, 6},
- {3, 1.0, 8.0}};
- struct cls_struct_16byte1 h_dbl = { 3.0, 2.0, 4};
- struct cls_struct_combined res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_type2.size = 0;
- cls_struct_type2.alignment = 0;
- cls_struct_type2.type = FFI_TYPE_STRUCT;
- cls_struct_type2.elements = cls_struct_fields2;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_float;
- cls_struct_fields[2] = &ffi_type_sint;
- cls_struct_fields[3] = NULL;
-
- cls_struct_fields1[0] = &ffi_type_sint;
- cls_struct_fields1[1] = &ffi_type_double;
- cls_struct_fields1[2] = &ffi_type_float;
- cls_struct_fields1[3] = NULL;
-
- cls_struct_fields2[0] = &cls_struct_type;
- cls_struct_fields2[1] = &cls_struct_type1;
- cls_struct_fields2[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = &cls_struct_type2;
- dbl_arg_types[3] = &cls_struct_type;
- dbl_arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type2,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = &h_dbl;
- args_dbl[4] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_combined_fn), &res_dbl, args_dbl);
- /* { dg-output "9 2 6 1 2 3 4 5 6 3 1 8 3 2 4: 15 10 13 10 12 13" } */
- CHECK( res_dbl.d.a == (e_dbl.a + f_dbl.dd + g_dbl.d.a));
- CHECK( res_dbl.d.b == (e_dbl.b + f_dbl.ff + g_dbl.d.b));
- CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c));
- CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii));
- CHECK( res_dbl.e.dd == (e_dbl.a + f_dbl.dd + g_dbl.e.dd));
- CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_combined_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_combined(*)(cls_struct_16byte1,
- cls_struct_16byte2,
- cls_struct_combined,
- cls_struct_16byte1))
- (code))(e_dbl, f_dbl, g_dbl, h_dbl);
- /* { dg-output "\n9 2 6 1 2 3 4 5 6 3 1 8 3 2 4: 15 10 13 10 12 13" } */
- CHECK( res_dbl.d.a == (e_dbl.a + f_dbl.dd + g_dbl.d.a));
- CHECK( res_dbl.d.b == (e_dbl.b + f_dbl.ff + g_dbl.d.b));
- CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c));
- CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii));
- CHECK( res_dbl.e.dd == (e_dbl.a + f_dbl.dd + g_dbl.e.dd));
- CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff));
- /* CHECK( 1 == 0); */
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/nested_struct10.c b/deps/libffi/testsuite/libffi.closures/nested_struct10.c
deleted file mode 100644
index a2cdc649463..00000000000
--- a/deps/libffi/testsuite/libffi.closures/nested_struct10.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Sample taken from Alan Modras patch to src/prep_cif.c.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20051010 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- unsigned long long a;
- unsigned char b;
-} A;
-
-typedef struct B {
- unsigned char y;
- struct A x;
- unsigned int z;
-} B;
-
-typedef struct C {
- unsigned long long d;
- unsigned char e;
-} C;
-
-static B B_fn(struct A b2, struct B b3, struct C b4)
-{
- struct B result;
-
- result.x.a = b2.a + b3.x.a + b3.z + b4.d;
- result.x.b = b2.b + b3.x.b + b3.y + b4.e;
- result.y = b2.b + b3.x.b + b4.e;
- result.z = 0;
-
- printf("%d %d %d %d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b,
- (int)b3.x.a, b3.x.b, b3.y, b3.z, (int)b4.d, b4.e,
- (int)result.x.a, result.x.b, result.y);
-
- CHECK((int)b2.a == 1);
- CHECK(b2.b == 7);
- CHECK((int)b3.x.a == 12);
- CHECK(b3.x.b == 127);
- CHECK(b3.y == 99);
- CHECK(b3.z == 255);
- CHECK((int)b4.d == 2);
- CHECK(b4.e == 9);
- CHECK((int)result.x.a == 270);
- CHECK(result.x.b == 242);
- CHECK(result.y == 143);
-
- return result;
-}
-
-static void
-B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct A b0;
- struct B b1;
- struct C b2;
-
- b0 = *(struct A*)(args[0]);
- b1 = *(struct B*)(args[1]);
- b2 = *(struct C*)(args[2]);
-
- *(B*)resp = B_fn(b0, b1, b2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[4];
- ffi_type* cls_struct_fields[3];
- ffi_type* cls_struct_fields1[4];
- ffi_type* cls_struct_fields2[3];
- ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
- ffi_type* dbl_arg_types[4];
-
- struct A e_dbl = { 1LL, 7};
- struct B f_dbl = { 99, {12LL , 127}, 255};
- struct C g_dbl = { 2LL, 9};
-
- struct B res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_type2.size = 0;
- cls_struct_type2.alignment = 0;
- cls_struct_type2.type = FFI_TYPE_STRUCT;
- cls_struct_type2.elements = cls_struct_fields2;
-
- cls_struct_fields[0] = &ffi_type_uint64;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = NULL;
-
- cls_struct_fields1[0] = &ffi_type_uchar;
- cls_struct_fields1[1] = &cls_struct_type;
- cls_struct_fields1[2] = &ffi_type_uint;
- cls_struct_fields1[3] = NULL;
-
- cls_struct_fields2[0] = &ffi_type_uint64;
- cls_struct_fields2[1] = &ffi_type_uchar;
- cls_struct_fields2[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = &cls_struct_type2;
- dbl_arg_types[3] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type1,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = NULL;
-
- ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
- /* { dg-output "1 7 12 127 99 255 2 9: 270 242 143" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + f_dbl.z + g_dbl.d));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((B(*)(A, B, C))(code))(e_dbl, f_dbl, g_dbl);
- /* { dg-output "\n1 7 12 127 99 255 2 9: 270 242 143" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + f_dbl.z + g_dbl.d));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/nested_struct11.c b/deps/libffi/testsuite/libffi.closures/nested_struct11.c
deleted file mode 100644
index c9821e49303..00000000000
--- a/deps/libffi/testsuite/libffi.closures/nested_struct11.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check parameter passing with nested structs
- of a single type. This tests the special cases
- for homogeneous floating-point aggregates in the
- AArch64 PCS.
- Limitations: none.
- PR: none.
- Originator: ARM Ltd. */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- float a_x;
- float a_y;
-} A;
-
-typedef struct B {
- float b_x;
- float b_y;
-} B;
-
-typedef struct C {
- A a;
- B b;
-} C;
-
-static C C_fn (int x, int y, int z, C source, int i, int j, int k)
-{
- C result;
- result.a.a_x = source.a.a_x;
- result.a.a_y = source.a.a_y;
- result.b.b_x = source.b.b_x;
- result.b.b_y = source.b.b_y;
-
- printf ("%d, %d, %d, %d, %d, %d\n", x, y, z, i, j, k);
-
- CHECK(x == 1);
- CHECK(y == 1);
- CHECK(z == 1);
- CHECK(i == 1);
- CHECK(j == 1);
- CHECK(k == 1);
-
- printf ("%.1f, %.1f, %.1f, %.1f, "
- "%.1f, %.1f, %.1f, %.1f\n",
- source.a.a_x, source.a.a_y,
- source.b.b_x, source.b.b_y,
- result.a.a_x, result.a.a_y,
- result.b.b_x, result.b.b_y);
-
- CHECK_FLOAT_EQ(source.a.a_x, 1.0);
- CHECK_FLOAT_EQ(source.a.a_y, 2.0);
- CHECK_FLOAT_EQ(source.b.b_x, 4.0);
- CHECK_FLOAT_EQ(source.b.b_y, 8.0);
- CHECK_FLOAT_EQ(result.a.a_x, 1.0);
- CHECK_FLOAT_EQ(result.a.a_y, 2.0);
- CHECK_FLOAT_EQ(result.b.b_x, 4.0);
- CHECK_FLOAT_EQ(result.b.b_y, 8.0);
-
- return result;
-}
-
-int main (void)
-{
- ffi_cif cif;
-
- ffi_type* struct_fields_source_a[3];
- ffi_type* struct_fields_source_b[3];
- ffi_type* struct_fields_source_c[3];
- ffi_type* arg_types[8];
-
- ffi_type struct_type_a, struct_type_b, struct_type_c;
-
- struct A source_fld_a = {1.0, 2.0};
- struct B source_fld_b = {4.0, 8.0};
- int k = 1;
-
- struct C result;
- struct C source = {source_fld_a, source_fld_b};
-
- struct_type_a.size = 0;
- struct_type_a.alignment = 0;
- struct_type_a.type = FFI_TYPE_STRUCT;
- struct_type_a.elements = struct_fields_source_a;
-
- struct_type_b.size = 0;
- struct_type_b.alignment = 0;
- struct_type_b.type = FFI_TYPE_STRUCT;
- struct_type_b.elements = struct_fields_source_b;
-
- struct_type_c.size = 0;
- struct_type_c.alignment = 0;
- struct_type_c.type = FFI_TYPE_STRUCT;
- struct_type_c.elements = struct_fields_source_c;
-
- struct_fields_source_a[0] = &ffi_type_float;
- struct_fields_source_a[1] = &ffi_type_float;
- struct_fields_source_a[2] = NULL;
-
- struct_fields_source_b[0] = &ffi_type_float;
- struct_fields_source_b[1] = &ffi_type_float;
- struct_fields_source_b[2] = NULL;
-
- struct_fields_source_c[0] = &struct_type_a;
- struct_fields_source_c[1] = &struct_type_b;
- struct_fields_source_c[2] = NULL;
-
- arg_types[0] = &ffi_type_sint32;
- arg_types[1] = &ffi_type_sint32;
- arg_types[2] = &ffi_type_sint32;
- arg_types[3] = &struct_type_c;
- arg_types[4] = &ffi_type_sint32;
- arg_types[5] = &ffi_type_sint32;
- arg_types[6] = &ffi_type_sint32;
- arg_types[7] = NULL;
-
- void *args[7];
- args[0] = &k;
- args[1] = &k;
- args[2] = &k;
- args[3] = &source;
- args[4] = &k;
- args[5] = &k;
- args[6] = &k;
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 7, &struct_type_c,
- arg_types) == FFI_OK);
-
- ffi_call (&cif, FFI_FN (C_fn), &result, args);
- /* { dg-output "1, 1, 1, 1, 1, 1\n" } */
- /* { dg-output "1.0, 2.0, 4.0, 8.0, 1.0, 2.0, 4.0, 8.0" } */
- CHECK_FLOAT_EQ(result.a.a_x, source.a.a_x);
- CHECK_FLOAT_EQ(result.a.a_y, source.a.a_y);
- CHECK_FLOAT_EQ(result.b.b_x, source.b.b_x);
- CHECK_FLOAT_EQ(result.b.b_y, source.b.b_y);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/nested_struct12.c b/deps/libffi/testsuite/libffi.closures/nested_struct12.c
deleted file mode 100644
index 7ca16c17d1e..00000000000
--- a/deps/libffi/testsuite/libffi.closures/nested_struct12.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Area: ffi_call
- Purpose: Check nested float struct.
- Limitations: none.
- PR: none.
- Originator: Cheng Jin <jincheng@ca.ibm.com> */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct stru_FF stru_FF;
-typedef struct stru_Nested_F stru_Nested_F;
-
-struct stru_FF {
- float elem1;
- float elem2;
-};
-
-struct stru_Nested_F {
- float elem1;
- stru_FF elem2;
-};
-
-static float testNestedFloatStruct(float arg1, stru_Nested_F arg2)
-{
- float floatSum = arg1 + arg2.elem1 + arg2.elem2.elem1 + arg2.elem2.elem2;
- return floatSum;
-}
-
-int main (void)
-{
- float ts12_result = 0;
- int structElemNum = 2;
- int nestedStructElemNum = 2;
- int argNum = 2;
-
- ffi_cif cif;
- ffi_type **struct_float1 = (ffi_type **)malloc(sizeof(ffi_type *) * (structElemNum + 1));
- ffi_type **struct_float2 = (ffi_type **)malloc(sizeof(ffi_type *) * (nestedStructElemNum + 1));
- ffi_type **args = (ffi_type **)malloc(sizeof(ffi_type *) * (argNum + 1));
- void **values = (void **)malloc(sizeof(void *) * (argNum + 1));
- ffi_type struct_float_type1, struct_float_type2;
- ffi_type *retType = &ffi_type_float;
- float arg1;
- float *arg2 = (float *)malloc(sizeof(stru_Nested_F));
-
- struct_float2[0] = &ffi_type_float;
- struct_float2[1] = &ffi_type_float;
- struct_float2[2] = NULL;
-
- struct_float_type2.size = 0;
- struct_float_type2.alignment = 0;
- struct_float_type2.type = FFI_TYPE_STRUCT;
- struct_float_type2.elements = struct_float2;
-
- struct_float1[0] = &ffi_type_float;
- struct_float1[1] = &struct_float_type2;
- struct_float1[2] = NULL;
-
- struct_float_type1.size = 0;
- struct_float_type1.alignment = 0;
- struct_float_type1.type = FFI_TYPE_STRUCT;
- struct_float_type1.elements = struct_float1;
-
- args[0] = &ffi_type_float;
- args[1] = &struct_float_type1;
- args[2] = NULL;
-
- arg1 = 37.88;
- arg2[0] = 31.22;
- arg2[1] = 33.44;
- arg2[2] = 35.66;
- values[0] = &arg1;
- values[1] = arg2;
- values[2] = NULL;
-
- CHECK( ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, retType, args) == FFI_OK);
- ffi_call(&cif, FFI_FN(testNestedFloatStruct), &ts12_result, values);
- CHECK_FLOAT_EQ(ts12_result, 138.2f);
-
- free(struct_float1);
- free(struct_float2);
- free(args);
- free(values);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/nested_struct13.c b/deps/libffi/testsuite/libffi.closures/nested_struct13.c
deleted file mode 100644
index 6edfdcbb5e3..00000000000
--- a/deps/libffi/testsuite/libffi.closures/nested_struct13.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing.
- Limitations: none.
- PR: none.
- Originator: <jincheng@ca.ibm.com> and <jakub@redhat.com> 20210609 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- float a, b;
-} A;
-
-typedef struct B {
- float x;
- struct A y;
-} B;
-
-B B_fn(float b0, struct B b1)
-{
- struct B result;
-
- result.x = b0 + b1.x;
- result.y.a = b0 + b1.y.a;
- result.y.b = b0 + b1.y.b;
-
- printf("%g %g %g %g: %g %g %g\n", b0, b1.x, b1.y.a, b1.y.b,
- result.x, result.y.a, result.y.b);
-
- CHECK_FLOAT_EQ(b0, 12.125);
- CHECK_FLOAT_EQ(b1.x, 24.75);
- CHECK_FLOAT_EQ(b1.y.a, 31.625);
- CHECK_FLOAT_EQ(b1.y.b, 32.25);
- CHECK_FLOAT_EQ(result.x, 36.875);
- CHECK_FLOAT_EQ(result.y.a, 43.75);
- CHECK_FLOAT_EQ(result.y.b, 44.375);
-
- return result;
-}
-
-static void
-B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- float b0;
- struct B b1;
-
- b0 = *(float*)(args[0]);
- b1 = *(struct B*)(args[1]);
-
- *(B*)resp = B_fn(b0, b1);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[3];
- ffi_type* cls_struct_fields1[3];
- ffi_type cls_struct_type, cls_struct_type1;
- ffi_type* dbl_arg_types[3];
-
- float e_dbl = 12.125f;
- struct B f_dbl = { 24.75f, { 31.625f, 32.25f } };
-
- struct B res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_fields[0] = &ffi_type_float;
- cls_struct_fields[1] = &ffi_type_float;
- cls_struct_fields[2] = NULL;
-
- cls_struct_fields1[0] = &ffi_type_float;
- cls_struct_fields1[1] = &cls_struct_type;
- cls_struct_fields1[2] = NULL;
-
-
- dbl_arg_types[0] = &ffi_type_float;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
- /* { dg-output "12.125 24.75 31.625 32.25: 36.875 43.75 44.375" } */
- CHECK_FLOAT_EQ( res_dbl.x, (e_dbl + f_dbl.x));
- CHECK_FLOAT_EQ( res_dbl.y.a, (e_dbl + f_dbl.y.a));
- CHECK_FLOAT_EQ( res_dbl.y.b, (e_dbl + f_dbl.y.b));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((B(*)(float, B))(code))(e_dbl, f_dbl);
- /* { dg-output "\n12.125 24.75 31.625 32.25: 36.875 43.75 44.375" } */
- CHECK_FLOAT_EQ( res_dbl.x, (e_dbl + f_dbl.x));
- CHECK_FLOAT_EQ( res_dbl.y.a, (e_dbl + f_dbl.y.a));
- CHECK_FLOAT_EQ( res_dbl.y.b, (e_dbl + f_dbl.y.b));
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/nested_struct2.c b/deps/libffi/testsuite/libffi.closures/nested_struct2.c
deleted file mode 100644
index 93a913d3216..00000000000
--- a/deps/libffi/testsuite/libffi.closures/nested_struct2.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Sample taken from Alan Modras patch to src/prep_cif.c.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030911 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- unsigned long a;
- unsigned char b;
-} A;
-
-typedef struct B {
- struct A x;
- unsigned char y;
-} B;
-
-static B B_fn(struct A b0, struct B b1)
-{
- struct B result;
-
- result.x.a = b0.a + b1.x.a;
- result.x.b = b0.b + b1.x.b + b1.y;
- result.y = b0.b + b1.x.b;
-
- printf("%lu %d %lu %d %d: %lu %d %d\n", b0.a, b0.b, b1.x.a, b1.x.b, b1.y,
- result.x.a, result.x.b, result.y);
-
- CHECK(b0.a == 1);
- CHECK(b0.b == 7);
- CHECK(b1.x.a == 12);
- CHECK(b1.x.b == 127);
- CHECK(b1.y == 99);
- CHECK(result.x.a == 13);
- CHECK(result.x.b == 233);
- CHECK(result.y == 134);
-
- return result;
-}
-
-static void
-B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct A b0;
- struct B b1;
-
- b0 = *(struct A*)(args[0]);
- b1 = *(struct B*)(args[1]);
-
- *(B*)resp = B_fn(b0, b1);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[3];
- ffi_type* cls_struct_fields1[3];
- ffi_type cls_struct_type, cls_struct_type1;
- ffi_type* dbl_arg_types[3];
-
- struct A e_dbl = { 1, 7};
- struct B f_dbl = {{12 , 127}, 99};
-
- struct B res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_fields[0] = &ffi_type_ulong;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = NULL;
-
- cls_struct_fields1[0] = &cls_struct_type;
- cls_struct_fields1[1] = &ffi_type_uchar;
- cls_struct_fields1[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
- /* { dg-output "1 7 12 127 99: 13 233 134" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((B(*)(A, B))(code))(e_dbl, f_dbl);
- /* { dg-output "\n1 7 12 127 99: 13 233 134" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/nested_struct3.c b/deps/libffi/testsuite/libffi.closures/nested_struct3.c
deleted file mode 100644
index d39a9ccfe5a..00000000000
--- a/deps/libffi/testsuite/libffi.closures/nested_struct3.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Sample taken from Alan Modras patch to src/prep_cif.c.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030911 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- unsigned long long a;
- unsigned char b;
-} A;
-
-typedef struct B {
- struct A x;
- unsigned char y;
-} B;
-
-static B B_fn(struct A b0, struct B b1)
-{
- struct B result;
-
- result.x.a = b0.a + b1.x.a;
- result.x.b = b0.b + b1.x.b + b1.y;
- result.y = b0.b + b1.x.b;
-
- printf("%d %d %d %d %d: %d %d %d\n", (int)b0.a, b0.b,
- (int)b1.x.a, b1.x.b, b1.y,
- (int)result.x.a, result.x.b, result.y);
-
- CHECK((int)b0.a == 1);
- CHECK(b0.b == 7);
- CHECK((int)b1.x.a == 12);
- CHECK(b1.x.b == 127);
- CHECK(b1.y == 99);
- CHECK((int)result.x.a == 13);
- CHECK(result.x.b == 233);
- CHECK(result.y == 134);
-
- return result;
-}
-
-static void
-B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct A b0;
- struct B b1;
-
- b0 = *(struct A*)(args[0]);
- b1 = *(struct B*)(args[1]);
-
- *(B*)resp = B_fn(b0, b1);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[3];
- ffi_type* cls_struct_fields1[3];
- ffi_type cls_struct_type, cls_struct_type1;
- ffi_type* dbl_arg_types[3];
-
- struct A e_dbl = { 1LL, 7};
- struct B f_dbl = {{12LL , 127}, 99};
-
- struct B res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_fields[0] = &ffi_type_uint64;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = NULL;
-
- cls_struct_fields1[0] = &cls_struct_type;
- cls_struct_fields1[1] = &ffi_type_uchar;
- cls_struct_fields1[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
- /* { dg-output "1 7 12 127 99: 13 233 134" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
-
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((B(*)(A, B))(code))(e_dbl, f_dbl);
- /* { dg-output "\n1 7 12 127 99: 13 233 134" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/nested_struct4.c b/deps/libffi/testsuite/libffi.closures/nested_struct4.c
deleted file mode 100644
index d5c960dce7d..00000000000
--- a/deps/libffi/testsuite/libffi.closures/nested_struct4.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Sample taken from Alan Modras patch to src/prep_cif.c.
- Limitations: none.
- PR: PR 25630.
- Originator: <andreast@gcc.gnu.org> 20051010 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- double a;
- unsigned char b;
-} A;
-
-typedef struct B {
- struct A x;
- unsigned char y;
-} B;
-
-static B B_fn(struct A b2, struct B b3)
-{
- struct B result;
-
- result.x.a = b2.a + b3.x.a;
- result.x.b = b2.b + b3.x.b + b3.y;
- result.y = b2.b + b3.x.b;
-
- printf("%d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b,
- (int)b3.x.a, b3.x.b, b3.y,
- (int)result.x.a, result.x.b, result.y);
-
- CHECK((int)b2.a == 1);
- CHECK(b2.b == 7);
- CHECK((int)b3.x.a == 12);
- CHECK(b3.x.b == 127);
- CHECK(b3.y == 99);
- CHECK((int)result.x.a == 13);
- CHECK(result.x.b == 233);
- CHECK(result.y == 134);
-
- return result;
-}
-
-static void
-B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct A b0;
- struct B b1;
-
- b0 = *(struct A*)(args[0]);
- b1 = *(struct B*)(args[1]);
-
- *(B*)resp = B_fn(b0, b1);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[3];
- ffi_type* cls_struct_fields1[3];
- ffi_type cls_struct_type, cls_struct_type1;
- ffi_type* dbl_arg_types[3];
-
- struct A e_dbl = { 1.0, 7};
- struct B f_dbl = {{12.0 , 127}, 99};
-
- struct B res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = NULL;
-
- cls_struct_fields1[0] = &cls_struct_type;
- cls_struct_fields1[1] = &ffi_type_uchar;
- cls_struct_fields1[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
- /* { dg-output "1 7 12 127 99: 13 233 134" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((B(*)(A, B))(code))(e_dbl, f_dbl);
- /* { dg-output "\n1 7 12 127 99: 13 233 134" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/nested_struct5.c b/deps/libffi/testsuite/libffi.closures/nested_struct5.c
deleted file mode 100644
index b053f52b020..00000000000
--- a/deps/libffi/testsuite/libffi.closures/nested_struct5.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Sample taken from Alan Modras patch to src/prep_cif.c.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20051010 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- long double a;
- unsigned char b;
-} A;
-
-typedef struct B {
- struct A x;
- unsigned char y;
-} B;
-
-static B B_fn(struct A b2, struct B b3)
-{
- struct B result;
-
- result.x.a = b2.a + b3.x.a;
- result.x.b = b2.b + b3.x.b + b3.y;
- result.y = b2.b + b3.x.b;
-
- printf("%d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b,
- (int)b3.x.a, b3.x.b, b3.y,
- (int)result.x.a, result.x.b, result.y);
-
- CHECK((int)b2.a == 1);
- CHECK(b2.b == 7);
- CHECK((int)b3.x.a == 12);
- CHECK(b3.x.b == 127);
- CHECK(b3.y == 99);
- CHECK((int)result.x.a == 13);
- CHECK(result.x.b == 233);
- CHECK(result.y == 134);
-
- return result;
-}
-
-static void
-B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct A b0;
- struct B b1;
-
- b0 = *(struct A*)(args[0]);
- b1 = *(struct B*)(args[1]);
-
- *(B*)resp = B_fn(b0, b1);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[3];
- ffi_type* cls_struct_fields1[3];
- ffi_type cls_struct_type, cls_struct_type1;
- ffi_type* dbl_arg_types[3];
-
- struct A e_dbl = { 1.0, 7};
- struct B f_dbl = {{12.0 , 127}, 99};
-
- struct B res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_fields[0] = &ffi_type_longdouble;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = NULL;
-
- cls_struct_fields1[0] = &cls_struct_type;
- cls_struct_fields1[1] = &ffi_type_uchar;
- cls_struct_fields1[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
- /* { dg-output "1 7 12 127 99: 13 233 134" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
-
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((B(*)(A, B))(code))(e_dbl, f_dbl);
- /* { dg-output "\n1 7 12 127 99: 13 233 134" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/nested_struct6.c b/deps/libffi/testsuite/libffi.closures/nested_struct6.c
deleted file mode 100644
index 690ec0be89a..00000000000
--- a/deps/libffi/testsuite/libffi.closures/nested_struct6.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Sample taken from Alan Modras patch to src/prep_cif.c.
- Limitations: none.
- PR: PR 25630.
- Originator: <andreast@gcc.gnu.org> 20051010 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- double a;
- unsigned char b;
-} A;
-
-typedef struct B {
- struct A x;
- unsigned char y;
-} B;
-
-typedef struct C {
- long d;
- unsigned char e;
-} C;
-
-static B B_fn(struct A b2, struct B b3, struct C b4)
-{
- struct B result;
-
- result.x.a = b2.a + b3.x.a + b4.d;
- result.x.b = b2.b + b3.x.b + b3.y + b4.e;
- result.y = b2.b + b3.x.b + b4.e;
-
- printf("%d %d %d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b,
- (int)b3.x.a, b3.x.b, b3.y, (int)b4.d, b4.e,
- (int)result.x.a, result.x.b, result.y);
-
- CHECK((int)b2.a == 1);
- CHECK(b2.b == 7);
- CHECK((int)b3.x.a == 12);
- CHECK(b3.x.b == 127);
- CHECK(b3.y == 99);
- CHECK((int)b4.d == 2);
- CHECK(b4.e == 9);
- CHECK((int)result.x.a == 15);
- CHECK(result.x.b == 242);
- CHECK(result.y == 143);
-
- return result;
-}
-
-static void
-B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct A b0;
- struct B b1;
- struct C b2;
-
- b0 = *(struct A*)(args[0]);
- b1 = *(struct B*)(args[1]);
- b2 = *(struct C*)(args[2]);
-
- *(B*)resp = B_fn(b0, b1, b2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[4];
- ffi_type* cls_struct_fields[3];
- ffi_type* cls_struct_fields1[3];
- ffi_type* cls_struct_fields2[3];
- ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
- ffi_type* dbl_arg_types[4];
-
- struct A e_dbl = { 1.0, 7};
- struct B f_dbl = {{12.0 , 127}, 99};
- struct C g_dbl = { 2, 9};
-
- struct B res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_type2.size = 0;
- cls_struct_type2.alignment = 0;
- cls_struct_type2.type = FFI_TYPE_STRUCT;
- cls_struct_type2.elements = cls_struct_fields2;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = NULL;
-
- cls_struct_fields1[0] = &cls_struct_type;
- cls_struct_fields1[1] = &ffi_type_uchar;
- cls_struct_fields1[2] = NULL;
-
- cls_struct_fields2[0] = &ffi_type_slong;
- cls_struct_fields2[1] = &ffi_type_uchar;
- cls_struct_fields2[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = &cls_struct_type2;
- dbl_arg_types[3] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type1,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = NULL;
-
- ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
- /* { dg-output "1 7 12 127 99 2 9: 15 242 143" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((B(*)(A, B, C))(code))(e_dbl, f_dbl, g_dbl);
- /* { dg-output "\n1 7 12 127 99 2 9: 15 242 143" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/nested_struct7.c b/deps/libffi/testsuite/libffi.closures/nested_struct7.c
deleted file mode 100644
index b3ddd030d28..00000000000
--- a/deps/libffi/testsuite/libffi.closures/nested_struct7.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Sample taken from Alan Modras patch to src/prep_cif.c.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20051010 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- unsigned long long a;
- unsigned char b;
-} A;
-
-typedef struct B {
- struct A x;
- unsigned char y;
-} B;
-
-static B B_fn(struct A b2, struct B b3)
-{
- struct B result;
-
- result.x.a = b2.a + b3.x.a;
- result.x.b = b2.b + b3.x.b + b3.y;
- result.y = b2.b + b3.x.b;
-
- printf("%d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b,
- (int)b3.x.a, b3.x.b, b3.y,
- (int)result.x.a, result.x.b, result.y);
-
- CHECK((int)b2.a == 1);
- CHECK(b2.b == 7);
- CHECK((int)b3.x.a == 12);
- CHECK(b3.x.b == 127);
- CHECK(b3.y == 99);
- CHECK((int)result.x.a == 13);
- CHECK(result.x.b == 233);
- CHECK(result.y == 134);
-
- return result;
-}
-
-static void
-B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct A b0;
- struct B b1;
-
- b0 = *(struct A*)(args[0]);
- b1 = *(struct B*)(args[1]);
-
- *(B*)resp = B_fn(b0, b1);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[3];
- ffi_type* cls_struct_fields1[3];
- ffi_type cls_struct_type, cls_struct_type1;
- ffi_type* dbl_arg_types[3];
-
- struct A e_dbl = { 1LL, 7};
- struct B f_dbl = {{12.0 , 127}, 99};
-
- struct B res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_fields[0] = &ffi_type_uint64;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = NULL;
-
- cls_struct_fields1[0] = &cls_struct_type;
- cls_struct_fields1[1] = &ffi_type_uchar;
- cls_struct_fields1[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
- /* { dg-output "1 7 12 127 99: 13 233 134" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((B(*)(A, B))(code))(e_dbl, f_dbl);
- /* { dg-output "\n1 7 12 127 99: 13 233 134" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/nested_struct8.c b/deps/libffi/testsuite/libffi.closures/nested_struct8.c
deleted file mode 100644
index 768f3331b2b..00000000000
--- a/deps/libffi/testsuite/libffi.closures/nested_struct8.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Sample taken from Alan Modras patch to src/prep_cif.c.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20051010 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- unsigned long long a;
- unsigned char b;
-} A;
-
-typedef struct B {
- struct A x;
- unsigned char y;
-} B;
-
-typedef struct C {
- unsigned long long d;
- unsigned char e;
-} C;
-
-static B B_fn(struct A b2, struct B b3, struct C b4)
-{
- struct B result;
-
- result.x.a = b2.a + b3.x.a + b4.d;
- result.x.b = b2.b + b3.x.b + b3.y + b4.e;
- result.y = b2.b + b3.x.b + b4.e;
-
- printf("%d %d %d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b,
- (int)b3.x.a, b3.x.b, b3.y, (int)b4.d, b4.e,
- (int)result.x.a, result.x.b, result.y);
-
- CHECK((int)b2.a == 1);
- CHECK(b2.b == 7);
- CHECK((int)b3.x.a == 12);
- CHECK(b3.x.b == 127);
- CHECK(b3.y == 99);
- CHECK((int)b4.d == 2);
- CHECK(b4.e == 9);
- CHECK((int)result.x.a == 15);
- CHECK(result.x.b == 242);
- CHECK(result.y == 143);
-
- return result;
-}
-
-static void
-B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct A b0;
- struct B b1;
- struct C b2;
-
- b0 = *(struct A*)(args[0]);
- b1 = *(struct B*)(args[1]);
- b2 = *(struct C*)(args[2]);
-
- *(B*)resp = B_fn(b0, b1, b2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[4];
- ffi_type* cls_struct_fields[3];
- ffi_type* cls_struct_fields1[3];
- ffi_type* cls_struct_fields2[3];
- ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
- ffi_type* dbl_arg_types[4];
-
- struct A e_dbl = { 1LL, 7};
- struct B f_dbl = {{12LL , 127}, 99};
- struct C g_dbl = { 2LL, 9};
-
- struct B res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_type2.size = 0;
- cls_struct_type2.alignment = 0;
- cls_struct_type2.type = FFI_TYPE_STRUCT;
- cls_struct_type2.elements = cls_struct_fields2;
-
- cls_struct_fields[0] = &ffi_type_uint64;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = NULL;
-
- cls_struct_fields1[0] = &cls_struct_type;
- cls_struct_fields1[1] = &ffi_type_uchar;
- cls_struct_fields1[2] = NULL;
-
- cls_struct_fields2[0] = &ffi_type_uint64;
- cls_struct_fields2[1] = &ffi_type_uchar;
- cls_struct_fields2[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = &cls_struct_type2;
- dbl_arg_types[3] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type1,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = NULL;
-
- ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
- /* { dg-output "1 7 12 127 99 2 9: 15 242 143" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((B(*)(A, B, C))(code))(e_dbl, f_dbl, g_dbl);
- /* { dg-output "\n1 7 12 127 99 2 9: 15 242 143" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/nested_struct9.c b/deps/libffi/testsuite/libffi.closures/nested_struct9.c
deleted file mode 100644
index f88ab0a94fa..00000000000
--- a/deps/libffi/testsuite/libffi.closures/nested_struct9.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Sample taken from Alan Modras patch to src/prep_cif.c.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20051010 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- unsigned char a;
- unsigned long long b;
-} A;
-
-typedef struct B {
- struct A x;
- unsigned char y;
-} B;
-
-typedef struct C {
- unsigned long d;
- unsigned char e;
-} C;
-
-static B B_fn(struct A b2, struct B b3, struct C b4)
-{
- struct B result;
-
- result.x.a = b2.a + b3.x.a + b4.d;
- result.x.b = b2.b + b3.x.b + b3.y + b4.e;
- result.y = b2.b + b3.x.b + b4.e;
-
- printf("%d %d %d %d %d %d %d: %d %d %d\n", b2.a, (int)b2.b,
- b3.x.a, (int)b3.x.b, b3.y, (int)b4.d, b4.e,
- result.x.a, (int)result.x.b, result.y);
-
- CHECK((int)b2.a == 1);
- CHECK(b2.b == 7);
- CHECK((int)b3.x.a == 12);
- CHECK(b3.x.b == 127);
- CHECK(b3.y == 99);
- CHECK((int)b4.d == 2);
- CHECK(b4.e == 9);
- CHECK((int)result.x.a == 15);
- CHECK(result.x.b == 242);
- CHECK(result.y == 143);
-
- return result;
-}
-
-static void
-B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct A b0;
- struct B b1;
- struct C b2;
-
- b0 = *(struct A*)(args[0]);
- b1 = *(struct B*)(args[1]);
- b2 = *(struct C*)(args[2]);
-
- *(B*)resp = B_fn(b0, b1, b2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[4];
- ffi_type* cls_struct_fields[3];
- ffi_type* cls_struct_fields1[3];
- ffi_type* cls_struct_fields2[3];
- ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
- ffi_type* dbl_arg_types[4];
-
- struct A e_dbl = { 1, 7LL};
- struct B f_dbl = {{12.0 , 127}, 99};
- struct C g_dbl = { 2, 9};
-
- struct B res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_type2.size = 0;
- cls_struct_type2.alignment = 0;
- cls_struct_type2.type = FFI_TYPE_STRUCT;
- cls_struct_type2.elements = cls_struct_fields2;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_uint64;
- cls_struct_fields[2] = NULL;
-
- cls_struct_fields1[0] = &cls_struct_type;
- cls_struct_fields1[1] = &ffi_type_uchar;
- cls_struct_fields1[2] = NULL;
-
- cls_struct_fields2[0] = &ffi_type_ulong;
- cls_struct_fields2[1] = &ffi_type_uchar;
- cls_struct_fields2[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = &cls_struct_type2;
- dbl_arg_types[3] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type1,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = NULL;
-
- ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
- /* { dg-output "1 7 12 127 99 2 9: 15 242 143" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((B(*)(A, B, C))(code))(e_dbl, f_dbl, g_dbl);
- /* { dg-output "\n1 7 12 127 99 2 9: 15 242 143" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/problem1.c b/deps/libffi/testsuite/libffi.closures/problem1.c
deleted file mode 100644
index 6a91555a1fa..00000000000
--- a/deps/libffi/testsuite/libffi.closures/problem1.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct my_ffi_struct {
- double a;
- double b;
- double c;
-} my_ffi_struct;
-
-my_ffi_struct callee(struct my_ffi_struct a1, struct my_ffi_struct a2)
-{
- struct my_ffi_struct result;
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
-
- printf("%g %g %g %g %g %g: %g %g %g\n", a1.a, a1.b, a1.c,
- a2.a, a2.b, a2.c, result.a, result.b, result.c);
-
- return result;
-}
-
-void stub(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct my_ffi_struct a1;
- struct my_ffi_struct a2;
-
- a1 = *(struct my_ffi_struct*)(args[0]);
- a2 = *(struct my_ffi_struct*)(args[1]);
-
- *(my_ffi_struct *)resp = callee(a1, a2);
-}
-
-
-int main(void)
-{
- ffi_type* my_ffi_struct_fields[4];
- ffi_type my_ffi_struct_type;
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args[4];
- ffi_type* arg_types[3];
-
- struct my_ffi_struct g = { 1.0, 2.0, 3.0 };
- struct my_ffi_struct f = { 1.0, 2.0, 3.0 };
- struct my_ffi_struct res;
-
- my_ffi_struct_type.size = 0;
- my_ffi_struct_type.alignment = 0;
- my_ffi_struct_type.type = FFI_TYPE_STRUCT;
- my_ffi_struct_type.elements = my_ffi_struct_fields;
-
- my_ffi_struct_fields[0] = &ffi_type_double;
- my_ffi_struct_fields[1] = &ffi_type_double;
- my_ffi_struct_fields[2] = &ffi_type_double;
- my_ffi_struct_fields[3] = NULL;
-
- arg_types[0] = &my_ffi_struct_type;
- arg_types[1] = &my_ffi_struct_type;
- arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &my_ffi_struct_type,
- arg_types) == FFI_OK);
-
- args[0] = &g;
- args[1] = &f;
- args[2] = NULL;
- ffi_call(&cif, FFI_FN(callee), &res, args);
- /* { dg-output "1 2 3 1 2 3: 2 4 6" } */
- printf("res: %g %g %g\n", res.a, res.b, res.c);
- /* { dg-output "\nres: 2 4 6" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, stub, NULL, code) == FFI_OK);
-
- res = ((my_ffi_struct(*)(struct my_ffi_struct, struct my_ffi_struct))(code))(g, f);
- /* { dg-output "\n1 2 3 1 2 3: 2 4 6" } */
- printf("res: %g %g %g\n", res.a, res.b, res.c);
- /* { dg-output "\nres: 2 4 6" } */
-
- exit(0);;
-}
diff --git a/deps/libffi/testsuite/libffi.closures/single_entry_structs1.c b/deps/libffi/testsuite/libffi.closures/single_entry_structs1.c
deleted file mode 100644
index 00c4e174494..00000000000
--- a/deps/libffi/testsuite/libffi.closures/single_entry_structs1.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Single argument structs have a different ABI in emscripten.
- Limitations: none.
- PR: none.
- Originator: <hood@mit.edu> */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- int a;
-} A;
-
-static struct A A_fn(int b0, struct A b1)
-{
- b1.a += b0;
- return b1;
-}
-
-static void
-A_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- int b0;
- struct A b1;
-
- b0 = *(int*)(args[0]);
- b1 = *(struct A*)(args[1]);
-
- *(A*)resp = A_fn(b0, b1);
-}
-
-int main (void)
-{
- printf("123\n");
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[2];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[3];
-
- int e_dbl = 12125;
- struct A f_dbl = { 31625 };
-
- struct A res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_sint;
- cls_struct_fields[1] = NULL;
-
- dbl_arg_types[0] = &ffi_type_sint;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- res_dbl = A_fn(e_dbl, f_dbl);
- printf("0 res: %d\n", res_dbl.a);
- /* { dg-output "0 res: 43750" } */
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
-
- ffi_call(&cif, FFI_FN(A_fn), &res_dbl, args_dbl);
- printf("1 res: %d\n", res_dbl.a);
- /* { dg-output "\n1 res: 43750" } */
- CHECK( res_dbl.a == (e_dbl + f_dbl.a));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, A_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((A(*)(int, A))(code))(e_dbl, f_dbl);
- printf("2 res: %d\n", res_dbl.a);
- /* { dg-output "\n2 res: 43750" } */
- CHECK( res_dbl.a == (e_dbl + f_dbl.a));
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/single_entry_structs2.c b/deps/libffi/testsuite/libffi.closures/single_entry_structs2.c
deleted file mode 100644
index ab6556bf4ca..00000000000
--- a/deps/libffi/testsuite/libffi.closures/single_entry_structs2.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Single argument structs have a different ABI in emscripten.
- Limitations: none.
- PR: none.
- Originator: <hood@mit.edu> */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- int a, b;
-} A;
-
-typedef struct B {
- struct A y;
-} B;
-
-static struct B B_fn(int b0, struct B b1)
-{
- b1.y.a += b0;
- b1.y.b -= b0;
- return b1;
-}
-
-static void
-B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- int b0;
- struct B b1;
-
- b0 = *(int*)(args[0]);
- b1 = *(struct B*)(args[1]);
-
- *(B*)resp = B_fn(b0, b1);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[3];
- ffi_type* cls_struct_fields1[2];
- ffi_type cls_struct_type, cls_struct_type1;
- ffi_type* dbl_arg_types[3];
-
- int e_dbl = 12125;
- struct B f_dbl = { { 31625, 16723 } };
-
- struct B res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_fields[0] = &ffi_type_sint;
- cls_struct_fields[1] = &ffi_type_sint;
- cls_struct_fields[2] = NULL;
-
- cls_struct_fields1[0] = &cls_struct_type;
- cls_struct_fields1[1] = NULL;
-
-
- dbl_arg_types[0] = &ffi_type_sint;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = NULL;
-
- res_dbl = B_fn(e_dbl, f_dbl);
- printf("0 res: %d %d\n", res_dbl.y.a, res_dbl.y.b);
- /* { dg-output "0 res: 43750 4598" } */
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
- printf("1 res: %d %d\n", res_dbl.y.a, res_dbl.y.b);
- /* { dg-output "\n1 res: 43750 4598" } */
- CHECK( res_dbl.y.a == (f_dbl.y.a + e_dbl));
- CHECK( res_dbl.y.b == (f_dbl.y.b - e_dbl));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((B(*)(int, B))(code))(e_dbl, f_dbl);
- printf("2 res: %d %d\n", res_dbl.y.a, res_dbl.y.b);
- /* { dg-output "\n2 res: 43750 4598" } */
- CHECK( res_dbl.y.a == (f_dbl.y.a + e_dbl));
- CHECK( res_dbl.y.b == (f_dbl.y.b - e_dbl));
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/single_entry_structs3.c b/deps/libffi/testsuite/libffi.closures/single_entry_structs3.c
deleted file mode 100644
index 4f619cbf7c8..00000000000
--- a/deps/libffi/testsuite/libffi.closures/single_entry_structs3.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Single argument structs have a different ABI in emscripten.
- Limitations: none.
- PR: none.
- Originator: <hood@mit.edu> */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- int a;
-} A;
-
-typedef struct B {
- struct A y;
-} B;
-
-static struct B B_fn(int b0, struct B b1)
-{
- b1.y.a += b0;
- return b1;
-}
-
-static void
-B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- int b0;
- struct B b1;
-
- b0 = *(int*)(args[0]);
- b1 = *(struct B*)(args[1]);
-
- *(B*)resp = B_fn(b0, b1);
-}
-
-int main (void)
-{
- printf("123\n");
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[2];
- ffi_type* cls_struct_fields1[2];
- ffi_type cls_struct_type, cls_struct_type1;
- ffi_type* dbl_arg_types[3];
-
- int e_dbl = 12125;
- struct B f_dbl = { { 31625 } };
-
- struct B res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_fields[0] = &ffi_type_sint;
- cls_struct_fields[1] = NULL;
-
- cls_struct_fields1[0] = &cls_struct_type;
- cls_struct_fields1[1] = NULL;
-
-
- dbl_arg_types[0] = &ffi_type_sint;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = NULL;
-
- res_dbl = B_fn(e_dbl, f_dbl);
- printf("0 res: %d\n", res_dbl.y.a);
- /* { dg-output "0 res: 43750" } */
-
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
-
- ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
- printf("1 res: %d\n", res_dbl.y.a);
- /* { dg-output "\n1 res: 43750" } */
- CHECK( res_dbl.y.a == (e_dbl + f_dbl.y.a));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((B(*)(int, B))(code))(e_dbl, f_dbl);
- printf("2 res: %d\n", res_dbl.y.a);
- /* { dg-output "\n2 res: 43750" } */
- CHECK( res_dbl.y.a == (e_dbl + f_dbl.y.a));
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/stret_large.c b/deps/libffi/testsuite/libffi.closures/stret_large.c
deleted file mode 100644
index 71c2469e1c4..00000000000
--- a/deps/libffi/testsuite/libffi.closures/stret_large.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure returning with different structure size.
- Depending on the ABI. Check bigger struct which overlaps
- the gp and fp register count on Darwin/AIX/ppc64.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/21/2007 */
-
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-#include "ffitest.h"
-
-/* 13 FPRs: 104 bytes */
-/* 14 FPRs: 112 bytes */
-
-typedef struct struct_108byte {
- double a;
- double b;
- double c;
- double d;
- double e;
- double f;
- double g;
- double h;
- double i;
- double j;
- double k;
- double l;
- double m;
- int n;
-} struct_108byte;
-
-struct_108byte cls_struct_108byte_fn(
- struct_108byte b0,
- struct_108byte b1,
- struct_108byte b2,
- struct_108byte b3)
-{
- struct_108byte result;
-
- result.a = b0.a + b1.a + b2.a + b3.a;
- result.b = b0.b + b1.b + b2.b + b3.b;
- result.c = b0.c + b1.c + b2.c + b3.c;
- result.d = b0.d + b1.d + b2.d + b3.d;
- result.e = b0.e + b1.e + b2.e + b3.e;
- result.f = b0.f + b1.f + b2.f + b3.f;
- result.g = b0.g + b1.g + b2.g + b3.g;
- result.h = b0.h + b1.h + b2.h + b3.h;
- result.i = b0.i + b1.i + b2.i + b3.i;
- result.j = b0.j + b1.j + b2.j + b3.j;
- result.k = b0.k + b1.k + b2.k + b3.k;
- result.l = b0.l + b1.l + b2.l + b3.l;
- result.m = b0.m + b1.m + b2.m + b3.m;
- result.n = b0.n + b1.n + b2.n + b3.n;
-
- printf("%g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", result.a, result.b, result.c,
- result.d, result.e, result.f, result.g, result.h, result.i,
- result.j, result.k, result.l, result.m, result.n);
-
- return result;
-}
-
-static void
-cls_struct_108byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__)
-{
- struct_108byte b0, b1, b2, b3;
-
- b0 = *(struct_108byte*)(args[0]);
- b1 = *(struct_108byte*)(args[1]);
- b2 = *(struct_108byte*)(args[2]);
- b3 = *(struct_108byte*)(args[3]);
-
- *(struct_108byte*)resp = cls_struct_108byte_fn(b0, b1, b2, b3);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[15];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct_108byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0, 1.0, 2.0, 3.0, 7.0, 2.0, 7 };
- struct_108byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0, 4.0, 5.0, 7.0, 9.0, 1.0, 4 };
- struct_108byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0, 8.0, 6.0, 1.0, 4.0, 0.0, 3 };
- struct_108byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0, 9.0, 2.0, 6.0, 5.0, 3.0, 2 };
- struct_108byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_double;
- cls_struct_fields[3] = &ffi_type_double;
- cls_struct_fields[4] = &ffi_type_double;
- cls_struct_fields[5] = &ffi_type_double;
- cls_struct_fields[6] = &ffi_type_double;
- cls_struct_fields[7] = &ffi_type_double;
- cls_struct_fields[8] = &ffi_type_double;
- cls_struct_fields[9] = &ffi_type_double;
- cls_struct_fields[10] = &ffi_type_double;
- cls_struct_fields[11] = &ffi_type_double;
- cls_struct_fields[12] = &ffi_type_double;
- cls_struct_fields[13] = &ffi_type_sint32;
- cls_struct_fields[14] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = &cls_struct_type;
- dbl_arg_types[3] = &cls_struct_type;
- dbl_arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = &h_dbl;
- args_dbl[4] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_108byte_fn), &res_dbl, args_dbl);
- /* { dg-output "22 15 17 25 6 13 19 18 22 15 17 25 6 16" } */
- printf("res: %g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", res_dbl.a, res_dbl.b,
- res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i,
- res_dbl.j, res_dbl.k, res_dbl.l, res_dbl.m, res_dbl.n);
- /* { dg-output "\nres: 22 15 17 25 6 13 19 18 22 15 17 25 6 16" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_108byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((struct_108byte(*)(struct_108byte, struct_108byte,
- struct_108byte, struct_108byte))(code))(e_dbl, f_dbl, g_dbl, h_dbl);
- /* { dg-output "\n22 15 17 25 6 13 19 18 22 15 17 25 6 16" } */
- printf("res: %g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", res_dbl.a, res_dbl.b,
- res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i,
- res_dbl.j, res_dbl.k, res_dbl.l, res_dbl.m, res_dbl.n);
- /* { dg-output "\nres: 22 15 17 25 6 13 19 18 22 15 17 25 6 16" } */
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/stret_large2.c b/deps/libffi/testsuite/libffi.closures/stret_large2.c
deleted file mode 100644
index d9c750ee1c0..00000000000
--- a/deps/libffi/testsuite/libffi.closures/stret_large2.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure returning with different structure size.
- Depending on the ABI. Check bigger struct which overlaps
- the gp and fp register count on Darwin/AIX/ppc64.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/21/2007 */
-
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-#include "ffitest.h"
-
-/* 13 FPRs: 104 bytes */
-/* 14 FPRs: 112 bytes */
-
-typedef struct struct_116byte {
- double a;
- double b;
- double c;
- double d;
- double e;
- double f;
- double g;
- double h;
- double i;
- double j;
- double k;
- double l;
- double m;
- double n;
- int o;
-} struct_116byte;
-
-struct_116byte cls_struct_116byte_fn(
- struct_116byte b0,
- struct_116byte b1,
- struct_116byte b2,
- struct_116byte b3)
-{
- struct_116byte result;
-
- result.a = b0.a + b1.a + b2.a + b3.a;
- result.b = b0.b + b1.b + b2.b + b3.b;
- result.c = b0.c + b1.c + b2.c + b3.c;
- result.d = b0.d + b1.d + b2.d + b3.d;
- result.e = b0.e + b1.e + b2.e + b3.e;
- result.f = b0.f + b1.f + b2.f + b3.f;
- result.g = b0.g + b1.g + b2.g + b3.g;
- result.h = b0.h + b1.h + b2.h + b3.h;
- result.i = b0.i + b1.i + b2.i + b3.i;
- result.j = b0.j + b1.j + b2.j + b3.j;
- result.k = b0.k + b1.k + b2.k + b3.k;
- result.l = b0.l + b1.l + b2.l + b3.l;
- result.m = b0.m + b1.m + b2.m + b3.m;
- result.n = b0.n + b1.n + b2.n + b3.n;
- result.o = b0.o + b1.o + b2.o + b3.o;
-
- printf("%g %g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", result.a, result.b, result.c,
- result.d, result.e, result.f, result.g, result.h, result.i,
- result.j, result.k, result.l, result.m, result.n, result.o);
-
- return result;
-}
-
-static void
-cls_struct_116byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__)
-{
- struct_116byte b0, b1, b2, b3;
-
- b0 = *(struct_116byte*)(args[0]);
- b1 = *(struct_116byte*)(args[1]);
- b2 = *(struct_116byte*)(args[2]);
- b3 = *(struct_116byte*)(args[3]);
-
- *(struct_116byte*)resp = cls_struct_116byte_fn(b0, b1, b2, b3);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[16];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct_116byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0, 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 7 };
- struct_116byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0, 4.0, 5.0, 7.0, 9.0, 1.0, 6.0, 4 };
- struct_116byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0, 8.0, 6.0, 1.0, 4.0, 0.0, 7.0, 3 };
- struct_116byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0, 9.0, 2.0, 6.0, 5.0, 3.0, 8.0, 2 };
- struct_116byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_double;
- cls_struct_fields[3] = &ffi_type_double;
- cls_struct_fields[4] = &ffi_type_double;
- cls_struct_fields[5] = &ffi_type_double;
- cls_struct_fields[6] = &ffi_type_double;
- cls_struct_fields[7] = &ffi_type_double;
- cls_struct_fields[8] = &ffi_type_double;
- cls_struct_fields[9] = &ffi_type_double;
- cls_struct_fields[10] = &ffi_type_double;
- cls_struct_fields[11] = &ffi_type_double;
- cls_struct_fields[12] = &ffi_type_double;
- cls_struct_fields[13] = &ffi_type_double;
- cls_struct_fields[14] = &ffi_type_sint32;
- cls_struct_fields[15] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = &cls_struct_type;
- dbl_arg_types[3] = &cls_struct_type;
- dbl_arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = &h_dbl;
- args_dbl[4] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_116byte_fn), &res_dbl, args_dbl);
- /* { dg-output "22 15 17 25 6 13 19 18 22 15 17 25 6 26 16" } */
- printf("res: %g %g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", res_dbl.a, res_dbl.b,
- res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i,
- res_dbl.j, res_dbl.k, res_dbl.l, res_dbl.m, res_dbl.n, res_dbl.o);
- /* { dg-output "\nres: 22 15 17 25 6 13 19 18 22 15 17 25 6 26 16" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_116byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((struct_116byte(*)(struct_116byte, struct_116byte,
- struct_116byte, struct_116byte))(code))(e_dbl, f_dbl, g_dbl, h_dbl);
- /* { dg-output "\n22 15 17 25 6 13 19 18 22 15 17 25 6 26 16" } */
- printf("res: %g %g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", res_dbl.a, res_dbl.b,
- res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i,
- res_dbl.j, res_dbl.k, res_dbl.l, res_dbl.m, res_dbl.n, res_dbl.o);
- /* { dg-output "\nres: 22 15 17 25 6 13 19 18 22 15 17 25 6 26 16" } */
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/stret_medium.c b/deps/libffi/testsuite/libffi.closures/stret_medium.c
deleted file mode 100644
index 56e3d9d8fc0..00000000000
--- a/deps/libffi/testsuite/libffi.closures/stret_medium.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure returning with different structure size.
- Depending on the ABI. Check bigger struct which overlaps
- the gp and fp register count on Darwin/AIX/ppc64.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/21/2007 */
-
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-#include "ffitest.h"
-
-typedef struct struct_72byte {
- double a;
- double b;
- double c;
- double d;
- double e;
- double f;
- double g;
- double h;
- double i;
-} struct_72byte;
-
-static struct_72byte cls_struct_72byte_fn(
- struct_72byte b0,
- struct_72byte b1,
- struct_72byte b2,
- struct_72byte b3)
-{
- struct_72byte result;
-
- result.a = b0.a + b1.a + b2.a + b3.a;
- result.b = b0.b + b1.b + b2.b + b3.b;
- result.c = b0.c + b1.c + b2.c + b3.c;
- result.d = b0.d + b1.d + b2.d + b3.d;
- result.e = b0.e + b1.e + b2.e + b3.e;
- result.f = b0.f + b1.f + b2.f + b3.f;
- result.g = b0.g + b1.g + b2.g + b3.g;
- result.h = b0.h + b1.h + b2.h + b3.h;
- result.i = b0.i + b1.i + b2.i + b3.i;
-
- printf("%g %g %g %g %g %g %g %g %g\n", result.a, result.b, result.c,
- result.d, result.e, result.f, result.g, result.h, result.i);
-
- return result;
-}
-
-static void
-cls_struct_72byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__)
-{
- struct_72byte b0, b1, b2, b3;
-
- b0 = *(struct_72byte*)(args[0]);
- b1 = *(struct_72byte*)(args[1]);
- b2 = *(struct_72byte*)(args[2]);
- b3 = *(struct_72byte*)(args[3]);
-
- *(struct_72byte*)resp = cls_struct_72byte_fn(b0, b1, b2, b3);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[10];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct_72byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0, 7.0 };
- struct_72byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0, 4.0 };
- struct_72byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0, 3.0 };
- struct_72byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0, 2.0 };
- struct_72byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_double;
- cls_struct_fields[3] = &ffi_type_double;
- cls_struct_fields[4] = &ffi_type_double;
- cls_struct_fields[5] = &ffi_type_double;
- cls_struct_fields[6] = &ffi_type_double;
- cls_struct_fields[7] = &ffi_type_double;
- cls_struct_fields[8] = &ffi_type_double;
- cls_struct_fields[9] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = &cls_struct_type;
- dbl_arg_types[3] = &cls_struct_type;
- dbl_arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = &h_dbl;
- args_dbl[4] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_72byte_fn), &res_dbl, args_dbl);
- /* { dg-output "22 15 17 25 6 13 19 18 16" } */
- printf("res: %g %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i);
- /* { dg-output "\nres: 22 15 17 25 6 13 19 18 16" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_72byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((struct_72byte(*)(struct_72byte, struct_72byte,
- struct_72byte, struct_72byte))(code))(e_dbl, f_dbl, g_dbl, h_dbl);
- /* { dg-output "\n22 15 17 25 6 13 19 18 16" } */
- printf("res: %g %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i);
- /* { dg-output "\nres: 22 15 17 25 6 13 19 18 16" } */
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/stret_medium2.c b/deps/libffi/testsuite/libffi.closures/stret_medium2.c
deleted file mode 100644
index 0746b6ee4b7..00000000000
--- a/deps/libffi/testsuite/libffi.closures/stret_medium2.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure returning with different structure size.
- Depending on the ABI. Check bigger struct which overlaps
- the gp and fp register count on Darwin/AIX/ppc64.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/21/2007 */
-
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-/* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
-#include "ffitest.h"
-
-typedef struct struct_72byte {
- double a;
- double b;
- double c;
- double d;
- double e;
- double f;
- double g;
- double h;
- long long i;
-} struct_72byte;
-
-static struct_72byte cls_struct_72byte_fn(
- struct_72byte b0,
- struct_72byte b1,
- struct_72byte b2,
- struct_72byte b3)
-{
- struct_72byte result;
-
- result.a = b0.a + b1.a + b2.a + b3.a;
- result.b = b0.b + b1.b + b2.b + b3.b;
- result.c = b0.c + b1.c + b2.c + b3.c;
- result.d = b0.d + b1.d + b2.d + b3.d;
- result.e = b0.e + b1.e + b2.e + b3.e;
- result.f = b0.f + b1.f + b2.f + b3.f;
- result.g = b0.g + b1.g + b2.g + b3.g;
- result.h = b0.h + b1.h + b2.h + b3.h;
- result.i = b0.i + b1.i + b2.i + b3.i;
-
- printf("%g %g %g %g %g %g %g %g %" PRIdLL "\n", result.a, result.b, result.c,
- result.d, result.e, result.f, result.g, result.h, result.i);
-
- return result;
-}
-
-static void
-cls_struct_72byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__)
-{
- struct_72byte b0, b1, b2, b3;
-
- b0 = *(struct_72byte*)(args[0]);
- b1 = *(struct_72byte*)(args[1]);
- b2 = *(struct_72byte*)(args[2]);
- b3 = *(struct_72byte*)(args[3]);
-
- *(struct_72byte*)resp = cls_struct_72byte_fn(b0, b1, b2, b3);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[10];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct_72byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0, 7 };
- struct_72byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0, 4 };
- struct_72byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0, 3 };
- struct_72byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0, 2 };
- struct_72byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_double;
- cls_struct_fields[3] = &ffi_type_double;
- cls_struct_fields[4] = &ffi_type_double;
- cls_struct_fields[5] = &ffi_type_double;
- cls_struct_fields[6] = &ffi_type_double;
- cls_struct_fields[7] = &ffi_type_double;
- cls_struct_fields[8] = &ffi_type_sint64;
- cls_struct_fields[9] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = &cls_struct_type;
- dbl_arg_types[3] = &cls_struct_type;
- dbl_arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = &h_dbl;
- args_dbl[4] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_72byte_fn), &res_dbl, args_dbl);
- /* { dg-output "22 15 17 25 6 13 19 18 16" } */
- printf("res: %g %g %g %g %g %g %g %g %" PRIdLL "\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i);
- /* { dg-output "\nres: 22 15 17 25 6 13 19 18 16" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_72byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((struct_72byte(*)(struct_72byte, struct_72byte,
- struct_72byte, struct_72byte))(code))(e_dbl, f_dbl, g_dbl, h_dbl);
- /* { dg-output "\n22 15 17 25 6 13 19 18 16" } */
- printf("res: %g %g %g %g %g %g %g %g %" PRIdLL "\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i);
- /* { dg-output "\nres: 22 15 17 25 6 13 19 18 16" } */
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/testclosure.c b/deps/libffi/testsuite/libffi.closures/testclosure.c
deleted file mode 100644
index e738a01fb02..00000000000
--- a/deps/libffi/testsuite/libffi.closures/testclosure.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value float.
- Limitations: none.
- PR: 41908.
- Originator: <rfm@gnu.org> 20091102 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_combined {
- float a;
- float b;
- float c;
- float d;
-} cls_struct_combined;
-
-static void cls_struct_combined_fn(struct cls_struct_combined arg)
-{
- printf("%g %g %g %g\n",
- arg.a, arg.b,
- arg.c, arg.d);
- fflush(stdout);
-
- CHECK_FLOAT_EQ(arg.a, 4);
- CHECK_FLOAT_EQ(arg.b, 5);
- CHECK_FLOAT_EQ(arg.c, 1);
- CHECK_FLOAT_EQ(arg.d, 8);
-}
-
-static void
-cls_struct_combined_gn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__,
- void** args, void* userdata __UNUSED__)
-{
- struct cls_struct_combined a0;
-
- a0 = *(struct cls_struct_combined*)(args[0]);
-
- cls_struct_combined_fn(a0);
-}
-
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type* cls_struct_fields0[5];
- ffi_type cls_struct_type0;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_combined g_dbl = {4.0, 5.0, 1.0, 8.0};
-
- cls_struct_type0.size = 0;
- cls_struct_type0.alignment = 0;
- cls_struct_type0.type = FFI_TYPE_STRUCT;
- cls_struct_type0.elements = cls_struct_fields0;
-
- cls_struct_fields0[0] = &ffi_type_float;
- cls_struct_fields0[1] = &ffi_type_float;
- cls_struct_fields0[2] = &ffi_type_float;
- cls_struct_fields0[3] = &ffi_type_float;
- cls_struct_fields0[4] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type0;
- dbl_arg_types[1] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_void,
- dbl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_combined_gn, NULL, code) == FFI_OK);
-
- ((void(*)(cls_struct_combined)) (code))(g_dbl);
- /* { dg-output "4 5 1 8" } */
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/unwindtest.cc b/deps/libffi/testsuite/libffi.closures/unwindtest.cc
deleted file mode 100644
index 634fb716bf8..00000000000
--- a/deps/libffi/testsuite/libffi.closures/unwindtest.cc
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Area: ffi_closure, unwind info
- Purpose: Check if the unwind information is passed correctly.
- Limitations: none.
- PR: none.
- Originator: Jeff Sturm <jsturm@one-point.com> */
-
-/* { dg-do run { xfail moxie*-*-* } } */
-
-#include "ffitest.h"
-
-void ABI_ATTR
-closure_test_fn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__,
- void** args __UNUSED__, void* userdata __UNUSED__)
-{
- throw 9;
-}
-
-typedef void (*closure_test_type)();
-
-void closure_test_fn1(ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
- {
- *(ffi_arg*)resp =
- (int)*(float *)args[0] +(int)(*(float *)args[1]) +
- (int)(*(float *)args[2]) + (int)*(float *)args[3] +
- (int)(*(signed short *)args[4]) + (int)(*(float *)args[5]) +
- (int)*(float *)args[6] + (int)(*(int *)args[7]) +
- (int)(*(double*)args[8]) + (int)*(int *)args[9] +
- (int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
- (int)*(int *)args[12] + (int)(*(int *)args[13]) +
- (int)(*(int *)args[14]) + *(int *)args[15] + (int)(intptr_t)userdata;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
- (int)*(float *)args[0], (int)(*(float *)args[1]),
- (int)(*(float *)args[2]), (int)*(float *)args[3],
- (int)(*(signed short *)args[4]), (int)(*(float *)args[5]),
- (int)*(float *)args[6], (int)(*(int *)args[7]),
- (int)(*(double *)args[8]), (int)*(int *)args[9],
- (int)(*(int *)args[10]), (int)(*(float *)args[11]),
- (int)*(int *)args[12], (int)(*(int *)args[13]),
- (int)(*(int *)args[14]), *(int *)args[15],
- (int)(intptr_t)userdata, (int)*(ffi_arg*)resp);
-
- throw (int)*(ffi_arg*)resp;
-}
-
-typedef int (*closure_test_type1)(float, float, float, float, signed short,
- float, float, int, double, int, int, float,
- int, int, int, int);
-
-#ifdef __EMSCRIPTEN__
-extern "C"
-#endif
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = (ffi_closure *)ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[17];
-
- {
- cl_arg_types[1] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0,
- &ffi_type_void, cl_arg_types) == FFI_OK);
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn, NULL, code) == FFI_OK);
-
- try
- {
- (*((closure_test_type)(code)))();
- } catch (int exception_code)
- {
- CHECK(exception_code == 9);
- }
-
- printf("part one OK\n");
- /* { dg-output "part one OK" } */
- }
-
- {
-
- cl_arg_types[0] = &ffi_type_float;
- cl_arg_types[1] = &ffi_type_float;
- cl_arg_types[2] = &ffi_type_float;
- cl_arg_types[3] = &ffi_type_float;
- cl_arg_types[4] = &ffi_type_sshort;
- cl_arg_types[5] = &ffi_type_float;
- cl_arg_types[6] = &ffi_type_float;
- cl_arg_types[7] = &ffi_type_uint;
- cl_arg_types[8] = &ffi_type_double;
- cl_arg_types[9] = &ffi_type_uint;
- cl_arg_types[10] = &ffi_type_uint;
- cl_arg_types[11] = &ffi_type_float;
- cl_arg_types[12] = &ffi_type_uint;
- cl_arg_types[13] = &ffi_type_uint;
- cl_arg_types[14] = &ffi_type_uint;
- cl_arg_types[15] = &ffi_type_uint;
- cl_arg_types[16] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn1,
- (void *) 3 /* userdata */, code) == FFI_OK);
- try
- {
- (*((closure_test_type1)code))
- (1.1, 2.2, 3.3, 4.4, 127, 5.5, 6.6, 8, 9, 10, 11, 12.0, 13,
- 19, 21, 1);
- /* { dg-output "\n1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */
- } catch (int exception_code)
- {
- CHECK(exception_code == 255);
- }
- printf("part two OK\n");
- /* { dg-output "\npart two OK" } */
- }
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.closures/unwindtest_ffi_call.cc b/deps/libffi/testsuite/libffi.closures/unwindtest_ffi_call.cc
deleted file mode 100644
index 1b86cc0716d..00000000000
--- a/deps/libffi/testsuite/libffi.closures/unwindtest_ffi_call.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Area: ffi_call, unwind info
- Purpose: Check if the unwind information is passed correctly.
- Limitations: none.
- PR: none.
- Originator: Andreas Tobler <andreast@gcc.gnu.org> 20061213 */
-
-/* { dg-do run { xfail moxie*-*-* } } */
-
-#include "ffitest.h"
-
-static int checking(int a __UNUSED__, short b __UNUSED__,
- signed char c __UNUSED__)
-{
- throw 9;
-}
-
-#ifdef __EMSCRIPTEN__
-extern "C"
-#endif
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg rint;
-
- signed int si;
- signed short ss;
- signed char sc;
-
- args[0] = &ffi_type_sint;
- values[0] = &si;
- args[1] = &ffi_type_sshort;
- values[1] = &ss;
- args[2] = &ffi_type_schar;
- values[2] = ≻
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
- &ffi_type_sint, args) == FFI_OK);
-
- si = -6;
- ss = -12;
- sc = -1;
- {
- try
- {
- ffi_call(&cif, FFI_FN(checking), &rint, values);
- } catch (int exception_code)
- {
- CHECK(exception_code == 9);
- }
- printf("part one OK\n");
- /* { dg-output "part one OK" } */
- }
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.complex/cls_align_complex.inc b/deps/libffi/testsuite/libffi.complex/cls_align_complex.inc
deleted file mode 100644
index 4a812edf055..00000000000
--- a/deps/libffi/testsuite/libffi.complex/cls_align_complex.inc
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*-c-*- */
-#include "ffitest.h"
-#include <complex.h>
-
-typedef struct cls_struct_align {
- unsigned char a;
- _Complex T_C_TYPE b;
- unsigned char c;
-} cls_struct_align;
-
-cls_struct_align cls_struct_align_fn(
- struct cls_struct_align a1, struct cls_struct_align a2)
-{
- struct cls_struct_align result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %f,%fi %d %d %f,%fi %d: %d %f,%fi %d\n",
- a1.a, T_CONV creal (a1.b), T_CONV cimag (a1.b), a1.c,
- a2.a, T_CONV creal (a2.b), T_CONV cimag (a2.b), a2.c,
- result.a, T_CONV creal (result.b), T_CONV cimag (result.b), result.c);
-
- return result;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_c[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* c_arg_types[5];
-
- struct cls_struct_align g_c = { 12, 4951 + 7 * I, 127 };
- struct cls_struct_align f_c = { 1, 9320 + 1 * I, 13 };
- struct cls_struct_align res_c;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &T_FFI_TYPE;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- c_arg_types[0] = &cls_struct_type;
- c_arg_types[1] = &cls_struct_type;
- c_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- c_arg_types) == FFI_OK);
-
- args_c[0] = &g_c;
- args_c[1] = &f_c;
- args_c[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_c, args_c);
- /* { dg-output "12 4951,7i 127 1 9320,1i 13: 13 14271,8i 140" } */
- printf("res: %d %f,%fi %d\n",
- res_c.a, T_CONV creal (res_c.b), T_CONV cimag (res_c.b), res_c.c);
- /* { dg-output "\nres: 13 14271,8i 140" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_c = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_c, f_c);
- /* { dg-output "\n12 4951,7i 127 1 9320,1i 13: 13 14271,8i 140" } */
- printf("res: %d %f,%fi %d\n",
- res_c.a, T_CONV creal (res_c.b), T_CONV cimag (res_c.b), res_c.c);
- /* { dg-output "\nres: 13 14271,8i 140" } */
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.complex/cls_align_complex_double.c b/deps/libffi/testsuite/libffi.complex/cls_align_complex_double.c
deleted file mode 100644
index 0dff23ae47c..00000000000
--- a/deps/libffi/testsuite/libffi.complex/cls_align_complex_double.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of complex.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_double.inc"
-#include "cls_align_complex.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/cls_align_complex_float.c b/deps/libffi/testsuite/libffi.complex/cls_align_complex_float.c
deleted file mode 100644
index 0affbd07e53..00000000000
--- a/deps/libffi/testsuite/libffi.complex/cls_align_complex_float.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of complex.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_float.inc"
-#include "cls_align_complex.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c b/deps/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c
deleted file mode 100644
index 7889ba859b5..00000000000
--- a/deps/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of complex.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_longdouble.inc"
-#include "cls_align_complex.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/cls_complex.inc b/deps/libffi/testsuite/libffi.complex/cls_complex.inc
deleted file mode 100644
index f9374044e87..00000000000
--- a/deps/libffi/testsuite/libffi.complex/cls_complex.inc
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*-c-*- */
-#include "ffitest.h"
-#include <complex.h>
-
-static void cls_ret_complex_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
- {
- _Complex T_C_TYPE *pa;
- _Complex T_C_TYPE *pr;
- pa = (_Complex T_C_TYPE *)args[0];
- pr = (_Complex T_C_TYPE *)resp;
- *pr = *pa;
-
- printf("%.6f,%.6fi: %.6f,%.6fi\n",
- T_CONV creal (*pa), T_CONV cimag (*pa),
- T_CONV creal (*pr), T_CONV cimag (*pr));
- }
-typedef _Complex T_C_TYPE (*cls_ret_complex)(_Complex T_C_TYPE);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[2];
- _Complex T_C_TYPE res;
-
- cl_arg_types[0] = &T_FFI_TYPE;
- cl_arg_types[1] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &T_FFI_TYPE, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_complex_fn, NULL, code) == FFI_OK);
-
- res = (*((cls_ret_complex)code))(0.125 + 128.0 * I);
- printf("res: %.6f,%.6fi\n", T_CONV creal (res), T_CONV cimag (res));
- CHECK (res == (0.125 + 128.0 * I));
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.complex/cls_complex_double.c b/deps/libffi/testsuite/libffi.complex/cls_complex_double.c
deleted file mode 100644
index 05e35340e08..00000000000
--- a/deps/libffi/testsuite/libffi.complex/cls_complex_double.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value complex.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_double.inc"
-#include "cls_complex.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/cls_complex_float.c b/deps/libffi/testsuite/libffi.complex/cls_complex_float.c
deleted file mode 100644
index 5df7849d4c9..00000000000
--- a/deps/libffi/testsuite/libffi.complex/cls_complex_float.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value complex.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_float.inc"
-#include "cls_complex.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/cls_complex_longdouble.c b/deps/libffi/testsuite/libffi.complex/cls_complex_longdouble.c
deleted file mode 100644
index 2b1c320a20a..00000000000
--- a/deps/libffi/testsuite/libffi.complex/cls_complex_longdouble.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value complex.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_longdouble.inc"
-#include "cls_complex.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/cls_complex_struct.inc b/deps/libffi/testsuite/libffi.complex/cls_complex_struct.inc
deleted file mode 100644
index df8708d1c4f..00000000000
--- a/deps/libffi/testsuite/libffi.complex/cls_complex_struct.inc
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*-c-*- */
-#include "ffitest.h"
-#include <complex.h>
-
-typedef struct Cs {
- _Complex T_C_TYPE x;
- _Complex T_C_TYPE y;
-} Cs;
-
-Cs gc;
-
-void
-closure_test_fn(Cs p)
-{
- printf("%.1f,%.1fi %.1f,%.1fi\n",
- T_CONV creal (p.x), T_CONV cimag (p.x),
- T_CONV creal (p.y), T_CONV cimag (p.y));
- gc = p;
-}
-
-void
-closure_test_gn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__,
- void** args, void* userdata __UNUSED__)
-{
- closure_test_fn(*(Cs*)args[0]);
-}
-
-int main(int argc __UNUSED__, char** argv __UNUSED__)
-{
- ffi_cif cif;
-
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type *cl_arg_types[1];
-
- ffi_type ts1_type;
- ffi_type* ts1_type_elements[4];
-
- Cs arg = { 1.0 + 11.0 * I, 2.0 + 22.0 * I};
-
- ts1_type.size = 0;
- ts1_type.alignment = 0;
- ts1_type.type = FFI_TYPE_STRUCT;
- ts1_type.elements = ts1_type_elements;
-
- ts1_type_elements[0] = &T_FFI_TYPE;
- ts1_type_elements[1] = &T_FFI_TYPE;
- ts1_type_elements[2] = NULL;
-
- cl_arg_types[0] = &ts1_type;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_void, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_gn, NULL, code) == FFI_OK);
-
- gc.x = 0.0 + 0.0 * I;
- gc.y = 0.0 + 0.0 * I;
- ((void*(*)(Cs))(code))(arg);
- /* { dg-output "1.0,11.0i 2.0,22.0i\n" } */
- CHECK (gc.x == arg.x && gc.y == arg.y);
-
- gc.x = 0.0 + 0.0 * I;
- gc.y = 0.0 + 0.0 * I;
- closure_test_fn(arg);
- /* { dg-output "1.0,11.0i 2.0,22.0i\n" } */
- CHECK (gc.x == arg.x && gc.y == arg.y);
-
- return 0;
-}
diff --git a/deps/libffi/testsuite/libffi.complex/cls_complex_struct_double.c b/deps/libffi/testsuite/libffi.complex/cls_complex_struct_double.c
deleted file mode 100644
index ec71346a3fb..00000000000
--- a/deps/libffi/testsuite/libffi.complex/cls_complex_struct_double.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check complex arguments in structs.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_double.inc"
-#include "cls_complex_struct.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/cls_complex_struct_float.c b/deps/libffi/testsuite/libffi.complex/cls_complex_struct_float.c
deleted file mode 100644
index 96fdf750430..00000000000
--- a/deps/libffi/testsuite/libffi.complex/cls_complex_struct_float.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check complex arguments in structs.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_float.inc"
-#include "cls_complex_struct.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c b/deps/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c
deleted file mode 100644
index 005b467398f..00000000000
--- a/deps/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check complex arguments in structs.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_longdouble.inc"
-#include "cls_complex_struct.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/cls_complex_va.inc b/deps/libffi/testsuite/libffi.complex/cls_complex_va.inc
deleted file mode 100644
index 8a3e15f0f6a..00000000000
--- a/deps/libffi/testsuite/libffi.complex/cls_complex_va.inc
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*-c-*- */
-#include "ffitest.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <complex.h>
-
-static _Complex T_C_TYPE gComplexValue1 = 1 + 2 * I;
-static _Complex T_C_TYPE gComplexValue2 = 3 + 4 * I;
-
-static int cls_variadic(const char *format, ...)
-{
- va_list ap;
- _Complex T_C_TYPE p1, p2;
-
- va_start (ap, format);
- p1 = va_arg (ap, _Complex T_C_TYPE);
- p2 = va_arg (ap, _Complex T_C_TYPE);
- va_end (ap);
-
- return printf(format, T_CONV creal (p1), T_CONV cimag (p1),
- T_CONV creal (p2), T_CONV cimag (p2));
-}
-
-static void
-cls_complex_va_fn(ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
-{
- char* format = *(char**)args[0];
- gComplexValue1 = *(_Complex T_C_TYPE*)args[1];
- gComplexValue2 = *(_Complex T_C_TYPE*)args[2];
-
- *(ffi_arg*)resp =
- printf(format,
- T_CONV creal (gComplexValue1), T_CONV cimag (gComplexValue1),
- T_CONV creal (gComplexValue2), T_CONV cimag (gComplexValue2));
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args[4];
- ffi_type* arg_types[4];
- char *format = "%.1f,%.1fi %.1f,%.1fi\n";
-
- _Complex T_C_TYPE complexArg1 = 1.0 + 22.0 *I;
- _Complex T_C_TYPE complexArg2 = 333.0 + 4444.0 *I;
- ffi_arg res = 0;
-
- arg_types[0] = &ffi_type_pointer;
- arg_types[1] = &T_FFI_TYPE;
- arg_types[2] = &T_FFI_TYPE;
- arg_types[3] = NULL;
-
- /* This printf call is variadic */
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 3, &ffi_type_sint,
- arg_types) == FFI_OK);
-
- args[0] = &format;
- args[1] = &complexArg1;
- args[2] = &complexArg2;
- args[3] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_variadic), &res, args);
- printf("res: %d\n", (int) res);
- CHECK (res == 24);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_complex_va_fn, NULL, code)
- == FFI_OK);
-
- res = ((int(*)(char *, ...))(code))(format, complexArg1, complexArg2);
- CHECK (gComplexValue1 == complexArg1);
- CHECK (gComplexValue2 == complexArg2);
- printf("res: %d\n", (int) res);
- CHECK (res == 24);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.complex/cls_complex_va_double.c b/deps/libffi/testsuite/libffi.complex/cls_complex_va_double.c
deleted file mode 100644
index 879ccf3b81f..00000000000
--- a/deps/libffi/testsuite/libffi.complex/cls_complex_va_double.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Test complex' passed in variable argument lists.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_double.inc"
-#include "cls_complex_va.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/cls_complex_va_float.c b/deps/libffi/testsuite/libffi.complex/cls_complex_va_float.c
deleted file mode 100644
index 2b17826045a..00000000000
--- a/deps/libffi/testsuite/libffi.complex/cls_complex_va_float.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Test complex' passed in variable argument lists.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-/* Alpha splits _Complex into two arguments. It's illegal to pass
- float through varargs, so _Complex float goes badly. In sort of
- gets passed as _Complex double, but the compiler doesn't agree
- with itself on this issue. */
-/* { dg-do run { xfail alpha*-*-* } } */
-
-#include "complex_defs_float.inc"
-#include "cls_complex_va.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c b/deps/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c
deleted file mode 100644
index 6eca9656eac..00000000000
--- a/deps/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Test complex' passed in variable argument lists.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_longdouble.inc"
-#include "cls_complex_va.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/complex.exp b/deps/libffi/testsuite/libffi.complex/complex.exp
deleted file mode 100644
index 4631db285a2..00000000000
--- a/deps/libffi/testsuite/libffi.complex/complex.exp
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2003, 2006, 2009, 2010, 2014 Free Software Foundation, Inc.
-
-# This program 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 3 of the License, or
-# (at your option) any later version.
-#
-# This program 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; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-dg-init
-libffi-init
-
-global srcdir subdir
-
-set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.{c,cc}]]
-
-if { [libffi_feature_test "#ifdef FFI_TARGET_HAS_COMPLEX_TYPE"] } {
- run-many-tests $tlist ""
-} else {
- foreach test $tlist {
- unsupported "$test"
- }
-}
-
-dg-finish
-
-# Local Variables:
-# tcl-indent-level:4
-# End:
diff --git a/deps/libffi/testsuite/libffi.complex/complex.inc b/deps/libffi/testsuite/libffi.complex/complex.inc
deleted file mode 100644
index 515ae3e60de..00000000000
--- a/deps/libffi/testsuite/libffi.complex/complex.inc
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*-c-*-*/
-#include "ffitest.h"
-#include <complex.h>
-
-static _Complex T_C_TYPE f_complex(_Complex T_C_TYPE c, int x, int *py)
-{
- c = -(2 * creal (c)) + (cimag (c) + 1)* I;
- *py += x;
-
- return c;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
-
- _Complex T_C_TYPE tc_arg;
- _Complex T_C_TYPE tc_result;
- int tc_int_arg_x;
- int tc_y;
- int *tc_ptr_arg_y = &tc_y;
-
- args[0] = &T_FFI_TYPE;
- args[1] = &ffi_type_sint;
- args[2] = &ffi_type_pointer;
- values[0] = &tc_arg;
- values[1] = &tc_int_arg_x;
- values[2] = &tc_ptr_arg_y;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
- &T_FFI_TYPE, args) == FFI_OK);
-
- tc_arg = 1 + 7 * I;
- tc_int_arg_x = 1234;
- tc_y = 9876;
- ffi_call(&cif, FFI_FN(f_complex), &tc_result, values);
-
- printf ("%f,%fi %f,%fi, x %d 1234, y %d 11110\n",
- T_CONV creal (tc_result), T_CONV cimag (tc_result),
- T_CONV creal (2.0), T_CONV creal (8.0), tc_int_arg_x, tc_y);
-
- CHECK (creal (tc_result) == -2);
- CHECK (cimag (tc_result) == 8);
- CHECK (tc_int_arg_x == 1234);
- CHECK (*tc_ptr_arg_y == 11110);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.complex/complex_defs_double.inc b/deps/libffi/testsuite/libffi.complex/complex_defs_double.inc
deleted file mode 100644
index 3583e166d66..00000000000
--- a/deps/libffi/testsuite/libffi.complex/complex_defs_double.inc
+++ /dev/null
@@ -1,7 +0,0 @@
-/* -*-c-*- */
-/* Complex base type. */
-#define T_FFI_TYPE ffi_type_complex_double
-/* C type corresponding to the base type. */
-#define T_C_TYPE double
-/* C cast for a value of type T_C_TYPE that is passed to printf. */
-#define T_CONV
diff --git a/deps/libffi/testsuite/libffi.complex/complex_defs_float.inc b/deps/libffi/testsuite/libffi.complex/complex_defs_float.inc
deleted file mode 100644
index bbd9375cbfa..00000000000
--- a/deps/libffi/testsuite/libffi.complex/complex_defs_float.inc
+++ /dev/null
@@ -1,7 +0,0 @@
-/* -*-c-*- */
-/* Complex base type. */
-#define T_FFI_TYPE ffi_type_complex_float
-/* C type corresponding to the base type. */
-#define T_C_TYPE float
-/* C cast for a value of type T_C_TYPE that is passed to printf. */
-#define T_CONV (double)
diff --git a/deps/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc b/deps/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc
deleted file mode 100644
index 14b9f243f48..00000000000
--- a/deps/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc
+++ /dev/null
@@ -1,7 +0,0 @@
-/* -*-c-*- */
-/* Complex base type. */
-#define T_FFI_TYPE ffi_type_complex_longdouble
-/* C type corresponding to the base type. */
-#define T_C_TYPE long double
-/* C cast for a value of type T_C_TYPE that is passed to printf. */
-#define T_CONV
diff --git a/deps/libffi/testsuite/libffi.complex/complex_double.c b/deps/libffi/testsuite/libffi.complex/complex_double.c
deleted file mode 100644
index 8a3297b2a24..00000000000
--- a/deps/libffi/testsuite/libffi.complex/complex_double.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call
- Purpose: Check complex types.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_double.inc"
-#include "complex.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/complex_float.c b/deps/libffi/testsuite/libffi.complex/complex_float.c
deleted file mode 100644
index 5044ebbcaae..00000000000
--- a/deps/libffi/testsuite/libffi.complex/complex_float.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call
- Purpose: Check complex types.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_float.inc"
-#include "complex.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/complex_i128.c b/deps/libffi/testsuite/libffi.complex/complex_i128.c
deleted file mode 100644
index a599d556e12..00000000000
--- a/deps/libffi/testsuite/libffi.complex/complex_i128.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/* Area: ffi_call
- Purpose: Check complex int128 call and return.
- Limitations: none.
- PR: none. */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-/* clang defines __SIZEOF_INT128__ but does not support _Complex __int128,
- so exclude it here and fall through to the trivial main() below. */
-#if defined(FFI_TARGET_HAS_INT128) && \
- defined(FFI_TARGET_HAS_COMPLEX_TYPE) && \
- defined(__SIZEOF_INT128__) && \
- !defined(__clang__)
-
-typedef __int128_t i128;
-typedef _Complex __int128 ci128;
-
-static const ci128 val =
- (((i128)0x01020304050607ull << 64) | 0x08090a0b0c0d0e0full) +
- (((i128)0x10203040506070ull << 64) | 0x8090a0b0c0d0e0f0ull) * 1i;
-static const int dummy = 0xdeadbeef;
-
-#define D(X) int X __attribute__((unused))
-
-static ci128 f0(ci128 x)
-{
- return x;
-}
-
-static ci128 f1(D(a), ci128 x)
-{
- return x;
-}
-
-static ci128 f2(D(a), D(b), ci128 x)
-{
- return x;
-}
-
-static ci128 f3(D(a), D(b), D(c), ci128 x)
-{
- return x;
-}
-
-static ci128 f4(D(a), D(b), D(c), D(d), ci128 x)
-{
- return x;
-}
-
-static ci128 f5(D(a), D(b), D(c), D(d), D(e), ci128 x)
-{
- return x;
-}
-
-static ci128 f6(D(a), D(b), D(c), D(d), D(e), D(f), ci128 x)
-{
- return x;
-}
-
-static ci128 f7(D(a), D(b), D(c), D(d), D(e), D(f), D(g), ci128 x)
-{
- return x;
-}
-
-static ci128 f8(D(a), D(b), D(c), D(d), D(e), D(f), D(g), D(h), ci128 x)
-{
- return x;
-}
-
-#define N 9
-
-static void * const funcs[N] = {
- f0, f1, f2, f3, f4, f5, f6, f7, f8
-};
-
-static ffi_type ffi_type_ci128 = {
- sizeof(ci128),
- _Alignof(ci128),
- FFI_TYPE_COMPLEX,
- (ffi_type *[2]){ &ffi_type_sint128, NULL },
-};
-
-int main (void)
-{
- int i;
-
- for (i = 0; i < N; i++)
- {
- ffi_cif cif;
- ffi_status s;
- ffi_type *args[N];
- void *values[N];
- ci128 ret;
- int j;
-
- for (j = 0; j < i; j++)
- {
- args[j] = &ffi_type_sint;
- values[j] = (void *)&dummy;
- }
- args[i] = &ffi_type_ci128;
- values[i] = (void *)&val;
-
- s = ffi_prep_cif(&cif, FFI_DEFAULT_ABI, i + 1,
- &ffi_type_ci128, args);
- CHECK(s == FFI_OK);
-
- ffi_call(&cif, FFI_FN(funcs[i]), &ret, values);
- CHECK(ret == val);
- }
-
- return 0;
-}
-
-#else
-int main (void) { return 0; }
-#endif
diff --git a/deps/libffi/testsuite/libffi.complex/complex_int.c b/deps/libffi/testsuite/libffi.complex/complex_int.c
deleted file mode 100644
index cae5c4558f7..00000000000
--- a/deps/libffi/testsuite/libffi.complex/complex_int.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Area: ffi_call
- Purpose: Check non-standard complex types.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-#include "ffi.h"
-#include <complex.h>
-
-_Complex int f_complex(_Complex int c, int x, int *py)
-{
- __real__ c = -2 * __real__ c;
- __imag__ c = __imag__ c + 1;
- *py += x;
- return c;
-}
-
-/*
- * This macro can be used to define new complex type descriptors
- * in a platform independent way.
- *
- * name: Name of the new descriptor is ffi_type_complex_<name>.
- * type: The C base type of the complex type.
- */
-#define FFI_COMPLEX_TYPEDEF(name, type, ffitype) \
- static ffi_type *ffi_elements_complex_##name [2] = { \
- (ffi_type *)(&ffitype), NULL \
- }; \
- struct struct_align_complex_##name { \
- char c; \
- _Complex type x; \
- }; \
- ffi_type ffi_type_complex_##name = { \
- sizeof(_Complex type), \
- offsetof(struct struct_align_complex_##name, x), \
- FFI_TYPE_COMPLEX, \
- (ffi_type **)ffi_elements_complex_##name \
- }
-
-/* Define new complex type descriptors using the macro: */
-/* ffi_type_complex_sint */
-FFI_COMPLEX_TYPEDEF(sint, int, ffi_type_sint);
-/* ffi_type_complex_uchar */
-FFI_COMPLEX_TYPEDEF(uchar, unsigned char, ffi_type_uint8);
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
-
- _Complex int tc_arg;
- _Complex int tc_result;
- int tc_int_arg_x;
- int tc_y;
- int *tc_ptr_arg_y = &tc_y;
-
- args[0] = &ffi_type_complex_sint;
- args[1] = &ffi_type_sint;
- args[2] = &ffi_type_pointer;
- values[0] = &tc_arg;
- values[1] = &tc_int_arg_x;
- values[2] = &tc_ptr_arg_y;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &ffi_type_complex_sint, args)
- == FFI_OK);
-
- tc_arg = 1 + 7 * I;
- tc_int_arg_x = 1234;
- tc_y = 9876;
- ffi_call(&cif, FFI_FN(f_complex), &tc_result, values);
-
- printf ("%d,%di %d,%di, x %d 1234, y %d 11110\n",
- (int)tc_result, (int)(tc_result * -I), 2, 8, tc_int_arg_x, tc_y);
- /* { dg-output "-2,8i 2,8i, x 1234 1234, y 11110 11110" } */
- CHECK (creal (tc_result) == -2);
- CHECK (cimag (tc_result) == 8);
- CHECK (tc_int_arg_x == 1234);
- CHECK (*tc_ptr_arg_y == 11110);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.complex/complex_int_small.c b/deps/libffi/testsuite/libffi.complex/complex_int_small.c
deleted file mode 100644
index 29bc46d61c0..00000000000
--- a/deps/libffi/testsuite/libffi.complex/complex_int_small.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check integer complex types smaller than a register.
- Limitations: none.
- PR: none. */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-#include <complex.h>
-
-/* _Complex signed char and _Complex short are passed and returned in a
- single register or stack slot on most targets, which for complex values
- is a different code path from the larger types. The last function
- passes both after eight ints, so that they go to the stack on targets
- with eight argument registers. */
-
-#define FFI_COMPLEX_TYPEDEF(name, type, ffitype) \
- static ffi_type *ffi_elements_complex_##name [2] = { \
- (ffi_type *)(&ffitype), NULL \
- }; \
- struct struct_align_complex_##name { \
- char c; \
- _Complex type x; \
- }; \
- static ffi_type ffi_type_complex_##name = { \
- sizeof(_Complex type), \
- offsetof(struct struct_align_complex_##name, x), \
- FFI_TYPE_COMPLEX, \
- (ffi_type **)ffi_elements_complex_##name \
- }
-
-FFI_COMPLEX_TYPEDEF(schar, signed char, ffi_type_schar);
-FFI_COMPLEX_TYPEDEF(sshort, short, ffi_type_sshort);
-
-typedef _Complex signed char cc;
-typedef _Complex short cs;
-
-/* ffi_call requires its return storage to be at least register-sized and
- suitably aligned, even when the declared return type is smaller. */
-typedef union
-{
- ffi_arg align;
- cc cchar;
- cs cshort;
-} complex_result;
-
-static cc
-f_cc (cc a, int k)
-{
- __real__ a = __real__ a * k;
- __imag__ a = __imag__ a - k;
- return a;
-}
-
-static cs
-f_cs (cs a, int k)
-{
- __real__ a = __real__ a * k;
- __imag__ a = __imag__ a - k;
- return a;
-}
-
-static cs
-f_stack (int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8,
- cc a, cs b)
-{
- __real__ b = __real__ b + __real__ a + i1 + i2 + i3 + i4;
- __imag__ b = __imag__ b + __imag__ a + i5 + i6 + i7 + i8;
- return b;
-}
-
-static void
-cls_cc (ffi_cif *cif __UNUSED__, void *resp, void **args,
- void *userdata __UNUSED__)
-{
- *(cc *) resp = f_cc (*(cc *) args[0], *(int *) args[1]);
-}
-
-static void
-cls_cs (ffi_cif *cif __UNUSED__, void *resp, void **args,
- void *userdata __UNUSED__)
-{
- *(cs *) resp = f_cs (*(cs *) args[0], *(int *) args[1]);
-}
-
-static void
-cls_stack (ffi_cif *cif __UNUSED__, void *resp, void **args,
- void *userdata __UNUSED__)
-{
- *(cs *) resp = f_stack (*(int *) args[0], *(int *) args[1],
- *(int *) args[2], *(int *) args[3],
- *(int *) args[4], *(int *) args[5],
- *(int *) args[6], *(int *) args[7],
- *(cc *) args[8], *(cs *) args[9]);
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- ffi_type *types[10];
- void *values[10];
- ffi_closure *pcl;
- void *code;
- int ints[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
- cc a, ra;
- cs b, rb;
- complex_result result;
- int k = 3, i;
-
- pcl = ffi_closure_alloc (sizeof (ffi_closure), &code);
- CHECK (pcl != NULL);
-
- __real__ a = 5;
- __imag__ a = -7;
- __real__ b = 300;
- __imag__ b = -400;
-
- types[0] = &ffi_type_complex_schar;
- types[1] = &ffi_type_sint;
- values[0] = &a;
- values[1] = &k;
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 2, &ffi_type_complex_schar,
- types) == FFI_OK);
- ffi_call (&cif, FFI_FN (f_cc), &result, values);
- ra = result.cchar;
- printf ("cc: %d,%di\n", (int) __real__ ra, (int) __imag__ ra);
- CHECK (__real__ ra == 15 && __imag__ ra == -10);
- CHECK (ffi_prep_closure_loc (pcl, &cif, cls_cc, NULL, code) == FFI_OK);
- ra = ((cc (*)(cc, int)) code) (a, k);
- printf ("closure cc: %d,%di\n", (int) __real__ ra, (int) __imag__ ra);
- CHECK (__real__ ra == 15 && __imag__ ra == -10);
-
- types[0] = &ffi_type_complex_sshort;
- values[0] = &b;
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 2, &ffi_type_complex_sshort,
- types) == FFI_OK);
- ffi_call (&cif, FFI_FN (f_cs), &result, values);
- rb = result.cshort;
- printf ("cs: %d,%di\n", (int) __real__ rb, (int) __imag__ rb);
- CHECK (__real__ rb == 900 && __imag__ rb == -403);
- CHECK (ffi_prep_closure_loc (pcl, &cif, cls_cs, NULL, code) == FFI_OK);
- rb = ((cs (*)(cs, int)) code) (b, k);
- printf ("closure cs: %d,%di\n", (int) __real__ rb, (int) __imag__ rb);
- CHECK (__real__ rb == 900 && __imag__ rb == -403);
-
- for (i = 0; i < 8; i++)
- {
- types[i] = &ffi_type_sint;
- values[i] = &ints[i];
- }
- types[8] = &ffi_type_complex_schar;
- values[8] = &a;
- types[9] = &ffi_type_complex_sshort;
- values[9] = &b;
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 10, &ffi_type_complex_sshort,
- types) == FFI_OK);
- ffi_call (&cif, FFI_FN (f_stack), &result, values);
- rb = result.cshort;
- printf ("stack: %d,%di\n", (int) __real__ rb, (int) __imag__ rb);
- CHECK (__real__ rb == 315 && __imag__ rb == -381);
- CHECK (ffi_prep_closure_loc (pcl, &cif, cls_stack, NULL, code) == FFI_OK);
- rb = ((cs (*)(int, int, int, int, int, int, int, int, cc, cs)) code)
- (1, 2, 3, 4, 5, 6, 7, 8, a, b);
- printf ("closure stack: %d,%di\n", (int) __real__ rb, (int) __imag__ rb);
- CHECK (__real__ rb == 315 && __imag__ rb == -381);
-
- ffi_closure_free (pcl);
- exit (0);
-}
diff --git a/deps/libffi/testsuite/libffi.complex/complex_longdouble.c b/deps/libffi/testsuite/libffi.complex/complex_longdouble.c
deleted file mode 100644
index 7e783660930..00000000000
--- a/deps/libffi/testsuite/libffi.complex/complex_longdouble.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call
- Purpose: Check complex types.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_longdouble.inc"
-#include "complex.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/complex_longdouble_abi.c b/deps/libffi/testsuite/libffi.complex/complex_longdouble_abi.c
deleted file mode 100644
index 5a2ef2436b8..00000000000
--- a/deps/libffi/testsuite/libffi.complex/complex_longdouble_abi.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Area: ffi_prep_types
- Purpose: Check that _Complex long double follows the abi's long double width.
- Limitations: powerpc64 only -- the one target where long double has more
- than one width at run time.
- PR: none.
- Originator: Anthony Green 20260916 */
-
-/* { dg-do run { target powerpc64*-*-linux-gnu* } } */
-
-#include "ffitest.h"
-
-/* ffi_prep_cif() and ffi_get_struct_offsets() resize ffi_type_longdouble to
- match the FFI_LINUX_LONG_DOUBLE_128 bit of the abi they are handed, so that
- one libffi can describe calls into libraries built with either width. That
- is also why these two types, alone among the ffi_type objects, are not
- const. ffi_type_complex_longdouble has to keep up: two halves of whatever
- long double currently is. */
-
-static void
-check_width (ffi_abi abi, size_t ld_size, unsigned short ld_align)
-{
- ffi_cif cif;
- ffi_type *args[1];
- ffi_type *elements[2];
- ffi_type s;
- size_t offsets[1];
-
- args[0] = &ffi_type_complex_longdouble;
- CHECK (ffi_prep_cif (&cif, abi, 1, &ffi_type_complex_longdouble, args)
- == FFI_OK);
-
- CHECK (ffi_type_longdouble.size == ld_size);
- CHECK (ffi_type_longdouble.alignment == ld_align);
-
- CHECK (ffi_type_complex_longdouble.size == 2 * ld_size);
- CHECK (ffi_type_complex_longdouble.alignment == ld_align);
- CHECK (ffi_type_complex_longdouble.elements[0]->size == ld_size);
-
- /* A struct built out of that type has to come out the same size, which is
- what ffi_get_struct_offsets() and every struct-passing path rely on. */
- elements[0] = &ffi_type_complex_longdouble;
- elements[1] = NULL;
- s.size = 0;
- s.alignment = 0;
- s.type = FFI_TYPE_STRUCT;
- s.elements = elements;
- CHECK (ffi_get_struct_offsets (abi, &s, offsets) == FFI_OK);
- CHECK (s.size == 2 * ld_size);
- CHECK (offsets[0] == 0);
-}
-
-int
-main (void)
-{
- size_t native = (FFI_DEFAULT_ABI & FFI_LINUX_LONG_DOUBLE_128) ? 16 : 8;
-
- /* A 64-bit long double, as musl selects on ppc64le. */
- check_width ((ffi_abi) FFI_LINUX, 8, 8);
- /* A 128-bit long double, either IBM-128 or IEEE-128. */
- check_width ((ffi_abi) (FFI_LINUX | FFI_LINUX_LONG_DOUBLE_128), 16, 16);
- /* Leave the globals as this build's default abi found them. */
- check_width (FFI_DEFAULT_ABI, native, (unsigned short) native);
-
- printf ("success\n");
- exit (0);
-}
-
-/* { dg-output "success" } */
diff --git a/deps/libffi/testsuite/libffi.complex/complex_regs.inc b/deps/libffi/testsuite/libffi.complex/complex_regs.inc
deleted file mode 100644
index f2d2bbf8e36..00000000000
--- a/deps/libffi/testsuite/libffi.complex/complex_regs.inc
+++ /dev/null
@@ -1,142 +0,0 @@
-/* -*-c-*- */
-#include "ffitest.h"
-#include <complex.h>
-
-/* A complex argument that arrives when the argument registers are nearly
- used up. Seven doubles leave one floating-point argument register on
- RISC-V and LoongArch, so the complex value has to move to integer
- registers as a whole. Five ints leave an odd number of GPRs on 32-bit
- PowerPC, where a two-word complex skips to the next even register pair
- and a larger one goes to the stack, followed by every later argument.
- Eight doubles and eight ints push the complex value onto the stack on
- every target. */
-
-typedef _Complex T_C_TYPE C;
-
-static C
-fn_d7 (double d1, double d2, double d3, double d4, double d5, double d6,
- double d7, C c, int k)
-{
- return c * k + (d1 + d2 + d3 + d4 + d5 + d6 + d7);
-}
-
-static C
-fn_i5 (int i1, int i2, int i3, int i4, int i5, C c, int k)
-{
- return c * k + (i1 + i2 + i3 + i4 + i5);
-}
-
-static C
-fn_d8i8 (double d1, double d2, double d3, double d4, double d5, double d6,
- double d7, double d8, int i1, int i2, int i3, int i4, int i5, int i6,
- int i7, int i8, C c, int k)
-{
- return c * k + (d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8
- + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8);
-}
-
-/* SHAPE[0] doubles, SHAPE[1] ints, then the complex value and an int. */
-static void
-cls_fn (ffi_cif *cif __UNUSED__, void *resp, void **args, void *userdata)
-{
- const int *shape = (const int *) userdata;
- T_C_TYPE s = 0;
- int i, n = 0;
-
- for (i = 0; i < shape[0]; i++)
- s += *(double *) args[n++];
- for (i = 0; i < shape[1]; i++)
- s += *(int *) args[n++];
- *(C *) resp = *(C *) args[n] * *(int *) args[n + 1] + s;
-}
-
-static void
-check (const char *name, C got, C want)
-{
- printf ("%s: %.3f,%.3fi (want %.3f,%.3fi)\n", name,
- T_CONV creal (got), T_CONV cimag (got),
- T_CONV creal (want), T_CONV cimag (want));
- CHECK (creal (got) == creal (want));
- CHECK (cimag (got) == cimag (want));
-}
-
-static void
-prep (ffi_cif *cif, ffi_type **types, void **values, int nd, int ni,
- double *d, int *i, C *c, int *k)
-{
- int j, n = 0;
-
- for (j = 0; j < nd; j++, n++)
- {
- types[n] = &ffi_type_double;
- values[n] = &d[j];
- }
- for (j = 0; j < ni; j++, n++)
- {
- types[n] = &ffi_type_sint;
- values[n] = &i[j];
- }
- types[n] = &T_FFI_TYPE;
- values[n++] = c;
- types[n] = &ffi_type_sint;
- values[n++] = k;
- CHECK (ffi_prep_cif (cif, FFI_DEFAULT_ABI, n, &T_FFI_TYPE, types) == FFI_OK);
-}
-
-int
-main (void)
-{
- static const int shape_d7[2] = { 7, 0 };
- static const int shape_i5[2] = { 0, 5 };
- static const int shape_d8i8[2] = { 8, 8 };
- double d[8] = { 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5 };
- int i[8] = { 10, 20, 30, 40, 50, 60, 70, 80 };
- C c = 1.25 + 2.5 * I;
- int k = 77;
- ffi_type *types[18];
- void *values[18];
- ffi_cif cif;
- ffi_closure *pcl;
- void *code;
- C r;
-
- pcl = ffi_closure_alloc (sizeof (ffi_closure), &code);
- CHECK (pcl != NULL);
-
- prep (&cif, types, values, 7, 0, d, i, &c, &k);
- ffi_call (&cif, FFI_FN (fn_d7), &r, values);
- check ("call d7", r, fn_d7 (d[0], d[1], d[2], d[3], d[4], d[5], d[6], c, k));
- CHECK (ffi_prep_closure_loc (pcl, &cif, cls_fn, (void *) shape_d7, code)
- == FFI_OK);
- r = ((C (*)(double, double, double, double, double, double, double, C,
- int)) code) (d[0], d[1], d[2], d[3], d[4], d[5], d[6], c, k);
- check ("closure d7", r,
- fn_d7 (d[0], d[1], d[2], d[3], d[4], d[5], d[6], c, k));
-
- prep (&cif, types, values, 0, 5, d, i, &c, &k);
- ffi_call (&cif, FFI_FN (fn_i5), &r, values);
- check ("call i5", r, fn_i5 (i[0], i[1], i[2], i[3], i[4], c, k));
- CHECK (ffi_prep_closure_loc (pcl, &cif, cls_fn, (void *) shape_i5, code)
- == FFI_OK);
- r = ((C (*)(int, int, int, int, int, C, int)) code)
- (i[0], i[1], i[2], i[3], i[4], c, k);
- check ("closure i5", r, fn_i5 (i[0], i[1], i[2], i[3], i[4], c, k));
-
- prep (&cif, types, values, 8, 8, d, i, &c, &k);
- ffi_call (&cif, FFI_FN (fn_d8i8), &r, values);
- check ("call d8i8", r,
- fn_d8i8 (d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7],
- i[0], i[1], i[2], i[3], i[4], i[5], i[6], i[7], c, k));
- CHECK (ffi_prep_closure_loc (pcl, &cif, cls_fn, (void *) shape_d8i8, code)
- == FFI_OK);
- r = ((C (*)(double, double, double, double, double, double, double, double,
- int, int, int, int, int, int, int, int, C, int)) code)
- (d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7],
- i[0], i[1], i[2], i[3], i[4], i[5], i[6], i[7], c, k);
- check ("closure d8i8", r,
- fn_d8i8 (d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7],
- i[0], i[1], i[2], i[3], i[4], i[5], i[6], i[7], c, k));
-
- ffi_closure_free (pcl);
- exit (0);
-}
diff --git a/deps/libffi/testsuite/libffi.complex/complex_regs_double.c b/deps/libffi/testsuite/libffi.complex/complex_regs_double.c
deleted file mode 100644
index 6c1cb7e025a..00000000000
--- a/deps/libffi/testsuite/libffi.complex/complex_regs_double.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check complex arguments after the argument registers run low.
- Limitations: none.
- PR: none. */
-
-/* { dg-do run { xfail mips64*-*-* } } */
-/* XFAIL: mips N64 complex-argument ABI bug; the little-endian variant
- fails the complex-double case too. See libffi issue #1071. */
-
-#include "complex_defs_double.inc"
-#include "complex_regs.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/complex_regs_float.c b/deps/libffi/testsuite/libffi.complex/complex_regs_float.c
deleted file mode 100644
index a7015c41d21..00000000000
--- a/deps/libffi/testsuite/libffi.complex/complex_regs_float.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check complex arguments after the argument registers run low.
- Limitations: none.
- PR: none. */
-
-/* { dg-do run { xfail mips64*-*-* } } */
-/* XFAIL: mips N64 ABI bug in complex-float/longdouble args and fp-struct
- returns; see libffi issue #1071. */
-
-#include "complex_defs_float.inc"
-#include "complex_regs.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/complex_regs_longdouble.c b/deps/libffi/testsuite/libffi.complex/complex_regs_longdouble.c
deleted file mode 100644
index b5e3082c7e9..00000000000
--- a/deps/libffi/testsuite/libffi.complex/complex_regs_longdouble.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check complex arguments after the argument registers run low.
- Limitations: none.
- PR: none. */
-
-/* { dg-do run { xfail mips64*-*-* } } */
-/* XFAIL: mips N64 ABI bug in complex-float/longdouble args and fp-struct
- returns; see libffi issue #1071. */
-
-#include "complex_defs_longdouble.inc"
-#include "complex_regs.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/ffitest.h b/deps/libffi/testsuite/libffi.complex/ffitest.h
deleted file mode 100644
index d27d362d6a6..00000000000
--- a/deps/libffi/testsuite/libffi.complex/ffitest.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../libffi.call/ffitest.h"
diff --git a/deps/libffi/testsuite/libffi.complex/many_complex.inc b/deps/libffi/testsuite/libffi.complex/many_complex.inc
deleted file mode 100644
index e37a7743976..00000000000
--- a/deps/libffi/testsuite/libffi.complex/many_complex.inc
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*-c-*- */
-#include "ffitest.h"
-
-#include <stdlib.h>
-#include <complex.h>
-
-static _Complex T_C_TYPE many(_Complex T_C_TYPE c1,
- _Complex T_C_TYPE c2,
- _Complex T_C_TYPE c3,
- _Complex T_C_TYPE c4,
- _Complex T_C_TYPE c5,
- _Complex T_C_TYPE c6,
- _Complex T_C_TYPE c7,
- _Complex T_C_TYPE c8,
- _Complex T_C_TYPE c9,
- _Complex T_C_TYPE c10,
- _Complex T_C_TYPE c11,
- _Complex T_C_TYPE c12,
- _Complex T_C_TYPE c13)
-{
- printf("0 :%f,%fi\n"
- "1 :%f,%fi\n"
- "2 :%f,%fi\n"
- "3 :%f,%fi\n"
- "4 :%f,%fi\n"
- "5 :%f,%fi\n"
- "6 :%f,%fi\n"
- "7 :%f,%fi\n"
- "8 :%f,%fi\n"
- "9 :%f,%fi\n"
- "10:%f,%fi\n"
- "11:%f,%fi\n"
- "12:%f,%fi\n",
- T_CONV creal (c1), T_CONV cimag (c1),
- T_CONV creal (c2), T_CONV cimag (c2),
- T_CONV creal (c3), T_CONV cimag (c3),
- T_CONV creal (c4), T_CONV cimag (c4),
- T_CONV creal (c5), T_CONV cimag (c5),
- T_CONV creal (c6), T_CONV cimag (c6),
- T_CONV creal (c7), T_CONV cimag (c7),
- T_CONV creal (c8), T_CONV cimag (c8),
- T_CONV creal (c9), T_CONV cimag (c9),
- T_CONV creal (c10), T_CONV cimag (c10),
- T_CONV creal (c11), T_CONV cimag (c11),
- T_CONV creal (c12), T_CONV cimag (c12),
- T_CONV creal (c13), T_CONV cimag (c13));
-
- return (c1+c2-c3-c4+c5+c6+c7-c8-c9-c10-c11+c12+c13);
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[13];
- void *values[13];
- _Complex T_C_TYPE ca[13];
- _Complex T_C_TYPE c, cc;
- int i;
-
- for (i = 0; i < 13; i++)
- {
- args[i] = &T_FFI_TYPE;
- values[i] = &ca[i];
- ca[i] = i + (-20 - i) * I;
- }
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 13, &T_FFI_TYPE, args) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(many), &c, values);
-
- cc = many(ca[0], ca[1], ca[2], ca[3], ca[4], ca[5], ca[6], ca[7], ca[8],
- ca[9], ca[10], ca[11], ca[12]);
- CHECK(creal (cc) == creal (c));
- CHECK(cimag (cc) == cimag (c));
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.complex/many_complex_double.c b/deps/libffi/testsuite/libffi.complex/many_complex_double.c
deleted file mode 100644
index 3fd53c3354d..00000000000
--- a/deps/libffi/testsuite/libffi.complex/many_complex_double.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value complex, with many arguments
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_double.inc"
-#include "many_complex.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/many_complex_float.c b/deps/libffi/testsuite/libffi.complex/many_complex_float.c
deleted file mode 100644
index c43d21cd9e1..00000000000
--- a/deps/libffi/testsuite/libffi.complex/many_complex_float.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value complex, with many arguments
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_float.inc"
-#include "many_complex.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/many_complex_longdouble.c b/deps/libffi/testsuite/libffi.complex/many_complex_longdouble.c
deleted file mode 100644
index dbab723969c..00000000000
--- a/deps/libffi/testsuite/libffi.complex/many_complex_longdouble.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value complex, with many arguments
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_longdouble.inc"
-#include "many_complex.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/return_complex.inc b/deps/libffi/testsuite/libffi.complex/return_complex.inc
deleted file mode 100644
index 8bf0c1fbab8..00000000000
--- a/deps/libffi/testsuite/libffi.complex/return_complex.inc
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*-c-*- */
-#include "ffitest.h"
-#include <complex.h>
-
-static _Complex T_C_TYPE return_c(_Complex T_C_TYPE c)
-{
- printf ("%f,%fi\n", T_CONV creal (c), T_CONV cimag (c));
- return 2 * c;
-}
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- _Complex T_C_TYPE c, rc, rc2;
- T_C_TYPE cr, ci;
-
- args[0] = &T_FFI_TYPE;
- values[0] = &c;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &T_FFI_TYPE, args) == FFI_OK);
-
- for (cr = -127.0; cr < 127; cr++)
- {
- ci = 1000.0 - cr;
- c = cr + ci * I;
- ffi_call(&cif, FFI_FN(return_c), &rc, values);
- rc2 = return_c(c);
- printf ("%f,%fi vs %f,%fi\n",
- T_CONV creal (rc), T_CONV cimag (rc),
- T_CONV creal (rc2), T_CONV cimag (rc2));
- CHECK(rc == 2 * c);
- }
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.complex/return_complex1.inc b/deps/libffi/testsuite/libffi.complex/return_complex1.inc
deleted file mode 100644
index 7cecc0fefa5..00000000000
--- a/deps/libffi/testsuite/libffi.complex/return_complex1.inc
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*-c-*- */
-#include "ffitest.h"
-#include <complex.h>
-
-static _Complex T_C_TYPE return_c(_Complex T_C_TYPE c1, float fl2, unsigned int in3, _Complex T_C_TYPE c4)
-{
- return c1 + fl2 + in3 + c4;
-}
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- _Complex T_C_TYPE c1, c4, rc, rc2;
- float fl2;
- unsigned int in3;
- args[0] = &T_FFI_TYPE;
- args[1] = &ffi_type_float;
- args[2] = &ffi_type_uint;
- args[3] = &T_FFI_TYPE;
- values[0] = &c1;
- values[1] = &fl2;
- values[2] = &in3;
- values[3] = &c4;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &T_FFI_TYPE, args) == FFI_OK);
- c1 = 127.0 + 255.0 * I;
- fl2 = 128.0;
- in3 = 255;
- c4 = 512.7 + 1024.1 * I;
-
- ffi_call(&cif, FFI_FN(return_c), &rc, values);
- rc2 = return_c(c1, fl2, in3, c4);
- printf ("%f,%fi vs %f,%fi\n",
- T_CONV creal (rc), T_CONV cimag (rc),
- T_CONV creal (rc2), T_CONV cimag (rc2));
- CHECK(rc == rc2);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.complex/return_complex1_double.c b/deps/libffi/testsuite/libffi.complex/return_complex1_double.c
deleted file mode 100644
index 727410d563d..00000000000
--- a/deps/libffi/testsuite/libffi.complex/return_complex1_double.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value complex.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_double.inc"
-#include "return_complex1.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/return_complex1_float.c b/deps/libffi/testsuite/libffi.complex/return_complex1_float.c
deleted file mode 100644
index a2aeada8476..00000000000
--- a/deps/libffi/testsuite/libffi.complex/return_complex1_float.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value complex.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_float.inc"
-#include "return_complex1.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/return_complex1_longdouble.c b/deps/libffi/testsuite/libffi.complex/return_complex1_longdouble.c
deleted file mode 100644
index 103504bf64e..00000000000
--- a/deps/libffi/testsuite/libffi.complex/return_complex1_longdouble.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value complex.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_longdouble.inc"
-#include "return_complex1.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/return_complex2.inc b/deps/libffi/testsuite/libffi.complex/return_complex2.inc
deleted file mode 100644
index 265170bf718..00000000000
--- a/deps/libffi/testsuite/libffi.complex/return_complex2.inc
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*-c-*- */
-#include "ffitest.h"
-#include <complex.h>
-
-_Complex T_C_TYPE
-return_c(_Complex T_C_TYPE c1, _Complex T_C_TYPE c2,
- unsigned int in3, _Complex T_C_TYPE c4)
-{
- volatile _Complex T_C_TYPE r = c1 + c2 + in3 + c4;
- return r;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- _Complex T_C_TYPE c1, c2, c4, rc, rc2;
- unsigned int in3;
- args[0] = &T_FFI_TYPE;
- args[1] = &T_FFI_TYPE;
- args[2] = &ffi_type_uint;
- args[3] = &T_FFI_TYPE;
- values[0] = &c1;
- values[1] = &c2;
- values[2] = &in3;
- values[3] = &c4;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &T_FFI_TYPE, args) == FFI_OK);
- c1 = 127.0 + 255.0 * I;
- c2 = 128.0 + 256.0;
- in3 = 255;
- c4 = 512.7 + 1024.1 * I;
-
- ffi_call(&cif, FFI_FN(return_c), &rc, values);
- rc2 = return_c(c1, c2, in3, c4);
- printf ("%f,%fi vs %f,%fi\n",
- T_CONV creal (rc), T_CONV cimag (rc),
- T_CONV creal (rc2), T_CONV cimag (rc2));
- CHECK(rc == rc2);
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.complex/return_complex2_double.c b/deps/libffi/testsuite/libffi.complex/return_complex2_double.c
deleted file mode 100644
index ab9efacb4a8..00000000000
--- a/deps/libffi/testsuite/libffi.complex/return_complex2_double.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value complex.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_double.inc"
-#include "return_complex2.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/return_complex2_float.c b/deps/libffi/testsuite/libffi.complex/return_complex2_float.c
deleted file mode 100644
index d7f22c2a0c7..00000000000
--- a/deps/libffi/testsuite/libffi.complex/return_complex2_float.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value complex.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_float.inc"
-#include "return_complex2.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/return_complex2_longdouble.c b/deps/libffi/testsuite/libffi.complex/return_complex2_longdouble.c
deleted file mode 100644
index 3edea629df0..00000000000
--- a/deps/libffi/testsuite/libffi.complex/return_complex2_longdouble.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value complex.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_longdouble.inc"
-#include "return_complex2.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/return_complex_double.c b/deps/libffi/testsuite/libffi.complex/return_complex_double.c
deleted file mode 100644
index e2497cc84aa..00000000000
--- a/deps/libffi/testsuite/libffi.complex/return_complex_double.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value complex.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_double.inc"
-#include "return_complex.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/return_complex_float.c b/deps/libffi/testsuite/libffi.complex/return_complex_float.c
deleted file mode 100644
index a35528ff935..00000000000
--- a/deps/libffi/testsuite/libffi.complex/return_complex_float.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value complex.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_float.inc"
-#include "return_complex.inc"
diff --git a/deps/libffi/testsuite/libffi.complex/return_complex_longdouble.c b/deps/libffi/testsuite/libffi.complex/return_complex_longdouble.c
deleted file mode 100644
index 142d7becbac..00000000000
--- a/deps/libffi/testsuite/libffi.complex/return_complex_longdouble.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value complex.
- Limitations: none.
- PR: none.
- Originator: <vogt@linux.vnet.ibm.com>. */
-
-/* { dg-do run } */
-
-#include "complex_defs_longdouble.inc"
-#include "return_complex.inc"
diff --git a/deps/libffi/testsuite/libffi.configure/libdir.sh b/deps/libffi/testsuite/libffi.configure/libdir.sh
deleted file mode 100755
index 0232593539f..00000000000
--- a/deps/libffi/testsuite/libffi.configure/libdir.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/sh
-
-set -eu
-
-srcdir=$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)
-test_root=$(mktemp -d "${TMPDIR:-/tmp}/libffi-libdir.XXXXXX")
-trap 'rm -rf "$test_root"' EXIT HUP INT TERM
-
-cat > "$test_root/cc" <<'EOF'
-#!/bin/sh
-for arg do
- if test "$arg" = -print-multi-os-directory; then
- echo ../lib64
- exit 0
- fi
-done
-exec gcc "$@"
-EOF
-chmod +x "$test_root/cc"
-
-mkdir "$test_root/default" "$test_root/disabled"
-
-(
- cd "$test_root/default"
- CC="$test_root/cc" "$srcdir/configure" --disable-builddir >/dev/null
-)
-grep -Fqx 'toolexeclibdir = ${libdir}/../lib64' \
- "$test_root/default/Makefile"
-
-(
- cd "$test_root/disabled"
- CC="$test_root/cc" "$srcdir/configure" --disable-builddir \
- --disable-multi-os-directory >/dev/null
-)
-grep -Fqx 'toolexeclibdir = ${libdir}' "$test_root/disabled/Makefile"
-
-check_explicit_libdir()
-{
- name=$1
- shift
- builddir="$test_root/$name"
- mkdir "$builddir"
- (
- cd "$builddir"
- CC="$test_root/cc" "$srcdir/configure" --disable-builddir "$@" \
- >/dev/null
- )
- grep -Fqx 'libdir = /test/custom lib' "$builddir/Makefile"
- grep -Fqx 'toolexeclibdir = ${libdir}' "$builddir/Makefile"
-}
-
-# Keep this list synchronized with the libdir spellings accepted by the
-# generated configure option parser.
-check_explicit_libdir long-equals '--libdir=/test/custom lib'
-check_explicit_libdir long-separate --libdir '/test/custom lib'
-check_explicit_libdir libdi-equals '--libdi=/test/custom lib'
-check_explicit_libdir libdi-separate --libdi '/test/custom lib'
-check_explicit_libdir libd-equals '--libd=/test/custom lib'
-check_explicit_libdir libd-separate --libd '/test/custom lib'
-check_explicit_libdir single-equals '-libdir=/test/custom lib'
-check_explicit_libdir single-separate -libdir '/test/custom lib'
diff --git a/deps/libffi/testsuite/libffi.go/aa-direct.c b/deps/libffi/testsuite/libffi.go/aa-direct.c
deleted file mode 100644
index b00c404ab35..00000000000
--- a/deps/libffi/testsuite/libffi.go/aa-direct.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* { dg-do run } */
-
-#include "static-chain.h"
-
-#if defined(__GNUC__) && !defined(__clang__) && defined(STATIC_CHAIN_REG)
-
-#include "ffitest.h"
-
-/* Blatent assumption here that the prologue doesn't clobber the
- static chain for trivial functions. If this is not true, don't
- define STATIC_CHAIN_REG, and we'll test what we can via other tests. */
-void *doit(void)
-{
- register void *chain __asm__(STATIC_CHAIN_REG);
- return chain;
-}
-
-int main()
-{
- ffi_cif cif;
- void *result;
-
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 0, &ffi_type_pointer, NULL) == FFI_OK);
-
- ffi_call_go(&cif, FFI_FN(doit), &result, NULL, &result);
-
- CHECK(result == &result);
-
- return 0;
-}
-
-#else /* UNSUPPORTED */
-int main() { return 0; }
-#endif
diff --git a/deps/libffi/testsuite/libffi.go/closure1.c b/deps/libffi/testsuite/libffi.go/closure1.c
deleted file mode 100644
index 7b34afc88c8..00000000000
--- a/deps/libffi/testsuite/libffi.go/closure1.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-void doit(ffi_cif *cif, void *rvalue, void **avalue, void *closure)
-{
- (void)cif;
- (void)avalue;
- *(void **)rvalue = closure;
-}
-
-typedef void * (*FN)(void);
-
-int main()
-{
- ffi_cif cif;
- ffi_go_closure cl;
- void *result;
-
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 0, &ffi_type_pointer, NULL) == FFI_OK);
- CHECK(ffi_prep_go_closure(&cl, &cif, doit) == FFI_OK);
-
- ffi_call_go(&cif, FFI_FN(*(FN *)&cl), &result, NULL, &cl);
-
- CHECK(result == &cl);
-
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.go/ffitest.h b/deps/libffi/testsuite/libffi.go/ffitest.h
deleted file mode 100644
index d27d362d6a6..00000000000
--- a/deps/libffi/testsuite/libffi.go/ffitest.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../libffi.call/ffitest.h"
diff --git a/deps/libffi/testsuite/libffi.go/go.exp b/deps/libffi/testsuite/libffi.go/go.exp
deleted file mode 100644
index f477e99ade6..00000000000
--- a/deps/libffi/testsuite/libffi.go/go.exp
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright (C) 2003, 2006, 2009, 2010, 2014 Free Software Foundation, Inc.
-
-# This program 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 3 of the License, or
-# (at your option) any later version.
-#
-# This program 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; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-dg-init
-libffi-init
-
-global srcdir subdir
-
-if { [string match $compiler_vendor "microsoft"] } {
- # -wd4005 macro redefinition
- # -wd4244 implicit conversion to type of smaller size
- # -wd4305 truncation to smaller type
- # -wd4477 printf %lu of uintptr_t
- # -wd4312 implicit conversion to type of greater size
- # -wd4311 pointer truncation to unsigned long
- # -EHsc C++ Exception Handling (no SEH exceptions)
- set additional_options "-wd4005 -wd4244 -wd4305 -wd4477 -wd4312 -wd4311 -EHsc";
-} else {
- set additional_options "";
-}
-
-set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.{c,cc}]]
-
-if { [libffi_feature_test "#ifdef FFI_GO_CLOSURES"] } {
- run-many-tests $tlist $additional_options
-} else {
- foreach test $tlist {
- unsupported "$test"
- }
-}
-
-dg-finish
-
-# Local Variables:
-# tcl-indent-level:4
-# End:
diff --git a/deps/libffi/testsuite/libffi.go/static-chain.h b/deps/libffi/testsuite/libffi.go/static-chain.h
deleted file mode 100644
index 3675b40a54c..00000000000
--- a/deps/libffi/testsuite/libffi.go/static-chain.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifdef __aarch64__
-# define STATIC_CHAIN_REG "x18"
-#elif defined(__alpha__)
-# define STATIC_CHAIN_REG "$1"
-#elif defined(__arm__)
-# define STATIC_CHAIN_REG "ip"
-#elif defined(__sparc__)
-# if defined(__arch64__) || defined(__sparcv9)
-# define STATIC_CHAIN_REG "g5"
-# else
-# define STATIC_CHAIN_REG "g2"
-# endif
-#elif defined(__x86_64__)
-# define STATIC_CHAIN_REG "r10"
-#elif defined(__i386__)
-# ifndef ABI_NUM
-# define STATIC_CHAIN_REG "ecx" /* FFI_DEFAULT_ABI only */
-# endif
-#endif
diff --git a/deps/libffi/testsuite/libffi.jspi/cls_jspi.c b/deps/libffi/testsuite/libffi.jspi/cls_jspi.c
deleted file mode 100644
index 518297dfe9f..00000000000
--- a/deps/libffi/testsuite/libffi.jspi/cls_jspi.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/* Area: closure_call
- Purpose: Check that a closure handler can suspend with JSPI.
- Limitations: Emscripten only, needs -sJSPI and a JSPI-enabled engine.
- PR: none.
- Originator: Hood Chatham 20260912 */
-
-/* { dg-do run { target wasm*-*-* } } */
-#include "ffitest.h"
-#include <emscripten.h>
-
-/* JSPI suspends the whole wasm stack while the promise is pending. That
- only works if every frame between the JSPI entry point (main) and the
- suspending import is a wasm frame, so the closure trampoline must not
- be a JS function. Exercise each kind of trampoline epilogue: void,
- return-by-pointer (struct), i32, i64, f32, f64. */
-
-EM_ASYNC_JS(int, async_add_one, (int x), {
- await new Promise(resolve => setTimeout(resolve, 1));
- return x + 1;
-});
-
-static int n_calls = 0;
-
-typedef struct { double a; int b; long long c; } big_t;
-
-static void int_fn(ffi_cif *cif __UNUSED__, void *ret, void **args,
- void *userdata)
-{
- int x = *(int *)args[0];
- short y = *(short *)args[1];
- n_calls++;
- *(ffi_arg *)ret = async_add_one(x) * 10 + y + *(int *)userdata;
-}
-
-static void double_fn(ffi_cif *cif __UNUSED__, void *ret, void **args,
- void *userdata __UNUSED__)
-{
- n_calls++;
- *(double *)ret = async_add_one((int)*(double *)args[0]) + 0.5;
-}
-
-static void float_fn(ffi_cif *cif __UNUSED__, void *ret, void **args,
- void *userdata __UNUSED__)
-{
- n_calls++;
- *(float *)ret = async_add_one((int)*(float *)args[0]) + 0.25f;
-}
-
-static void i64_fn(ffi_cif *cif __UNUSED__, void *ret, void **args,
- void *userdata __UNUSED__)
-{
- long long x = *(long long *)args[0];
- n_calls++;
- *(long long *)ret = ((long long)async_add_one((int)x) << 40) | 7;
-}
-
-static void struct_fn(ffi_cif *cif __UNUSED__, void *ret, void **args,
- void *userdata __UNUSED__)
-{
- big_t in = *(big_t *)args[0];
- big_t *out = ret;
- n_calls++;
- out->a = in.a * 2;
- out->b = async_add_one(in.b);
- out->c = in.c + 1;
-}
-
-static void void_fn(ffi_cif *cif __UNUSED__, void *ret __UNUSED__,
- void **args, void *userdata)
-{
- n_calls++;
- *(int *)userdata = async_add_one(*(int *)args[0]);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl;
- int ud = 1000;
-
- /* int f(int, short) */
- {
- ffi_type *cl_arg_types[] = { &ffi_type_sint, &ffi_type_sshort };
- int (*f)(int, short);
- pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
- CHECK(ffi_prep_closure_loc(pcl, &cif, int_fn, &ud, code) == FFI_OK);
- f = code;
- CHECK(f(4, 3) == 50 + 3 + 1000);
- CHECK(f(-2, -1) == -10 - 1 + 1000);
- /* Nested: a suspending closure call inside the arguments of another. */
- CHECK(f(f(0, 0) - 1000, 1) == 110 + 1 + 1000);
- ffi_closure_free(pcl);
- }
-
- /* double f(double) */
- {
- ffi_type *cl_arg_types[] = { &ffi_type_double };
- double (*f)(double);
- pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_double, cl_arg_types) == FFI_OK);
- CHECK(ffi_prep_closure_loc(pcl, &cif, double_fn, NULL, code) == FFI_OK);
- f = code;
- CHECK(f(2.0) == 3.5);
- ffi_closure_free(pcl);
- }
-
- /* float f(float) */
- {
- ffi_type *cl_arg_types[] = { &ffi_type_float };
- float (*f)(float);
- pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_float, cl_arg_types) == FFI_OK);
- CHECK(ffi_prep_closure_loc(pcl, &cif, float_fn, NULL, code) == FFI_OK);
- f = code;
- CHECK(f(2.0f) == 3.25f);
- ffi_closure_free(pcl);
- }
-
- /* long long f(long long) */
- {
- ffi_type *cl_arg_types[] = { &ffi_type_sint64 };
- long long (*f)(long long);
- pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_sint64, cl_arg_types) == FFI_OK);
- CHECK(ffi_prep_closure_loc(pcl, &cif, i64_fn, NULL, code) == FFI_OK);
- f = code;
- CHECK(f(5) == ((6LL << 40) | 7));
- ffi_closure_free(pcl);
- }
-
- /* big_t f(big_t): returned through a pointer argument. */
- {
- ffi_type *elements[] = { &ffi_type_double, &ffi_type_sint,
- &ffi_type_sint64, NULL };
- ffi_type big = { 0, 0, FFI_TYPE_STRUCT, elements };
- ffi_type *cl_arg_types[] = { &big };
- big_t (*f)(big_t);
- big_t in = { 1.5, 10, 1LL << 33 };
- big_t out;
- pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &big, cl_arg_types) == FFI_OK);
- CHECK(ffi_prep_closure_loc(pcl, &cif, struct_fn, NULL, code) == FFI_OK);
- f = code;
- out = f(in);
- CHECK(out.a == 3.0);
- CHECK(out.b == 11);
- CHECK(out.c == (1LL << 33) + 1);
- ffi_closure_free(pcl);
- }
-
- /* void f(int) */
- {
- ffi_type *cl_arg_types[] = { &ffi_type_sint };
- void (*f)(int);
- int result = 0;
- pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_void, cl_arg_types) == FFI_OK);
- CHECK(ffi_prep_closure_loc(pcl, &cif, void_fn, &result, code) == FFI_OK);
- f = code;
- f(41);
- CHECK(result == 42);
- ffi_closure_free(pcl);
- }
-
- printf("%d closure calls\n", n_calls);
- /* { dg-output "9 closure calls" } */
- exit(0);
-}
diff --git a/deps/libffi/testsuite/libffi.jspi/ffitest.h b/deps/libffi/testsuite/libffi.jspi/ffitest.h
deleted file mode 100644
index d27d362d6a6..00000000000
--- a/deps/libffi/testsuite/libffi.jspi/ffitest.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../libffi.call/ffitest.h"
diff --git a/deps/libffi/testsuite/libffi.jspi/jspi.exp b/deps/libffi/testsuite/libffi.jspi/jspi.exp
deleted file mode 100644
index f298e98c153..00000000000
--- a/deps/libffi/testsuite/libffi.jspi/jspi.exp
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (C) 2003, 2006, 2009, 2010, 2014, 2019 Free Software Foundation, Inc.
-# Copyright (C) 2019 Anthony Green
-
-# This program 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 3 of the License, or
-# (at your option) any later version.
-#
-# This program 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; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-# Tests for Emscripten's JavaScript Promise Integration (JSPI). These
-# build with -sJSPI and need a JS engine with JSPI enabled to run.
-
-dg-init
-libffi-init
-
-global srcdir subdir
-
-set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.c]]
-
-# JSPI only exists on Emscripten. emcc warns that -sJSPI is experimental,
-# which would otherwise count as an excess error.
-if { [istarget "wasm*-*-*"] } {
- run-many-tests $tlist "-sJSPI -Wno-experimental"
-} else {
- foreach test $tlist {
- unsupported "$test"
- }
-}
-
-dg-finish
-
-# Local Variables:
-# tcl-indent-level:4
-# End:
diff --git a/deps/libffi/testsuite/libffi.threads/ffitest.h b/deps/libffi/testsuite/libffi.threads/ffitest.h
deleted file mode 100644
index d27d362d6a6..00000000000
--- a/deps/libffi/testsuite/libffi.threads/ffitest.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../libffi.call/ffitest.h"
diff --git a/deps/libffi/testsuite/libffi.threads/threads.exp b/deps/libffi/testsuite/libffi.threads/threads.exp
deleted file mode 100644
index ca0375091d2..00000000000
--- a/deps/libffi/testsuite/libffi.threads/threads.exp
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright (C) 2003, 2006, 2009, 2010, 2014 Free Software Foundation, Inc.
-
-# This program 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 3 of the License, or
-# (at your option) any later version.
-#
-# This program 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; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-dg-init
-libffi-init
-
-global srcdir subdir
-
-if { [string match $compiler_vendor "microsoft"] } {
- # -wd4005 macro redefinition
- # -wd4244 implicit conversion to type of smaller size
- # -wd4305 truncation to smaller type
- # -wd4477 printf %lu of uintptr_t
- # -wd4312 implicit conversion to type of greater size
- # -wd4311 pointer truncation to unsigned long
- # -EHsc C++ Exception Handling (no SEH exceptions)
- set additional_options "-wd4005 -wd4244 -wd4305 -wd4477 -wd4312 -wd4311 -EHsc";
-} else {
- set additional_options "";
-}
-
-set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.c]]
-
-# No pthreads for windows or wasm
-if { [string match $compiler_vendor "microsoft"] || [istarget "wasm*-*-*"] } {
- foreach test $tlist {
- unsupported "$test"
- }
-} else {
- run-many-tests $tlist $additional_options
-}
-
-dg-finish
-
-# Local Variables:
-# tcl-indent-level:4
-# End:
diff --git a/deps/libffi/testsuite/libffi.threads/tsan.c b/deps/libffi/testsuite/libffi.threads/tsan.c
deleted file mode 100644
index 52b5204ce17..00000000000
--- a/deps/libffi/testsuite/libffi.threads/tsan.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#define NUM_THREADS 20
-
-static char thread_failure;
-
-#if defined(_POSIX_BARRIERS) && _POSIX_BARRIERS > 0
-pthread_barrier_t barrier;
-#endif
-
-typedef float (*callback_fn)(float, float);
-
-void callback(ffi_cif *cif __UNUSED__, void *ret, void **args, void *userdata __UNUSED__) {
- float a = *(float *)args[0];
- float b = *(float *)args[1];
- *(float *)ret = a / 2 + b / 2;
-}
-
-void *thread_func(void *arg) {
-#if defined(_POSIX_BARRIERS) && _POSIX_BARRIERS > 0
- pthread_barrier_wait(&barrier);
-#endif
-
- ffi_cif cif;
- ffi_type *args[2] = { &ffi_type_float, &ffi_type_float };
-
- if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ffi_type_float, args) != FFI_OK) {
- fprintf(stderr, "ffi_prep_cif failed\n");
- return &thread_failure;
- }
-
- ffi_closure *closure = ffi_closure_alloc(sizeof(ffi_closure), (void **)&arg);
-
- if (ffi_prep_closure_loc(closure, &cif, callback, NULL, arg) != FFI_OK) {
- fprintf(stderr, "ffi_prep_closure_loc failed\n");
- return &thread_failure;
- }
-
- callback_fn fn = (callback_fn)arg;
- (void) fn(4.0f, 6.0f);
-
- ffi_closure_free(closure);
- return NULL;
-}
-
-int main() {
- pthread_t threads[NUM_THREADS];
-
-#if defined(_POSIX_BARRIERS) && _POSIX_BARRIERS > 0
- pthread_barrier_init(&barrier, NULL, NUM_THREADS);
-#endif
-
- for (int i = 0; i < NUM_THREADS; ++i) {
- if (pthread_create(&threads[i], NULL, thread_func, NULL) != 0) {
- perror("pthread_create");
- exit(EXIT_FAILURE);
- }
- }
-
- for (int i = 0; i < NUM_THREADS; ++i) {
- void *result;
- if (pthread_join(threads[i], &result) != 0) {
- fprintf(stderr, "pthread_join failed\n");
- exit(EXIT_FAILURE);
- }
- if (result == &thread_failure)
- exit(EXIT_FAILURE);
- }
-
-#if defined(_POSIX_BARRIERS) && _POSIX_BARRIERS > 0
- pthread_barrier_destroy(&barrier);
-#endif
-
- printf("Completed\n");
- return 0;
-}
diff --git a/deps/libffi/testsuite/libffi.vector/cls_vector.c b/deps/libffi/testsuite/libffi.vector/cls_vector.c
deleted file mode 100644
index 18d8806b51b..00000000000
--- a/deps/libffi/testsuite/libffi.vector/cls_vector.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Area: closure_call
- Purpose: A closure that receives two vector arguments (and a scalar) and
- returns a vector. Exercises the closure argument-extraction and
- vector return paths.
- Limitations: none.
- PR: none.
- Originator: libffi vector support. */
-
-/* { dg-do run } */
-
-#include "vector.h"
-
-typedef float f32x4 __attribute__((vector_size (16)));
-
-static void
-cls_vector_fn (ffi_cif *cif __UNUSED__, void *resp, void **args,
- void *userdata __UNUSED__)
-{
- f32x4 a = *(f32x4 *) args[0];
- f32x4 b = *(f32x4 *) args[1];
- int scale = *(int *) args[2];
- f32x4 *r = (f32x4 *) resp;
-
- *r = (a + b) * (float) scale;
-}
-
-typedef f32x4 (*cls_vector_t) (f32x4, f32x4, int);
-
-int
-main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc (sizeof (ffi_closure), &code);
- ffi_type vec_type;
- ffi_type *vec_elems[5];
- ffi_type *arg_types[3];
- f32x4 a = { 1, 2, 3, 4 };
- f32x4 b = { 10, 20, 30, 40 };
- f32x4 res;
- int scale = 2;
- int i;
-
- CHECK (pcl != NULL);
-
- make_vector_type (&vec_type, vec_elems, &ffi_type_float, 4);
-
- arg_types[0] = &vec_type;
- arg_types[1] = &vec_type;
- arg_types[2] = &ffi_type_sint;
-
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 3, &vec_type, arg_types)
- == FFI_OK);
- CHECK (ffi_prep_closure_loc (pcl, &cif, cls_vector_fn, NULL, code)
- == FFI_OK);
-
- res = ((cls_vector_t) code) (a, b, scale);
-
- for (i = 0; i < 4; i++)
- {
- float want = (a[i] + b[i]) * (float) scale;
- printf ("res[%d] = %g (want %g)\n", i, (double) res[i], (double) want);
- CHECK (res[i] == want);
- }
-
- exit (0);
-}
diff --git a/deps/libffi/testsuite/libffi.vector/ffitest.h b/deps/libffi/testsuite/libffi.vector/ffitest.h
deleted file mode 100644
index d27d362d6a6..00000000000
--- a/deps/libffi/testsuite/libffi.vector/ffitest.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../libffi.call/ffitest.h"
diff --git a/deps/libffi/testsuite/libffi.vector/vector.exp b/deps/libffi/testsuite/libffi.vector/vector.exp
deleted file mode 100644
index a76957ee4d3..00000000000
--- a/deps/libffi/testsuite/libffi.vector/vector.exp
+++ /dev/null
@@ -1,59 +0,0 @@
-# Copyright (C) 2026 Free Software Foundation, Inc.
-
-# This program 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 3 of the License, or
-# (at your option) any later version.
-#
-# This program 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; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-dg-init
-libffi-init
-
-global srcdir subdir
-
-# The tests are written with the GCC/Clang vector extension
-# (__attribute__ ((vector_size (N)))). A target port can support
-# FFI_TYPE_VECTOR at the ABI level while the compiler under test (e.g.
-# MSVC) cannot compile that syntax, so probe the compiler with an actual
-# compilation, not just a preprocessor check.
-proc libffi_vector_syntax_test { } {
- set src "vecprobe[pid].c"
- set obj "vecprobe[pid].o"
-
- set f [open $src "w"]
- puts $f "typedef float probe_v4 __attribute__ ((vector_size (16)));"
- puts $f "probe_v4 probe_var;"
- puts $f "int main (void) { return 0; }"
- close $f
-
- set lines [libffi_target_compile $src $obj object ""]
- file delete $src
- file delete $obj
-
- return [string match "" $lines]
-}
-
-set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.{c,cc}]]
-
-if { [libffi_feature_test "#ifdef FFI_TARGET_HAS_VECTOR_TYPE"]
- && [libffi_vector_syntax_test] } {
- run-many-tests $tlist ""
-} else {
- foreach test $tlist {
- unsupported "$test"
- }
-}
-
-dg-finish
-
-# Local Variables:
-# tcl-indent-level:4
-# End:
diff --git a/deps/libffi/testsuite/libffi.vector/vector.h b/deps/libffi/testsuite/libffi.vector/vector.h
deleted file mode 100644
index 7baf832d37e..00000000000
--- a/deps/libffi/testsuite/libffi.vector/vector.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*-c-*- */
-/* Shared helpers for the libffi vector (SIMD) tests.
-
- Vectors are built with the portable GCC/Clang spelling
- __attribute__((vector_size (N))) so the tests compile on both compilers.
- A vector ffi_type is described exactly like a struct, except every element
- points at the SAME scalar ffi_type and the count is the lane count; the
- caller leaves size and alignment at zero and libffi computes them. */
-
-#ifndef LIBFFI_VECTOR_H
-#define LIBFFI_VECTOR_H
-
-#include "ffitest.h"
-
-/* Build (into the caller-provided ELEMS array of length COUNT + 1 and the
- ffi_type object TY) a vector type descriptor of COUNT lanes of scalar type
- ELEM. ELEMS must have room for COUNT + 1 pointers (NULL terminator). */
-static inline void
-make_vector_type (ffi_type *ty, ffi_type **elems, ffi_type *elem,
- unsigned count)
-{
- unsigned i;
- for (i = 0; i < count; i++)
- elems[i] = elem;
- elems[count] = NULL;
- ty->size = 0;
- ty->alignment = 0;
- ty->type = FFI_TYPE_VECTOR;
- ty->elements = elems;
-}
-
-#endif /* LIBFFI_VECTOR_H */
diff --git a/deps/libffi/testsuite/libffi.vector/vector_args_spill.c b/deps/libffi/testsuite/libffi.vector/vector_args_spill.c
deleted file mode 100644
index dec6ab2e62a..00000000000
--- a/deps/libffi/testsuite/libffi.vector/vector_args_spill.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Area: ffi_call
- Purpose: Pass many vector arguments interleaved with scalars, enough to
- exhaust the vector argument registers and spill onto the stack.
- Limitations: none.
- PR: none.
- Originator: libffi vector support. */
-
-/* { dg-do run } */
-
-#include "vector.h"
-
-typedef float f32x4 __attribute__((vector_size (16)));
-
-/* Ten vectors exceeds the 8 vector argument registers on both AArch64 and
- x86-64, so v8/v9 are passed on the stack. The scalars are interleaved to
- make sure the two register files advance independently. */
-static float
-mix (int i0, f32x4 v0, f32x4 v1, double d0, f32x4 v2, f32x4 v3,
- f32x4 v4, int i1, f32x4 v5, f32x4 v6, f32x4 v7, double d1,
- f32x4 v8, f32x4 v9)
-{
- float acc = 0;
- acc += 1 * v0[0] + v0[3];
- acc += 2 * v1[0] + v1[3];
- acc += 3 * v2[0] + v2[3];
- acc += 4 * v3[0] + v3[3];
- acc += 5 * v4[0] + v4[3];
- acc += 6 * v5[0] + v5[3];
- acc += 7 * v6[0] + v6[3];
- acc += 8 * v7[0] + v7[3];
- acc += 9 * v8[0] + v8[3];
- acc += 10 * v9[0] + v9[3];
- acc += i0 + i1 + (float) d0 + (float) d1;
- return acc;
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- ffi_type vec_type;
- ffi_type *vec_elems[5];
- ffi_type *args[14];
- void *values[14];
- f32x4 v[10];
- int i0 = 100, i1 = 7;
- double d0 = 3.5, d1 = 0.25;
- float r, ref;
- unsigned k;
-
- make_vector_type (&vec_type, vec_elems, &ffi_type_float, 4);
-
- for (k = 0; k < 10; k++)
- {
- f32x4 t = { (float) (k + 1), 0, 0, (float) (100 + k) };
- v[k] = t;
- }
-
- args[0] = &ffi_type_sint; values[0] = &i0;
- args[1] = &vec_type; values[1] = &v[0];
- args[2] = &vec_type; values[2] = &v[1];
- args[3] = &ffi_type_double; values[3] = &d0;
- args[4] = &vec_type; values[4] = &v[2];
- args[5] = &vec_type; values[5] = &v[3];
- args[6] = &vec_type; values[6] = &v[4];
- args[7] = &ffi_type_sint; values[7] = &i1;
- args[8] = &vec_type; values[8] = &v[5];
- args[9] = &vec_type; values[9] = &v[6];
- args[10] = &vec_type; values[10] = &v[7];
- args[11] = &ffi_type_double; values[11] = &d1;
- args[12] = &vec_type; values[12] = &v[8];
- args[13] = &vec_type; values[13] = &v[9];
-
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 14, &ffi_type_float, args)
- == FFI_OK);
-
- ffi_call (&cif, FFI_FN (mix), &r, values);
-
- ref = mix (i0, v[0], v[1], d0, v[2], v[3], v[4], i1, v[5], v[6], v[7],
- d1, v[8], v[9]);
- printf ("r = %g (want %g)\n", (double) r, (double) ref);
- CHECK (r == ref);
-
- exit (0);
-}
diff --git a/deps/libffi/testsuite/libffi.vector/vector_double2.c b/deps/libffi/testsuite/libffi.vector/vector_double2.c
deleted file mode 100644
index dd45878b5af..00000000000
--- a/deps/libffi/testsuite/libffi.vector/vector_double2.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Area: ffi_call
- Purpose: Pass and return a 16-byte double2 vector (single Q/SSE reg).
- Limitations: none.
- PR: none.
- Originator: libffi vector support. */
-
-/* { dg-do run } */
-
-#include "vector.h"
-
-typedef double d2 __attribute__((vector_size (16)));
-
-static d2
-add_d2 (d2 a, d2 b)
-{
- return a + b;
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- ffi_type vec_type;
- ffi_type *vec_elems[3];
- ffi_type *args[2];
- void *values[2];
- d2 a = { 1.5, 2.5 };
- d2 b = { 10.0, 20.0 };
- d2 r, ref;
- int i;
-
- make_vector_type (&vec_type, vec_elems, &ffi_type_double, 2);
-
- args[0] = &vec_type;
- args[1] = &vec_type;
- values[0] = &a;
- values[1] = &b;
-
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 2, &vec_type, args) == FFI_OK);
- CHECK (vec_type.size == 16);
- CHECK (vec_type.alignment == 16);
-
- ffi_call (&cif, FFI_FN (add_d2), &r, values);
-
- ref = add_d2 (a, b);
- for (i = 0; i < 2; i++)
- {
- printf ("r[%d] = %g (want %g)\n", i, r[i], ref[i]);
- CHECK (r[i] == ref[i]);
- }
-
- exit (0);
-}
diff --git a/deps/libffi/testsuite/libffi.vector/vector_double4.c b/deps/libffi/testsuite/libffi.vector/vector_double4.c
deleted file mode 100644
index 9f447393592..00000000000
--- a/deps/libffi/testsuite/libffi.vector/vector_double4.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Area: ffi_call
- Purpose: A 32-byte double4 vector. On AArch64 a bare vector wider than
- 16 bytes is passed by reference and returned in memory (no
- short-vector register class), so the call must round-trip. On
- x86-64 wider-than-16-byte vectors are not implemented, so
- ffi_prep_cif must report FFI_BAD_TYPEDEF.
- Limitations: none.
- PR: none.
- Originator: libffi vector support. */
-
-/* { dg-do run } */
-
-#include "vector.h"
-
-typedef double d4 __attribute__((vector_size (32)));
-
-/* Only called on ports that can actually marshal a 32-byte vector. */
-static d4 add_d4 (d4 a, d4 b) __UNUSED__;
-
-static d4
-add_d4 (d4 a, d4 b)
-{
- return a + b;
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- ffi_type vec_type;
- ffi_type *vec_elems[5];
- ffi_type *args[2];
-
- make_vector_type (&vec_type, vec_elems, &ffi_type_double, 4);
- args[0] = &vec_type;
- args[1] = &vec_type;
-
-#if defined(__aarch64__) || defined(_M_ARM64)
- {
- void *values[2];
- d4 a = { 1, 2, 3, 4 };
- d4 b = { 10, 20, 30, 40 };
- d4 r, ref;
- int i;
-
- values[0] = &a;
- values[1] = &b;
-
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 2, &vec_type, args) == FFI_OK);
- CHECK (vec_type.size == 32);
- CHECK (vec_type.alignment == 16);
-
- ffi_call (&cif, FFI_FN (add_d4), &r, values);
-
- ref = add_d4 (a, b);
- for (i = 0; i < 4; i++)
- {
- printf ("r[%d] = %g (want %g)\n", i, r[i], ref[i]);
- CHECK (r[i] == ref[i]);
- }
- }
-#else
- {
- /* x86-64 (and any other opted-in port without >16B support): the >16-byte
- vector must be rejected, both as a return type and as an argument. */
- ffi_status s_ret, s_arg;
-
- s_ret = ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 0, &vec_type, NULL);
- printf ("32-byte vector return: status %d (want %d = FFI_BAD_TYPEDEF)\n",
- s_ret, FFI_BAD_TYPEDEF);
- CHECK (s_ret == FFI_BAD_TYPEDEF);
-
- s_arg = ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 1, &ffi_type_void, args);
- printf ("32-byte vector argument: status %d (want %d = FFI_BAD_TYPEDEF)\n",
- s_arg, FFI_BAD_TYPEDEF);
- CHECK (s_arg == FFI_BAD_TYPEDEF);
- }
-#endif
-
- exit (0);
-}
diff --git a/deps/libffi/testsuite/libffi.vector/vector_float32x2.c b/deps/libffi/testsuite/libffi.vector/vector_float32x2.c
deleted file mode 100644
index f613687a298..00000000000
--- a/deps/libffi/testsuite/libffi.vector/vector_float32x2.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Area: ffi_call
- Purpose: Pass and return an 8-byte float32x2 vector (single D/SSE reg).
- Limitations: none.
- PR: none.
- Originator: libffi vector support. */
-
-/* { dg-do run } */
-
-#include "vector.h"
-
-typedef float f32x2 __attribute__((vector_size (8)));
-
-static f32x2
-add_f32x2 (f32x2 a, f32x2 b)
-{
- return a + b;
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- ffi_type vec_type;
- ffi_type *vec_elems[3];
- ffi_type *args[2];
- void *values[2];
- f32x2 a = { 3, 4 };
- f32x2 b = { 5, 6 };
- f32x2 r, ref;
- int i;
-
- make_vector_type (&vec_type, vec_elems, &ffi_type_float, 2);
-
- args[0] = &vec_type;
- args[1] = &vec_type;
- values[0] = &a;
- values[1] = &b;
-
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 2, &vec_type, args) == FFI_OK);
- CHECK (vec_type.size == 8);
- CHECK (vec_type.alignment == 8);
-
- ffi_call (&cif, FFI_FN (add_f32x2), &r, values);
-
- ref = add_f32x2 (a, b);
- for (i = 0; i < 2; i++)
- {
- printf ("r[%d] = %g (want %g)\n", i, (double) r[i], (double) ref[i]);
- CHECK (r[i] == ref[i]);
- }
-
- exit (0);
-}
diff --git a/deps/libffi/testsuite/libffi.vector/vector_float32x4.c b/deps/libffi/testsuite/libffi.vector/vector_float32x4.c
deleted file mode 100644
index c7b02667117..00000000000
--- a/deps/libffi/testsuite/libffi.vector/vector_float32x4.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Area: ffi_call
- Purpose: Pass and return a 16-byte float32x4 vector (the vec4 shape of
- libffi/libffi#773).
- Limitations: none.
- PR: libffi/libffi#773.
- Originator: libffi vector support. */
-
-/* { dg-do run } */
-
-#include "vector.h"
-
-typedef float f32x4 __attribute__((vector_size (16)));
-
-static f32x4
-add_f32x4 (f32x4 a, f32x4 b)
-{
- return a + b;
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- ffi_type vec_type;
- ffi_type *vec_elems[5];
- ffi_type *args[2];
- void *values[2];
- f32x4 a = { 1, 2, 3, 4 };
- f32x4 b = { 10, 20, 30, 40 };
- f32x4 r, rp, ref;
- ffi_call_plan *plan;
- int i;
-
- make_vector_type (&vec_type, vec_elems, &ffi_type_float, 4);
-
- args[0] = &vec_type;
- args[1] = &vec_type;
- values[0] = &a;
- values[1] = &b;
-
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 2, &vec_type, args) == FFI_OK);
- CHECK (vec_type.size == 16);
- CHECK (vec_type.alignment == 16);
-
- ffi_call (&cif, FFI_FN (add_f32x4), &r, values);
-
- plan = ffi_call_plan_alloc (&cif);
- CHECK (plan != NULL);
- ffi_call_plan_invoke (plan, FFI_FN (add_f32x4), &rp, values);
- ffi_call_plan_free (plan);
-
- ref = add_f32x4 (a, b);
- for (i = 0; i < 4; i++)
- {
- printf ("r[%d] = %g (want %g)\n", i, (double) r[i], (double) ref[i]);
- CHECK (r[i] == ref[i]);
- CHECK (rp[i] == ref[i]);
- }
-
- exit (0);
-}
diff --git a/deps/libffi/testsuite/libffi.vector/vector_hva.c b/deps/libffi/testsuite/libffi.vector/vector_hva.c
deleted file mode 100644
index 5f80da07dfd..00000000000
--- a/deps/libffi/testsuite/libffi.vector/vector_hva.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Area: ffi_call
- Purpose: Pass and return a homogeneous vector aggregate: a struct of two
- identical 16-byte vectors. On AArch64 this is an HVA carried in
- a pair of Q registers; on x86-64 the existing SSE struct
- classification handles it (four SSE eightbytes). Both round-trip.
- Limitations: none.
- PR: none.
- Originator: libffi vector support. */
-
-/* { dg-do run } */
-
-#include "vector.h"
-
-typedef float f32x4 __attribute__((vector_size (16)));
-
-struct hva2
-{
- f32x4 a;
- f32x4 b;
-};
-
-static struct hva2
-bump (struct hva2 s)
-{
- s.a = s.a + 1;
- s.b = s.b + 2;
- return s;
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- ffi_type vec_type;
- ffi_type *vec_elems[5];
- ffi_type struct_type;
- ffi_type *struct_elems[3];
- ffi_type *args[1];
- void *values[1];
- struct hva2 in = { { 1, 2, 3, 4 }, { 10, 20, 30, 40 } };
- struct hva2 out, ref;
- int i;
-
- make_vector_type (&vec_type, vec_elems, &ffi_type_float, 4);
-
- struct_elems[0] = &vec_type;
- struct_elems[1] = &vec_type;
- struct_elems[2] = NULL;
- struct_type.size = 0;
- struct_type.alignment = 0;
- struct_type.type = FFI_TYPE_STRUCT;
- struct_type.elements = struct_elems;
-
- args[0] = &struct_type;
- values[0] = ∈
-
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 1, &struct_type, args)
- == FFI_OK);
- CHECK (struct_type.size == 32);
-
- ffi_call (&cif, FFI_FN (bump), &out, values);
-
- ref = bump (in);
- for (i = 0; i < 4; i++)
- {
- printf ("a[%d] = %g (want %g), b[%d] = %g (want %g)\n",
- i, (double) out.a[i], (double) ref.a[i],
- i, (double) out.b[i], (double) ref.b[i]);
- CHECK (out.a[i] == ref.a[i]);
- CHECK (out.b[i] == ref.b[i]);
- }
-
- exit (0);
-}
diff --git a/deps/libffi/testsuite/libffi.vector/vector_int32x4.c b/deps/libffi/testsuite/libffi.vector/vector_int32x4.c
deleted file mode 100644
index eaa6b802bab..00000000000
--- a/deps/libffi/testsuite/libffi.vector/vector_int32x4.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Area: ffi_call
- Purpose: Pass and return a 16-byte int32x4 integer vector. Integer
- lanes still travel in a vector register, unlike an HFA of ints.
- Limitations: none.
- PR: none.
- Originator: libffi vector support. */
-
-/* { dg-do run } */
-
-#include "vector.h"
-
-typedef int i32x4 __attribute__((vector_size (16)));
-
-static i32x4
-add_i32x4 (i32x4 a, i32x4 b)
-{
- return a + b;
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- ffi_type vec_type;
- ffi_type *vec_elems[5];
- ffi_type *args[2];
- void *values[2];
- i32x4 a = { 1, 2, 3, 4 };
- i32x4 b = { 5, 6, 7, 8 };
- i32x4 r, ref;
- int i;
-
- make_vector_type (&vec_type, vec_elems, &ffi_type_sint32, 4);
-
- args[0] = &vec_type;
- args[1] = &vec_type;
- values[0] = &a;
- values[1] = &b;
-
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 2, &vec_type, args) == FFI_OK);
- CHECK (vec_type.size == 16);
- CHECK (vec_type.alignment == 16);
-
- ffi_call (&cif, FFI_FN (add_i32x4), &r, values);
-
- ref = add_i32x4 (a, b);
- for (i = 0; i < 4; i++)
- {
- printf ("r[%d] = %d (want %d)\n", i, r[i], ref[i]);
- CHECK (r[i] == ref[i]);
- }
-
- exit (0);
-}
diff --git a/deps/libffi/testsuite/libffi.vector/vector_unsupported_abi.c b/deps/libffi/testsuite/libffi.vector/vector_unsupported_abi.c
deleted file mode 100644
index d6e17910e15..00000000000
--- a/deps/libffi/testsuite/libffi.vector/vector_unsupported_abi.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* Area: ffi_prep_cif
- Purpose: On x86-64 System V, reject vector types whose calling
- convention is undefined (so GCC and Clang disagree) with
- FFI_BAD_TYPEDEF, while still accepting the shapes both
- compilers agree on. Rejecting <1 x double> closes a
- type-confusion that turned a caller's integer argument into
- the store address of the return value (GHSA-5pc3-hr6f-q3mm).
- Limitations: The classification is x86-64 System V specific, so the
- assertions only run there; the test passes trivially on
- other targets and ABIs.
- PR: GHSA-5pc3-hr6f-q3mm.
- Originator: libffi vector support. */
-
-/* { dg-do run } */
-
-#include "vector.h"
-
-#if defined(__x86_64__) && !defined(_WIN64) && !defined(__CYGWIN__)
-
-/* Expect ffi_prep_cif for RET f(ARG) to return STATUS. Either type may be
- NULL to mean "no argument" / void return as appropriate. */
-static void
-check_cif (ffi_type *ret, ffi_type *arg, ffi_status expected)
-{
- ffi_cif cif;
- ffi_type *args[1];
- unsigned nargs = 0;
-
- if (arg != NULL)
- {
- args[0] = arg;
- nargs = 1;
- }
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, nargs,
- ret ? ret : &ffi_type_void, args) == expected);
-}
-
-int
-main (void)
-{
- ffi_type vt, vt2;
- ffi_type *elems[17], *elems2[17];
- ffi_type *selems[2];
- ffi_type st;
-
- /* --- Shapes with an undefined ABI: must be rejected. --- */
-
- /* <1 x double> (8 bytes): GCC returns/passes it in memory, Clang in %xmm0.
- This is the one that produced the out-of-bounds write. */
- make_vector_type (&vt, elems, &ffi_type_double, 1);
- check_cif (&vt, NULL, FFI_BAD_TYPEDEF); /* as return value */
- check_cif (NULL, &vt, FFI_BAD_TYPEDEF); /* as argument */
-
- /* <1 x float> (4 bytes): GCC memory, Clang INTEGER (%eax). */
- make_vector_type (&vt, elems, &ffi_type_float, 1);
- check_cif (NULL, &vt, FFI_BAD_TYPEDEF);
-
- /* <4 x uint8> (4 bytes): sub-8-byte, unspecified. */
- make_vector_type (&vt, elems, &ffi_type_uint8, 4);
- check_cif (NULL, &vt, FFI_BAD_TYPEDEF);
-
- /* A struct that contains <1 x double> must be rejected recursively. */
- make_vector_type (&vt, elems, &ffi_type_double, 1);
- selems[0] = &vt;
- selems[1] = NULL;
- st.size = 0;
- st.alignment = 0;
- st.type = FFI_TYPE_STRUCT;
- st.elements = selems;
- check_cif (&st, NULL, FFI_BAD_TYPEDEF);
- check_cif (NULL, &st, FFI_BAD_TYPEDEF);
-
- /* --- Shapes both compilers agree on: must still be accepted. --- */
-
- /* <2 x float> (8 bytes, not <1 x double>) -> SSE on GCC and Clang. */
- make_vector_type (&vt, elems, &ffi_type_float, 2);
- check_cif (&vt, NULL, FFI_OK);
- check_cif (NULL, &vt, FFI_OK);
-
- /* <8 x uint8> (8 bytes) -> SSE on both. */
- make_vector_type (&vt, elems, &ffi_type_uint8, 8);
- check_cif (NULL, &vt, FFI_OK);
-
- /* <4 x float> (16 bytes) -> SSE + SSEUP on both. */
- make_vector_type (&vt2, elems2, &ffi_type_float, 4);
- check_cif (&vt2, NULL, FFI_OK);
- check_cif (NULL, &vt2, FFI_OK);
-
- /* <2 x double> (16 bytes) -> SSE + SSEUP on both. */
- make_vector_type (&vt2, elems2, &ffi_type_double, 2);
- check_cif (&vt2, NULL, FFI_OK);
-
- printf ("unsupported vector abi ok\n");
- exit (0);
-}
-
-#else
-
-int
-main (void)
-{
- exit (0);
-}
-
-#endif /* x86-64 System V */
diff --git a/deps/libffi/testsuite/libffi.vector/vector_validate.c b/deps/libffi/testsuite/libffi.vector/vector_validate.c
deleted file mode 100644
index d923ab465fe..00000000000
--- a/deps/libffi/testsuite/libffi.vector/vector_validate.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Area: ffi_prep_cif
- Purpose: Validate that malformed vector type descriptors are rejected
- with FFI_BAD_TYPEDEF, and that a well-formed vector is accepted
- with the computed power-of-two size and min(size,16) alignment.
- Limitations: none.
- PR: none.
- Originator: libffi vector support. */
-
-/* { dg-do run } */
-
-#include "vector.h"
-
-int
-main (void)
-{
- ffi_cif cif;
-
- /* Heterogeneous lanes (float mixed with double) -> FFI_BAD_TYPEDEF. */
- {
- ffi_type vt;
- ffi_type *elems[3];
- ffi_type *args[1];
- elems[0] = &ffi_type_float;
- elems[1] = &ffi_type_double;
- elems[2] = NULL;
- vt.size = 0;
- vt.alignment = 0;
- vt.type = FFI_TYPE_VECTOR;
- vt.elements = elems;
- args[0] = &vt;
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 1, &ffi_type_void, args)
- == FFI_BAD_TYPEDEF);
- }
-
- /* An empty (zero-lane) vector -> FFI_BAD_TYPEDEF. */
- {
- ffi_type vt;
- ffi_type *elems[1];
- ffi_type *args[1];
- elems[0] = NULL;
- vt.size = 0;
- vt.alignment = 0;
- vt.type = FFI_TYPE_VECTOR;
- vt.elements = elems;
- args[0] = &vt;
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 1, &ffi_type_void, args)
- == FFI_BAD_TYPEDEF);
- }
-
- /* A non-scalar (struct) lane type -> FFI_BAD_TYPEDEF. */
- {
- ffi_type inner;
- ffi_type *inner_elems[2];
- ffi_type vt;
- ffi_type *elems[3];
- ffi_type *args[1];
- inner_elems[0] = &ffi_type_float;
- inner_elems[1] = NULL;
- inner.size = 0;
- inner.alignment = 0;
- inner.type = FFI_TYPE_STRUCT;
- inner.elements = inner_elems;
- elems[0] = &inner;
- elems[1] = &inner;
- elems[2] = NULL;
- vt.size = 0;
- vt.alignment = 0;
- vt.type = FFI_TYPE_VECTOR;
- vt.elements = elems;
- args[0] = &vt;
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 1, &ffi_type_void, args)
- == FFI_BAD_TYPEDEF);
- }
-
- /* A well-formed 3 x float vector is accepted with computed layout. */
- {
- ffi_type vt;
- ffi_type *elems[4];
- ffi_type *args[1];
- make_vector_type (&vt, elems, &ffi_type_float, 3);
- args[0] = &vt;
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 1, &ffi_type_void, args)
- == FFI_OK);
- CHECK (vt.size == 16); /* 12 rounded up to 16 */
- CHECK (vt.alignment == 16); /* min(16, 16) */
- }
-
- /* An 8-byte vector gets alignment 8 = min(8, 16). */
- {
- ffi_type vt;
- ffi_type *elems[3];
- ffi_type *args[1];
- make_vector_type (&vt, elems, &ffi_type_float, 2);
- args[0] = &vt;
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 1, &ffi_type_void, args)
- == FFI_OK);
- CHECK (vt.size == 8);
- CHECK (vt.alignment == 8);
- }
-
- printf ("vector validation ok\n");
- exit (0);
-}
diff --git a/deps/libffi/testsuite/libffi.vector/vector_vec3.c b/deps/libffi/testsuite/libffi.vector/vector_vec3.c
deleted file mode 100644
index 5a036728302..00000000000
--- a/deps/libffi/testsuite/libffi.vector/vector_vec3.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Area: ffi_call
- Purpose: Pass and return a three-lane float vector. Clang's
- ext_vector_type(3) has 12 bytes of data padded to 16-byte
- storage; libffi's power-of-two size rule must reproduce that
- layout so a natively compiled callee agrees.
- Limitations: Clang only (GCC's vector_size requires power-of-two totals and
- rejects a 12-byte vector). A no-op on other compilers.
- PR: none.
- Originator: libffi vector support. */
-
-/* { dg-do run } */
-
-#include "vector.h"
-
-#ifdef __clang__
-
-typedef float f3 __attribute__((ext_vector_type (3)));
-
-static f3
-scale3 (f3 v)
-{
- f3 r;
- r[0] = v[0] + 1;
- r[1] = v[1] + 2;
- r[2] = v[2] + 3;
- return r;
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- ffi_type vec_type;
- ffi_type *vec_elems[4];
- ffi_type *args[1];
- void *values[1];
- f3 a = { 10, 20, 30 };
- f3 r, ref;
- int i;
-
- make_vector_type (&vec_type, vec_elems, &ffi_type_float, 3);
-
- args[0] = &vec_type;
- values[0] = &a;
-
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 1, &vec_type, args) == FFI_OK);
- /* 3 x float = 12, rounded up to 16 (matches ext_vector_type storage). */
- CHECK (vec_type.size == 16);
- CHECK (vec_type.alignment == 16);
- CHECK (sizeof (f3) == 16);
-
- ffi_call (&cif, FFI_FN (scale3), &r, values);
-
- ref = scale3 (a);
- for (i = 0; i < 3; i++)
- {
- printf ("r[%d] = %g (want %g)\n", i, (double) r[i], (double) ref[i]);
- CHECK (r[i] == ref[i]);
- }
-
- exit (0);
-}
-
-#else
-
-int
-main (void)
-{
- /* ext_vector_type is a Clang extension; nothing to test elsewhere. */
- exit (0);
-}
-
-#endif
diff --git a/tools/dep_updaters/update-libffi.sh b/tools/dep_updaters/update-libffi.sh
index dc96c9c3244..38bf5b5ed5a 100755
--- a/tools/dep_updaters/update-libffi.sh
+++ b/tools/dep_updaters/update-libffi.sh
@@ -32,7 +32,7 @@ IFS=' ' read -r NEW_VERSION NEW_VERSION_URL LIBFFI_TARBALL <<EOF
$NEW_VERSION_METADATA
EOF
-CURRENT_VERSION=$(sed -n '/^@set VERSION /s/.* \([0-9.]*\)$/\1/p' "$DEPS_DIR/libffi/doc/version.texi")
+CURRENT_VERSION=$(sed -n 's/^AC_INIT(\[libffi\], *\[\([^]]*\)\].*/\1/p' "$DEPS_DIR/libffi/configure.ac")
# This function exit with 0 if new version and current version are the same
compare_dependency_version "libffi" "$NEW_VERSION" "$CURRENT_VERSION"
@@ -52,7 +52,7 @@ trap cleanup INT TERM EXIT
echo "Fetching libffi source archive..."
curl -fsSLo "$WORKSPACE/$LIBFFI_TARBALL" "$NEW_VERSION_URL"
log_and_verify_sha256sum "libffi" "$WORKSPACE/$LIBFFI_TARBALL"
-tar -C "$WORKSPACE" -xzf "$WORKSPACE/$LIBFFI_TARBALL"
+tar -C "$WORKSPACE" -xzf "$WORKSPACE/$LIBFFI_TARBALL" --exclude='*/testsuite/*' --exclude='*/doc/*'
LIBFFI_STAGING=$(find "$WORKSPACE" -mindepth 1 -maxdepth 1 -type d -print -quit)
echo "Copying existing Node.js-specific files"