diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/include/ffitarget.h b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/include/ffitarget.h new file mode 100644 index 0000000000000000000000000000000000000000..5a3399d80982b1f63e6a9b34e775fd0dd814ec1b --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/include/ffitarget.h @@ -0,0 +1,164 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012, 2014, 2018 Anthony Green + Copyright (c) 1996-2003, 2010 Red Hat, Inc. + Copyright (C) 2008 Free Software Foundation, Inc. + + Target configuration macros for x86 and x86-64. + + 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. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +/* ---- System specific configurations ----------------------------------- */ + +/* For code common to all platforms on x86 and x86_64. */ +#define X86_ANY + +#if defined (X86_64) && defined (__i386__) +#undef X86_64 +#warning ****************************************************** +#warning ********** X86 IS DEFINED **************************** +#warning ****************************************************** +#define X86 +#endif + +#ifdef X86_WIN64 +#define FFI_SIZEOF_ARG 8 +#define USE_BUILTIN_FFS 0 /* not yet implemented in mingw-64 */ +#endif + +#define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION +#ifndef _MSC_VER +#define FFI_TARGET_HAS_COMPLEX_TYPE +#endif + +/* ---- Generic type definitions ----------------------------------------- */ + +#ifndef LIBFFI_ASM +#ifdef X86_WIN64 +#ifdef _MSC_VER +typedef unsigned __int64 ffi_arg; +typedef __int64 ffi_sarg; +#else +typedef unsigned long long ffi_arg; +typedef long long ffi_sarg; +#endif +#else +#if defined __x86_64__ && defined __ILP32__ +#define FFI_SIZEOF_ARG 8 +#define FFI_SIZEOF_JAVA_RAW 4 +typedef unsigned long long ffi_arg; +typedef long long ffi_sarg; +#else +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; +#endif +#endif + +typedef enum ffi_abi { +#if defined(X86_WIN64) + FFI_FIRST_ABI = 0, + FFI_WIN64, /* sizeof(long double) == 8 - microsoft compilers */ + FFI_GNUW64, /* sizeof(long double) == 16 - GNU compilers */ + FFI_LAST_ABI, +#ifdef __GNUC__ + FFI_DEFAULT_ABI = FFI_GNUW64 +#else + FFI_DEFAULT_ABI = FFI_WIN64 +#endif + +#elif defined(X86_64) || (defined (__x86_64__) && defined (X86_DARWIN)) + FFI_FIRST_ABI = 1, + FFI_UNIX64, + FFI_WIN64, + FFI_EFI64 = FFI_WIN64, + FFI_GNUW64, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_UNIX64 + +#elif defined(X86_WIN32) + FFI_FIRST_ABI = 0, + FFI_SYSV = 1, + FFI_STDCALL = 2, + FFI_THISCALL = 3, + FFI_FASTCALL = 4, + FFI_MS_CDECL = 5, + FFI_PASCAL = 6, + FFI_REGISTER = 7, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_MS_CDECL +#else + FFI_FIRST_ABI = 0, + FFI_SYSV = 1, + FFI_THISCALL = 3, + FFI_FASTCALL = 4, + FFI_STDCALL = 5, + FFI_PASCAL = 6, + FFI_REGISTER = 7, + FFI_MS_CDECL = 8, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_SYSV +#endif +} ffi_abi; +#endif + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_GO_CLOSURES 1 + +#define FFI_TYPE_SMALL_STRUCT_1B (FFI_TYPE_LAST + 1) +#define FFI_TYPE_SMALL_STRUCT_2B (FFI_TYPE_LAST + 2) +#define FFI_TYPE_SMALL_STRUCT_4B (FFI_TYPE_LAST + 3) +#define FFI_TYPE_MS_STRUCT (FFI_TYPE_LAST + 4) + +#if defined (X86_64) || defined(X86_WIN64) \ + || (defined (__x86_64__) && defined (X86_DARWIN)) +/* 4 bytes of ENDBR64 + 7 bytes of LEA + 6 bytes of JMP + 7 bytes of NOP + + 8 bytes of pointer. */ +# define FFI_TRAMPOLINE_SIZE 32 +# define FFI_NATIVE_RAW_API 0 +#else +/* 4 bytes of ENDBR32 + 5 bytes of MOV + 5 bytes of JMP + 2 unused + bytes. */ +# define FFI_TRAMPOLINE_SIZE 16 +# define FFI_NATIVE_RAW_API 1 /* x86 has native raw api support */ +#endif + +#if !defined(GENERATE_LIBFFI_MAP) && defined(__CET__) +# include +# if (__CET__ & 1) != 0 +# define ENDBR_PRESENT +# endif +# define _CET_NOTRACK notrack +#else +# define _CET_ENDBR +# define _CET_NOTRACK +#endif + +#endif diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/about.json b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..a27af96dec672dcb7dcb9d1c97ac216a8d6a559c --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/about.json @@ -0,0 +1,133 @@ +{ + "channels": [ + "https://repo.anaconda.com/pkgs/main" + ], + "conda_build_version": "24.1.2", + "conda_version": "24.1.2", + "description": "The libffi library provides a portable, high level programming interface\nto various calling conventions. This allows a programmer to call any\nfunction specified by a call interface description at run-time.\n", + "dev_url": "https://github.com/libffi/libffi", + "doc_url": "https://sourceware.org/libffi/", + "env_vars": { + "CIO_TEST": "" + }, + "extra": { + "copy_test_source_files": true, + "final": true, + "flow_run_id": "9d85cb11-b977-4c5d-afe8-1f4416fc0019", + "recipe-maintainers": [ + "stefan-balke", + "scopatz", + "isuruf" + ], + "remote_url": "git@github.com:AnacondaRecipes/libffi-feedstock.git", + "sha": "d17938611be89ed8fc328d1fd8701795d5b7ad9d" + }, + "home": "https://sourceware.org/libffi/", + "identifiers": [], + "keywords": [], + "license": "MIT", + "license_family": "MIT", + "license_file": "LICENSE", + "root_pkgs": [ + "_libgcc_mutex 0.1 main", + "_openmp_mutex 5.1 1_gnu", + "archspec 0.2.1 pyhd3eb1b0_0", + "boltons 23.0.0 py39h06a4308_0", + "brotli-python 1.0.9 py39h6a678d5_7", + "bzip2 1.0.8 h7b6447c_0", + "c-ares 1.19.1 h5eee18b_0", + "charset-normalizer 2.0.4 pyhd3eb1b0_0", + "conda-content-trust 0.2.0 py39h06a4308_0", + "conda-package-handling 2.2.0 py39h06a4308_0", + "conda-package-streaming 0.9.0 py39h06a4308_0", + "fmt 9.1.0 hdb19cb5_0", + "icu 73.1 h6a678d5_0", + "idna 3.4 py39h06a4308_0", + "jsonpatch 1.32 pyhd3eb1b0_0", + "jsonpointer 2.1 pyhd3eb1b0_0", + "krb5 1.20.1 h143b758_1", + "ld_impl_linux-64 2.38 h1181459_1", + "libarchive 3.6.2 h6ac8c49_2", + "libev 4.33 h7f8727e_1", + "libffi 3.4.4 h6a678d5_0", + "libgcc-ng 11.2.0 h1234567_1", + "libgomp 11.2.0 h1234567_1", + "libnghttp2 1.57.0 h2d74bed_0", + "libsolv 0.7.24 he621ea3_0", + "libssh2 1.10.0 hdbd6064_2", + "libstdcxx-ng 11.2.0 h1234567_1", + "libxml2 2.10.4 hf1b16e4_1", + "lz4-c 1.9.4 h6a678d5_0", + "ncurses 6.4 h6a678d5_0", + "packaging 23.1 py39h06a4308_0", + "pcre2 10.42 hebb0a14_0", + "pluggy 1.0.0 py39h06a4308_1", + "pybind11-abi 4 hd3eb1b0_1", + "pycosat 0.6.6 py39h5eee18b_0", + "pycparser 2.21 pyhd3eb1b0_0", + "pysocks 1.7.1 py39h06a4308_0", + "python 3.9.18 h955ad1f_0", + "readline 8.2 h5eee18b_0", + "reproc 14.2.4 h295c915_1", + "reproc-cpp 14.2.4 h295c915_1", + "ruamel.yaml 0.17.21 py39h5eee18b_0", + "ruamel.yaml.clib 0.2.6 py39h5eee18b_1", + "sqlite 3.41.2 h5eee18b_0", + "tk 8.6.12 h1ccaba5_0", + "tqdm 4.65.0 py39hb070fc8_0", + "wheel 0.41.2 py39h06a4308_0", + "yaml-cpp 0.8.0 h6a678d5_0", + "zlib 1.2.13 h5eee18b_0", + "zstandard 0.19.0 py39h5eee18b_0", + "zstd 1.5.5 hc292b87_0", + "attrs 23.1.0 py39h06a4308_0", + "beautifulsoup4 4.12.2 py39h06a4308_0", + "ca-certificates 2023.12.12 h06a4308_0", + "certifi 2024.2.2 py39h06a4308_0", + "cffi 1.16.0 py39h5eee18b_0", + "chardet 4.0.0 py39h06a4308_1003", + "click 8.1.7 py39h06a4308_0", + "conda 24.1.2 py39h06a4308_0", + "conda-build 24.1.2 py39h06a4308_0", + "conda-index 0.4.0 pyhd3eb1b0_0", + "conda-libmamba-solver 24.1.0 pyhd3eb1b0_0", + "cryptography 42.0.2 py39hdda0065_0", + "distro 1.8.0 py39h06a4308_0", + "filelock 3.13.1 py39h06a4308_0", + "jinja2 3.1.3 py39h06a4308_0", + "jsonschema 4.19.2 py39h06a4308_0", + "jsonschema-specifications 2023.7.1 py39h06a4308_0", + "libcurl 8.5.0 h251f7ec_0", + "libedit 3.1.20230828 h5eee18b_0", + "liblief 0.12.3 h6a678d5_0", + "libmamba 1.5.6 haf1ee3a_0", + "libmambapy 1.5.6 py39h2dafd23_0", + "markupsafe 2.1.3 py39h5eee18b_0", + "menuinst 2.0.2 py39h06a4308_0", + "more-itertools 10.1.0 py39h06a4308_0", + "openssl 3.0.13 h7f8727e_0", + "patch 2.7.6 h7b6447c_1001", + "patchelf 0.17.2 h6a678d5_0", + "pip 23.3.1 py39h06a4308_0", + "pkginfo 1.9.6 py39h06a4308_0", + "platformdirs 3.10.0 py39h06a4308_0", + "psutil 5.9.0 py39h5eee18b_0", + "py-lief 0.12.3 py39h6a678d5_0", + "pyopenssl 24.0.0 py39h06a4308_0", + "python-libarchive-c 2.9 pyhd3eb1b0_1", + "pytz 2023.3.post1 py39h06a4308_0", + "pyyaml 6.0.1 py39h5eee18b_0", + "referencing 0.30.2 py39h06a4308_0", + "requests 2.31.0 py39h06a4308_1", + "rpds-py 0.10.6 py39hb02cf49_0", + "setuptools 68.2.2 py39h06a4308_0", + "soupsieve 2.5 py39h06a4308_0", + "tomli 2.0.1 py39h06a4308_0", + "tzdata 2023d h04d1e81_0", + "urllib3 2.1.0 py39h06a4308_1", + "xz 5.4.5 h5eee18b_0", + "yaml 0.2.5 h7b6447c_0" + ], + "summary": "A Portable Foreign Function Interface Library", + "tags": [] +} \ No newline at end of file diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/files b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/files new file mode 100644 index 0000000000000000000000000000000000000000..cb47c16e07572cb3ad7cd91e693722deca63254e --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/files @@ -0,0 +1,15 @@ +include/ffi.h +include/ffitarget.h +lib/libffi.7.so +lib/libffi.8.so +lib/libffi.a +lib/libffi.so +lib/libffi.so.7 +lib/libffi.so.8 +lib/libffi.so.8.1.2 +lib/pkgconfig/libffi.pc +share/info/libffi.info +share/man/man3/ffi.3 +share/man/man3/ffi_call.3 +share/man/man3/ffi_prep_cif.3 +share/man/man3/ffi_prep_cif_var.3 diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/git b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/git new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/has_prefix b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/has_prefix new file mode 100644 index 0000000000000000000000000000000000000000..6be25b04dc39fe5f5b27fa7c3578509fd6989ac0 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/has_prefix @@ -0,0 +1 @@ +/croot/libffi_1714483243560/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_ text lib/pkgconfig/libffi.pc diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/hash_input.json b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..aaadf704b14bc9c77525ea764313f5ffa272ae4d --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/hash_input.json @@ -0,0 +1,8 @@ +{ + "c_compiler_version": "11.2.0", + "cxx_compiler_version": "11.2.0", + "cxx_compiler": "gxx", + "c_compiler": "gcc", + "target_platform": "linux-64", + "channel_targets": "defaults" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/index.json b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..ea88ee81e67a6fc7f3460576aa8bf93e7b35a249 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/index.json @@ -0,0 +1,16 @@ +{ + "arch": "x86_64", + "build": "h6a678d5_1", + "build_number": 1, + "depends": [ + "libgcc-ng >=11.2.0", + "libstdcxx-ng >=11.2.0" + ], + "license": "MIT", + "license_family": "MIT", + "name": "libffi", + "platform": "linux", + "subdir": "linux-64", + "timestamp": 1714483282916, + "version": "3.4.4" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/licenses/LICENSE b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..75d1bce11f9118ccfd96b24a2e49af078da1b469 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/licenses/LICENSE @@ -0,0 +1,21 @@ +libffi - Copyright (c) 1996-2022 Anthony Green, Red Hat, Inc and others. +See source files for details. + +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. diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/paths.json b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..50ed492730b06dc25944933a5bb3542ae766081d --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/paths.json @@ -0,0 +1,97 @@ +{ + "paths": [ + { + "_path": "include/ffi.h", + "path_type": "hardlink", + "sha256": "f49fc7045d930af653d73aa480b645b296399a6205002215894d90de4de8355a", + "size_in_bytes": 14287 + }, + { + "_path": "include/ffitarget.h", + "path_type": "hardlink", + "sha256": "45e4fd2585aaed711e4fa3d1377b70c8e54dcdc56bdf402fa23a8816d19cc58a", + "size_in_bytes": 4928 + }, + { + "_path": "lib/libffi.7.so", + "path_type": "softlink", + "sha256": "a5d54aeb8ed2fd5e0ccf9d38b28cad6dec76517f69224a5d9687c1970b57b194", + "size_in_bytes": 72144 + }, + { + "_path": "lib/libffi.8.so", + "path_type": "softlink", + "sha256": "a5d54aeb8ed2fd5e0ccf9d38b28cad6dec76517f69224a5d9687c1970b57b194", + "size_in_bytes": 72144 + }, + { + "_path": "lib/libffi.a", + "path_type": "hardlink", + "sha256": "66e22d52480d4a11234ee038fe8929c1fdeea490a344260ed10711dd900059d7", + "size_in_bytes": 97758 + }, + { + "_path": "lib/libffi.so", + "path_type": "softlink", + "sha256": "a5d54aeb8ed2fd5e0ccf9d38b28cad6dec76517f69224a5d9687c1970b57b194", + "size_in_bytes": 72144 + }, + { + "_path": "lib/libffi.so.7", + "path_type": "softlink", + "sha256": "a5d54aeb8ed2fd5e0ccf9d38b28cad6dec76517f69224a5d9687c1970b57b194", + "size_in_bytes": 72144 + }, + { + "_path": "lib/libffi.so.8", + "path_type": "softlink", + "sha256": "a5d54aeb8ed2fd5e0ccf9d38b28cad6dec76517f69224a5d9687c1970b57b194", + "size_in_bytes": 72144 + }, + { + "_path": "lib/libffi.so.8.1.2", + "path_type": "hardlink", + "sha256": "a5d54aeb8ed2fd5e0ccf9d38b28cad6dec76517f69224a5d9687c1970b57b194", + "size_in_bytes": 72144 + }, + { + "_path": "lib/pkgconfig/libffi.pc", + "file_mode": "text", + "path_type": "hardlink", + "prefix_placeholder": "/croot/libffi_1714483243560/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_", + "sha256": "d42c74b8e17b72244a609b67b6f23d18da75e961f35ae11a8be0f205daee22b4", + "size_in_bytes": 756 + }, + { + "_path": "share/info/libffi.info", + "path_type": "hardlink", + "sha256": "f7481e5e3817a91d6c746b69f0b2708470b802bb2a6834b9a82e9f71b661fb62", + "size_in_bytes": 38202 + }, + { + "_path": "share/man/man3/ffi.3", + "path_type": "hardlink", + "sha256": "aa4730e114c305943a2226a524ed8447dc6b66a184523999868e5433c2c9de74", + "size_in_bytes": 850 + }, + { + "_path": "share/man/man3/ffi_call.3", + "path_type": "hardlink", + "sha256": "2817ce7b78cb737d7b85b18b45899470f5f565f990d056d3d8cfabf6d779477f", + "size_in_bytes": 2333 + }, + { + "_path": "share/man/man3/ffi_prep_cif.3", + "path_type": "hardlink", + "sha256": "f60c5bb9d04b55988da13511a2c3edfa0f39fb6f51abfb8ac24d0b161c4169c0", + "size_in_bytes": 1158 + }, + { + "_path": "share/man/man3/ffi_prep_cif_var.3", + "path_type": "hardlink", + "sha256": "9365685252f33f13627c9303bc01883b764227132069260c19e94100ff442a51", + "size_in_bytes": 1321 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/0001-arm64-changes-from-v3.3-patch.patch b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/0001-arm64-changes-from-v3.3-patch.patch new file mode 100644 index 0000000000000000000000000000000000000000..83cb76ecf6b2808730dfd3f0b02a5af81b06317f --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/0001-arm64-changes-from-v3.3-patch.patch @@ -0,0 +1,213 @@ +From a6ef415fa95661b67017f1bdc32d8f98db7d9c44 Mon Sep 17 00:00:00 2001 +From: Daniel Holth +Date: Fri, 27 Aug 2021 15:55:36 -0400 +Subject: [PATCH] arm64 changes merged from v3.3 arm64-changes patch + +--- + src/aarch64/ffi.c | 29 +++++++++++++++++--- + src/closures.c | 67 ++++++++++++++++++++++++++++++++++++++++------- + src/x86/ffi64.c | 6 +++++ + 3 files changed, 89 insertions(+), 13 deletions(-) + +diff --git a/src/aarch64/ffi.c b/src/aarch64/ffi.c +index 6544ac0..3f936d3 100644 +--- a/src/aarch64/ffi.c ++++ b/src/aarch64/ffi.c +@@ -715,12 +715,13 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue, + state.ngrn = N_X_ARG_REG; + /* Note that the default abi extends each argument + to a full 64-bit slot, while the iOS abi allocates +- only enough space. */ ++ only enough space, except for variadic arguments. */ + #ifdef __APPLE__ +- memcpy(d, a, s); +-#else +- *(ffi_arg *)d = ext; ++ if (!state.allocating_variadic) ++ memcpy(d, a, s); ++ else + #endif ++ *(ffi_arg *)d = ext; + } + } + break; +@@ -867,7 +868,11 @@ ffi_prep_closure_loc (ffi_closure *closure, + # ifdef HAVE_PTRAUTH + codeloc = ptrauth_auth_data(codeloc, ptrauth_key_function_pointer, 0); + # endif ++# ifdef FFI_TRAMPOLINE_WHOLE_DYLIB ++ void **config = (void **)((uint8_t *)codeloc - 2*PAGE_MAX_SIZE); ++# else + void **config = (void **)((uint8_t *)codeloc - PAGE_MAX_SIZE); ++# endif + config[0] = closure; + config[1] = start; + # endif +@@ -920,6 +925,22 @@ out: + return FFI_OK; + } + ++ffi_closure * ++ffi_find_closure_for_code(void *codeloc) ++{ ++#if FFI_EXEC_TRAMPOLINE_TABLE ++# ifdef FFI_TRAMPOLINE_WHOLE_DYLIB ++ void **config = (void **)((uint8_t *)codeloc - 2*PAGE_MAX_SIZE); ++# else ++ void **config = (void **)((uint8_t *)codeloc - PAGE_MAX_SIZE); ++# endif ++ return config[0]; ++#else ++ return (ffi_closure*)codeloc; ++#endif ++} ++ffi_closure *ffi_find_closure_for_code_np(void *codeloc) { return ffi_find_closure_for_code(codeloc); } /* Apple renamed this entry ... */ ++ + #ifdef FFI_GO_CLOSURES + extern void ffi_go_closure_SYSV (void) FFI_HIDDEN; + extern void ffi_go_closure_SYSV_V (void) FFI_HIDDEN; +diff --git a/src/closures.c b/src/closures.c +index 9aafbec..af1c3b8 100644 +--- a/src/closures.c ++++ b/src/closures.c +@@ -168,7 +168,13 @@ ffi_tramp_is_present (__attribute__((unused)) void *ptr) + #include + #include + ++#ifdef FFI_TRAMPOLINE_WHOLE_DYLIB ++#include ++#include ++#include ++#else + extern void *ffi_closure_trampoline_table_page; ++#endif + + typedef struct ffi_trampoline_table ffi_trampoline_table; + typedef struct ffi_trampoline_table_entry ffi_trampoline_table_entry; +@@ -196,6 +202,21 @@ struct ffi_trampoline_table_entry + /* Total number of trampolines that fit in one trampoline table */ + #define FFI_TRAMPOLINE_COUNT (PAGE_MAX_SIZE / FFI_TRAMPOLINE_SIZE) + ++/* The trampoline dylib has one page for the MACHO_HEADER and one page for the ++ * trampolines. iOS 12.0 and later, and macOS on Apple Silicon require that ++ * the entire dylib needs to be remapped as a unit. ++ * ++ * arm (legacy): Allocate two pages -- a config page and a placeholder for the trampolines ++ * arm64 (modern): Allocate three pages -- a config page and two placeholders for the trampoline dylib ++ */ ++#ifdef FFI_TRAMPOLINE_WHOLE_DYLIB ++#define FFI_TRAMPOLINE_ALLOCATION_PAGE_COUNT 3 ++#define FFI_TRAMPOLINE_PAGE_SEGMENT_OFFSET PAGE_MAX_SIZE ++#else ++#define FFI_TRAMPOLINE_ALLOCATION_PAGE_COUNT 2 ++#define FFI_TRAMPOLINE_PAGE_SEGMENT_OFFSET 0 ++#endif ++ + static pthread_mutex_t ffi_trampoline_lock = PTHREAD_MUTEX_INITIALIZER; + static ffi_trampoline_table *ffi_trampoline_tables = NULL; + +@@ -211,35 +232,63 @@ ffi_trampoline_table_alloc (void) + kern_return_t kt; + uint16_t i; + +- /* Allocate two pages -- a config page and a placeholder page */ + config_page = 0x0; +- kt = vm_allocate (mach_task_self (), &config_page, PAGE_MAX_SIZE * 2, ++ /* The entire allocation is: ++ * config_page ++ * trampoline_segment ++ * ++ * trampoline_segment is: ++ * trampoline dylib mach-o header (if FFI_TRAMPOLINE_WHOLE_DYLIB) ++ * trampoline page ++ */ ++ kt = vm_allocate (mach_task_self (), &config_page, FFI_TRAMPOLINE_ALLOCATION_PAGE_COUNT * PAGE_MAX_SIZE, + VM_FLAGS_ANYWHERE); + if (kt != KERN_SUCCESS) + return NULL; + +- /* Remap the trampoline table on top of the placeholder page */ +- trampoline_page = config_page + PAGE_MAX_SIZE; ++ static void *trampoline_table_page; ++ ++#ifdef FFI_TRAMPOLINE_WHOLE_DYLIB ++ static dispatch_once_t trampoline_template_init_once; ++ ++ dispatch_once(&trampoline_template_init_once, ^{ ++ void * const trampoline_handle = dlopen("/usr/lib/libffi-trampolines.dylib", RTLD_NOW | RTLD_LOCAL | RTLD_FIRST); ++ assert(trampoline_handle); ++ ++ trampoline_table_page = dlsym(trampoline_handle, "ffi_closure_trampoline_table_page"); ++ assert(trampoline_table_page); ++ }); ++#else ++ trampoline_table_page = &ffi_closure_trampoline_table_page; ++#endif + + #ifdef HAVE_PTRAUTH +- trampoline_page_template = (vm_address_t)(uintptr_t)ptrauth_auth_data((void *)&ffi_closure_trampoline_table_page, ptrauth_key_function_pointer, 0); ++ trampoline_page_template = (uintptr_t)ptrauth_auth_data(trampoline_table_page, ptrauth_key_function_pointer, 0); + #else +- trampoline_page_template = (vm_address_t)&ffi_closure_trampoline_table_page; ++ trampoline_page_template = (uintptr_t)trampoline_table_page; + #endif + + #ifdef __arm__ + /* ffi_closure_trampoline_table_page can be thumb-biased on some ARM archs */ + trampoline_page_template &= ~1UL; + #endif +- kt = vm_remap (mach_task_self (), &trampoline_page, PAGE_MAX_SIZE, 0x0, +- VM_FLAGS_OVERWRITE, mach_task_self (), trampoline_page_template, ++ ++ vm_address_t trampoline_segment_template = trampoline_page_template - FFI_TRAMPOLINE_PAGE_SEGMENT_OFFSET; ++ vm_size_t trampoline_segment_size = (FFI_TRAMPOLINE_ALLOCATION_PAGE_COUNT - 1) * PAGE_MAX_SIZE; ++ ++ /* Remap the trampoline table on top of the placeholder page */ ++ vm_address_t trampoline_segment = config_page + PAGE_MAX_SIZE; ++ kt = vm_remap (mach_task_self(), &trampoline_segment, trampoline_segment_size, 0x0, ++ VM_FLAGS_FIXED | VM_FLAGS_OVERWRITE, mach_task_self(), trampoline_segment_template, + FALSE, &cur_prot, &max_prot, VM_INHERIT_SHARE); + if (kt != KERN_SUCCESS) + { +- vm_deallocate (mach_task_self (), config_page, PAGE_MAX_SIZE * 2); ++ vm_deallocate (mach_task_self (), config_page, FFI_TRAMPOLINE_ALLOCATION_PAGE_COUNT * PAGE_MAX_SIZE); + return NULL; + } + ++ trampoline_page = trampoline_segment + FFI_TRAMPOLINE_PAGE_SEGMENT_OFFSET; ++ + if (!(cur_prot & VM_PROT_EXECUTE)) + { + /* If VM_PROT_EXECUTE isn't set on the remapped trampoline page, set it */ + kt = vm_protect (mach_task_self (), trampoline_page, PAGE_MAX_SIZE, + FALSE, cur_prot | VM_PROT_EXECUTE); + if (kt != KERN_SUCCESS) + { + vm_deallocate (mach_task_self (), config_page, PAGE_MAX_SIZE * 2); + return NULL; + } + } + + /* We have valid trampoline and config pages */ + table = calloc (1, sizeof (ffi_trampoline_table)); + table->free_count = FFI_TRAMPOLINE_COUNT; +diff --git a/src/x86/ffi64.c b/src/x86/ffi64.c +index 6a8e37f..a3d51bc 100644 +--- a/src/x86/ffi64.c ++++ b/src/x86/ffi64.c +@@ -809,6 +809,12 @@ out: + return FFI_OK; + } + ++ffi_closure * ++ffi_find_closure_for_code(void *code) ++{ ++ return (ffi_closure *) code; ++} ++ ffi_closure *ffi_find_closure_for_code_np(void *code) { return ffi_find_closure_for_code(code); } /* Apple renamed ... */ + int FFI_HIDDEN + ffi_closure_unix64_inner(ffi_cif *cif, + void (*fun)(ffi_cif*, void*, void**, void*), +-- +2.32.0 + diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/0002-Don-t-define-FFI_COMPLEX_TYPEDEF-ifndef-FFI_TARGET_H.patch b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/0002-Don-t-define-FFI_COMPLEX_TYPEDEF-ifndef-FFI_TARGET_H.patch new file mode 100644 index 0000000000000000000000000000000000000000..fa31050034fc16427735b27db8705c2bca937af6 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/0002-Don-t-define-FFI_COMPLEX_TYPEDEF-ifndef-FFI_TARGET_H.patch @@ -0,0 +1,33 @@ +From 77a2d361b38c957700a79b79dd4002eb9b638877 Mon Sep 17 00:00:00 2001 +From: Ray Donnelly +Date: Fri, 3 Jun 2016 14:26:07 +0100 +Subject: [PATCH 2/3] Don't define FFI_COMPLEX_TYPEDEF ifndef + FFI_TARGET_HAS_COMPLEX_TYPE + +--- + src/types.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/types.c b/src/types.c +index 7e80aec..e4b024c 100644 +--- a/src/types.c ++++ b/src/types.c +@@ -45,6 +45,7 @@ maybe_const ffi_type ffi_type_##name = { \ + id, NULL \ + } + ++#ifdef FFI_TARGET_HAS_COMPLEX_TYPE + #define FFI_COMPLEX_TYPEDEF(name, type, maybe_const) \ + static ffi_type *ffi_elements_complex_##name [2] = { \ + (ffi_type *)(&ffi_type_##name), NULL \ +@@ -60,6 +61,7 @@ maybe_const ffi_type ffi_type_complex_##name = { \ + FFI_TYPE_COMPLEX, \ + (ffi_type **)ffi_elements_complex_##name \ + } ++#endif + + /* Size and alignment are fake here. They must not be 0. */ + FFI_EXTERN const ffi_type ffi_type_void = { +-- +2.8.2 + diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/0004-LIBFFI_CLOSURE.patch b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/0004-LIBFFI_CLOSURE.patch new file mode 100644 index 0000000000000000000000000000000000000000..e6a8512e866feed5e2bd71c8b1e96f8bae875277 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/0004-LIBFFI_CLOSURE.patch @@ -0,0 +1,84 @@ +Index: libffi-3.4.4/libffi.map.in +=================================================================== +--- libffi-3.4.4.orig/libffi.map.in ++++ libffi-3.4.4/libffi.map.in +@@ -74,3 +74,79 @@ LIBFFI_GO_CLOSURE_8.0 { + ffi_prep_go_closure; + } LIBFFI_CLOSURE_8.0; + #endif ++ ++/* These version numbers correspond to the libtool-version abi numbers, ++ not to the libffi release numbers. */ ++ ++LIBFFI_BASE_7.0 { ++ global: ++ /* Exported data variables. */ ++ ffi_type_void; ++ ffi_type_uint8; ++ ffi_type_sint8; ++ ffi_type_uint16; ++ ffi_type_sint16; ++ ffi_type_uint32; ++ ffi_type_sint32; ++ ffi_type_uint64; ++ ffi_type_sint64; ++ ffi_type_float; ++ ffi_type_double; ++ ffi_type_longdouble; ++ ffi_type_pointer; ++ ++ /* Exported functions. */ ++ ffi_call; ++ ffi_prep_cif; ++ ffi_prep_cif_var; ++ ++ ffi_raw_call; ++ ffi_ptrarray_to_raw; ++ ffi_raw_to_ptrarray; ++ ffi_raw_size; ++ ++ ffi_java_raw_call; ++ ffi_java_ptrarray_to_raw; ++ ffi_java_raw_to_ptrarray; ++ ffi_java_raw_size; ++ ++ local: ++ *; ++}; ++ ++LIBFFI_BASE_7.1 { ++ global: ++ ffi_get_struct_offsets; ++} LIBFFI_BASE_7.0; ++ ++#ifdef FFI_TARGET_HAS_COMPLEX_TYPE ++LIBFFI_COMPLEX_7.0 { ++ global: ++ /* Exported data variables. */ ++ ffi_type_complex_float; ++ ffi_type_complex_double; ++ ffi_type_complex_longdouble; ++} LIBFFI_BASE_7.0; ++#endif ++ ++#if FFI_CLOSURES ++LIBFFI_CLOSURE_7.0 { ++ global: ++ ffi_closure_alloc; ++ ffi_closure_free; ++ ffi_prep_closure; ++ ffi_prep_closure_loc; ++ ffi_prep_raw_closure; ++ ffi_prep_raw_closure_loc; ++ ffi_prep_java_raw_closure; ++ ffi_prep_java_raw_closure_loc; ++} LIBFFI_BASE_7.0; ++#endif ++ ++#if FFI_GO_CLOSURES ++LIBFFI_GO_CLOSURE_7.0 { ++ global: ++ ffi_call_go; ++ ffi_prep_go_closure; ++} LIBFFI_CLOSURE_7.0; ++#endif diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/bld.bat b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/bld.bat new file mode 100644 index 0000000000000000000000000000000000000000..c43edaa7f33cc48eda9338ba4db5c0738dd371b8 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/bld.bat @@ -0,0 +1,34 @@ +if "%ARCH%" == "64" ( + set ARCH="x64" +) else ( + set ARCH="Win32" +) + +mkdir buildd +cd buildd +cmake -G "NMake Makefiles" ^ + -D CMAKE_BUILD_TYPE=Release ^ + -D CMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^ + -D CMAKE_INSTALL_PREFIX:PATH=%LIBRARY_PREFIX% ^ + -D BUILD_SHARED_LIBS:BOOL=ON ^ + -D VERSION=%PKG_VERSION% ^ + .. + +echo "configured ..." + +cmake --build . --config Release + +echo "built ..." + +cmake --build . --target install --config Release + +if errorlevel 1 exit 1 + +copy %LIBRARY_LIB%\ffi.lib %LIBRARY_LIB%\libffi.lib +copy %LIBRARY_LIB%\ffi.lib %LIBRARY_LIB%\libffi.dll.lib +copy %LIBRARY_PREFIX%\bin\ffi.dll %LIBRARY_PREFIX%\bin\ffi-8.dll +:: ffi-8 is backward compatible to ffi-7 +copy %LIBRARY_PREFIX%\bin\ffi.dll %LIBRARY_PREFIX%\bin\ffi-7.dll + +exit 0 + diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/build.sh b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..f4551d6893a0688a4fcf63ee74617adbe4c273e4 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/build.sh @@ -0,0 +1,70 @@ +#!/bin/bash + +set -ex + +cd $SRC_DIR + +# work-a-round for cyclic dependencies on OSX +if [[ $target_platform == osx-* ]]; then + conda create -p $SRC_DIR/compilers clang_${target_platform} clangxx_${target_platform} --yes --quiet + cp -fr compilers/* $BUILD_PREFIX/. 2>/dev/null || true + # do manual activation ... + . $BUILD_PREFIX/etc/conda/activate.d/activate_clang_${target_platform}.sh + . $BUILD_PREFIX/etc/conda/activate.d/activate_clangxx_${target_platform}.sh +fi + +export CFLAGS="${CFLAGS//-fvisibility=+([! ])/}" +export CXXFLAGS="${CXXFLAGS//-fvisibility=+([! ])/}" + +configure_args=( + --disable-debug + --disable-dependency-tracking + --prefix="${PREFIX}" + --includedir="${PREFIX}/include" +) + +configure_args+=(--build=$BUILD --host=$HOST) + +if [[ "$target_platform" == osx-* ]]; then + export CFLAGS="${CFLAGS} -Wno-deprecated-declarations" + export CXXFLAGS="${CXXFLAGS} -Wno-deprecated-declarations" + export CPP="${CC} -E" + export CXXCPP="${CXX} -E" +else + autoreconf -vfi +fi + +if [[ "$target_platform" == linux* ]]; then + # this changes the install dir from ${PREFIX}/lib64 to ${PREFIX}/lib + sed -i 's:@toolexeclibdir@:$(libdir):g' Makefile.in */Makefile.in + sed -i 's:@toolexeclibdir@:${libdir}:g' libffi.pc.in +fi + +./configure "${configure_args[@]}" || { cat config.log; exit 1;} + +make -j${CPU_COUNT} ${VERBOSE_AT} +make check +make install + +if [[ $target_platform == osx-* ]]; then + # do manual deactivation ... + . $BUILD_PREFIX/etc/conda/deactivate.d/deactivate_clang_${target_platform}.sh + . $BUILD_PREFIX/etc/conda/deactivate.d/deactivate_clangxx_${target_platform}.sh +fi + +# This overlaps with libgcc-ng: +rm -rf ${PREFIX}/share/info/dir + +# Make sure we provide old variant. As in 3.4 no API change was introduced in coparison to 3.3 +# we will go with the assumption of being backward compatible. +pushd $PREFIX/lib +# make sure we address also .so<.number>, and don't produce dead links +if [[ -f libffi${SHLIB_EXT}.8 ]]; then + ln -s libffi${SHLIB_EXT}.8 libffi${SHLIB_EXT}.7 + if [[ ! -f libffi.8{SHLIB_EXT} ]]; then + ln -s libffi${SHLIB_EXT}.8 libffi.8${SHLIB_EXT} + fi +fi +ln -s -f libffi.8${SHLIB_EXT} libffi.7${SHLIB_EXT} +popd + diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/conda_build_config.yaml b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8f11561bd6361575e102710d8654b8bd2b4b28b5 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/conda_build_config.yaml @@ -0,0 +1,101 @@ +VERBOSE_AT: V=1 +VERBOSE_CM: VERBOSE=1 +apr: 1.6.3 +blas_impl: openblas +boost: '1.82' +boost_cpp: '1.82' +bzip2: '1.0' +c_compiler: gcc +c_compiler_version: 11.2.0 +cairo: '1.16' +channel_targets: defaults +clang_variant: clang +cpu_optimization_target: nocona +cran_mirror: https://mran.microsoft.com/snapshot/2018-01-01 +cxx_compiler: gxx +cxx_compiler_version: 11.2.0 +cyrus_sasl: 2.1.28 +dbus: '1' +expat: '2' +extend_keys: +- extend_keys +- ignore_build_only_deps +- pin_run_as_build +- ignore_version +fontconfig: '2.14' +fortran_compiler: gfortran +fortran_compiler_version: 11.2.0 +freetype: '2.10' +g2clib: '1.6' +geos: 3.8.0 +giflib: '5' +glib: '2' +gmp: '6.1' +gnu: 2.12.2 +gst_plugins_base: '1.14' +gstreamer: '1.14' +harfbuzz: 4.3.0 +hdf4: '4.2' +hdf5: 1.12.1 +hdfeos2: '2.20' +hdfeos5: '5.1' +icu: '73' +ignore_build_only_deps: +- numpy +- python +jpeg: '9' +libcurl: 8.1.1 +libdap4: '3.19' +libffi: '3.4' +libgd: 2.3.3 +libgdal: 3.6.2 +libgsasl: '1.10' +libkml: '1.3' +libnetcdf: '4.8' +libpng: '1.6' +libprotobuf: 3.20.3 +libtiff: '4.2' +libwebp: 1.3.2 +libxml2: '2.10' +libxslt: '1.1' +llvm_variant: llvm +lua: '5' +lzo: '2' +mkl: 2023.* +mpfr: '4' +numpy: '1.21' +openblas: 0.3.21 +openjpeg: '2.3' +openssl: '3.0' +perl: '5.34' +pin_run_as_build: + python: + max_pin: x.x + min_pin: x.x + r-base: + max_pin: x.x + min_pin: x.x + libboost: + max_pin: x.x.x +pixman: '0.40' +proj: 9.3.1 +proj4: 5.2.0 +python: '3.8' +python_impl: cpython +python_implementation: cpython +r_base: '3.5' +r_implementation: r-base +r_version: 3.5.0 +readline: '8.0' +rust_compiler: rust +rust_compiler_version: 1.71.1 +serf: 1.3.9 +sqlite: '3' +target_platform: linux-64 +tk: '8.6' +xz: '5' +zip_keys: +- - python + - numpy +zlib: '1.2' +zstd: 1.5.2 diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/fix_w3264_masm.patch b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/fix_w3264_masm.patch new file mode 100644 index 0000000000000000000000000000000000000000..8e1675678a2b6dc9c9c9bb446275de2ee594cfd0 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/fix_w3264_masm.patch @@ -0,0 +1,37 @@ +diff --git a/configure_options.cmake b/configure_options.cmake +index 849231c..ceb6539 100644 +--- a/configure_options.cmake ++++ b/configure_options.cmake +@@ -79,6 +79,7 @@ elseif(TARGET_PLATFORM STREQUAL X86_64) + elseif(TARGET_PLATFORM MATCHES X86.*) + if(MSVC) + list(APPEND WIN_ASSEMBLY_LIST src/x86/sysv_intel.S) ++ set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO") + enable_language(ASM_MASM) + else() + list(APPEND SOURCES_LIST src/x86/sysv.S) +@@ -329,13 +330,17 @@ foreach(ASM_PATH IN LISTS WIN_ASSEMBLY_LIST) + + set_source_files_properties("${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm" PROPERTIES GENERATED TRUE) + +- add_custom_command( +- COMMAND "${CMAKE_ASM_MASM_COMPILER}" /Fo "${CMAKE_CURRENT_BINARY_DIR}/${ASM_FILENAME}.obj" "${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm" +- DEPENDS ${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm +- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ASM_FILENAME}.obj +- COMMENT "Assembling ${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm") ++ if(TARGET_PLATFORM MATCHES X86.*) ++ list(APPEND SOURCES_LIST ${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm) ++ else() ++ add_custom_command( ++ COMMAND "${CMAKE_ASM_MASM_COMPILER}" /Fo "${CMAKE_CURRENT_BINARY_DIR}/${ASM_FILENAME}.obj" "${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm" ++ DEPENDS ${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm ++ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ASM_FILENAME}.obj ++ COMMENT "Assembling ${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm") + +- set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${ASM_FILENAME}.obj PROPERTIES EXTERNAL_OBJECT TRUE) ++ set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${ASM_FILENAME}.obj PROPERTIES EXTERNAL_OBJECT TRUE) + +- list(APPEND OBJECTS_LIST ${CMAKE_CURRENT_BINARY_DIR}/${ASM_FILENAME}.obj) ++ list(APPEND OBJECTS_LIST ${CMAKE_CURRENT_BINARY_DIR}/${ASM_FILENAME}.obj) ++ endif() + endforeach() diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/meta.yaml b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7801c493d97d30c4569efd70ba32f088c75935bc --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/meta.yaml @@ -0,0 +1,96 @@ +# This file created by conda-build 24.1.2 +# meta.yaml template originally from: +# /feedstock/recipe, last modified Tue Apr 30 13:20:34 2024 +# ------------------------------------------------ + +package: + name: libffi + version: 3.4.4 +source: + patches: + - 0004-LIBFFI_CLOSURE.patch + sha256: d66c56ad259a82cf2a9dfc408b32bf5da52371500b84745f7fb8b645712df676 + url: https://github.com/libffi/libffi/releases/download/v3.4.4/libffi-3.4.4.tar.gz +build: + number: '1' + run_exports: + - libffi >=3.4,<4.0a0 + string: h6a678d5_1 +requirements: + build: + - _libgcc_mutex 0.1 main + - _openmp_mutex 5.1 1_gnu + - _sysroot_linux-64_curr_repodata_hack 3 haa98f57_10 + - autoconf 2.71 pl5340h5eee18b_0 + - automake 1.16.5 pl5340h06a4308_1 + - binutils_impl_linux-64 2.38 h2a08ee3_1 + - binutils_linux-64 2.38.0 hc2dff05_0 + - gcc_impl_linux-64 11.2.0 h1234567_1 + - gcc_linux-64 11.2.0 h5c386dc_0 + - gdbm 1.18 hd4cb3f1_4 + - gettext 0.21.0 h39681ba_1 + - gxx_impl_linux-64 11.2.0 h1234567_1 + - gxx_linux-64 11.2.0 hc2dff05_0 + - icu 73.1 h6a678d5_0 + - kernel-headers_linux-64 3.10.0 h57e8cba_10 + - ld_impl_linux-64 2.38 h1181459_1 + - libgcc-devel_linux-64 11.2.0 h1234567_1 + - libgcc-ng 11.2.0 h1234567_1 + - libgomp 11.2.0 h1234567_1 + - libstdcxx-devel_linux-64 11.2.0 h1234567_1 + - libstdcxx-ng 11.2.0 h1234567_1 + - libtool 2.4.6 h6a678d5_1009 + - libxml2 2.10.4 hfdd30dd_2 + - m4 1.4.18 h4e445db_0 + - make 4.2.1 h1bed415_1 + - ncurses 6.4 h6a678d5_0 + - patch 2.7.6 h7b6447c_1001 + - perl 5.34.0 h5eee18b_2 + - readline 8.2 h5eee18b_0 + - sed 4.8 h7b6447c_0 + - sysroot_linux-64 2.17 h57e8cba_10 + - texinfo 6.8 pl5262h7f8727e_0 + - xz 5.4.6 h5eee18b_0 + - zlib 1.2.13 h5eee18b_0 + host: + - _libgcc_mutex 0.1 main + - _openmp_mutex 5.1 1_gnu + - libgcc-ng 11.2.0 h1234567_1 + - libgomp 11.2.0 h1234567_1 + - libstdcxx-ng 11.2.0 h1234567_1 + run: + - libgcc-ng >=11.2.0 + - libstdcxx-ng >=11.2.0 +test: + requires: + - gcc_linux-64 11.2.0.* + - gxx_linux-64 11.2.0.* + - make + source_files: + - testsuite + - testsuite/libffi.bhaible +about: + description: '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. + + ' + dev_url: https://github.com/libffi/libffi + doc_url: https://sourceware.org/libffi/ + home: https://sourceware.org/libffi/ + license: MIT + license_family: MIT + license_file: LICENSE + summary: A Portable Foreign Function Interface Library +extra: + copy_test_source_files: true + final: true + flow_run_id: 9d85cb11-b977-4c5d-afe8-1f4416fc0019 + recipe-maintainers: + - isuruf + - scopatz + - stefan-balke + remote_url: git@github.com:AnacondaRecipes/libffi-feedstock.git + sha: d17938611be89ed8fc328d1fd8701795d5b7ad9d diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/meta.yaml.template b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/meta.yaml.template new file mode 100644 index 0000000000000000000000000000000000000000..25d695d51f887a6c8fa407099952ed1e0f7297d7 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/meta.yaml.template @@ -0,0 +1,72 @@ +{% set version = "3.4.4" %} +{% set am_version = "1.15" %} # keep synchronized with build.sh +{% set posix = 'm2-' if win else '' %} +{% set native = 'm2w64-' if win else '' %} + +package: + name: libffi + version: {{ version }} + +source: + url: https://github.com/libffi/libffi/releases/download/v{{version}}/libffi-{{version}}.tar.gz + sha256: d66c56ad259a82cf2a9dfc408b32bf5da52371500b84745f7fb8b645712df676 + patches: + - 0001-arm64-changes-from-v3.3-patch.patch # [osx] + # Windows-specific: + - 0002-Don-t-define-FFI_COMPLEX_TYPEDEF-ifndef-FFI_TARGET_H.patch # [win] + - win_cmake.patch # [win] + - fix_w3264_masm.patch # [win] + - 0004-LIBFFI_CLOSURE.patch # [linux] +build: + number: 1 + run_exports: + # good history: https://abi-laboratory.pro/tracker/timeline/libffi/ + - {{ pin_subpackage('libffi', "x.x") }} + +requirements: + build: + - cmake # [win] + - make # [unix] + - autoconf # [unix] + - libtool # [unix] + - {{ posix }}patch + - automake # [unix] + - {{ posix }}texinfo # [unix] + - {{ compiler('c') }} # [not osx] + - {{ compiler('cxx') }} # [not osx] + - {{ posix }}sed # [unix] + host: + run: + +test: + requires: + - llvm-tools # [win] + - m2-grep # [win] + - make # [unix] + - cmake # [win] + # no compile tests here, as used compiler might be not upward-compatible + # needs to be fixed + - {{ compiler('c') }} # [not osx] + - {{ compiler('cxx') }} # [not osx] + source_files: + - testsuite/libffi.bhaible + - testsuite + +about: + home: https://sourceware.org/libffi/ + license: MIT + license_file: LICENSE + license_family: MIT + summary: A Portable Foreign Function Interface Library + description: | + 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. + doc_url: https://sourceware.org/libffi/ + dev_url: https://github.com/libffi/libffi + +extra: + recipe-maintainers: + - stefan-balke + - scopatz + - isuruf diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/run_test.bat b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/run_test.bat new file mode 100644 index 0000000000000000000000000000000000000000..3a789c302a7adba774b1a8fd5de5303570edcc66 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/run_test.bat @@ -0,0 +1,9 @@ +if not exist %LIBRARY_PREFIX%/bin/ffi-7.dll exit /b 1 +if not exist %LIBRARY_PREFIX%/lib/libffi.lib exit /b 1 +if not exist %LIBRARY_PREFIX%/lib/ffi.lib exit /b 1 +if not exist %LIBRARY_PREFIX%/lib/pkgconfig/libffi.pc exit /b 1 +if not exist %LIBRARY_PREFIX%/include/ffi.h exit /b 1 +if not exist %LIBRARY_PREFIX%/include/ffitarget.h exit /b 1 +echo "platform name" +echo %SUBDIR% +if %SUBDIR%==win-64 (llvm-nm %LIBRARY_PREFIX%/lib/libffi.lib | grep "__imp_ffi_type_void" ) else (llvm-nm %LIBRARY_PREFIX%/lib/libffi.lib | grep "__imp__ffi_type_void") diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/run_test.sh b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/run_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..3bcc910c4c3a508773a0d0e879b58bbf634de036 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/run_test.sh @@ -0,0 +1,14 @@ +set -ex +test -e $PREFIX/lib/libffi${SHLIB_EXT} +test -e $PREFIX/lib/libffi.a +test -e $PREFIX/lib/pkgconfig/libffi.pc +test -e $PREFIX/include/ffi.h +test -e $PREFIX/include/ffitarget.h +cd $PWD/testsuite/libffi.bhaible +echo "Triggering libffi tests" +if [[ $(uname) == Darwin ]]; then + echo "ignore compile test due possible incompatiblity ..." +else + make prefix=$PREFIX CC=$CC +fi +echo "completed triggering the tests" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/win_cmake.patch b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/win_cmake.patch new file mode 100644 index 0000000000000000000000000000000000000000..b37c8d2a97938f697f2a8cf6f9b3a3ffb96a1d4b --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/recipe/win_cmake.patch @@ -0,0 +1,706 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +new file mode 100644 +index 0000000..26cc2fd +--- /dev/null ++++ b/CMakeLists.txt +@@ -0,0 +1,61 @@ ++cmake_minimum_required(VERSION 2.8.8) ++project(libffi C) ++ ++set(SOURCES_LIST ++ src/closures.c ++ src/java_raw_api ++ src/prep_cif.c ++ src/raw_api.c ++ src/tramp.c ++ src/types.c) ++ ++if(CMAKE_BUILD_TYPE MATCHES DEBUG) ++ list(APPEND SOURCES_LIST src/debug.c) ++ add_definitions(-DFFI_DEBUG) ++endif() ++ ++include(configure_platform.cmake) ++include(configure_options.cmake) ++ ++file(COPY ${FFI_CONFIG_FILE} DESTINATION ${CMAKE_BINARY_DIR}) ++file(COPY src/${TARGETDIR}/ffitarget.h DESTINATION ${CMAKE_BINARY_DIR}/include) ++ ++include_directories(${CMAKE_BINARY_DIR}/include) ++include_directories(${CMAKE_BINARY_DIR}) ++include_directories(include) ++ ++add_definitions(-DFFI_BUILDING) ++ ++add_library(objlib OBJECT ${SOURCES_LIST}) ++set_property(TARGET objlib PROPERTY POSITION_INDEPENDENT_CODE 1) ++ ++add_library(ffi_static STATIC $) ++ ++if(MSVC) ++ add_definitions(-DFFI_BUILDING_DLL) ++ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) ++elseif(CMAKE_SYSTEM_NAME MATCHES Darwin) ++ set(CMAKE_MACOSX_RPATH 1) ++endif() ++add_library(ffi_shared SHARED $ ${OBJECTS_LIST}) ++ ++set_target_properties(ffi_static PROPERTIES OUTPUT_NAME ffi) ++set_target_properties(ffi_shared PROPERTIES OUTPUT_NAME ffi) ++ ++install(TARGETS ffi_static ffi_shared ++ EXPORT ${PROJECT_NAME}Targets ++ RUNTIME DESTINATION bin ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib) ++ ++install(EXPORT ${PROJECT_NAME}Targets ++ DESTINATION share/${PROJECT_NAME}) ++ ++install(FILES ++ ${CMAKE_BINARY_DIR}/include/ffi.h ++ ${CMAKE_BINARY_DIR}/include/ffitarget.h ++ DESTINATION include) ++ ++install(FILES ++ ${CMAKE_LIBRARY_DIR}/pkgconfig/libffi.pc ++ DESTINATION lib/pkgconfig) +diff --git a/configure_options.cmake b/configure_options.cmake +new file mode 100644 +index 0000000..849231c +--- /dev/null ++++ b/configure_options.cmake +@@ -0,0 +1,341 @@ ++include(CheckCSourceCompiles) ++include(CheckCSourceRuns) ++include(CheckFunctionExists) ++include(CheckIncludeFile) ++include(CheckIncludeFiles) ++include(CheckSymbolExists) ++include(CheckTypeSize) ++ ++# options in AC counterpart can be overriden from command-line ++# e.g.: cmake .. -DFFI_MMAP_EXEC_EMUTRAMP_PAX=1 -DVERSION=X.Y ++if(NOT DEFINED VERSION) ++ set(VERSION 3.x-dev) ++endif() ++set(PACKAGE libffi) ++set(PACKAGE_BUGREPORT http://github.com/libffi/libffi/issues) ++set(PACKAGE_NAME ${PACKAGE}) ++set(PACKAGE_STRING "${PACKAGE} ${VERSION}") ++set(PACKAGE_TARNAME ${PACKAGE}) ++set(PACKAGE_URL http://github.com/libffi/libffi) ++set(PACKAGE_VERSION ${VERSION}) ++set(TARGET ${TARGET_PLATFORM}) ++set(LT_OBJDIR .libs/) ++set(prefix ../..) ++set(exec_prefix \${prefix}) ++set(libdir \${exec_prefix}/lib) ++set(toolexeclibdir \${exec_prefix}/lib) ++set(includedir \${prefix}/include) ++ ++check_type_size (size_t SIZEOF_SIZE_T) ++ ++if(SIZEOF_SIZE_T STREQUAL "") ++ set(size_t "unsinged int") ++endif() ++ ++if(MSVC) ++ get_filename_component(COMPILER_DIR "${CMAKE_C_COMPILER}" DIRECTORY) ++else() ++ enable_language(ASM) ++endif() ++ ++set(FFI_EXEC_TRAMPOLINE_TABLE 0) ++if(TARGET_PLATFORM STREQUAL X86_WIN64) ++ if(MSVC) ++ list(APPEND WIN_ASSEMBLY_LIST src/x86/win64_intel.S) ++ enable_language(ASM_MASM) ++ else() ++ list(APPEND SOURCES_LIST src/x86/win64.S) ++ endif() ++ list(APPEND SOURCES_LIST src/x86/ffiw64.c) ++ ++ set(TARGETDIR x86) ++elseif(TARGET_PLATFORM STREQUAL X86_64) ++ list(APPEND SOURCES_LIST ++ src/x86/ffi64.c ++ src/x86/unix64.S) ++ ++ if(SIZEOF_SIZE_T EQUAL 4 AND TARGET_PLATFORM MATCHES X86.*) ++ set(CMAKE_REQUIRED_FLAGS "-Werror") ++ ++ check_c_source_compiles( ++ " ++ int main(void) ++ { ++ return __x86_64__; ++ } ++ " ++ TARGET_X32) ++ ++ set(CMAKE_REQUIRED_FLAGS) ++ endif() ++ ++ if(NOT TARGET_X32) ++ list(APPEND SOURCES_LIST ++ src/x86/ffiw64.c ++ src/x86/win64.S) ++ endif() ++ ++ set(TARGETDIR x86) ++elseif(TARGET_PLATFORM MATCHES X86.*) ++ if(MSVC) ++ list(APPEND WIN_ASSEMBLY_LIST src/x86/sysv_intel.S) ++ enable_language(ASM_MASM) ++ else() ++ list(APPEND SOURCES_LIST src/x86/sysv.S) ++ endif() ++ ++ list(APPEND SOURCES_LIST src/x86/ffi.c) ++ set(TARGETDIR x86) ++elseif(TARGET_PLATFORM MATCHES ARM_WIN64|AARCH64) ++ if(TARGET_PLATFORM STREQUAL ARM_WIN64) ++ set(CMAKE_ASM_MASM_COMPILER ${COMPILER_DIR}/armasm64.exe) ++ set(CMAKE_ASM_COMPILER ${CMAKE_ASM_MASM_COMPILER}) ++ list(APPEND WIN_ASSEMBLY_LIST src/aarch64/win64_armasm.S) ++ file(COPY src/aarch64/ffitarget.h DESTINATION ${CMAKE_BINARY_DIR}/include) ++ enable_language(ASM) ++ else() ++ list(APPEND SOURCES_LIST src/aarch64/sysv.S) ++ endif() ++ ++ list(APPEND SOURCES_LIST src/aarch64/ffi.c) ++ set(TARGETDIR aarch64) ++elseif(TARGET_PLATFORM MATCHES ARM.*) ++ if(MSVC) ++ set(CMAKE_ASM_MASM_COMPILER ${COMPILER_DIR}/armasm.exe) ++ set(CMAKE_ASM_COMPILER ${CMAKE_ASM_MASM_COMPILER}) ++ list(APPEND WIN_ASSEMBLY_LIST src/arm/sysv_msvc_arm32.S) ++ file(COPY src/arm/ffitarget.h DESTINATION ${CMAKE_BINARY_DIR}/include) ++ enable_language(ASM) ++ else() ++ list(APPEND SOURCES_LIST src/arm/sysv.S) ++ endif() ++ ++ list(APPEND SOURCES_LIST src/arm/ffi.c) ++ set(TARGETDIR arm) ++endif() ++ ++if(CMAKE_SYSTEM_NAME STREQUAL Darwin AND TARGET_PLATFORM STREQUAL AARCH64) ++ set(FFI_EXEC_TRAMPOLINE_TABLE 1) ++elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin OR TARGET_PLATFORM MATCHES .*FREEBSD.*) ++ set(FFI_MMAP_EXEC_WRIT 1) ++endif() ++ ++check_type_size (double SIZEOF_DOUBLE) ++check_type_size ("long double" SIZEOF_LONG_DOUBLE) ++ ++if(SIZEOF_LONG_DOUBLE STREQUAL "") ++ set(HAVE_LONG_DOUBLE 0) ++ ++ if(DEFINED HAVE_LONG_DOUBLE_VARIANT) ++ set(HAVE_LONG_DOUBLE 1) ++ elseif(NOT SIZEOF_DOUBLE EQUAL SIZEOF_LONG_DOUBLE) ++ set(HAVE_LONG_DOUBLE 1) ++ endif() ++else() ++ set(HAVE_LONG_DOUBLE 1) ++endif() ++ ++check_function_exists(alloca C_ALLOCA) ++check_function_exists (mmap HAVE_MMAP) ++ ++check_symbol_exists (MAP_ANON sys/mman.h HAVE_MMAP_ANON) ++ ++check_c_source_runs( ++ " ++ #include ++ #include ++ #include ++ #include ++ ++ int main(void) { ++ int devzero = open(\"/dev/zero\", O_RDWR); ++ return devzero == -1 || mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, devzero, 0) == (void *)-1 ? 1 : 0; ++ }" HAVE_MMAP_DEV_ZERO) ++ ++check_include_file(alloca.h HAVE_ALLOCA_H) ++ ++check_c_source_compiles( ++ " ++ #include ++ int main() ++ { ++ char* x = alloca(1024); ++ return 0; ++ } ++ " ++ HAVE_ALLOCA) ++ ++check_include_file(dlfcn.h HAVE_DLFCN_H) ++check_include_file(inttypes.h HAVE_INTTYPES_H) ++check_include_file(memory.h HAVE_MEMORY_H) ++check_include_file(stdint.h HAVE_STDINT_H) ++check_include_file(stdlib.h HAVE_STDLIB_H) ++check_include_file(strings.h HAVE_STRINGS_H) ++check_include_file(string.h HAVE_STRING_H) ++check_include_file(sys/mman.h HAVE_SYS_MMAN_H) ++check_include_file(sys/stat.h HAVE_SYS_STAT_H) ++check_include_file(sys/types.h HAVE_SYS_TYPES_H) ++check_include_file(unistd.h HAVE_UNISTD_H) ++check_include_files("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS) ++ ++check_symbol_exists(memcpy string.h HAVE_MEMCPY) ++set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE") ++check_symbol_exists(mkostemp stdlib.h HAVE_MKOSTEMP) ++set(CMAKE_REQUIRED_DEFINITIONS) ++ ++if (NOT MSVC) ++ find_program(OBJDUMP objdump) ++ find_program(NM NAMES nm llvm-nm) ++ ++ if(OBJDUMP) ++ set(DUMPTOOL_CMD "objdump -t -h") # on macOS -t -h can't be combined ++ set(EH_FRAME_GREP_EXPR "grep -A1 -n eh_frame | grep -q READONLY") ++ elseif(NM) ++ set(DUMPTOOL_CMD "nm -a") ++ set(EH_FRAME_GREP_EXPR "grep -q ' r \.eh_frame'") ++ endif() ++ ++ execute_process( ++ COMMAND ++ sh -c "echo 'extern void foo (void); void bar (void) { foo (); foo (); }' | ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} -xc -c -fpic -fexceptions -o conftest.o - 2>&1; ++ ${DUMPTOOL_CMD} conftest.o 2>&1 | ${EH_FRAME_GREP_EXPR}" ++ WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ++ OUTPUT_VARIABLE IGNORE ++ ERROR_VARIABLE IGNORE ++ RESULT_VARIABLE HAVE_RO_EH_FRAME_EXITCODE) ++ ++ file(REMOVE ${CMAKE_BINARY_DIR}/conftest.*) ++ ++ if(HAVE_RO_EH_FRAME_EXITCODE EQUAL "0") ++ set(HAVE_RO_EH_FRAME 1) ++ set(EH_FRAME_FLAGS "a") ++ message(STATUS "Checking if .eh_frame section is read-only - yes") ++ else() ++ set(EH_FRAME_FLAGS "aw") ++ message(STATUS "Checking if .eh_frame section is read-only - no") ++ endif() ++ ++ execute_process( ++ COMMAND sh -c "echo '.text; foo: nop; .data; .long foo-.; .text' | ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} -xassembler -c -o conftest.o - 2>&1" ++ WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ++ OUTPUT_VARIABLE IGNORE ++ ERROR_VARIABLE IGNORE ++ RESULT_VARIABLE HAVE_AS_X86_PCREL_EXITCODE) ++ ++ file(REMOVE ${CMAKE_BINARY_DIR}/conftest.*) ++ ++ if(HAVE_AS_X86_PCREL_EXITCODE EQUAL "0") ++ set(HAVE_AS_X86_PCREL 1) ++ message(STATUS "Checking HAVE_AS_X86_PCREL - yes") ++ else() ++ message(STATUS "Checking HAVE_AS_X86_PCREL - no") ++ endif() ++ ++ execute_process( ++ COMMAND ++ sh -c "echo '.text;.globl foo;foo:;jmp bar;.section .eh_frame,\"a\",@unwind;bar:' | ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} -xassembler -Wa,--fatal-warnings -c -o conftest.o - 2>&1 && ++ echo 'extern void foo();int main(){foo();}' | ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} conftest.o -xc - 2>&1" ++ WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ++ OUTPUT_VARIABLE IGNORE ++ ERROR_VARIABLE IGNORE ++ RESULT_VARIABLE HAVE_AS_X86_64_UNWIND_SECTION_TYPE_EXITCODE) ++ ++ file(REMOVE ${CMAKE_BINARY_DIR}/conftest.*) ++ ++ if(HAVE_AS_X86_64_UNWIND_SECTION_TYPE_EXITCODE EQUAL "0") ++ set(HAVE_AS_X86_64_UNWIND_SECTION_TYPE 1) ++ message(STATUS "Checking HAVE_AS_X86_64_UNWIND_SECTION_TYPE - yes") ++ else() ++ message(STATUS "Checking HAVE_AS_X86_64_UNWIND_SECTION_TYPE - no") ++ endif() ++ ++ execute_process( ++ COMMAND sh -c "echo 'int __attribute__ ((visibility (\"hidden\"))) foo(void){return 1;}' | ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} -xc -Werror -S -o- - 2>&1 | ++ grep -q '\\.hidden.*foo'" ++ WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ++ OUTPUT_VARIABLE IGNORE ++ ERROR_VARIABLE IGNORE ++ RESULT_VARIABLE HAVE_HIDDEN_VISIBILITY_ATTRIBUTE_EXITCODE) ++ ++ if(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE_EXITCODE EQUAL "0") ++ set(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE 1) ++ message(STATUS "Checking HAVE_HIDDEN_VISIBILITY_ATTRIBUTE - yes") ++ else() ++ message(STATUS "Checking HAVE_HIDDEN_VISIBILITY_ATTRIBUTE - no") ++ endif() ++endif() ++ ++file(WRITE ${CMAKE_BINARY_DIR}/conftest.c "void nm_test_func(){} int main(){nm_test_func();return 0;}") ++ ++if(MSVC) ++ execute_process( ++ COMMAND "${CMAKE_C_COMPILER}" ${CMAKE_C_FLAGS} /c conftest.c ++ WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ++ OUTPUT_VARIABLE IGNORE ++ ERROR_VARIABLE IGNORE ++ RESULT_VARIABLE SYMBOL_UNDERSCORE_EXITCODE) ++ ++ if(SYMBOL_UNDERSCORE_EXITCODE EQUAL "0") ++ execute_process( ++ COMMAND "${COMPILER_DIR}/dumpbin.exe" /ALL /RAWDATA:NONE conftest.obj | findstr _nm_test_func > NUL ++ WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ++ OUTPUT_VARIABLE IGNORE ++ ERROR_VARIABLE IGNORE ++ RESULT_VARIABLE SYMBOL_UNDERSCORE_EXITCODE) ++ endif() ++elseif() ++ execute_process( ++ COMMAND sh -c "${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} -xc -c -o conftest.o conftest.c 2>&1; ++ ${DUMPTOOL_CMD} conftest.o 2>&1 | grep -q _nm_test_func" ++ WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ++ OUTPUT_VARIABLE IGNORE ++ ERROR_VARIABLE IGNORE ++ RESULT_VARIABLE SYMBOL_UNDERSCORE_EXITCODE) ++endif() ++ ++file(REMOVE ${CMAKE_BINARY_DIR}/conftest.*) ++ ++if(SYMBOL_UNDERSCORE_EXITCODE EQUAL "0") ++ set(SYMBOL_UNDERSCORE 1) ++ message(STATUS "Checking if symbols are underscored - yes") ++else() ++ message(STATUS "Checking if symbols are underscored - no") ++endif() ++ ++check_c_source_compiles( ++ " ++ asm (\".cfi_sections\\\\n\\\\t.cfi_startproc\\\\n\\\\t.cfi_endproc\"); ++ int main(void) ++ { ++ return 0; ++ } ++ " ++ HAVE_AS_CFI_PSEUDO_OP) ++ ++configure_file(include/ffi.h.in ${CMAKE_BINARY_DIR}/include/ffi.h) ++configure_file(include/fficonfig.h.in ${CMAKE_BINARY_DIR}/include/fficonfig.h) ++configure_file(libffi.pc.in ${CMAKE_LIBRARY_DIR}/pkgconfig/libffi.pc) ++ ++foreach(ASM_PATH IN LISTS WIN_ASSEMBLY_LIST) ++ get_filename_component(ASM_FILENAME "${ASM_PATH}" NAME_WE) ++ get_filename_component(ASM_DIRNAME "${ASM_PATH}" DIRECTORY) ++ ++ add_custom_command( ++ COMMAND "${CMAKE_C_COMPILER}" /nologo /P /EP /I. /I"${CMAKE_CURRENT_SOURCE_DIR}/${ASM_DIRNAME}" /Fi"${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm" /Iinclude ++ /I"${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_SOURCE_DIR}/${ASM_PATH}" ++ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${ASM_PATH} ++ OUTPUT ${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm ++ COMMENT "Preprocessing ${CMAKE_CURRENT_SOURCE_DIR}/${ASM_PATH}. Outputting to ${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm") ++ ++ set_source_files_properties("${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm" PROPERTIES GENERATED TRUE) ++ ++ add_custom_command( ++ COMMAND "${CMAKE_ASM_MASM_COMPILER}" /Fo "${CMAKE_CURRENT_BINARY_DIR}/${ASM_FILENAME}.obj" "${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm" ++ DEPENDS ${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm ++ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ASM_FILENAME}.obj ++ COMMENT "Assembling ${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm") ++ ++ set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${ASM_FILENAME}.obj PROPERTIES EXTERNAL_OBJECT TRUE) ++ ++ list(APPEND OBJECTS_LIST ${CMAKE_CURRENT_BINARY_DIR}/${ASM_FILENAME}.obj) ++endforeach() +diff --git a/configure_platform.cmake b/configure_platform.cmake +new file mode 100644 +index 0000000..bc57a65 +--- /dev/null ++++ b/configure_platform.cmake +@@ -0,0 +1,43 @@ ++if("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "") ++ set(HOST_ARCH ${CMAKE_SYSTEM_PROCESSOR}) ++else() ++ set(HOST_ARCH ${CMAKE_C_COMPILER_ARCHITECTURE_ID}) ++endif() ++ ++if("${TARGET_PLATFORM}" STREQUAL "") ++ if(HOST_ARCH MATCHES x64|x86_64|AMD64|amd64) ++ if(CMAKE_SYSTEM_NAME STREQUAL Windows) ++ set(TARGET_PLATFORM X86_WIN64) ++ else() ++ set(TARGET_PLATFORM X86_64) ++ endif() ++ elseif(HOST_ARCH MATCHES i.*86.*|X86|x86) ++ if(MSVC) ++ set(TARGET_PLATFORM X86_WIN32) ++ else() ++ set(TARGET_PLATFORM X86) ++ endif() ++ ++ if(CMAKE_SYSTEM_NAME STREQUAL Darwin) ++ set(TARGET_PLATFORM X86_DARWIN) ++ elseif(CMAKE_SYSTEM_NAME MATCHES FreeBSD|OpenBSD) ++ set(TARGET_PLATFORM X86_FREEBSD) ++ endif() ++ elseif(HOST_ARCH MATCHES aarch64|ARM64|arm64) ++ if(MSVC) ++ set(TARGET_PLATFORM ARM_WIN64) ++ else() ++ set(TARGET_PLATFORM AARCH64) ++ endif() ++ elseif(HOST_ARCH MATCHES arm.*|ARM.*) ++ if(MSVC) ++ set(TARGET_PLATFORM ARM_WIN32) ++ else() ++ set(TARGET_PLATFORM ARM) ++ endif() ++ else() ++ message(FATAL_ERROR "Unknown host.") ++ endif() ++endif() ++ ++message(STATUS "Building for TARGET_PLATFORM: ${TARGET_PLATFORM}") +diff --git a/include/fficonfig.h.in b/include/fficonfig.h.in +new file mode 100644 +index 0000000..1b36207 +--- /dev/null ++++ b/include/fficonfig.h.in +@@ -0,0 +1,210 @@ ++/* fficonfig.h.in. Generated from configure.ac by autoheader. */ ++ ++/* Define if building universal (internal helper macro) */ ++#cmakedefine AC_APPLE_UNIVERSAL_BUILD ++ ++/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP ++ systems. This function is required for `alloca.c' support on those systems. ++ */ ++#cmakedefine CRAY_STACKSEG_END "@CRAY_STACKSEG_END@" ++ ++/* Define if using `alloca.c'. */ ++#cmakedefine C_ALLOCA ++ ++/* Define to the flags needed for the .section .eh_frame directive. */ ++#cmakedefine EH_FRAME_FLAGS "@EH_FRAME_FLAGS@" ++ ++/* Define this if you want extra debugging. */ ++#cmakedefine FFI_DEBUG ++ ++/* Cannot use PROT_EXEC on this target, so, we revert to alternative means */ ++#cmakedefine FFI_EXEC_TRAMPOLINE_TABLE ++ ++/* Define this if you want to enable pax emulated trampolines */ ++#cmakedefine FFI_MMAP_EXEC_EMUTRAMP_PAX ++ ++/* Cannot use malloc on this target, so, we revert to alternative means */ ++#cmakedefine01 FFI_MMAP_EXEC_WRIT ++ ++/* Define this if you do not want support for the raw API. */ ++#cmakedefine01 FFI_NO_RAW_API ++ ++/* Define this if you do not want support for aggregate types. */ ++#cmakedefine01 FFI_NO_STRUCTS ++ ++/* Define to 1 if you have `alloca', as a function or macro. */ ++#cmakedefine01 HAVE_ALLOCA ++ ++/* Define to 1 if you have and it should be used (not on Ultrix). ++ */ ++#cmakedefine01 HAVE_ALLOCA_H ++ ++/* Define if your assembler supports .cfi_* directives. */ ++#cmakedefine HAVE_AS_CFI_PSEUDO_OP ++ ++/* Define if your assembler supports .register. */ ++#cmakedefine HAVE_AS_REGISTER_PSEUDO_OP ++ ++/* Define if the compiler uses zarch features. */ ++#cmakedefine HAVE_AS_S390_ZARCH ++ ++/* Define if your assembler and linker support unaligned PC relative relocs. ++ */ ++#cmakedefine HAVE_AS_SPARC_UA_PCREL ++ ++/* Define if your assembler supports unwind section type. */ ++#cmakedefine HAVE_AS_X86_64_UNWIND_SECTION_TYPE ++ ++/* Define if your assembler supports PC relative relocs. */ ++#cmakedefine HAVE_AS_X86_PCREL ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine01 HAVE_DLFCN_H ++ ++/* Define if __attribute__((visibility("hidden"))) is supported. */ ++#cmakedefine HAVE_HIDDEN_VISIBILITY_ATTRIBUTE ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine01 HAVE_INTTYPES_H ++ ++/* Define if you have the long double type and it is bigger than a double */ ++#cmakedefine01 HAVE_LONG_DOUBLE ++ ++/* Define if you support more than one size of the long double type */ ++#cmakedefine HAVE_LONG_DOUBLE_VARIANT ++ ++/* Define to 1 if you have the `memcpy' function. */ ++#cmakedefine01 HAVE_MEMCPY ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine01 HAVE_MEMORY_H ++ ++/* Define to 1 if you have the `mkostemp' function. */ ++#cmakedefine01 HAVE_MKOSTEMP ++ ++/* Define to 1 if you have the `mmap' function. */ ++#cmakedefine01 HAVE_MMAP ++ ++/* Define if mmap with MAP_ANON(YMOUS) works. */ ++#cmakedefine HAVE_MMAP_ANON ++ ++/* Define if mmap of /dev/zero works. */ ++#cmakedefine HAVE_MMAP_DEV_ZERO ++ ++/* Define if read-only mmap of a plain file works. */ ++#cmakedefine HAVE_MMAP_FILE ++ ++/* Define if .eh_frame sections should be read-only. */ ++#cmakedefine HAVE_RO_EH_FRAME ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine01 HAVE_STDINT_H ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine01 HAVE_STDLIB_H ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine01 HAVE_STRINGS_H ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine01 HAVE_STRING_H ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine01 HAVE_SYS_MMAN_H ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine01 HAVE_SYS_STAT_H ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine01 HAVE_SYS_TYPES_H ++ ++/* Define to 1 if you have the header file. */ ++#cmakedefine01 HAVE_UNISTD_H ++ ++/* Define to the sub-directory where libtool stores uninstalled libraries. */ ++#cmakedefine LT_OBJDIR "@LT_OBJDIR@" ++ ++/* Name of package */ ++#cmakedefine PACKAGE "@PACKAGE@" ++ ++/* Define to the address where bug reports for this package should be sent. */ ++#cmakedefine PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" ++ ++/* Define to the full name of this package. */ ++#cmakedefine PACKAGE_NAME "@PACKAGE_NAME@" ++ ++/* Define to the full name and version of this package. */ ++#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@" ++ ++/* Define to the one symbol short name of this package. */ ++#cmakedefine PACKAGE_TARNAME "@PACKAGE_TARNAME@" ++ ++/* Define to the home page for this package. */ ++#cmakedefine PACKAGE_URL "@PACKAGE_URL@" ++ ++/* Define to the version of this package. */ ++#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@" ++ ++/* The size of `double', as computed by sizeof. */ ++#cmakedefine SIZEOF_DOUBLE @SIZEOF_DOUBLE@ ++ ++/* The size of `long double', as computed by sizeof. */ ++#cmakedefine SIZEOF_LONG_DOUBLE @SIZEOF_LONG_DOUBLE@ ++ ++/* The size of `size_t', as computed by sizeof. */ ++#cmakedefine SIZEOF_SIZE_T @SIZEOF_SIZE_T@ ++ ++/* If using the C implementation of alloca, define if you know the ++ direction of stack growth for your system; otherwise it will be ++ automatically deduced at runtime. ++ STACK_DIRECTION > 0 => grows toward higher addresses ++ STACK_DIRECTION < 0 => grows toward lower addresses ++ STACK_DIRECTION = 0 => direction of growth unknown */ ++#cmakedefine STACK_DIRECTION @STACK_DIRECTION@ ++ ++/* Define to 1 if you have the ANSI C header files. */ ++#cmakedefine01 STDC_HEADERS ++ ++/* Define if symbols are underscored. */ ++#cmakedefine SYMBOL_UNDERSCORE ++ ++/* Define this if you are using Purify and want to suppress spurious messages. ++ */ ++#cmakedefine USING_PURIFY ++ ++/* Version number of package */ ++#cmakedefine VERSION "@VERSION@" ++ ++/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most ++ significant byte first (like Motorola and SPARC, unlike Intel). */ ++#if defined AC_APPLE_UNIVERSAL_BUILD ++# if defined __BIG_ENDIAN__ ++# define WORDS_BIGENDIAN 1 ++# endif ++#else ++# ifndef WORDS_BIGENDIAN ++# undef WORDS_BIGENDIAN ++# endif ++#endif ++ ++/* Define to `unsigned int' if does not define. */ ++#cmakedefine size_t @size_t@ ++ ++ ++#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE ++#ifdef LIBFFI_ASM ++#ifdef __APPLE__ ++#define FFI_HIDDEN(name) .private_extern name ++#else ++#define FFI_HIDDEN(name) .hidden name ++#endif ++#else ++#define FFI_HIDDEN __attribute__ ((visibility ("hidden"))) ++#endif ++#else ++#ifdef LIBFFI_ASM ++#define FFI_HIDDEN(name) ++#else ++#define FFI_HIDDEN ++#endif ++#endif +diff --git a/src/closures.c b/src/closures.c +index 5120021..c329077 100644 +--- a/src/closures.c ++++ b/src/closures.c +@@ -137,6 +137,7 @@ ffi_closure_free (void *ptr) + /* Windows systems may have Data Execution Protection (DEP) enabled, + which requires the use of VirtualMalloc/VirtualFree to alloc/free + executable memory. */ ++# undef FFI_MMAP_EXEC_WRIT + # define FFI_MMAP_EXEC_WRIT 1 + # endif + #endif +diff --git a/src/dlmalloc.c b/src/dlmalloc.c +index d63dd36..950e977 100644 +--- a/src/dlmalloc.c ++++ b/src/dlmalloc.c +@@ -451,6 +451,7 @@ DEFAULT_MMAP_THRESHOLD default: 256K + #ifdef WIN32 + #define WIN32_LEAN_AND_MEAN + #include ++#undef HAVE_MMAP + #define HAVE_MMAP 1 + #define HAVE_MORECORE 0 + #define LACKS_UNISTD_H +-- +2.23.0 + diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/repodata_record.json b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..f3258c91281676ce4f222df51443d1c27cea896d --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/repodata_record.json @@ -0,0 +1,23 @@ +{ + "arch": "x86_64", + "build": "h6a678d5_1", + "build_number": 1, + "channel": "https://repo.anaconda.com/pkgs/main/linux-64/", + "constrains": [], + "depends": [ + "libgcc-ng >=11.2.0", + "libstdcxx-ng >=11.2.0" + ], + "fn": "libffi-3.4.4-h6a678d5_1.conda", + "license": "MIT", + "license_family": "MIT", + "md5": "70646cc713f0c43926cfdcfe9b695fe0", + "name": "libffi", + "platform": "linux", + "sha256": "b0e7fe2e5d498bc5a2c57cf942701bba8f22ec55de55e092ffbffc40b816df88", + "size": 144691, + "subdir": "linux-64", + "timestamp": 1714483282000, + "url": "https://repo.anaconda.com/pkgs/main/linux-64/libffi-3.4.4-h6a678d5_1.conda", + "version": "3.4.4" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/run_exports.json b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/run_exports.json new file mode 100644 index 0000000000000000000000000000000000000000..618520938b44b656cb828bfceede99bcf13ec5a4 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/run_exports.json @@ -0,0 +1 @@ +{"weak": ["libffi >=3.4,<4.0a0"]} \ No newline at end of file diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/run_test.sh b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/run_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..3bcc910c4c3a508773a0d0e879b58bbf634de036 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/run_test.sh @@ -0,0 +1,14 @@ +set -ex +test -e $PREFIX/lib/libffi${SHLIB_EXT} +test -e $PREFIX/lib/libffi.a +test -e $PREFIX/lib/pkgconfig/libffi.pc +test -e $PREFIX/include/ffi.h +test -e $PREFIX/include/ffitarget.h +cd $PWD/testsuite/libffi.bhaible +echo "Triggering libffi tests" +if [[ $(uname) == Darwin ]]; then + echo "ignore compile test due possible incompatiblity ..." +else + make prefix=$PREFIX CC=$CC +fi +echo "completed triggering the tests" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/test_time_dependencies.json b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/test_time_dependencies.json new file mode 100644 index 0000000000000000000000000000000000000000..8a29e4cfb6417f3f0cb660feafedc4cfb59b121f --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/test_time_dependencies.json @@ -0,0 +1 @@ +["make", "gxx_linux-64 11.2.0.*", "gcc_linux-64 11.2.0.*"] \ No newline at end of file diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/Makefile.am b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..c4331b1d3325e662fa9881a8f06f12650cdb52b3 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/Makefile.am @@ -0,0 +1,133 @@ +## 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 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/call.exp \ +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/many.c libffi.call/many2.c libffi.call/many_double.c \ +libffi.call/many_mixed.c libffi.call/negint.c libffi.call/offsets.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/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/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/struct_by_value_big.c \ +libffi.call/struct_by_value_2.c libffi.call/struct_by_value_3.c \ +libffi.call/struct_by_value_4.c libffi.call/struct_by_value_small.c \ +libffi.call/strlen2.c libffi.call/strlen3.c libffi.call/strlen4.c \ +libffi.call/strlen.c libffi.call/va_3.c \ +libffi.call/struct_by_value_2.c libffi.call/struct_by_value_3.c \ +libffi.call/struct_by_value_4.c libffi.closures/closure.exp \ +libffi.call/s55.c libffi.call/bpo-38748.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_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_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_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/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.closures/cls_align_longdouble_split.c \ +libffi.closures/cls_align_longdouble_split2.c \ +libffi.closures/cls_longdouble.c libffi.closures/huge_struct.c \ +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_int.c libffi.complex/complex_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 diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/Makefile.in b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/Makefile.in new file mode 100644 index 0000000000000000000000000000000000000000..44a5f999d52ec803e1e76ca9dec74628789ea706 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/Makefile.in @@ -0,0 +1,662 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 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)) +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@ +ALLOCA = @ALLOCA@ +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@ +FGREP = @FGREP@ +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@ +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@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +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 = $(libdir) +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 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/call.exp \ +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/many.c libffi.call/many2.c libffi.call/many_double.c \ +libffi.call/many_mixed.c libffi.call/negint.c libffi.call/offsets.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/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/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/struct_by_value_big.c \ +libffi.call/struct_by_value_2.c libffi.call/struct_by_value_3.c \ +libffi.call/struct_by_value_4.c libffi.call/struct_by_value_small.c \ +libffi.call/strlen2.c libffi.call/strlen3.c libffi.call/strlen4.c \ +libffi.call/strlen.c libffi.call/va_3.c \ +libffi.call/struct_by_value_2.c libffi.call/struct_by_value_3.c \ +libffi.call/struct_by_value_4.c libffi.closures/closure.exp \ +libffi.call/s55.c libffi.call/bpo-38748.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_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_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_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/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.closures/cls_align_longdouble_split.c \ +libffi.closures/cls_align_longdouble_split2.c \ +libffi.closures/cls_longdouble.c libffi.closures/huge_struct.c \ +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_int.c libffi.complex/complex_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 + +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) + @echo 'Making a new site.exp file ...' + @echo '## these variables are automatically generated by make ##' >site.tmp + @echo '# Do not edit here. If you wish to override these values' >>site.tmp + @echo '# edit the last section' >>site.tmp + @echo 'set srcdir "$(srcdir)"' >>site.tmp + @echo "set objdir \"`pwd`\"" >>site.tmp + @echo 'set build_alias "$(build_alias)"' >>site.tmp + @echo 'set build_triplet $(build_triplet)' >>site.tmp + @echo 'set host_alias "$(host_alias)"' >>site.tmp + @echo 'set host_triplet $(host_triplet)' >>site.tmp + @echo 'set target_alias "$(target_alias)"' >>site.tmp + @echo 'set target_triplet $(target_triplet)' >>site.tmp + @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. ##" \ + || exit 1; \ + done >> site.tmp + @echo "## End of auto-generated content; you can edit from here. ##" >> site.tmp + @if test -f site.exp; then \ + sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.tmp; \ + fi + @-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: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || 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: diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/config/default.exp b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/config/default.exp new file mode 100644 index 0000000000000000000000000000000000000000..90967cccc18afeb470c705244f4cb9e44f15eb0d --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/config/default.exp @@ -0,0 +1 @@ +load_lib "standard.exp" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/lib/libffi.exp b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/lib/libffi.exp new file mode 100644 index 0000000000000000000000000000000000000000..7457af415f3d04fc14a33ef8a44ad7b469ff15c5 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/lib/libffi.exp @@ -0,0 +1,666 @@ +# Copyright (C) 2003, 2005, 2008, 2009, 2010, 2011, 2014, 2019, 2022 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 +# . + +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 +} + +# 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] + } + + # 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]].exe" + # 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]].exe" + # 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 + 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${libffi_dir}/.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 ffi_mips.h in srcdir, too + lappend options "additional_flags=-I${libffi_include} -I${srcdir}/../include -I${libffi_include}/.." + 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" + } + + # 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" + } + + lappend options "libs= -lffi" + + if { ![string match "*android*" $target_triplet] } { + + if { [string match "aarch64*-*-linux*" $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] } { + lappend options "libs= -lc++" + } + } + + if { [string match "arc*-*-linux*" $target_triplet] } { + lappend options "libs= -lpthread" + } + } + + verbose "options: $options" + return [target_compile $source $dest $type $options] +} + +# 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 " + puts $f $test + puts $f "/* OK */" + puts $f "#else" + puts $f "# error Failed $test" + puts $f "#endif" + close $f + + set lines [libffi_target_compile $src /dev/null assembly ""] + file delete $src + + 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" + 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/lib/target-libpath.exp b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/lib/target-libpath.exp new file mode 100644 index 0000000000000000000000000000000000000000..e33a656c6cc0d7b4b74e605e5951b1d3b36c501b --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/lib/target-libpath.exp @@ -0,0 +1,283 @@ +# 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 +# . + +# 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/lib/wrapper.exp b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/lib/wrapper.exp new file mode 100644 index 0000000000000000000000000000000000000000..4e5ae435a13eb99b1c74c341e19c1839de2b90f4 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/lib/wrapper.exp @@ -0,0 +1,45 @@ +# 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 +# . + +# 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.bhaible/Makefile b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.bhaible/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..3322de94f7ab926b9b92b63b2f68202824f2ad7d --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.bhaible/Makefile @@ -0,0 +1,28 @@ +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.bhaible/README b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.bhaible/README new file mode 100644 index 0000000000000000000000000000000000000000..be8540b64fa97e03c261f50c8b4cdb1313f4fde8 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.bhaible/README @@ -0,0 +1,78 @@ +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.bhaible/alignof.h b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.bhaible/alignof.h new file mode 100644 index 0000000000000000000000000000000000000000..00604a513ad37eb61fd577edbe4bac52b8909076 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.bhaible/alignof.h @@ -0,0 +1,50 @@ +/* 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 . */ + +#ifndef _ALIGNOF_H +#define _ALIGNOF_H + +#include + +/* 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 + 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 struct alignof_helper { char __slot1; type __slot2; }; +# define alignof_slot(type) offsetof (alignof_helper, __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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.bhaible/bhaible.exp b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.bhaible/bhaible.exp new file mode 100644 index 0000000000000000000000000000000000000000..44aebc5e063798c0255d124587343ef57ae2b30c --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.bhaible/bhaible.exp @@ -0,0 +1,63 @@ +# 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 +# . + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.bhaible/test-call.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.bhaible/test-call.c new file mode 100644 index 0000000000000000000000000000000000000000..4887e0092ebc38cb770b8d7a8abca56b2ec224f0 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.bhaible/test-call.c @@ -0,0 +1,1746 @@ +/** + Copyright 1993 Bill Triggs + Copyright 1995-2017 Bruno Haible + + 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 . +**/ + +/* { dg-do run { xfail gccbug } } */ + +#include +#include +#include +#include +#include "alignof.h" +#include + +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.bhaible/test-callback.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.bhaible/test-callback.c new file mode 100644 index 0000000000000000000000000000000000000000..0b16799d868d9c17411344863c3d9ca252facaba --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.bhaible/test-callback.c @@ -0,0 +1,2885 @@ +/* + * Copyright 1993 Bill Triggs + * Copyright 1995-2017 Bruno Haible + * + * 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 . + */ + +/* { dg-do run { xfail gccbug } } */ + +#include +#include +#include +#include +#include "alignof.h" +#include + +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.bhaible/testcases.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.bhaible/testcases.c new file mode 100644 index 0000000000000000000000000000000000000000..23a6f466096f7c4a652b1e3905b376c8e8705e25 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.bhaible/testcases.c @@ -0,0 +1,747 @@ +/* + * Copyright 1993 Bill Triggs + * Copyright 1995-2017 Bruno Haible + * + * 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 . + */ + +/* This file defines test functions of selected signatures, that exercise + dark corners of the various ABIs. */ + +#include + +FILE* out; + +#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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/align_mixed.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/align_mixed.c new file mode 100644 index 0000000000000000000000000000000000000000..5d4959ce975bb34e3f318e910b2265343f99a634 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/align_mixed.c @@ -0,0 +1,46 @@ +/* Area: ffi_call + Purpose: Check for proper argument alignment. + Limitations: none. + PR: none. + Originator: (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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/align_stdcall.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/align_stdcall.c new file mode 100644 index 0000000000000000000000000000000000000000..5e5cb860cce9ab7803dc63e1821fd6c8b3351d5e --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/align_stdcall.c @@ -0,0 +1,46 @@ +/* Area: ffi_call + Purpose: Check for proper argument alignment. + Limitations: none. + PR: none. + Originator: (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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/bpo-38748.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/bpo-38748.c new file mode 100644 index 0000000000000000000000000000000000000000..294bda0fec0e47da7191760ff9f81e28cdd4861a --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/bpo-38748.c @@ -0,0 +1,41 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/call.exp b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/call.exp new file mode 100644 index 0000000000000000000000000000000000000000..13ba2bdcd4922b2c454589833dd562792e796c73 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/call.exp @@ -0,0 +1,54 @@ +# 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 +# . + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/err_bad_typedef.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/err_bad_typedef.c new file mode 100644 index 0000000000000000000000000000000000000000..bf6016186170d4f892ee26c5b21ef48242f4dda6 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/err_bad_typedef.c @@ -0,0 +1,26 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/ffitest.h b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/ffitest.h new file mode 100644 index 0000000000000000000000000000000000000000..8bd8a3cb6eeaac23a916b3e7e05f371fb56df76a --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/ffitest.h @@ -0,0 +1,163 @@ +#include +#include +#include +#include +#include +#include "fficonfig.h" + +#include +#include + +#if defined HAVE_STDINT_H +#include +#endif + +#if defined HAVE_INTTYPES_H +#include +#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 +# 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 +# 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 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 , which always has "lld" here, but the + arguments are uint64_t, int64_t, which are unsigned long, long for + 64-bit in . */ +#if (_MIPS_SZLONG == 64) +#define PRId64 "ld" +#define PRIu64 "lu" +#endif +/* This doesn't match , 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/float.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/float.c new file mode 100644 index 0000000000000000000000000000000000000000..fbc272d84f1fa894f0c26e8765ed9c109f7dacff --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/float.c @@ -0,0 +1,59 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/float1.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/float1.c new file mode 100644 index 0000000000000000000000000000000000000000..c48493c6b22755b8f4a67543bc845e5839f24c25 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/float1.c @@ -0,0 +1,60 @@ +/* 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 + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/float2.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/float2.c new file mode 100644 index 0000000000000000000000000000000000000000..57cd9e30f92866a25e49ae849aa5ef4255202218 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/float2.c @@ -0,0 +1,61 @@ +/* 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 + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/float3.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/float3.c new file mode 100644 index 0000000000000000000000000000000000000000..bab3206a174fb84366638c13516d25d179666c4d --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/float3.c @@ -0,0 +1,74 @@ +/* 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 + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/float4.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/float4.c new file mode 100644 index 0000000000000000000000000000000000000000..0dd6d85e7aa0307211322103f66f9ce7d5d614cf --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/float4.c @@ -0,0 +1,62 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/float_va.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/float_va.c new file mode 100644 index 0000000000000000000000000000000000000000..d01d9d0a9c5da7ea49c1b3f9bfb73b5837a3ec6e --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/float_va.c @@ -0,0 +1,110 @@ +/* Area: fp and variadics + Purpose: check fp inputs and returns work on variadics, even the fixed params + Limitations: None + PR: none + Originator: 2011-01-25 + + Intended to stress the difference in ABI on ARM vfp +*/ + +/* { dg-do run } */ + +#include + +#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 +#include +#include + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/many2.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/many2.c new file mode 100644 index 0000000000000000000000000000000000000000..1c85746e4c4bc6488f8726a1efa8a15dccdddc04 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/many2.c @@ -0,0 +1,57 @@ +/* Area: ffi_call + Purpose: Check uint8_t arguments. + Limitations: none. + PR: PR45677. + Originator: Dan Witte 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/many_double.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/many_double.c new file mode 100644 index 0000000000000000000000000000000000000000..4ef8c8ab28b0de3e404520b9aad2d09256f3d8c3 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/many_double.c @@ -0,0 +1,70 @@ +/* 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 +#include +#include + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/many_mixed.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/many_mixed.c new file mode 100644 index 0000000000000000000000000000000000000000..85ec36ecbefaa952594f5c20bceba49638c442ce --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/many_mixed.c @@ -0,0 +1,78 @@ +/* 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 +#include +#include + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/negint.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/negint.c new file mode 100644 index 0000000000000000000000000000000000000000..6e2f26fc100e1a74dbcc8c41bd7acf030d90c9bf --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/negint.c @@ -0,0 +1,52 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/offsets.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/offsets.c new file mode 100644 index 0000000000000000000000000000000000000000..23d88b35d56514c88c60d9d92fa1cee55da09989 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/offsets.c @@ -0,0 +1,46 @@ +/* Area: Struct layout + Purpose: Test ffi_get_struct_offsets + Limitations: none. + PR: none. + Originator: Tom Tromey. */ + +/* { dg-do run } */ +#include "ffitest.h" +#include + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/pr1172638.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/pr1172638.c new file mode 100644 index 0000000000000000000000000000000000000000..7da1621cd663c5d3ad421dda803bbb85a0597c4e --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/pr1172638.c @@ -0,0 +1,127 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/promotion.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/promotion.c new file mode 100644 index 0000000000000000000000000000000000000000..44561615dd42e63b11eca45da270e25eb688c954 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/promotion.c @@ -0,0 +1,59 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/pyobjc_tc.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/pyobjc_tc.c new file mode 100644 index 0000000000000000000000000000000000000000..e29bd6c28368f9c7d8dc6a83772273a7ce9b0482 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/pyobjc_tc.c @@ -0,0 +1,114 @@ +/* Area: ffi_call + Purpose: Check different structures. + Limitations: none. + PR: none. + Originator: Ronald Oussoren 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_dbl.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_dbl.c new file mode 100644 index 0000000000000000000000000000000000000000..fd07e501794d8e43bfd171bc8343261052a5c6fe --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_dbl.c @@ -0,0 +1,36 @@ +/* Area: ffi_call + Purpose: Check return value double. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_dbl1.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_dbl1.c new file mode 100644 index 0000000000000000000000000000000000000000..0ea5d50551afc6a045b1927173c2a833c11987b3 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_dbl1.c @@ -0,0 +1,43 @@ +/* Area: ffi_call + Purpose: Check return value double. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_dbl2.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_dbl2.c new file mode 100644 index 0000000000000000000000000000000000000000..b3818f866b5dc946dcd78f79417814e249859533 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_dbl2.c @@ -0,0 +1,42 @@ +/* Area: ffi_call + Purpose: Check return value double. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_fl.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_fl.c new file mode 100644 index 0000000000000000000000000000000000000000..fb8a09e32ab4fa69fc2e05e7b26450b13453036f --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_fl.c @@ -0,0 +1,35 @@ +/* Area: ffi_call + Purpose: Check return value float. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_fl1.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_fl1.c new file mode 100644 index 0000000000000000000000000000000000000000..c3d92c283d0b0e4a4e71f28b50dcae087c4a2523 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_fl1.c @@ -0,0 +1,36 @@ +/* Area: ffi_call + Purpose: Check return value float. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_fl2.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_fl2.c new file mode 100644 index 0000000000000000000000000000000000000000..ddb976cc2bbc71646330747a279f5c0db8635e74 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_fl2.c @@ -0,0 +1,49 @@ +/* Area: ffi_call + Purpose: Check return value float. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_fl3.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_fl3.c new file mode 100644 index 0000000000000000000000000000000000000000..c37877b18ec86fcab552d482cf8ec998468d1d71 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_fl3.c @@ -0,0 +1,42 @@ +/* Area: ffi_call + Purpose: Check return value float. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_ldl.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_ldl.c new file mode 100644 index 0000000000000000000000000000000000000000..52a92fe0711cfde8b918525309fa12f13eab1e83 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_ldl.c @@ -0,0 +1,34 @@ +/* Area: ffi_call + Purpose: Check return value long double. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_ll.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_ll.c new file mode 100644 index 0000000000000000000000000000000000000000..ea4a1e44780c09fe9d7df9a6f84c255700d6a2a0 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_ll.c @@ -0,0 +1,41 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_ll1.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_ll1.c new file mode 100644 index 0000000000000000000000000000000000000000..a2426ec93545ebf1fc34f366416a5a20a94d2764 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_ll1.c @@ -0,0 +1,48 @@ +/* Area: ffi_call + Purpose: Check if long long are passed in the corresponding regs on ppc. + Limitations: none. + PR: 20104. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_sc.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_sc.c new file mode 100644 index 0000000000000000000000000000000000000000..a36cf3eb8803236f538b6145c850a752a49e369f --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_sc.c @@ -0,0 +1,36 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_sl.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_sl.c new file mode 100644 index 0000000000000000000000000000000000000000..51bfb49459bb484513dd226915bef0f9f384e268 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_sl.c @@ -0,0 +1,42 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_uc.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_uc.c new file mode 100644 index 0000000000000000000000000000000000000000..6fe554619d522fe481c4970c32ac3c011e6277c0 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_uc.c @@ -0,0 +1,38 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_ul.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_ul.c new file mode 100644 index 0000000000000000000000000000000000000000..fedcc25abd163a5f3329720bc4ee84a545bf5f19 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/return_ul.c @@ -0,0 +1,42 @@ +/* Area: ffi_call + Purpose: Check if unsigned long as return type is handled correctly. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/s55.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/s55.c new file mode 100644 index 0000000000000000000000000000000000000000..94dfd5f87ca60503a9113699348dec12368a0602 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/s55.c @@ -0,0 +1,60 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/strlen.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/strlen.c new file mode 100644 index 0000000000000000000000000000000000000000..3ed53d55802c0aa4aa772c64f5fbabade130c27a --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/strlen.c @@ -0,0 +1,43 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/strlen2.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/strlen2.c new file mode 100644 index 0000000000000000000000000000000000000000..93e5a33028cbaa828d4674b9d2a2e588cd289eb6 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/strlen2.c @@ -0,0 +1,49 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/strlen3.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/strlen3.c new file mode 100644 index 0000000000000000000000000000000000000000..c7d472d22d8359523d4e6c5b5d6f22ceb19d5826 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/strlen3.c @@ -0,0 +1,49 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/strlen4.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/strlen4.c new file mode 100644 index 0000000000000000000000000000000000000000..ba5c2740ec0f3da4037d05edef8add8934af9b7e --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/strlen4.c @@ -0,0 +1,55 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct1.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct1.c new file mode 100644 index 0000000000000000000000000000000000000000..c13e23f872734ebc70cba1fb47796e722ddac0e0 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct1.c @@ -0,0 +1,67 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct10.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct10.c new file mode 100644 index 0000000000000000000000000000000000000000..1edbd5ffb98c699740594ffab78ea0c1d41a3498 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct10.c @@ -0,0 +1,57 @@ +/* Area: ffi_call + Purpose: Check structures. + Limitations: none. + PR: none. + Originator: Sergei Trofimovich + + 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct2.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct2.c new file mode 100644 index 0000000000000000000000000000000000000000..5077a5ee45a5fe6f1658c0aa498450026a616f02 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct2.c @@ -0,0 +1,67 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct3.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct3.c new file mode 100644 index 0000000000000000000000000000000000000000..7eba0ead6d6a8964263a7df59a52d7d28ec27a83 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct3.c @@ -0,0 +1,60 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct4.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct4.c new file mode 100644 index 0000000000000000000000000000000000000000..66a9551dd65032cd1124fe4758ff1134cebd2b7b --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct4.c @@ -0,0 +1,64 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct5.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct5.c new file mode 100644 index 0000000000000000000000000000000000000000..23e2a3f745c8b7a85df0c3bfd37f79808e855a78 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct5.c @@ -0,0 +1,66 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct6.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct6.c new file mode 100644 index 0000000000000000000000000000000000000000..173c66eb4d2bf07aba628896d51e3e8b28dde586 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct6.c @@ -0,0 +1,64 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct7.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct7.c new file mode 100644 index 0000000000000000000000000000000000000000..badc7e055609387bf6c09e32b7916919a5320aa1 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct7.c @@ -0,0 +1,74 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct8.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct8.c new file mode 100644 index 0000000000000000000000000000000000000000..ef204ecbbce5074389f51b192243cf25b9a75ecc --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct8.c @@ -0,0 +1,81 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct9.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct9.c new file mode 100644 index 0000000000000000000000000000000000000000..4a13b818c4ee0693604a6d41eb00c10067ee4273 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct9.c @@ -0,0 +1,68 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct_by_value_2.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct_by_value_2.c new file mode 100644 index 0000000000000000000000000000000000000000..f170289d1d348acf40ead8ad66acb9c42c3c2d22 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct_by_value_2.c @@ -0,0 +1,63 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct_by_value_3.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct_by_value_3.c new file mode 100644 index 0000000000000000000000000000000000000000..55cf113e5821558558596108dd218d20fbf71efd --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct_by_value_3.c @@ -0,0 +1,65 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct_by_value_4.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct_by_value_4.c new file mode 100644 index 0000000000000000000000000000000000000000..768650fca17e7bfe23b4d043d75ed44328bde72a --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct_by_value_4.c @@ -0,0 +1,67 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct_by_value_big.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct_by_value_big.c new file mode 100644 index 0000000000000000000000000000000000000000..06422cac2e177690393f0843d1a5e96bfd18956d --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct_by_value_big.c @@ -0,0 +1,93 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct_by_value_small.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct_by_value_small.c new file mode 100644 index 0000000000000000000000000000000000000000..19613f8b080653085164604a9f4fbcbe6d5c45f7 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/struct_by_value_small.c @@ -0,0 +1,61 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/uninitialized.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/uninitialized.c new file mode 100644 index 0000000000000000000000000000000000000000..f00d8302349dfc1e2de3b2f01a33b18763ee884d --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/uninitialized.c @@ -0,0 +1,61 @@ +/* { 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/va_1.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/va_1.c new file mode 100644 index 0000000000000000000000000000000000000000..ccc6faf5c932dfe8f018795c7d9478e0c0e60629 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/va_1.c @@ -0,0 +1,78 @@ +/* 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 + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/va_2.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/va_2.c new file mode 100644 index 0000000000000000000000000000000000000000..75d4dfc3dda54c32230e6b5544bf48b646d6e600 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/va_2.c @@ -0,0 +1,220 @@ +/* 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 + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/va_3.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/va_3.c new file mode 100644 index 0000000000000000000000000000000000000000..b3e73b50c5c908e93316d8f3b9a8dc6e28afb86b --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/va_3.c @@ -0,0 +1,154 @@ +/* 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 + +/* + * 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/va_struct1.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/va_struct1.c new file mode 100644 index 0000000000000000000000000000000000000000..fff5c9accfd78e694176e1bc8be4f03583992839 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/va_struct1.c @@ -0,0 +1,134 @@ +/* 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 + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/va_struct2.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/va_struct2.c new file mode 100644 index 0000000000000000000000000000000000000000..a8daff3bf6084c025fc260514d25ac902d661206 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/va_struct2.c @@ -0,0 +1,134 @@ +/* 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 + +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; + + 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/va_struct3.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/va_struct3.c new file mode 100644 index 0000000000000000000000000000000000000000..d3bd280966a713a633be27cbffaa031b1ae07a36 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.call/va_struct3.c @@ -0,0 +1,140 @@ +/* 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 + +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; + + 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure.exp b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure.exp new file mode 100644 index 0000000000000000000000000000000000000000..ed4145ca843b4a293400afaed431c99ee4b5699b --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure.exp @@ -0,0 +1,67 @@ +# 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 +# . + +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 "" +} 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_fn0.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_fn0.c new file mode 100644 index 0000000000000000000000000000000000000000..dfadb05563d35c040b9dd8e5736bdf594ad779d0 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_fn0.c @@ -0,0 +1,90 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_fn1.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_fn1.c new file mode 100644 index 0000000000000000000000000000000000000000..a90bb291b5b5cb535f23bd41f2b9d6274deff819 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_fn1.c @@ -0,0 +1,83 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_fn2.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_fn2.c new file mode 100644 index 0000000000000000000000000000000000000000..7d7af4b59baa2edd469b98ca20fba5d1659096e1 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_fn2.c @@ -0,0 +1,83 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_fn3.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_fn3.c new file mode 100644 index 0000000000000000000000000000000000000000..1ad8f9d86f42df625dbcc9e35de53cbd250f32e8 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_fn3.c @@ -0,0 +1,102 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_fn4.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_fn4.c new file mode 100644 index 0000000000000000000000000000000000000000..e5f1f53d1c776d2314f6d7add71b35a3831c4fab --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_fn4.c @@ -0,0 +1,91 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_fn5.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_fn5.c new file mode 100644 index 0000000000000000000000000000000000000000..97277f5c318b10781eaa721b13efde8b32f921fb --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_fn5.c @@ -0,0 +1,94 @@ +/* Area: closure_call + Purpose: Check multiple long long values passing. + Exceed the limit of gpr registers on PowerPC + Darwin. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_fn6.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_fn6.c new file mode 100644 index 0000000000000000000000000000000000000000..fb079e2efcd83dd1ae34bb44e48376288fb0819c --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_fn6.c @@ -0,0 +1,92 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_loc_fn0.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_loc_fn0.c new file mode 100644 index 0000000000000000000000000000000000000000..4f2f4f8c14584444389d0f5efe3d674c871fb81f --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_loc_fn0.c @@ -0,0 +1,99 @@ +/* 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: 20030828 */ + + + + +/* { dg-do run { xfail wasm32*-*-* } } */ +#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); + +#ifndef FFI_EXEC_STATIC_TRAMP + /* With static trampolines, the codeloc does not point to closure */ + CHECK(memcmp(pcl, 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_simple.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_simple.c new file mode 100644 index 0000000000000000000000000000000000000000..a18b4a4ff83a2184a2ed3b8e8a7f258beb49cf89 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/closure_simple.c @@ -0,0 +1,61 @@ +/* Area: closure_call + Purpose: Check simple closure handling with all ABIs + Limitations: none. + PR: none. + Originator: */ + +/* { 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_12byte.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_12byte.c new file mode 100644 index 0000000000000000000000000000000000000000..a1fdcd76f43e5e6b756792ec2ad07db61d53a418 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_12byte.c @@ -0,0 +1,112 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_16byte.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_16byte.c new file mode 100644 index 0000000000000000000000000000000000000000..57fe8737b1efd213cbbcfbee3bbba83ae4a74800 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_16byte.c @@ -0,0 +1,117 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_18byte.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_18byte.c new file mode 100644 index 0000000000000000000000000000000000000000..3783121b9fefdb34f473566238cc1c8783e4f307 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_18byte.c @@ -0,0 +1,120 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_19byte.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_19byte.c new file mode 100644 index 0000000000000000000000000000000000000000..98ce65a48a2ddb8f7cfa0c92b85fc52e36f12456 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_19byte.c @@ -0,0 +1,131 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_1_1byte.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_1_1byte.c new file mode 100644 index 0000000000000000000000000000000000000000..49e33b9bac9b83a30172cb5b977c552e408ee31e --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_1_1byte.c @@ -0,0 +1,93 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_20byte.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_20byte.c new file mode 100644 index 0000000000000000000000000000000000000000..fdae6f7236ab7bdd84279ddad31ffd3d7d43a354 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_20byte.c @@ -0,0 +1,109 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_20byte1.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_20byte1.c new file mode 100644 index 0000000000000000000000000000000000000000..e6979b5620a391413a278f257f9c440a8ec4bafe --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_20byte1.c @@ -0,0 +1,113 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_24byte.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_24byte.c new file mode 100644 index 0000000000000000000000000000000000000000..b204966e7edfb872710f8201cf7114c5c33c8e8d --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_24byte.c @@ -0,0 +1,145 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_2byte.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_2byte.c new file mode 100644 index 0000000000000000000000000000000000000000..c5209b783418238913a42706f3c97758c12ffd08 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_2byte.c @@ -0,0 +1,103 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_3_1byte.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_3_1byte.c new file mode 100644 index 0000000000000000000000000000000000000000..aaa7ccc5c16e3fcb0ed4a71cf0f75deda5c14eb1 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_3_1byte.c @@ -0,0 +1,114 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_3byte1.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_3byte1.c new file mode 100644 index 0000000000000000000000000000000000000000..b4249175443184da3ed6136e320e3b30d9c3d989 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_3byte1.c @@ -0,0 +1,103 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_3byte2.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_3byte2.c new file mode 100644 index 0000000000000000000000000000000000000000..f13590e4b5bf48fd1be8cca5b252358c82beff13 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_3byte2.c @@ -0,0 +1,103 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_3float.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_3float.c new file mode 100644 index 0000000000000000000000000000000000000000..63171bc7fd81ac102b7821337f0fe2016f4dec4a --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_3float.c @@ -0,0 +1,113 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations:>none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_4_1byte.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_4_1byte.c new file mode 100644 index 0000000000000000000000000000000000000000..b5d3f70320aa7504728054706ebdafa23e593e13 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_4_1byte.c @@ -0,0 +1,120 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_4byte.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_4byte.c new file mode 100644 index 0000000000000000000000000000000000000000..4f8d173bf94892a114aa47cbc187d6acc3dd352b --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_4byte.c @@ -0,0 +1,103 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_5_1_byte.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_5_1_byte.c new file mode 100644 index 0000000000000000000000000000000000000000..07552cde7761f3ab8407893e2c273a7b5d4014cb --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_5_1_byte.c @@ -0,0 +1,137 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_5byte.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_5byte.c new file mode 100644 index 0000000000000000000000000000000000000000..9f8936b5909575bf6380292685cc94588a888ea5 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_5byte.c @@ -0,0 +1,116 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_64byte.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_64byte.c new file mode 100644 index 0000000000000000000000000000000000000000..5adedc944c93b9d471f77b889bb1c32ce2f6d43b --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_64byte.c @@ -0,0 +1,148 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_6_1_byte.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_6_1_byte.c new file mode 100644 index 0000000000000000000000000000000000000000..05e2945b6804bd46e06c1e11fd7ab66cb6fc1776 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_6_1_byte.c @@ -0,0 +1,140 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_6byte.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_6byte.c new file mode 100644 index 0000000000000000000000000000000000000000..a8e3ea0716fe961c40ae3de9f815fd86959c21f8 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_6byte.c @@ -0,0 +1,121 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_7_1_byte.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_7_1_byte.c new file mode 100644 index 0000000000000000000000000000000000000000..3f17964833e61524fec19d0bb6d48ac7f4a18de1 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_7_1_byte.c @@ -0,0 +1,155 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_7byte.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_7byte.c new file mode 100644 index 0000000000000000000000000000000000000000..dcfc29b82a5b9d38644eba4e45a44db9e7f6364d --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_7byte.c @@ -0,0 +1,121 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_8byte.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_8byte.c new file mode 100644 index 0000000000000000000000000000000000000000..7a519e95e3eb7ee9cc1d5faac44459d3912d1b27 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_8byte.c @@ -0,0 +1,102 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Depending on the ABI. Check overlapping. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_9byte1.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_9byte1.c new file mode 100644 index 0000000000000000000000000000000000000000..9d3b609d3f864d20fb7edee2d40716173fa1150e --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_9byte1.c @@ -0,0 +1,103 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_9byte2.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_9byte2.c new file mode 100644 index 0000000000000000000000000000000000000000..6cfaaf39722682e2cac803d2050137c345ee2084 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_9byte2.c @@ -0,0 +1,103 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_double.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_double.c new file mode 100644 index 0000000000000000000000000000000000000000..036cca37f1146ad4ab1eb8b886c93ba6d999caf1 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_double.c @@ -0,0 +1,111 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of double. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_float.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_float.c new file mode 100644 index 0000000000000000000000000000000000000000..c7dbdfd8f694d2121ddcce3c398bb253f9971513 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_float.c @@ -0,0 +1,109 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of float. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_longdouble.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_longdouble.c new file mode 100644 index 0000000000000000000000000000000000000000..1cdb10bdbec2e9c50be9fc3a98a5b867dd5108d5 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_longdouble.c @@ -0,0 +1,111 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of long double. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_longdouble_split.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_longdouble_split.c new file mode 100644 index 0000000000000000000000000000000000000000..128d6e1b403997967104ffbed08c50bd5c0631f8 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_longdouble_split.c @@ -0,0 +1,147 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of long double. + Limitations: none. + PR: none. + Originator: 20031203 */ + +/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */ +/* { dg-options -mlong-double-128 { target powerpc64*-*-linux-gnu* } } */ + +#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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_longdouble_split2.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_longdouble_split2.c new file mode 100644 index 0000000000000000000000000000000000000000..3562a57fabdabe20d094c95df63a4932714d177b --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_longdouble_split2.c @@ -0,0 +1,152 @@ +/* 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 powerpc64*-*-linux-gnu* } } */ + +#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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_pointer.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_pointer.c new file mode 100644 index 0000000000000000000000000000000000000000..5fb3f09ac3849d6fd9f5377103f3c5dacbeac584 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_pointer.c @@ -0,0 +1,113 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of pointer. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_sint16.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_sint16.c new file mode 100644 index 0000000000000000000000000000000000000000..d2c9bf40fe9bec3483c4ced553ccbf7c25138192 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_sint16.c @@ -0,0 +1,108 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of sint16. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_sint32.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_sint32.c new file mode 100644 index 0000000000000000000000000000000000000000..570f45ffd6c0c0962f2333dddcfd499cbeefe1c4 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_sint32.c @@ -0,0 +1,106 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of sint32. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_sint64.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_sint64.c new file mode 100644 index 0000000000000000000000000000000000000000..49ee5612b1fc669af8e035c763f99c1221a2e3c7 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_sint64.c @@ -0,0 +1,109 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of sint64. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_uint16.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_uint16.c new file mode 100644 index 0000000000000000000000000000000000000000..2204dff92bf9eb623b5ec50bfbb953476799c603 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_uint16.c @@ -0,0 +1,108 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of uint16. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_uint32.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_uint32.c new file mode 100644 index 0000000000000000000000000000000000000000..1ce23daf5d2e2522e618f84ad2a26f7fa3c497a8 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_uint32.c @@ -0,0 +1,109 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of uint32. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_uint64.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_uint64.c new file mode 100644 index 0000000000000000000000000000000000000000..aee958a86d0829c8fddee9d683319811454dd721 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_align_uint64.c @@ -0,0 +1,111 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of uint64. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_dbls_struct.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_dbls_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..00e247e7ea9494b75aa0375f95eaf595f1efc3cf --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_dbls_struct.c @@ -0,0 +1,68 @@ +/* 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(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]; + + 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_double.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_double.c new file mode 100644 index 0000000000000000000000000000000000000000..84ad4cb7d925b69d238bd129ee3601c36a6c547b --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_double.c @@ -0,0 +1,43 @@ +/* Area: closure_call + Purpose: Check return value double. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_double_va.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_double_va.c new file mode 100644 index 0000000000000000000000000000000000000000..a6c445b826e532aa5156578cbc05d5513521238f --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_double_va.c @@ -0,0 +1,69 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_float.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_float.c new file mode 100644 index 0000000000000000000000000000000000000000..97c2ac02b7abeca42fc4b179f61e4fd070b8bce2 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_float.c @@ -0,0 +1,46 @@ +/* Area: closure_call + Purpose: Check return value float. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_longdouble.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_longdouble.c new file mode 100644 index 0000000000000000000000000000000000000000..2cfac4bafef92ed8ddc09efc73324575fbd7e258 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_longdouble.c @@ -0,0 +1,115 @@ +/* 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 powerpc64*-*-linux-gnu* } } */ + +#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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_longdouble_va.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_longdouble_va.c new file mode 100644 index 0000000000000000000000000000000000000000..493f0f6f643b6b826d04f50f6c7cd6fed71ca174 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_longdouble_va.c @@ -0,0 +1,69 @@ +/* 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" + +#define BUF_SIZE 50 +static char buffer[BUF_SIZE]; + +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(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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_many_mixed_args.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_many_mixed_args.c new file mode 100644 index 0000000000000000000000000000000000000000..7fd6c8207ac756dd7c5583be805d5b8d6b358b15 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_many_mixed_args.c @@ -0,0 +1,70 @@ +/* Area: closure_call + Purpose: Check closures called with many args of mixed types + Limitations: none. + PR: none. + Originator: */ + +/* { dg-do run } */ +#include "ffitest.h" +#include +#include + +#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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_many_mixed_float_double.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_many_mixed_float_double.c new file mode 100644 index 0000000000000000000000000000000000000000..62b0697ac01c9b7009744478dcc25f4ad03d939a --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_many_mixed_float_double.c @@ -0,0 +1,55 @@ +/* Area: closure_call + Purpose: Check register allocation for closure calls with many float and double arguments + Limitations: none. + PR: none. + Originator: */ + +/* { dg-do run } */ +#include "ffitest.h" +#include +#include + +#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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_multi_schar.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_multi_schar.c new file mode 100644 index 0000000000000000000000000000000000000000..921777a0fc5d1c76dcb129c80130ba679abf3949 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_multi_schar.c @@ -0,0 +1,78 @@ +/* Area: ffi_call, closure_call + Purpose: Check passing of multiple signed char values. + Limitations: none. + PR: PR13221. + Originator: 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(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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_multi_sshort.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_multi_sshort.c new file mode 100644 index 0000000000000000000000000000000000000000..d78c62d2d60558765c7c402f6de6fcfbca9bd7c4 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_multi_sshort.c @@ -0,0 +1,79 @@ +/* Area: ffi_call, closure_call + Purpose: Check passing of multiple signed short values. + Limitations: none. + PR: PR13221. + Originator: 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(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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_multi_sshortchar.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_multi_sshortchar.c new file mode 100644 index 0000000000000000000000000000000000000000..a2b370873151c6e32548dad9c66078a3e8a80f61 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_multi_sshortchar.c @@ -0,0 +1,94 @@ +/* Area: ffi_call, closure_call + Purpose: Check passing of multiple signed short/char values. + Limitations: none. + PR: PR13221. + Originator: 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(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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_multi_uchar.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_multi_uchar.c new file mode 100644 index 0000000000000000000000000000000000000000..76f90a02453da8d9659c015728ad32b6c88db18f --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_multi_uchar.c @@ -0,0 +1,99 @@ +/* Area: ffi_call, closure_call + Purpose: Check passing of multiple unsigned char values. + Limitations: none. + PR: PR13221. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_multi_ushort.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_multi_ushort.c new file mode 100644 index 0000000000000000000000000000000000000000..f61a62793dc500bb0c4656467579f0878c87287f --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_multi_ushort.c @@ -0,0 +1,78 @@ +/* Area: ffi_call, closure_call + Purpose: Check passing of multiple unsigned short values. + Limitations: none. + PR: PR13221. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_multi_ushortchar.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_multi_ushortchar.c new file mode 100644 index 0000000000000000000000000000000000000000..3315c995f5c2d297537429d04c37c013caeaa66b --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_multi_ushortchar.c @@ -0,0 +1,94 @@ +/* Area: ffi_call, closure_call + Purpose: Check passing of multiple unsigned short/char values. + Limitations: none. + PR: PR13221. + Originator: 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(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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_pointer.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_pointer.c new file mode 100644 index 0000000000000000000000000000000000000000..73a4cba7864feab8d0fea6e8e67c22328ddc554f --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_pointer.c @@ -0,0 +1,79 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_pointer_stack.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_pointer_stack.c new file mode 100644 index 0000000000000000000000000000000000000000..2054f254766875e333c3441683dce208e760d357 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_pointer_stack.c @@ -0,0 +1,152 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_schar.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_schar.c new file mode 100644 index 0000000000000000000000000000000000000000..22446c3171c5fedd3e45bd2c661eb440ad4a34e4 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_schar.c @@ -0,0 +1,47 @@ +/* Area: closure_call + Purpose: Check return value schar. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_sint.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_sint.c new file mode 100644 index 0000000000000000000000000000000000000000..a3f72c1298aef2350c97d0a6b9bb7e0fd361d91d --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_sint.c @@ -0,0 +1,44 @@ +/* Area: closure_call + Purpose: Check return value sint32. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_sshort.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_sshort.c new file mode 100644 index 0000000000000000000000000000000000000000..8061a0296daf1e0ef882fa0f3cd14a9de6a3beba --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_sshort.c @@ -0,0 +1,45 @@ +/* Area: closure_call + Purpose: Check return value sshort. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_struct_va1.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_struct_va1.c new file mode 100644 index 0000000000000000000000000000000000000000..c59a27f3d9192cc23cffc37767a8712485e9123c --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_struct_va1.c @@ -0,0 +1,125 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_uchar.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_uchar.c new file mode 100644 index 0000000000000000000000000000000000000000..aa2023ffd857290c577c5616b72a95961c0727c5 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_uchar.c @@ -0,0 +1,45 @@ +/* Area: closure_call + Purpose: Check return value uchar. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_uint.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_uint.c new file mode 100644 index 0000000000000000000000000000000000000000..23b88de2d0f8b159067faed76c6678cf4d945bf1 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_uint.c @@ -0,0 +1,47 @@ +/* Area: closure_call + Purpose: Check return value uint. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_uint_va.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_uint_va.c new file mode 100644 index 0000000000000000000000000000000000000000..0048a02d48943a433111601c81690ce227e1112a --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_uint_va.c @@ -0,0 +1,49 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_ulong_va.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_ulong_va.c new file mode 100644 index 0000000000000000000000000000000000000000..79f41706a3c252d17ac01eecae298d94df11e174 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_ulong_va.c @@ -0,0 +1,49 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_ulonglong.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_ulonglong.c new file mode 100644 index 0000000000000000000000000000000000000000..813bb2eff03a957eb219bd996c1e3ebb40355dd1 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_ulonglong.c @@ -0,0 +1,49 @@ +/* Area: closure_call + Purpose: Check return value long long. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_ushort.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_ushort.c new file mode 100644 index 0000000000000000000000000000000000000000..bfe5e657c17e38eef874b17bdef03f5f528ba6be --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/cls_ushort.c @@ -0,0 +1,46 @@ +/* Area: closure_call + Purpose: Check return value ushort. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/err_bad_abi.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/err_bad_abi.c new file mode 100644 index 0000000000000000000000000000000000000000..f5a73179ec96a345cc3f9f6199c54cdcb33941c0 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/err_bad_abi.c @@ -0,0 +1,36 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/ffitest.h b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/ffitest.h new file mode 100644 index 0000000000000000000000000000000000000000..d27d362d6a6e7e99787be66a5ccbb6c2f487c3a5 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/ffitest.h @@ -0,0 +1 @@ +#include "../libffi.call/ffitest.h" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/huge_struct.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/huge_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..71cae26818282675c3afc477b45f848786925bbe --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/huge_struct.c @@ -0,0 +1,343 @@ +/* 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*-*-* wasm32*-*-* } } */ +/* { dg-options -mlong-double-128 { target powerpc64*-*-linux-gnu* } } */ +/* { dg-options -Wformat=0 { target moxie*-*-elf or1k-*-* } } */ + +#include + +#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(int argc __UNUSED__, const char** argv __UNUSED__) +{ + 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..8b1b4ba79c17ea40546c6e0ef5453d1c0ddfc913 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct.c @@ -0,0 +1,175 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct1.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct1.c new file mode 100644 index 0000000000000000000000000000000000000000..df8ab5973d1a4b8f6322f6443b2c494f7a6ebde5 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct1.c @@ -0,0 +1,161 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct10.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct10.c new file mode 100644 index 0000000000000000000000000000000000000000..a2cdc649463285a58e0c0553ad5b471f92d86a84 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct10.c @@ -0,0 +1,146 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct11.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct11.c new file mode 100644 index 0000000000000000000000000000000000000000..c9821e49303338ca2e96f46a5b995c6cf3b59fbe --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct11.c @@ -0,0 +1,137 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct12.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct12.c new file mode 100644 index 0000000000000000000000000000000000000000..7ca16c17d1e181b69de333c4fef1e90ace077a76 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct12.c @@ -0,0 +1,86 @@ +/* Area: ffi_call + Purpose: Check nested float struct. + Limitations: none. + PR: none. + Originator: Cheng Jin */ + +/* { 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct13.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct13.c new file mode 100644 index 0000000000000000000000000000000000000000..6edfdcbb5e30e87a898c0c8188215afada3be6f7 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct13.c @@ -0,0 +1,115 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing. + Limitations: none. + PR: none. + Originator: and 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct2.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct2.c new file mode 100644 index 0000000000000000000000000000000000000000..93a913d32162a000f2b02cde55bc6ce641fd87d3 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct2.c @@ -0,0 +1,119 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct3.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct3.c new file mode 100644 index 0000000000000000000000000000000000000000..d39a9ccfe5aca2c6d950c9a2c54af3cebe23935a --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct3.c @@ -0,0 +1,120 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct4.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct4.c new file mode 100644 index 0000000000000000000000000000000000000000..d5c960dce7da04bb6c009f699ad1b15b71869797 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct4.c @@ -0,0 +1,120 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct5.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct5.c new file mode 100644 index 0000000000000000000000000000000000000000..b053f52b0204d3a6b5da870b0242dcbb39c078bb --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct5.c @@ -0,0 +1,121 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct6.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct6.c new file mode 100644 index 0000000000000000000000000000000000000000..690ec0be89a7c729697f88ecc3a964cd8b260cc0 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct6.c @@ -0,0 +1,142 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct7.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct7.c new file mode 100644 index 0000000000000000000000000000000000000000..b3ddd030d280d3168f1007c46458bc57c7563472 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct7.c @@ -0,0 +1,120 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct8.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct8.c new file mode 100644 index 0000000000000000000000000000000000000000..768f3331b2b4de58477a2624eb40a4efe5bbf039 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct8.c @@ -0,0 +1,142 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct9.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct9.c new file mode 100644 index 0000000000000000000000000000000000000000..f88ab0a94fa6c2ed98b6c1226ecae2dd7dae9d12 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/nested_struct9.c @@ -0,0 +1,142 @@ +/* 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: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/problem1.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/problem1.c new file mode 100644 index 0000000000000000000000000000000000000000..6a91555a1fa8ddaf285b777774a9564358b19ee5 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/problem1.c @@ -0,0 +1,90 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing with different structure size. + Limitations: none. + PR: none. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/single_entry_structs1.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/single_entry_structs1.c new file mode 100644 index 0000000000000000000000000000000000000000..00c4e174494d3316d61f83a3edbf49f7dfd2a2bf --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/single_entry_structs1.c @@ -0,0 +1,86 @@ +/* Area: ffi_call, closure_call + Purpose: Single argument structs have a different ABI in emscripten. + Limitations: none. + PR: none. + Originator: */ + +/* { 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/single_entry_structs2.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/single_entry_structs2.c new file mode 100644 index 0000000000000000000000000000000000000000..ab6556bf4ca0d834b56a3824ae2650892725a3f8 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/single_entry_structs2.c @@ -0,0 +1,102 @@ +/* Area: ffi_call, closure_call + Purpose: Single argument structs have a different ABI in emscripten. + Limitations: none. + PR: none. + Originator: */ + +/* { 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/single_entry_structs3.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/single_entry_structs3.c new file mode 100644 index 0000000000000000000000000000000000000000..4f619cbf7c8263e11567b9802e83641e1e057adf --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/single_entry_structs3.c @@ -0,0 +1,101 @@ +/* Area: ffi_call, closure_call + Purpose: Single argument structs have a different ABI in emscripten. + Limitations: none. + PR: none. + Originator: */ + +/* { 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/stret_large.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/stret_large.c new file mode 100644 index 0000000000000000000000000000000000000000..71c2469e1c4dc6995fafe9e34533a356cc9bd6d3 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/stret_large.c @@ -0,0 +1,145 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/stret_large2.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/stret_large2.c new file mode 100644 index 0000000000000000000000000000000000000000..d9c750ee1c040928c86ab9f7193caaba57bbddd1 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/stret_large2.c @@ -0,0 +1,148 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/stret_medium.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/stret_medium.c new file mode 100644 index 0000000000000000000000000000000000000000..56e3d9d8fc06dcc877d7f79919dd7727c78bef1f --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/stret_medium.c @@ -0,0 +1,124 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/stret_medium2.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/stret_medium2.c new file mode 100644 index 0000000000000000000000000000000000000000..0746b6ee4b7425d120718bba9d12d1ad2bf0244b --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/stret_medium2.c @@ -0,0 +1,125 @@ +/* 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/testclosure.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/testclosure.c new file mode 100644 index 0000000000000000000000000000000000000000..e738a01fb029d41fa4fe838d216aacea9e0368b7 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/testclosure.c @@ -0,0 +1,75 @@ +/* Area: closure_call + Purpose: Check return value float. + Limitations: none. + PR: 41908. + Originator: 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/unwindtest.cc b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/unwindtest.cc new file mode 100644 index 0000000000000000000000000000000000000000..6c97c61e81e049d40664c3cc7857dff58312e84b --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/unwindtest.cc @@ -0,0 +1,117 @@ +/* Area: ffi_closure, unwind info + Purpose: Check if the unwind information is passed correctly. + Limitations: none. + PR: none. + Originator: Jeff Sturm */ + +/* { 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); + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/unwindtest_ffi_call.cc b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/unwindtest_ffi_call.cc new file mode 100644 index 0000000000000000000000000000000000000000..153d24094080e00f75e92b10a575feea296ca9ca --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.closures/unwindtest_ffi_call.cc @@ -0,0 +1,54 @@ +/* Area: ffi_call, unwind info + Purpose: Check if the unwind information is passed correctly. + Limitations: none. + PR: none. + Originator: Andreas Tobler 20061213 */ + +/* { dg-do run { xfail moxie*-*-* } } */ + +#include "ffitest.h" + +static int checking(int a __UNUSED__, short b __UNUSED__, + signed char c __UNUSED__) +{ + throw 9; +} + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_align_complex.inc b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_align_complex.inc new file mode 100644 index 0000000000000000000000000000000000000000..4a812edf055e9b7d1c230e21e2c724a0a067e38a --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_align_complex.inc @@ -0,0 +1,91 @@ +/* -*-c-*- */ +#include "ffitest.h" +#include + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_align_complex_double.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_align_complex_double.c new file mode 100644 index 0000000000000000000000000000000000000000..0dff23ae47c35fe4eb50a388468547e63bd416c4 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_align_complex_double.c @@ -0,0 +1,10 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_double.inc" +#include "cls_align_complex.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_align_complex_float.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_align_complex_float.c new file mode 100644 index 0000000000000000000000000000000000000000..0affbd07e53d6f842a4bd524d3faf7d291df4474 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_align_complex_float.c @@ -0,0 +1,10 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_float.inc" +#include "cls_align_complex.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_align_complex_longdouble.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_align_complex_longdouble.c new file mode 100644 index 0000000000000000000000000000000000000000..7889ba859b54f68d2e17788ff14f813e5149aaa7 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_align_complex_longdouble.c @@ -0,0 +1,10 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure alignment of complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_longdouble.inc" +#include "cls_align_complex.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex.inc b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex.inc new file mode 100644 index 0000000000000000000000000000000000000000..f9374044e8781a4b6f8ff2a685bb43a7199420d9 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex.inc @@ -0,0 +1,42 @@ +/* -*-c-*- */ +#include "ffitest.h" +#include + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_double.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_double.c new file mode 100644 index 0000000000000000000000000000000000000000..05e35340e08d9f8b7c95297dc9125b74cfe60a53 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_double.c @@ -0,0 +1,10 @@ +/* Area: closure_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_double.inc" +#include "cls_complex.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_float.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_float.c new file mode 100644 index 0000000000000000000000000000000000000000..5df7849d4c97d70aade6bdcb16855302e2a1793b --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_float.c @@ -0,0 +1,10 @@ +/* Area: closure_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_float.inc" +#include "cls_complex.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_longdouble.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_longdouble.c new file mode 100644 index 0000000000000000000000000000000000000000..2b1c320a20a852f97548d7dd8fd7cc390374851c --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_longdouble.c @@ -0,0 +1,10 @@ +/* Area: closure_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_longdouble.inc" +#include "cls_complex.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_struct.inc b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_struct.inc new file mode 100644 index 0000000000000000000000000000000000000000..df8708d1c4f98ddbaceb7a337921fef0ceee4eed --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_struct.inc @@ -0,0 +1,71 @@ +/* -*-c-*- */ +#include "ffitest.h" +#include + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_struct_double.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_struct_double.c new file mode 100644 index 0000000000000000000000000000000000000000..ec71346a3fb6bfcd349bb296388e4f936660f8fb --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_struct_double.c @@ -0,0 +1,10 @@ +/* Area: ffi_call, closure_call + Purpose: Check complex arguments in structs. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_double.inc" +#include "cls_complex_struct.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_struct_float.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_struct_float.c new file mode 100644 index 0000000000000000000000000000000000000000..96fdf750430605ba1c34f9811e0b2c5309041335 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_struct_float.c @@ -0,0 +1,10 @@ +/* Area: ffi_call, closure_call + Purpose: Check complex arguments in structs. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_float.inc" +#include "cls_complex_struct.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_struct_longdouble.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_struct_longdouble.c new file mode 100644 index 0000000000000000000000000000000000000000..005b467398f202ff62ed5062cfaa006a9919f0dd --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_struct_longdouble.c @@ -0,0 +1,10 @@ +/* Area: ffi_call, closure_call + Purpose: Check complex arguments in structs. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_longdouble.inc" +#include "cls_complex_struct.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_va.inc b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_va.inc new file mode 100644 index 0000000000000000000000000000000000000000..8a3e15f0f6af6609cb033b52b4d04571b5ca0cae --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_va.inc @@ -0,0 +1,80 @@ +/* -*-c-*- */ +#include "ffitest.h" +#include +#include +#include +#include + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_va_double.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_va_double.c new file mode 100644 index 0000000000000000000000000000000000000000..879ccf3b81f8a520b850c9c1a36ba633063d55dc --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_va_double.c @@ -0,0 +1,10 @@ +/* Area: ffi_call, closure_call + Purpose: Test complex' passed in variable argument lists. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_double.inc" +#include "cls_complex_va.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_va_float.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_va_float.c new file mode 100644 index 0000000000000000000000000000000000000000..2b17826045aad88915ec03a2a0e03c8523a4bc86 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_va_float.c @@ -0,0 +1,16 @@ +/* Area: ffi_call, closure_call + Purpose: Test complex' passed in variable argument lists. + Limitations: none. + PR: none. + Originator: . */ + +/* { 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_va_longdouble.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_va_longdouble.c new file mode 100644 index 0000000000000000000000000000000000000000..6eca9656eac5a6dfb254b4083bf3b809fa6dc8ab --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/cls_complex_va_longdouble.c @@ -0,0 +1,10 @@ +/* Area: ffi_call, closure_call + Purpose: Test complex' passed in variable argument lists. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_longdouble.inc" +#include "cls_complex_va.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex.exp b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex.exp new file mode 100644 index 0000000000000000000000000000000000000000..4631db285a240745178a5e6daf52d794a0beb710 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex.exp @@ -0,0 +1,36 @@ +# 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 +# . + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex.inc b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex.inc new file mode 100644 index 0000000000000000000000000000000000000000..515ae3e60deab8ff012a3adf516d67fcaf637338 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex.inc @@ -0,0 +1,51 @@ +/* -*-c-*-*/ +#include "ffitest.h" +#include + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex_defs_double.inc b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex_defs_double.inc new file mode 100644 index 0000000000000000000000000000000000000000..3583e166d662796246b151bd7830364b8034d1e7 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex_defs_double.inc @@ -0,0 +1,7 @@ +/* -*-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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex_defs_float.inc b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex_defs_float.inc new file mode 100644 index 0000000000000000000000000000000000000000..bbd9375cbfafab361742b26b83e86b6f158aead8 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex_defs_float.inc @@ -0,0 +1,7 @@ +/* -*-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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex_defs_longdouble.inc b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex_defs_longdouble.inc new file mode 100644 index 0000000000000000000000000000000000000000..14b9f243f480ab9e72d2e9d827db71f7c7202f65 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex_defs_longdouble.inc @@ -0,0 +1,7 @@ +/* -*-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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex_double.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex_double.c new file mode 100644 index 0000000000000000000000000000000000000000..8a3297b2a24f35f5ef80e2029f10c61cb375ffe2 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex_double.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check complex types. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_double.inc" +#include "complex.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex_float.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex_float.c new file mode 100644 index 0000000000000000000000000000000000000000..5044ebbcaae1c94cef350a9f4cf3a5e0c73dc645 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex_float.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check complex types. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_float.inc" +#include "complex.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex_int.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex_int.c new file mode 100644 index 0000000000000000000000000000000000000000..bac319081e61389ff40bf51fa56a3010eccff6c4 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex_int.c @@ -0,0 +1,86 @@ +/* Area: ffi_call + Purpose: Check non-standard complex types. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "ffitest.h" +#include "ffi.h" +#include + +_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_. + * 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex_longdouble.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex_longdouble.c new file mode 100644 index 0000000000000000000000000000000000000000..7e783660930a62403ef3a13bc8e92dfe817a89fb --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/complex_longdouble.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check complex types. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_longdouble.inc" +#include "complex.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/ffitest.h b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/ffitest.h new file mode 100644 index 0000000000000000000000000000000000000000..d27d362d6a6e7e99787be66a5ccbb6c2f487c3a5 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/ffitest.h @@ -0,0 +1 @@ +#include "../libffi.call/ffitest.h" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/many_complex.inc b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/many_complex.inc new file mode 100644 index 0000000000000000000000000000000000000000..e37a77439765fe8357d0b092489f231bbd4d8883 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/many_complex.inc @@ -0,0 +1,78 @@ +/* -*-c-*- */ +#include "ffitest.h" + +#include +#include + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/many_complex_double.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/many_complex_double.c new file mode 100644 index 0000000000000000000000000000000000000000..3fd53c3354d9d736007ad2e2fbc5ffe9ee645486 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/many_complex_double.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex, with many arguments + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_double.inc" +#include "many_complex.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/many_complex_float.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/many_complex_float.c new file mode 100644 index 0000000000000000000000000000000000000000..c43d21cd9e1215ac3a886604ca033a96261ada61 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/many_complex_float.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex, with many arguments + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_float.inc" +#include "many_complex.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/many_complex_longdouble.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/many_complex_longdouble.c new file mode 100644 index 0000000000000000000000000000000000000000..dbab723969c1253c8eb2619238624ebb247ed222 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/many_complex_longdouble.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex, with many arguments + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_longdouble.inc" +#include "many_complex.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex.inc b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex.inc new file mode 100644 index 0000000000000000000000000000000000000000..8bf0c1fbab8502005801aefcef93177c3dc9c131 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex.inc @@ -0,0 +1,37 @@ +/* -*-c-*- */ +#include "ffitest.h" +#include + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex1.inc b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex1.inc new file mode 100644 index 0000000000000000000000000000000000000000..7cecc0fefa52c7c90c2ed49c4df23e50f5c0c06a --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex1.inc @@ -0,0 +1,41 @@ +/* -*-c-*- */ +#include "ffitest.h" +#include + +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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex1_double.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex1_double.c new file mode 100644 index 0000000000000000000000000000000000000000..727410d563da91f88258bb83eaba650fc9a284af --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex1_double.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_double.inc" +#include "return_complex1.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex1_float.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex1_float.c new file mode 100644 index 0000000000000000000000000000000000000000..a2aeada84763cebf2092c3f5e6e5d2c580329e8d --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex1_float.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_float.inc" +#include "return_complex1.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex1_longdouble.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex1_longdouble.c new file mode 100644 index 0000000000000000000000000000000000000000..103504bf64e11bc96b9eee22cbc83c5c14297df0 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex1_longdouble.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_longdouble.inc" +#include "return_complex1.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex2.inc b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex2.inc new file mode 100644 index 0000000000000000000000000000000000000000..265170bf718285c6d65fc551e341e9fc5b1f02d9 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex2.inc @@ -0,0 +1,44 @@ +/* -*-c-*- */ +#include "ffitest.h" +#include + +_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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex2_double.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex2_double.c new file mode 100644 index 0000000000000000000000000000000000000000..ab9efacb4a856aa76773a158b67530bcc09b1f55 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex2_double.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_double.inc" +#include "return_complex2.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex2_float.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex2_float.c new file mode 100644 index 0000000000000000000000000000000000000000..d7f22c2a0c78816a0d02a2d6dfb3b1de48dd4f1f --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex2_float.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_float.inc" +#include "return_complex2.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex2_longdouble.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex2_longdouble.c new file mode 100644 index 0000000000000000000000000000000000000000..3edea629df0b0c73d366755cece310ff9cb80542 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex2_longdouble.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_longdouble.inc" +#include "return_complex2.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex_double.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex_double.c new file mode 100644 index 0000000000000000000000000000000000000000..e2497cc84aa048a3ea242ee765e74ac1427e9e70 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex_double.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_double.inc" +#include "return_complex.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex_float.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex_float.c new file mode 100644 index 0000000000000000000000000000000000000000..a35528ff9356b1f41af0c101491cba88277f4af0 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex_float.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_float.inc" +#include "return_complex.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex_longdouble.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex_longdouble.c new file mode 100644 index 0000000000000000000000000000000000000000..142d7becbace62a36e1ce12d4029ae9ee886a7a8 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.complex/return_complex_longdouble.c @@ -0,0 +1,10 @@ +/* Area: ffi_call + Purpose: Check return value complex. + Limitations: none. + PR: none. + Originator: . */ + +/* { dg-do run } */ + +#include "complex_defs_longdouble.inc" +#include "return_complex.inc" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.go/aa-direct.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.go/aa-direct.c new file mode 100644 index 0000000000000000000000000000000000000000..b00c404ab353afaff3a75eb8582bc5e82c54b573 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.go/aa-direct.c @@ -0,0 +1,34 @@ +/* { 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.go/closure1.c b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.go/closure1.c new file mode 100644 index 0000000000000000000000000000000000000000..7b34afc88c8f3ce0f7260b7f53e4083143ff2c4f --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.go/closure1.c @@ -0,0 +1,28 @@ +/* { 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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.go/ffitest.h b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.go/ffitest.h new file mode 100644 index 0000000000000000000000000000000000000000..d27d362d6a6e7e99787be66a5ccbb6c2f487c3a5 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.go/ffitest.h @@ -0,0 +1 @@ +#include "../libffi.call/ffitest.h" diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.go/go.exp b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.go/go.exp new file mode 100644 index 0000000000000000000000000000000000000000..100c5e75b4091522110934a68713dd295fdd7c00 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.go/go.exp @@ -0,0 +1,36 @@ +# 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 +# . + +dg-init +libffi-init + +global srcdir subdir + +set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.{c,cc}]] + +if { [libffi_feature_test "#ifdef FFI_GO_CLOSURES"] } { + run-many-tests $tlist "" +} else { + foreach test $tlist { + unsupported "$test" + } +} + +dg-finish + +# Local Variables: +# tcl-indent-level:4 +# End: diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.go/static-chain.h b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.go/static-chain.h new file mode 100644 index 0000000000000000000000000000000000000000..3675b40a54c844358369bc8720818efe3843339f --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/info/test/testsuite/libffi.go/static-chain.h @@ -0,0 +1,19 @@ +#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/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/libffi.7.so b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/libffi.7.so new file mode 100644 index 0000000000000000000000000000000000000000..dd23bfd7f0f937627caf212c56095fd6b257f4ea Binary files /dev/null and b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/libffi.7.so differ diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/libffi.8.so b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/libffi.8.so new file mode 100644 index 0000000000000000000000000000000000000000..dd23bfd7f0f937627caf212c56095fd6b257f4ea Binary files /dev/null and b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/libffi.8.so differ diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/libffi.a b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/libffi.a new file mode 100644 index 0000000000000000000000000000000000000000..b134f37f16faca62e3f2401e6b259e0958743c54 Binary files /dev/null and b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/libffi.a differ diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/libffi.so b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/libffi.so new file mode 100644 index 0000000000000000000000000000000000000000..dd23bfd7f0f937627caf212c56095fd6b257f4ea Binary files /dev/null and b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/libffi.so differ diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/libffi.so.7 b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/libffi.so.7 new file mode 100644 index 0000000000000000000000000000000000000000..dd23bfd7f0f937627caf212c56095fd6b257f4ea Binary files /dev/null and b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/libffi.so.7 differ diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/libffi.so.8 b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/libffi.so.8 new file mode 100644 index 0000000000000000000000000000000000000000..dd23bfd7f0f937627caf212c56095fd6b257f4ea Binary files /dev/null and b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/libffi.so.8 differ diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/libffi.so.8.1.2 b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/libffi.so.8.1.2 new file mode 100644 index 0000000000000000000000000000000000000000..dd23bfd7f0f937627caf212c56095fd6b257f4ea Binary files /dev/null and b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/libffi.so.8.1.2 differ diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/pkgconfig/libffi.pc b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/pkgconfig/libffi.pc new file mode 100644 index 0000000000000000000000000000000000000000..fa3d8ecc7392bbe38ba97dcb6bb1288ed400771f --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/lib/pkgconfig/libffi.pc @@ -0,0 +1,11 @@ +prefix=/croot/libffi_1714483243560/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_ +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +toolexeclibdir=${libdir} +includedir=/croot/libffi_1714483243560/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/include + +Name: libffi +Description: Library supporting Foreign Function Interfaces +Version: 3.4.4 +Libs: -L${toolexeclibdir} -lffi +Cflags: -I${includedir} diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/share/info/libffi.info b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/share/info/libffi.info new file mode 100644 index 0000000000000000000000000000000000000000..6b9580ad68506e8d93928880cb01c372c3ad69ce --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/share/info/libffi.info @@ -0,0 +1,1060 @@ +This is libffi.info, produced by makeinfo version 6.8 from libffi.texi. + +This manual is for libffi, a portable foreign function interface +library. + + Copyright (C) 2008-2019, 2021, 2022 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 (C) 2008-2019, 2021, 2022 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. +* 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. + + 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. + + 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'. + + +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 + #include + + 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, 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, 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. + + +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. + + 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, Prev: Complex, Up: Types + +2.3.7 Complex Type Example +-------------------------- + +This example demonstrates how to use complex types: + + #include + #include + #include + + 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_. + * 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: Multiple ABIs, Next: The Closure API, 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: The Closure API, Next: Closure Example, Prev: Multiple ABIs, Up: Using libffi + +2.5 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. + + 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.6 Closure Example +=================== + +A trivial example that creates a new 'puts' by binding 'fputs' with +'stdout'. + + #include + #include + + /* 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.7 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) +* FFI: Introduction. (line 31) +* ffi_call: The Basics. (line 72) +* FFI_CLOSURES: The Closure API. (line 13) +* ffi_closure_alloc: The Closure API. (line 19) +* ffi_closure_free: The Closure API. (line 26) +* ffi_get_struct_offsets: Size and Alignment. (line 39) +* ffi_prep_cif: The Basics. (line 16) +* ffi_prep_cif_var: The Basics. (line 39) +* ffi_prep_closure_loc: The Closure API. (line 34) +* 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 34) +* 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_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) +* void: The Basics. (line 72) +* void <1>: The Closure API. (line 19) +* void <2>: The Closure API. (line 26) + + + +Tag Table: +Node: Top1400 +Node: Introduction2935 +Node: Using libffi4567 +Node: The Basics5096 +Node: Simple Example10024 +Node: Types11055 +Node: Primitive Types11566 +Node: Structures13687 +Node: Size and Alignment14726 +Node: Arrays Unions Enums16923 +Node: Type Example19852 +Node: Complex21143 +Node: Complex Type Example22561 +Node: Multiple ABIs25613 +Node: The Closure API25984 +Node: Closure Example29810 +Node: Thread Safety31442 +Node: Memory Usage32243 +Node: Missing Features33438 +Node: Index33803 + +End Tag Table + + +Local Variables: +coding: utf-8 +End: diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/share/man/man3/ffi.3 b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/share/man/man3/ffi.3 new file mode 100644 index 0000000000000000000000000000000000000000..1f1d3031c99772fb01aa08c126ea0e654aef5e2b --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/share/man/man3/ffi.3 @@ -0,0 +1,41 @@ +.Dd February 15, 2008 +.Dt FFI 3 +.Sh NAME +.Nm FFI +.Nd Foreign Function Interface +.Sh LIBRARY +libffi, -lffi +.Sh SYNOPSIS +.In ffi.h +.Ft ffi_status +.Fo ffi_prep_cif +.Fa "ffi_cif *cif" +.Fa "ffi_abi abi" +.Fa "unsigned int nargs" +.Fa "ffi_type *rtype" +.Fa "ffi_type **atypes" +.Fc +.Ft void +.Fo ffi_prep_cif_var +.Fa "ffi_cif *cif" +.Fa "ffi_abi abi" +.Fa "unsigned int nfixedargs" +.Fa "unsigned int ntotalargs" +.Fa "ffi_type *rtype" +.Fa "ffi_type **atypes" +.Fc +.Ft void +.Fo ffi_call +.Fa "ffi_cif *cif" +.Fa "void (*fn)(void)" +.Fa "void *rvalue" +.Fa "void **avalue" +.Fc +.Sh DESCRIPTION +The foreign function interface provides a mechanism by which a function can +generate a call to another function at runtime without requiring knowledge of +the called function's interface at compile time. +.Sh SEE ALSO +.Xr ffi_prep_cif 3 , +.Xr ffi_prep_cif_var 3 , +.Xr ffi_call 3 diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/share/man/man3/ffi_call.3 b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/share/man/man3/ffi_call.3 new file mode 100644 index 0000000000000000000000000000000000000000..5351513f90d86e310cd8cffe31112c75057d664b --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/share/man/man3/ffi_call.3 @@ -0,0 +1,103 @@ +.Dd February 15, 2008 +.Dt ffi_call 3 +.Sh NAME +.Nm ffi_call +.Nd Invoke a foreign function. +.Sh SYNOPSIS +.In ffi.h +.Ft void +.Fo ffi_call +.Fa "ffi_cif *cif" +.Fa "void (*fn)(void)" +.Fa "void *rvalue" +.Fa "void **avalue" +.Fc +.Sh DESCRIPTION +The +.Nm ffi_call +function provides a simple mechanism for invoking a function without +requiring knowledge of the function's interface at compile time. +.Fa fn +is called with the values retrieved from the pointers in the +.Fa avalue +array. The return value from +.Fa fn +is placed in storage pointed to by +.Fa rvalue . +.Fa cif +contains information describing the data types, sizes and alignments of the +arguments to and return value from +.Fa fn , +and must be initialized with +.Nm ffi_prep_cif +before it is used with +.Nm ffi_call . +.Pp +.Fa rvalue +must point to storage that is sizeof(ffi_arg) or larger for non-floating point +types. For smaller-sized return value types, the +.Nm ffi_arg +or +.Nm ffi_sarg +integral type must be used to hold +the return value. +.Sh EXAMPLES +.Bd -literal +#include +#include + +unsigned char +foo(unsigned int, float); + +int +main(int argc, const char **argv) +{ + ffi_cif cif; + ffi_type *arg_types[2]; + void *arg_values[2]; + ffi_status status; + + // Because the return value from foo() is smaller than sizeof(long), it + // must be passed as ffi_arg or ffi_sarg. + ffi_arg result; + + // Specify the data type of each argument. Available types are defined + // in . + arg_types[0] = &ffi_type_uint; + arg_types[1] = &ffi_type_float; + + // Prepare the ffi_cif structure. + if ((status = ffi_prep_cif(&cif, FFI_DEFAULT_ABI, + 2, &ffi_type_uint8, arg_types)) != FFI_OK) + { + // Handle the ffi_status error. + } + + // Specify the values of each argument. + unsigned int arg1 = 42; + float arg2 = 5.1; + + arg_values[0] = &arg1; + arg_values[1] = &arg2; + + // Invoke the function. + ffi_call(&cif, FFI_FN(foo), &result, arg_values); + + // The ffi_arg 'result' now contains the unsigned char returned from foo(), + // which can be accessed by a typecast. + printf("result is %hhu", (unsigned char)result); + + return 0; +} + +// The target function. +unsigned char +foo(unsigned int x, float y) +{ + unsigned char result = x - y; + return result; +} +.Ed +.Sh SEE ALSO +.Xr ffi 3 , +.Xr ffi_prep_cif 3 diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/share/man/man3/ffi_prep_cif.3 b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/share/man/man3/ffi_prep_cif.3 new file mode 100644 index 0000000000000000000000000000000000000000..ab2be8adc17a19af2507c495887fce1c31c7a4e7 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/share/man/man3/ffi_prep_cif.3 @@ -0,0 +1,68 @@ +.Dd February 15, 2008 +.Dt ffi_prep_cif 3 +.Sh NAME +.Nm ffi_prep_cif +.Nd Prepare a +.Nm ffi_cif +structure for use with +.Nm ffi_call +. +.Sh SYNOPSIS +.In ffi.h +.Ft ffi_status +.Fo ffi_prep_cif +.Fa "ffi_cif *cif" +.Fa "ffi_abi abi" +.Fa "unsigned int nargs" +.Fa "ffi_type *rtype" +.Fa "ffi_type **atypes" +.Fc +.Sh DESCRIPTION +The +.Nm ffi_prep_cif +function prepares a +.Nm ffi_cif +structure for use with +.Nm ffi_call +. +.Fa abi +specifies a set of calling conventions to use. +.Fa atypes +is an array of +.Fa nargs +pointers to +.Nm ffi_type +structs that describe the data type, size and alignment of each argument. +.Fa rtype +points to an +.Nm ffi_type +that describes the data type, size and alignment of the +return value. Note that to call a variadic function +.Nm ffi_prep_cif_var +must be used instead. +.Sh RETURN VALUES +Upon successful completion, +.Nm ffi_prep_cif +returns +.Nm FFI_OK . +It will return +.Nm FFI_BAD_TYPEDEF +if +.Fa cif +is +.Nm NULL +or +.Fa atypes +or +.Fa rtype +is malformed. If +.Fa abi +does not refer to a valid ABI, +.Nm FFI_BAD_ABI +will be returned. Available ABIs are +defined in +.Nm . +.Sh SEE ALSO +.Xr ffi 3 , +.Xr ffi_call 3 , +.Xr ffi_prep_cif_var 3 diff --git a/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/share/man/man3/ffi_prep_cif_var.3 b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/share/man/man3/ffi_prep_cif_var.3 new file mode 100644 index 0000000000000000000000000000000000000000..7e19d0b070f17fed3f0890dd433e188b890d1466 --- /dev/null +++ b/miniconda3/pkgs/libffi-3.4.4-h6a678d5_1/share/man/man3/ffi_prep_cif_var.3 @@ -0,0 +1,73 @@ +.Dd January 25, 2011 +.Dt ffi_prep_cif_var 3 +.Sh NAME +.Nm ffi_prep_cif_var +.Nd Prepare a +.Nm ffi_cif +structure for use with +.Nm ffi_call +for variadic functions. +.Sh SYNOPSIS +.In ffi.h +.Ft ffi_status +.Fo ffi_prep_cif_var +.Fa "ffi_cif *cif" +.Fa "ffi_abi abi" +.Fa "unsigned int nfixedargs" +.Fa "unsigned int ntotalargs" +.Fa "ffi_type *rtype" +.Fa "ffi_type **atypes" +.Fc +.Sh DESCRIPTION +The +.Nm ffi_prep_cif_var +function prepares a +.Nm ffi_cif +structure for use with +.Nm ffi_call +for variadic functions. +.Fa abi +specifies a set of calling conventions to use. +.Fa atypes +is an array of +.Fa ntotalargs +pointers to +.Nm ffi_type +structs that describe the data type, size and alignment of each argument. +.Fa rtype +points to an +.Nm ffi_type +that describes the data type, size and alignment of the +return value. +.Fa nfixedargs +must contain the number of fixed (non-variadic) arguments. +Note that to call a non-variadic function +.Nm ffi_prep_cif +must be used. +.Sh RETURN VALUES +Upon successful completion, +.Nm ffi_prep_cif_var +returns +.Nm FFI_OK . +It will return +.Nm FFI_BAD_TYPEDEF +if +.Fa cif +is +.Nm NULL +or +.Fa atypes +or +.Fa rtype +is malformed. If +.Fa abi +does not refer to a valid ABI, +.Nm FFI_BAD_ABI +will be returned. Available ABIs are +defined in +.Nm +. +.Sh SEE ALSO +.Xr ffi 3 , +.Xr ffi_call 3 , +.Xr ffi_prep_cif 3 diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/about.json b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..123d403a6b172e178c760e7f389ec6029fc4e193 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/about.json @@ -0,0 +1,164 @@ +{ + "channels": [ + "https://repo.anaconda.com/pkgs/main", + "https://repo.anaconda.com/pkgs/r", + "https://repo.anaconda.com/pkgs/r" + ], + "conda_build_version": "25.1.2", + "conda_version": "25.1.1", + "env_vars": { + "CIO_TEST": "" + }, + "extra": { + "copy_test_source_files": true, + "feedstock-name": "ctng-compilers-feedstock", + "final": true, + "parent_recipe": { + "name": "gcc_compilers", + "path": "/home/task_176276935360828/ctng-compilers-feedstock/recipe", + "version": "15.2.0" + }, + "recipe-maintainers": [ + "timsnyder", + "xhochy", + "isuruf", + "beckermr" + ] + }, + "home": "https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html", + "identifiers": [], + "keywords": [], + "license": "GPL-3.0-only WITH GCC-exception-3.1", + "root_pkgs": [ + "_libgcc_mutex 0.1 main", + "ca-certificates 2025.9.9 h06a4308_0", + "ld_impl_linux-64 2.40 h12ee557_0", + "libstdcxx-ng 11.2.0 h1234567_1", + "nlohmann_json 3.11.2 h6a678d5_0", + "pybind11-abi 5 hd3eb1b0_0", + "tzdata 2025a h04d1e81_0", + "libgomp 11.2.0 h1234567_1", + "_openmp_mutex 5.1 1_gnu", + "libgcc-ng 11.2.0 h1234567_1", + "bzip2 1.0.8 h5eee18b_6", + "c-ares 1.19.1 h5eee18b_0", + "cpp-expected 1.1.0 hdb19cb5_0", + "expat 2.6.4 h6a678d5_0", + "fmt 9.1.0 hdb19cb5_1", + "icu 73.1 h6a678d5_0", + "libev 4.33 h7f8727e_1", + "libffi 3.4.4 h6a678d5_1", + "libuuid 1.41.5 h5eee18b_0", + "lz4-c 1.9.4 h6a678d5_1", + "ncurses 6.4 h6a678d5_0", + "liblief 0.12.3 h6a678d5_0", + "reproc 14.2.4 h6a678d5_2", + "simdjson 3.10.1 hdb19cb5_0", + "xz 5.4.6 h5eee18b_1", + "yaml-cpp 0.8.0 h6a678d5_1", + "zlib 1.2.13 h5eee18b_1", + "libedit 3.1.20230828 h5eee18b_0", + "libnghttp2 1.57.0 h2d74bed_0", + "libssh2 1.11.1 h251f7ec_0", + "libxml2 2.13.5 hfdd30dd_0", + "pcre2 10.42 hebb0a14_1", + "readline 8.2 h5eee18b_0", + "reproc-cpp 14.2.4 h6a678d5_2", + "spdlog 1.11.0 hdb19cb5_0", + "tk 8.6.14 h39e8969_0", + "zstd 1.5.6 hc292b87_0", + "krb5 1.20.1 h143b758_1", + "libarchive 3.7.7 hfab0078_0", + "libsolv 0.7.30 he621ea3_1", + "sqlite 3.45.3 h5eee18b_0", + "libcurl 8.11.1 hc9e6f67_0", + "python 3.12.9 h5148396_0", + "libmamba 2.0.5 haf1ee3a_1", + "menuinst 2.2.0 py312h06a4308_1", + "anaconda-anon-usage 0.5.0 py312hfc0e8ea_100", + "annotated-types 0.6.0 py312h06a4308_0", + "archspec 0.2.3 pyhd3eb1b0_0", + "boltons 24.1.0 py312h06a4308_0", + "brotli-python 1.0.9 py312h6a678d5_9", + "charset-normalizer 3.3.2 pyhd3eb1b0_0", + "distro 1.9.0 py312h06a4308_0", + "frozendict 2.4.2 py312h06a4308_0", + "idna 3.7 py312h06a4308_0", + "jsonpointer 2.1 pyhd3eb1b0_0", + "libmambapy 2.0.5 py312hdb19cb5_1", + "mdurl 0.1.0 py312h06a4308_0", + "packaging 24.2 py312h06a4308_0", + "platformdirs 3.10.0 py312h06a4308_0", + "pluggy 1.5.0 py312h06a4308_0", + "pycosat 0.6.6 py312h5eee18b_2", + "pycparser 2.21 pyhd3eb1b0_0", + "pygments 2.15.1 py312h06a4308_1", + "pysocks 1.7.1 py312h06a4308_0", + "ruamel.yaml.clib 0.2.8 py312h5eee18b_0", + "setuptools 75.8.0 py312h06a4308_0", + "tqdm 4.67.1 py312he106c6f_0", + "truststore 0.10.0 py312h06a4308_0", + "typing_extensions 4.12.2 py312h06a4308_0", + "wheel 0.45.1 py312h06a4308_0", + "cffi 1.17.1 py312h1fdaa30_1", + "jsonpatch 1.33 py312h06a4308_1", + "markdown-it-py 2.2.0 py312h06a4308_1", + "pip 25.0 py312h06a4308_0", + "ruamel.yaml 0.18.6 py312h5eee18b_0", + "typing-extensions 4.12.2 py312h06a4308_0", + "urllib3 2.3.0 py312h06a4308_0", + "cryptography 43.0.3 py312h7825ff9_1", + "pydantic-core 2.27.1 py312h4aa5aa6_0", + "requests 2.32.3 py312h06a4308_1", + "rich 13.9.4 py312h06a4308_0", + "zstandard 0.23.0 py312h2c38b39_1", + "conda-content-trust 0.2.0 py312h06a4308_1", + "conda-package-streaming 0.11.0 py312h06a4308_0", + "pydantic 2.10.3 py312h06a4308_0", + "conda-package-handling 2.4.0 py312h06a4308_0", + "conda 25.1.1 py312h06a4308_0", + "conda-anaconda-tos 0.1.2 py312h06a4308_0", + "conda-libmamba-solver 25.1.1 pyhd3eb1b0_0", + "libsodium 1.0.20 heac8642_0", + "openssl 3.0.18 hd6dcaed_0", + "patch 2.8 hb25bd0a_0", + "patchelf 0.17.2 h6a678d5_0", + "yaml 0.2.5 h7b6447c_0", + "argcomplete 3.6.2 py312h06a4308_0", + "attrs 24.3.0 py312h06a4308_0", + "certifi 2025.8.3 py312h06a4308_0", + "chardet 5.2.0 py312h06a4308_0", + "click 8.2.1 py312h06a4308_0", + "filelock 3.17.0 py312h06a4308_0", + "jmespath 1.0.1 py312h06a4308_0", + "markupsafe 3.0.2 py312h5eee18b_0", + "more-itertools 10.3.0 py312h06a4308_0", + "pkginfo 1.12.0 py312h06a4308_0", + "psutil 7.0.0 py312hee96239_0", + "py-lief 0.12.3 py312h6a678d5_0", + "python-libarchive-c 5.1 pyhd3eb1b0_0", + "pytz 2025.2 py312h06a4308_0", + "pyyaml 6.0.2 py312h5eee18b_0", + "rpds-py 0.22.3 py312h4aa5aa6_0", + "six 1.17.0 py312h06a4308_0", + "soupsieve 2.5 py312h06a4308_0", + "tomlkit 0.13.2 py312h06a4308_0", + "xmltodict 0.14.2 py312h06a4308_0", + "jinja2 3.1.6 py312h06a4308_0", + "python-dateutil 2.9.0post0 py312h06a4308_2", + "referencing 0.30.2 py312h06a4308_0", + "yq 3.4.3 py312h06a4308_0", + "beautifulsoup4 4.13.5 py312h06a4308_0", + "botocore 1.37.10 py312h06a4308_0", + "jsonschema-specifications 2023.7.1 py312h06a4308_0", + "pynacl 1.5.0 py312h2630517_2", + "jsonschema 4.25.0 py312h06a4308_0", + "s3transfer 0.11.2 py312h06a4308_0", + "boto3 1.37.10 py312h06a4308_0", + "conda-anaconda-telemetry 0.3.0 pyhd3eb1b0_1", + "conda-index 0.5.0 py312h06a4308_0", + "conda-build 25.1.2 py312h06a4308_0" + ], + "summary": "The GCC low-level runtime library", + "tags": [] +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/files b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/files new file mode 100644 index 0000000000000000000000000000000000000000..f1254fdad492b5d96c20c53a9ba8cc81ddfc14aa --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/files @@ -0,0 +1,14 @@ +lib/libatomic.so +lib/libatomic.so.1 +lib/libatomic.so.1.2.0 +lib/libgcc_s.so +lib/libgcc_s.so.1 +lib/libitm.so +lib/libitm.so.1 +lib/libitm.so.1.0.0 +lib/libquadmath.so +lib/libquadmath.so.0 +lib/libquadmath.so.0.0.0 +share/info/libgomp.info +share/info/libquadmath.info +share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/git b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/git new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/hash_input.json b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..096bd42cbc9d2e504b96ac40ba551be1461c049d --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/hash_input.json @@ -0,0 +1,10 @@ +{ + "cross_target_stdlib": "sysroot", + "libgomp_ver": "1.0.0", + "cross_target_stdlib_version": "2.28", + "cross_target_platform": "linux-64", + "triplet": "x86_64-conda-linux-gnu", + "target_platform": "linux-64", + "channel_targets": "defaults", + "__glibc": "__glibc >=2.28,<3.0.a0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/index.json b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..a200f6773edd74d035b6e6114998048b4e51cc95 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/index.json @@ -0,0 +1,19 @@ +{ + "arch": "x86_64", + "build": "h69a1729_7", + "build_number": 7, + "constrains": [ + "libgcc-ng ==15.2.0=*_7", + "libgomp 15.2.0 h4751f2c_7" + ], + "depends": [ + "__glibc >=2.28,<3.0.a0", + "_openmp_mutex >=4.5" + ], + "license": "GPL-3.0-only WITH GCC-exception-3.1", + "name": "libgcc", + "platform": "linux", + "subdir": "linux-64", + "timestamp": 1762772576461, + "version": "15.2.0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/paths.json b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..8f5a443662e9400e64bd8fc84ebd56e61e021df7 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/paths.json @@ -0,0 +1,89 @@ +{ + "paths": [ + { + "_path": "lib/libatomic.so", + "path_type": "softlink", + "sha256": "3867bd037fd67c64cac210a97c52c2ef6fdc38f72d046080ed63419616977448", + "size_in_bytes": 168920 + }, + { + "_path": "lib/libatomic.so.1", + "path_type": "softlink", + "sha256": "3867bd037fd67c64cac210a97c52c2ef6fdc38f72d046080ed63419616977448", + "size_in_bytes": 168920 + }, + { + "_path": "lib/libatomic.so.1.2.0", + "path_type": "hardlink", + "sha256": "3867bd037fd67c64cac210a97c52c2ef6fdc38f72d046080ed63419616977448", + "size_in_bytes": 168920 + }, + { + "_path": "lib/libgcc_s.so", + "path_type": "hardlink", + "sha256": "69a56a9993b7729b29b274e65016031c81f2397f176ed5ad44d59bd50425e0bd", + "size_in_bytes": 132 + }, + { + "_path": "lib/libgcc_s.so.1", + "path_type": "hardlink", + "sha256": "0907d66b5a5f028480cf78adad58180e1c1183a3a085877e8f4fd471af60d50c", + "size_in_bytes": 658656 + }, + { + "_path": "lib/libitm.so", + "path_type": "softlink", + "sha256": "a647de901d181e5ede587b8cb5d1820c302977965f9929450c95408395a3eab9", + "size_in_bytes": 775712 + }, + { + "_path": "lib/libitm.so.1", + "path_type": "softlink", + "sha256": "a647de901d181e5ede587b8cb5d1820c302977965f9929450c95408395a3eab9", + "size_in_bytes": 775712 + }, + { + "_path": "lib/libitm.so.1.0.0", + "path_type": "hardlink", + "sha256": "a647de901d181e5ede587b8cb5d1820c302977965f9929450c95408395a3eab9", + "size_in_bytes": 775712 + }, + { + "_path": "lib/libquadmath.so", + "path_type": "softlink", + "sha256": "5179930816df6751b7a118f1e29eabf7021a92d12db8c6920416e231682fb1bc", + "size_in_bytes": 773304 + }, + { + "_path": "lib/libquadmath.so.0", + "path_type": "softlink", + "sha256": "5179930816df6751b7a118f1e29eabf7021a92d12db8c6920416e231682fb1bc", + "size_in_bytes": 773304 + }, + { + "_path": "lib/libquadmath.so.0.0.0", + "path_type": "hardlink", + "sha256": "5179930816df6751b7a118f1e29eabf7021a92d12db8c6920416e231682fb1bc", + "size_in_bytes": 773304 + }, + { + "_path": "share/info/libgomp.info", + "path_type": "hardlink", + "sha256": "9183a74823a2193acf72e08915a06714ee3f6de413a6751f3cc265f2764517f6", + "size_in_bytes": 359250 + }, + { + "_path": "share/info/libquadmath.info", + "path_type": "hardlink", + "sha256": "a8829e58df913add53edc8ec5570a17d6800a98fb69272ba7a18d54b08ba8f48", + "size_in_bytes": 36603 + }, + { + "_path": "share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION", + "path_type": "hardlink", + "sha256": "9d6b43ce4d8de0c878bf16b54d8e7a10d9bd42b75178153e3af6a815bdc90f74", + "size_in_bytes": 3324 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/conda_build_config.yaml b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6de73da57e6bc8ce414772f2c7a838d2e377b584 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/conda_build_config.yaml @@ -0,0 +1,42 @@ +binutils_version: '2.44' +c_compiler: gcc +c_stdlib: sysroot +c_stdlib_version: '2.28' +channel_sources: conda-forge/label/sysroot-with-crypt,conda-forge +channel_targets: defaults +cpu_optimization_target: nocona +cran_mirror: https://cran.r-project.org +cross_target_platform: linux-64 +cross_target_stdlib: sysroot +cross_target_stdlib_version: '2.28' +cxx_compiler: gxx +extend_keys: +- extend_keys +- ignore_version +- pin_run_as_build +- ignore_build_only_deps +fortran_compiler: gfortran +gcc_maj_ver: '15' +gcc_version: 15.2.0 +ignore_build_only_deps: +- python +- numpy +libgfortran_soname: '5' +libgomp_ver: 1.0.0 +lua: '5' +numpy: '1.26' +openmp_ver: '4.5' +perl: 5.26.2 +pin_run_as_build: + python: + max_pin: x.x + min_pin: x.x + r-base: + max_pin: x.x + min_pin: x.x +platform: linux-64 +python: '3.12' +r_base: '3.5' +target_platform: linux-64 +triplet: x86_64-conda-linux-gnu +with_conda_specs: 'true' diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/install-libgcc-no-gomp.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/install-libgcc-no-gomp.sh new file mode 100644 index 0000000000000000000000000000000000000000..e792608072235cedbc2836ec05a7bc9326d53862 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/install-libgcc-no-gomp.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" + +# we have to remove existing links/files so that the libgcc install works +rm -rf ${PREFIX}/lib/* +rm -rf ${PREFIX}/share/* +rm -f ${PREFIX}/${CHOST}/lib/libgomp* + +# now run install of libgcc +# this reinstalls the wrong symlinks for openmp +source ${RECIPE_DIR}/install-libgcc.sh + +# remove and relink things for openmp +rm -f ${PREFIX}/lib/libgomp.so +rm -f ${PREFIX}/${CHOST}/lib/libgomp.so +rm -f ${PREFIX}/lib/libgomp.so.${libgomp_ver:0:1} +rm -f ${PREFIX}/${CHOST}/lib/libgomp.so.${libgomp_ver:0:1} +rm -f ${PREFIX}/${CHOST}/lib/libgomp.so.${libgomp_ver} + +# (re)make the right links +# note that this code is remaking more links than the ones we want in this +# package but that is ok +pushd ${PREFIX}/lib + if [[ "${TARGET}" != *mingw* ]]; then + ln -s libgomp.so.${libgomp_ver} libgomp.so.${libgomp_ver:0:1} + fi +popd diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/meta.yaml b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..108dbc08d6bf40e16f708224021b46b2dd3eefaa --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/meta.yaml @@ -0,0 +1,58 @@ +# This file created by conda-build 25.1.2 +# ------------------------------------------------ + +package: + name: libgcc + version: 15.2.0 +source: + - patches: + - patches/0001-allow-commands-in-main-specfile.patch + - patches/0002-patch-zoneinfo_dir_override-to-point-to-our-tzdata.patch + - patches/0003-add-ldl-to-libstdc___la_LDFLAGS.patch + - patches/0004-Hardcode-HAVE_ALIGNED_ALLOC-1-in-libstdc-v3-configur.patch + sha256: 7294d65cc1a0558cb815af0ca8c7763d86f7a31199794ede3f630c0d1b0a5723 + url: + - https://ftp.gnu.org/gnu/gcc/gcc-15.2.0/gcc-15.2.0.tar.gz + - https://mirrors.ocf.berkeley.edu/gnu/gcc/gcc-15.2.0/gcc-15.2.0.tar.gz +build: + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - '*' + number: 7 + overlinking_ignore_patterns: + - lib/libgcc_s.so.* + rpaths_patcher: patchelf + string: h69a1729_7 +requirements: + host: + - _openmp_mutex 4.5 3_gnu + - kernel-headers_linux-64 4.18.0 h528b178_0 + - libgomp 15.2.0 h4751f2c_7 + - sysroot_linux-64 2.28 h528b178_0 + - tzdata 2025b h04d1e81_0 + run: + - __glibc >=2.28,<3.0.a0 + - _openmp_mutex >=4.5 + run_constrained: + - libgcc-ng ==15.2.0=*_7 + - libgomp 15.2.0 h4751f2c_7 +test: + commands: + - test -f ${PREFIX}/lib/libgcc_s.so + - test -f ${PREFIX}/lib/libgomp.so.1 + - test `readlink ${PREFIX}/lib/libgomp.so.1` == "libgomp.so.1.0.0" + requires: + - sysroot_linux-64 +about: + home: https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html + license: GPL-3.0-only WITH GCC-exception-3.1 + summary: The GCC low-level runtime library +extra: + copy_test_source_files: true + feedstock-name: ctng-compilers-feedstock + final: true + recipe-maintainers: + - beckermr + - isuruf + - timsnyder + - xhochy diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/LICENSE b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..cba42cffc2901212c539e558950c6f6ed985d628 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/LICENSE @@ -0,0 +1,13 @@ +BSD 3-clause license +Copyright (c) 2015-2019, conda-forge +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/build.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..68e45267b8eceabd79595abe9d20ddbc89939d23 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/build.sh @@ -0,0 +1,120 @@ +#!/bin/bash + +set -ex + +source ${RECIPE_DIR}/setup_compiler.sh + +# ensure patch is applied +grep 'conda-forge:: allow' gcc/gcc.c* + +GCC_CONFIGURE_OPTIONS=() + +if [[ "$channel_targets" == *conda-forge* ]]; then + GCC_CONFIGURE_OPTIONS+=(--with-pkgversion="conda-forge gcc ${gcc_version}-${PKG_BUILDNUM}") + GCC_CONFIGURE_OPTIONS+=(--with-bugurl="https://github.com/conda-forge/ctng-compilers-feedstock/issues/new/choose") +fi + +for tool in addr2line ar as c++filt cc c++ fc gcc g++ gfortran ld nm objcopy objdump ranlib readelf size strings strip; do + tool_upper=$(echo $tool | tr a-z-+ A-Z_X) + if [[ "$tool" == "cc" ]]; then + tool=gcc + elif [[ "$tool" == "fc" ]]; then + tool=gfortran + elif [[ "$tool" == "c++" ]]; then + tool=g++ + elif [[ "$target_platform" != "$build_platform" && "$tool" =~ ^(ar|nm|ranlib)$ ]]; then + tool="gcc-${tool}" + fi + eval "export ${tool_upper}_FOR_BUILD=\$BUILD_PREFIX/bin/\$BUILD-\$tool" + eval "export ${tool_upper}=\$BUILD_PREFIX/bin/\$HOST-\$tool" + eval "export ${tool_upper}_FOR_TARGET=\$BUILD_PREFIX/bin/\$TARGET-\$tool" +done + +if [[ "$cross_target_platform" == "win-64" ]]; then + # do not expect ${prefix}/mingw symlink - this should be superceded by + # 0005-Windows-Don-t-ignore-native-system-header-dir.patch .. but isn't! + sed -i 's#${prefix}/mingw/#${prefix}/${target}/sysroot/usr/#g' configure + if [[ "$gcc_maj_ver" == "13" || "$gcc_maj_ver" == "14" ]]; then + sed -i "s#/mingw/#/usr/#g" gcc/config/i386/mingw32.h + else + sed -i "s#/mingw/#/usr/#g" gcc/config/mingw/mingw32.h + fi +else + # prevent mingw patches from being archived in linux conda packages + rm -rf ${RECIPE_DIR}/patches/mingw +fi + +NATIVE_SYSTEM_HEADER_DIR=/usr/include +SYSROOT_DIR=${PREFIX}/${TARGET}/sysroot + +# workaround a bug in gcc build files when using external binutils +# and build != host == target +export gcc_cv_objdump=$OBJDUMP_FOR_TARGET + +ls $BUILD_PREFIX/bin/ + +./contrib/download_prerequisites + +# We want CONDA_PREFIX/usr/lib not CONDA_PREFIX/usr/lib64 and this +# is the only way. It is incompatible with multilib (obviously). +TINFO_FILES=$(find . -path "*/config/*/t-*") +for TINFO_FILE in ${TINFO_FILES}; do + echo TINFO_FILE ${TINFO_FILE} + sed -i.bak 's#^\(MULTILIB_OSDIRNAMES.*\)\(lib64\)#\1lib#g' ${TINFO_FILE} + rm -f ${TINFO_FILE}.bak + sed -i.bak 's#^\(MULTILIB_OSDIRNAMES.*\)\(libx32\)#\1lib#g' ${TINFO_FILE} + rm -f ${TINFO_FILE}.bak +done + +# workaround for https://gcc.gnu.org/bugzilla//show_bug.cgi?id=80196 +if [[ "$gcc_version" == "11."* && "$build_platform" != "$target_platform" ]]; then + sed -i.bak 's@-I$glibcxx_srcdir/libsupc++@-I$glibcxx_srcdir/libsupc++ -nostdinc++@g' libstdc++-v3/configure +fi + +mkdir -p build +cd build + +# We need to explicitly set the gxx include dir because previously +# with ct-ng, native build was not considered native because +# BUILD=HOST=x86_64-build_unknown-linux-gnu and TARGET=x86_64-conda-linux-gnu +# Depending on native or not, the include dir changes. Setting it explictly +# goes back to the original way. +# See https://github.com/gcc-mirror/gcc/blob/16e2427f50c208dfe07d07f18009969502c25dc8/gcc/configure.ac#L218 + +if [[ "$TARGET" == *linux* ]]; then + GCC_CONFIGURE_OPTIONS+=(--enable-libsanitizer) + GCC_CONFIGURE_OPTIONS+=(--enable-default-pie) + GCC_CONFIGURE_OPTIONS+=(--enable-threads=posix) +fi + +../configure \ + --prefix="$PREFIX" \ + --with-slibdir="$PREFIX/lib" \ + --libdir="$PREFIX/lib" \ + --mandir="$PREFIX/man" \ + --build=$BUILD \ + --host=$HOST \ + --target=$TARGET \ + --enable-languages=c,c++,fortran,objc,obj-c++ \ + --enable-__cxa_atexit \ + --disable-libmudflap \ + --enable-libgomp \ + --disable-libssp \ + --enable-libquadmath \ + --enable-libquadmath-support \ + --enable-lto \ + --enable-target-optspace \ + --enable-plugin \ + --enable-gold \ + --disable-nls \ + --disable-multilib \ + --enable-long-long \ + --with-sysroot=${SYSROOT_DIR} \ + --with-build-sysroot=${BUILD_PREFIX}/${TARGET}/sysroot \ + --with-native-system-header-dir=${NATIVE_SYSTEM_HEADER_DIR} \ + --with-gxx-include-dir="${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/include/c++" \ + "${GCC_CONFIGURE_OPTIONS[@]}" + +# Setting the CPU_COUNT=1 lets you see which job failed! +#CPU_COUNT=1 +make -j${CPU_COUNT} diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/c11threads.c b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/c11threads.c new file mode 100644 index 0000000000000000000000000000000000000000..1d0b34c8662f7eca07c573c32eadbdf35a8427e3 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/c11threads.c @@ -0,0 +1,6 @@ +#include +int main() { + mtx_t mutex; + mtx_init(&mutex, mtx_plain); +} + diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/conda_build_config.yaml b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2066b6abe52a8e832f676e8c49dd5a847678ae63 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/conda_build_config.yaml @@ -0,0 +1,49 @@ +triplet: + - x86_64-conda-linux-gnu # [linux and x86_64] + - powerpc64le-conda-linux-gnu # [ppc64le] + - aarch64-conda-linux-gnu # [linux and aarch64] + - x86_64-w64-mingw32 # [win] +gcc_version: + - 15.2.0 # [not ANACONDA_ROCKET_ENABLE_GCC13 and not ANACONDA_ROCKET_ENABLE_GCC14] + - 14.3.0 # [ANACONDA_ROCKET_ENABLE_GCC14] + - 13.4.0 # [ANACONDA_ROCKET_ENABLE_GCC13] +gcc_maj_ver: + - 15 # [not ANACONDA_ROCKET_ENABLE_GCC13 and not ANACONDA_ROCKET_ENABLE_GCC14] + - 14 # [ANACONDA_ROCKET_ENABLE_GCC14] + - 13 # [ANACONDA_ROCKET_ENABLE_GCC13] +libgfortran_soname: + - 5 # [not ANACONDA_ROCKET_ENABLE_GCC13 and not ANACONDA_ROCKET_ENABLE_GCC14] + - 5 # [ANACONDA_ROCKET_ENABLE_GCC14] + - 5 # [ANACONDA_ROCKET_ENABLE_GCC13] +binutils_version: + - 2.44 +cross_target_platform: + - linux-64 # [linux and x86_64] + - linux-ppc64le # [ppc64le] + - linux-aarch64 # [linux and aarch64] + - win-64 # [win] +cross_target_stdlib_version: + - 2.28 # [linux and x86_64] + - 2.28 # [ppc64le] + - 2.28 # [linux and aarch64] + - 12 # [win] +cross_target_stdlib: + - sysroot # [linux and x86_64] + - sysroot # [ppc64le] + - sysroot # [linux and aarch64] + - m2w64-sysroot # [win] +# openmp versions +openmp_ver: + - 4.5 +libgomp_ver: + - 1.0.0 +channel_sources: + - conda-forge/label/sysroot-with-crypt,conda-forge +# we could use stdlib("m2w64_c"), but this allows uniform use in setup_compiler.sh +c_stdlib: # [win] + - m2w64-sysroot # [win] +c_stdlib_version: # [win] + - 12 # [win] +with_conda_specs: + - true + - false diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/config.old b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/config.old new file mode 100644 index 0000000000000000000000000000000000000000..90a390a60b40932a63278c29c1f013e7d5254a2d --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/config.old @@ -0,0 +1,530 @@ +# +# Automatically generated file; DO NOT EDIT. +# Crosstool-NG Configuration +# +CT_CONFIGURE_has_static_link=y +CT_CONFIGURE_has_xz=y +CT_CONFIGURE_has_svn=y +CT_MODULES=y + +# +# Paths and misc options +# + +# +# crosstool-NG behavior +# +CT_OBSOLETE=y +CT_EXPERIMENTAL=y +CT_ALLOW_BUILD_AS_ROOT=y +CT_ALLOW_BUILD_AS_ROOT_SURE=y +# CT_DEBUG_CT is not set + +# +# Paths +# +CT_LOCAL_TARBALLS_DIR="${HOME}/src" +CT_SAVE_TARBALLS=y +CT_WORK_DIR="${CT_TOP_DIR}/.build" +CT_PREFIX_DIR="${CT_TOP_DIR}/gcc_built" +CT_BUILD_TOP_DIR="@BUILD_TOP@" +CT_INSTALL_DIR="${CT_PREFIX_DIR}" +CT_RM_RF_PREFIX_DIR=n +CT_REMOVE_DOCS=y +CT_INSTALL_DIR_RO=n +CT_STRIP_HOST_TOOLCHAIN_EXECUTABLES=y +# CT_STRIP_TARGET_TOOLCHAIN_EXECUTABLES is not set + +# +# Downloading +# +# CT_FORBID_DOWNLOAD is not set +# CT_FORCE_DOWNLOAD is not set +CT_CONNECT_TIMEOUT=10 +# CT_ONLY_DOWNLOAD is not set +# CT_USE_MIRROR is not set + +# +# Extracting +# +# CT_FORCE_EXTRACT is not set +CT_OVERIDE_CONFIG_GUESS_SUB=y +# CT_ONLY_EXTRACT is not set +CT_PATCH_BUNDLED=y +# CT_PATCH_LOCAL is not set +# CT_PATCH_BUNDLED_LOCAL is not set +# CT_PATCH_LOCAL_BUNDLED is not set +# CT_PATCH_BUNDLED_FALLBACK_LOCAL is not set +# CT_PATCH_LOCAL_FALLBACK_BUNDLED is not set +# CT_PATCH_NONE is not set +CT_PATCH_ORDER="bundled" + +# +# Build behavior +# +CT_PARALLEL_JOBS=4 +CT_LOAD="" +CT_USE_PIPES=y +CT_EXTRA_CFLAGS_FOR_BUILD="" +CT_EXTRA_LDFLAGS_FOR_BUILD="" +CT_EXTRA_CFLAGS_FOR_HOST="" +CT_EXTRA_LDFLAGS_FOR_HOST="" +# CT_CONFIG_SHELL_SH is not set +# CT_CONFIG_SHELL_ASH is not set +CT_CONFIG_SHELL_BASH=y +# CT_CONFIG_SHELL_CUSTOM is not set +CT_CONFIG_SHELL="${bash}" + +# +# Logging +# +# CT_LOG_ERROR is not set +# CT_LOG_WARN is not set +CT_LOG_INFO=y +# CT_LOG_EXTRA is not set +# CT_LOG_ALL is not set +# CT_LOG_DEBUG is not set +CT_LOG_LEVEL_MAX="INFO" +# CT_LOG_SEE_TOOLS_WARN is not set +CT_LOG_PROGRESS_BAR=y +CT_LOG_TO_FILE=y +CT_LOG_FILE_COMPRESS=y + +# +# Target options +# +CT_ARCH="arm" +CT_ARCH_SUPPORTS_BOTH_MMU=y +CT_ARCH_SUPPORTS_BOTH_ENDIAN=y +CT_ARCH_SUPPORTS_32=y +CT_ARCH_SUPPORTS_64=y +CT_ARCH_SUPPORTS_WITH_ARCH=y +CT_ARCH_SUPPORTS_WITH_CPU=y +CT_ARCH_SUPPORTS_WITH_TUNE=y +CT_ARCH_SUPPORTS_WITH_FLOAT=y +CT_ARCH_SUPPORTS_WITH_FPU=y +CT_ARCH_SUPPORTS_SOFTFP=y +CT_ARCH_DEFAULT_HAS_MMU=y +CT_ARCH_DEFAULT_LE=y +CT_ARCH_DEFAULT_32=y +CT_ARCH_CPU="arm1136jf-s" +CT_ARCH_FPU="vfp" +# CT_ARCH_BE is not set +CT_ARCH_LE=y +CT_ARCH_32=y +# CT_ARCH_64 is not set +CT_ARCH_BITNESS=32 +# CT_ARCH_FLOAT_HW is not set +CT_ARCH_FLOAT_SW=y +CT_TARGET_CFLAGS="" +CT_TARGET_LDFLAGS="" +# CT_ARCH_alpha is not set +CT_ARCH_arm=y +# CT_ARCH_avr is not set +# CT_ARCH_m68k is not set +# CT_ARCH_microblaze is not set +# CT_ARCH_mips is not set +# CT_ARCH_nios2 is not set +# CT_ARCH_powerpc is not set +# CT_ARCH_s390 is not set +# CT_ARCH_sh is not set +# CT_ARCH_sparc is not set +# CT_ARCH_x86 is not set +# CT_ARCH_xtensa is not set +CT_ARCH_alpha_AVAILABLE=y +CT_ARCH_arm_AVAILABLE=y +CT_ARCH_avr_AVAILABLE=y +CT_ARCH_m68k_AVAILABLE=y +CT_ARCH_microblaze_AVAILABLE=y +CT_ARCH_mips_AVAILABLE=y +CT_ARCH_nios2_AVAILABLE=y +CT_ARCH_powerpc_AVAILABLE=y +CT_ARCH_s390_AVAILABLE=y +CT_ARCH_sh_AVAILABLE=y +CT_ARCH_sparc_AVAILABLE=y +CT_ARCH_x86_AVAILABLE=y +CT_ARCH_xtensa_AVAILABLE=y +CT_ARCH_SUFFIX="" + +# +# Generic target options +# +# CT_MULTILIB is not set +# CT_DISABLE_MULTILIB_LIB_OSDIRNAMES is not set +CT_ARCH_USE_MMU=y +CT_ARCH_ENDIAN="little" +CT_ARCH_32=y + +# +# Target optimisations +# +CT_ARCH_EXCLUSIVE_WITH_CPU=y +# CT_ARCH_FLOAT_AUTO is not set +# CT_ARCH_FLOAT_SOFTFP is not set +CT_ARCH_FLOAT="soft" + +# +# arm other options +# +CT_ARCH_ARM_MODE="arm" +CT_ARCH_ARM_MODE_ARM=y +# CT_ARCH_ARM_MODE_THUMB is not set +# CT_ARCH_ARM_INTERWORKING is not set +CT_ARCH_ARM_EABI_FORCE=y +CT_ARCH_ARM_EABI=y + +# +# Toolchain options +# + +# +# General toolchain options +# +CT_FORCE_SYSROOT=y +CT_USE_SYSROOT=y +CT_SYSROOT_NAME="sysroot" +CT_SYSROOT_DIR_PREFIX="" +CT_WANTS_STATIC_LINK=y +CT_STATIC_TOOLCHAIN=y +CT_TOOLCHAIN_PKGVERSION="" +CT_TOOLCHAIN_BUGURL="" + +# +# Tuple completion and aliasing +# +CT_TARGET_VENDOR="unknown" +CT_TARGET_ALIAS_SED_EXPR="" +CT_TARGET_ALIAS="" + +# +# Toolchain type +# +# CT_NATIVE is not set +CT_CROSS=y +# CT_CROSS_NATIVE is not set +# CT_CANADIAN is not set +CT_TOOLCHAIN_TYPE="cross" + +# +# Build system +# +CT_BUILD="x86_64-pc-linux-gnu" +CT_BUILD_PREFIX="" +CT_BUILD_SUFFIX="" + +# +# Misc options +# +# CT_TOOLCHAIN_ENABLE_NLS is not set + +# +# Operating System +# +CT_KERNEL_SUPPORTS_SHARED_LIBS=y +CT_KERNEL="linux" +CT_KERNEL_VERSION="3.2.43" +# CT_KERNEL_bare_metal is not set +CT_KERNEL_linux=y +CT_KERNEL_bare_metal_AVAILABLE=y +CT_KERNEL_linux_AVAILABLE=y +# CT_KERNEL_LINUX_CUSTOM is not set +# CT_KERNEL_V_4_4 is not set +# CT_KERNEL_V_4_3 is not set +# CT_KERNEL_V_4_1 is not set +# CT_KERNEL_V_3_18 is not set +# CT_KERNEL_V_3_14 is not set +# CT_KERNEL_V_3_12 is not set +# CT_KERNEL_V_3_10 is not set +# CT_KERNEL_V_3_7 is not set +# CT_KERNEL_V_3_4 is not set +# CT_KERNEL_V_3_2 is not set +CT_KERNEL_V_3_2_43=y +# CT_KERNEL_V_2_6_32 is not set +# CT_KERNEL_V_2_6_18 is not set +CT_KERNEL_windows_AVAILABLE=y + +# +# Common kernel options +# +CT_SHARED_LIBS=y + +# +# linux other options +# +# CT_KERNEL_LINUX_VERBOSITY_0 is not set +CT_KERNEL_LINUX_VERBOSITY_1=y +# CT_KERNEL_LINUX_VERBOSITY_2 is not set +CT_KERNEL_LINUX_VERBOSE_LEVEL=1 +CT_KERNEL_LINUX_INSTALL_CHECK=y + +# +# Binary utilities +# +CT_ARCH_BINFMT_ELF=y +CT_BINUTILS="binutils" +CT_BINUTILS_binutils=y + +# +# GNU binutils +# +# CT_BINUTILS_CUSTOM is not set +CT_BINUTILS_VERSION="2.27" +# CT_CC_BINUTILS_SHOW_LINARO is not set +CT_BINUTILS_V_2_27=y +# CT_BINUTILS_V_2_25_1 is not set +# CT_BINUTILS_V_2_24 is not set +# CT_BINUTILS_V_2_23_2 is not set +CT_BINUTILS_2_26_or_later=y +CT_BINUTILS_2_25_1_or_later=y +CT_BINUTILS_2_25_or_later=y +CT_BINUTILS_2_24_or_later=y +CT_BINUTILS_2_23_2_or_later=y +CT_BINUTILS_HAS_HASH_STYLE=y +CT_BINUTILS_HAS_GOLD=y +CT_BINUTILS_GOLD_SUPPORTS_ARCH=y +CT_BINUTILS_HAS_PLUGINS=y +CT_BINUTILS_HAS_PKGVERSION_BUGURL=y +CT_BINUTILS_LINKER_LD=y +CT_BINUTILS_LINKERS_LIST="ld" +CT_BINUTILS_LINKER_DEFAULT="bfd" +CT_BINUTILS_EXTRA_CONFIG_ARRAY="" +CT_BINUTILS_FOR_TARGET=y +CT_BINUTILS_FOR_TARGET_IBERTY=y +CT_BINUTILS_FOR_TARGET_BFD=y +CT_BINUTILS_PLUGINS=y + +# +# binutils other options +# + +# +# C-library +# +CT_LIBC="uClibc" +CT_LIBC_VERSION="0.9.33.2" +# CT_LIBC_glibc is not set +# CT_LIBC_musl is not set +CT_LIBC_uClibc=y +CT_LIBC_avr_libc_AVAILABLE=y +CT_LIBC_glibc_AVAILABLE=y +CT_THREADS="nptl" +CT_LIBC_mingw_AVAILABLE=y +CT_LIBC_musl_AVAILABLE=y +CT_LIBC_newlib_AVAILABLE=y +CT_LIBC_none_AVAILABLE=y +CT_LIBC_uClibc_AVAILABLE=y + +CT_LIBC_UCLIBC_CUSTOM=n +CT_LIBC_UCLIBC_NG=n +CT_LIBC_UCLIBC_NG_V_1_0_22=n +CT_LIBC_UCLIBC_NG_V_1_0_21=n +CT_LIBC_UCLIBC_NG_V_1_0_20=n +CT_LIBC_UCLIBC_V_0_9_33_2=y + +CT_LIBC_UCLIBC_PARALLEL=y +# CT_LIBC_UCLIBC_VERBOSITY_0 is not set +# CT_LIBC_UCLIBC_VERBOSITY_1 is not set +CT_LIBC_UCLIBC_VERBOSITY_2=y +CT_LIBC_UCLIBC_VERBOSITY="V=2" +CT_LIBC_UCLIBC_DEBUG_LEVEL_0=y +# CT_LIBC_UCLIBC_DEBUG_LEVEL_1 is not set +# CT_LIBC_UCLIBC_DEBUG_LEVEL_2 is not set +# CT_LIBC_UCLIBC_DEBUG_LEVEL_3 is not set +CT_LIBC_UCLIBC_DEBUG_LEVEL=0 +CT_LIBC_UCLIBC_CONFIG_FILE="" +CT_LIBC_SUPPORT_THREADS_ANY=y +CT_LIBC_SUPPORT_THREADS_NATIVE=y +CT_LIBC_SUPPORT_THREADS_LT=y +CT_LIBC_SUPPORT_THREADS_NONE=y + +# +# Common C library options +# +CT_THREADS_NATIVE=y +# CT_THREADS_LT is not set +# CT_THREADS_NONE is not set +CT_LIBC_XLDD=y + +# +# uClibc other options +# +CT_LIBC_UCLIBC_LNXTHRD="" +# CT_LIBC_UCLIBC_LOCALES is not set +CT_LIBC_UCLIBC_IPV6=y +CT_LIBC_UCLIBC_WCHAR=y +# CT_LIBC_UCLIBC_FENV is not set + +# +# C compiler +# +CT_CC="gcc" +CT_CC_CORE_PASSES_NEEDED=y +CT_CC_CORE_PASS_1_NEEDED=y +CT_CC_CORE_PASS_2_NEEDED=y +CT_CC_gcc=y +# CT_CC_GCC_CUSTOM is not set +CT_CC_GCC_VERSION="6.3.0" +# CT_CC_GCC_SHOW_LINARO is not set +CT_CC_GCC_V_6_3_0=y +# CT_CC_GCC_V_6_1_0 is not set +# CT_CC_GCC_V_5_4_0 is not set +# CT_CC_GCC_V_4_9_3 is not set +# CT_CC_GCC_V_4_8_5 is not set +CT_CC_GCC_4_8_or_later=y +CT_CC_GCC_4_9_or_later=y +CT_CC_GCC_5_or_later=y +CT_CC_GCC_6=y +CT_CC_GCC_6_or_later=y +CT_CC_GCC_HAS_GRAPHITE=y +CT_CC_GCC_USE_GRAPHITE=y +CT_CC_GCC_HAS_LTO=y +CT_CC_GCC_USE_LTO=y +CT_CC_GCC_HAS_PKGVERSION_BUGURL=y +CT_CC_GCC_HAS_BUILD_ID=y +CT_CC_GCC_HAS_LNK_HASH_STYLE=y +CT_CC_GCC_USE_GMP_MPFR=y +CT_CC_GCC_USE_MPC=y +CT_CC_GCC_HAS_LIBQUADMATH=y +CT_CC_GCC_HAS_LIBSANITIZER=y +CT_CC_LANG_FORTRAN=y +CT_CC_GCC_ENABLE_CXX_FLAGS="" +CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY="" +CT_CC_GCC_EXTRA_CONFIG_ARRAY="" +CT_CC_GCC_STATIC_LIBSTDCXX=y +# CT_CC_GCC_SYSTEM_ZLIB is not set +# This does not work but it seems currently possible +# to hack it and use the stage2 liblto.so as long as +# you manually copy it to the right place. For conda +# compiler packages, we add it to binutils, since it +# is executed by programs in that package. +# Really, needs a CT_MOSTLY_STATIC_TOOLCHAIN config +# option that uses -fPIC for all companion libs and +# builds them statically and then the exes are just +# dynamic exes that happen to link only to glibc in +# a dynamic way. +CT_CC_GCC_ENABLE_PLUGINS=n + +# +# Optimisation features +# + +# +# Settings for libraries running on target +# +CT_CC_GCC_ENABLE_TARGET_OPTSPACE=y +# CT_CC_GCC_LIBMUDFLAP is not set +# CT_CC_GCC_LIBGOMP is not set +# CT_CC_GCC_LIBSSP is not set +# CT_CC_GCC_LIBQUADMATH is not set + +# +# Misc. obscure options. +# +CT_CC_CXA_ATEXIT=y +# CT_CC_GCC_DISABLE_PCH is not set +CT_CC_GCC_SJLJ_EXCEPTIONS=m +CT_CC_GCC_LDBL_128=m +# CT_CC_GCC_BUILD_ID is not set +CT_CC_GCC_LNK_HASH_STYLE_DEFAULT=y +# CT_CC_GCC_LNK_HASH_STYLE_SYSV is not set +# CT_CC_GCC_LNK_HASH_STYLE_GNU is not set +# CT_CC_GCC_LNK_HASH_STYLE_BOTH is not set +CT_CC_GCC_LNK_HASH_STYLE="" +CT_CC_GCC_DEC_FLOAT_AUTO=y +# CT_CC_GCC_DEC_FLOAT_BID is not set +# CT_CC_GCC_DEC_FLOAT_DPD is not set +# CT_CC_GCC_DEC_FLOATS_NO is not set +CT_CC_SUPPORT_CXX=y +CT_CC_SUPPORT_FORTRAN=y +CT_CC_SUPPORT_JAVA=y +CT_CC_SUPPORT_ADA=y +CT_CC_SUPPORT_OBJC=y +CT_CC_SUPPORT_OBJCXX=y +CT_CC_SUPPORT_GOLANG=y + +# +# Additional supported languages: +# +CT_CC_LANG_CXX=y +# CT_CC_LANG_JAVA is not set +# CT_CC_LANG_ADA is not set +CT_CC_LANG_OBJC=y +CT_CC_LANG_OBJCXX=y +# CT_CC_LANG_GOLANG is not set +CT_CC_LANG_OTHERS="" + +# +# Debug facilities +# +# CT_DEBUG_dmalloc is not set +# CT_DEBUG_duma is not set +# CT_DEBUG_gdb is not set +# CT_DEBUG_ltrace is not set +# CT_DEBUG_strace is not set + +# +# Companion libraries +# +CT_COMPLIBS_NEEDED=y +CT_GMP_NEEDED=y +CT_MPFR_NEEDED=y +CT_ISL_NEEDED=y +CT_MPC_NEEDED=y +CT_COMPLIBS=y +CT_GMP=y +CT_MPFR=y +CT_ISL=y +CT_MPC=y +CT_GMP_V_6_1_2=y +# CT_GMP_V_6_0_0 is not set +# CT_GMP_V_5_1_3 is not set +# CT_GMP_V_5_1_1 is not set +# CT_GMP_V_5_0_2 is not set +# CT_GMP_V_5_0_1 is not set +# CT_GMP_V_4_3_2 is not set +# CT_GMP_V_4_3_1 is not set +# CT_GMP_V_4_3_0 is not set +CT_GMP_5_0_2_or_later=y +CT_GMP_VERSION="6.1.2" +CT_MPFR_V_3_1_5=y +# CT_MPFR_V_3_1_2 is not set +# CT_MPFR_V_3_1_0 is not set +# CT_MPFR_V_3_0_1 is not set +# CT_MPFR_V_3_0_0 is not set +# CT_MPFR_V_2_4_2 is not set +# CT_MPFR_V_2_4_1 is not set +# CT_MPFR_V_2_4_0 is not set +CT_MPFR_VERSION="3.1.5" +CT_ISL_V_0_18=y +# CT_ISL_V_0_12_2 is not set +CT_ISL_V_0_14_or_later=y +CT_ISL_V_0_12_or_later=y +CT_ISL_VERSION="0.18" +CT_MPC_V_1_0_3=y +# CT_MPC_V_1_0_2 is not set +# CT_MPC_V_1_0_1 is not set +# CT_MPC_V_1_0 is not set +# CT_MPC_V_0_9 is not set +# CT_MPC_V_0_8_2 is not set +# CT_MPC_V_0_8_1 is not set +# CT_MPC_V_0_7 is not set +CT_MPC_VERSION="1.0.3" + +# +# Companion libraries common options +# +# CT_COMPLIBS_CHECK is not set + +# +# Companion tools +# + +# +# READ HELP before you say 'Y' below !!! +# +# CT_COMP_TOOLS is not set + +# +# Test suite +# +# CT_TEST_SUITE_GCC is not set diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/get_cpu_arch.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/get_cpu_arch.sh new file mode 100644 index 0000000000000000000000000000000000000000..b7ec10f51bb3d6f9d3709715366948dd28dd0a4c --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/get_cpu_arch.sh @@ -0,0 +1,35 @@ +get_cpu_arch() { + local CPU_ARCH + if [[ "$1" == *"-64" ]]; then + CPU_ARCH="x86_64" + elif [[ "$1" == *"-ppc64le" ]]; then + CPU_ARCH="powerpc64le" + elif [[ "$1" == *"-aarch64" ]]; then + CPU_ARCH="aarch64" + elif [[ "$1" == *"-s390x" ]]; then + CPU_ARCH="s390x" + else + echo "Unknown architecture" + exit 1 + fi + echo $CPU_ARCH +} + +get_triplet() { + if [[ "$1" == linux-* ]]; then + echo "$(get_cpu_arch $1)-conda-linux-gnu" + elif [[ "$1" == osx-64 ]]; then + echo "x86_64-apple-darwin13.4.0" + elif [[ "$1" == osx-arm64 ]]; then + echo "arm64-apple-darwin20.0.0" + elif [[ "$1" == win-64 ]]; then + echo "x86_64-w64-mingw32" + else + echo "unknown platform" + exit 1 + fi +} + +export BUILD="$(get_triplet $build_platform)" +export HOST="$(get_triplet $target_platform)" +export TARGET="$(get_triplet $cross_target_platform)" diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/hello-world.cpp b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/hello-world.cpp new file mode 100644 index 0000000000000000000000000000000000000000..abdfa651565e60579d61d05bc45afd98be1d3457 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/hello-world.cpp @@ -0,0 +1,7 @@ +#include + +int main(int argc, char * argv[]) +{ + std::cout << "Hello World!\n" << std::endl; + return 0; +} diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-conda-specs.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-conda-specs.sh new file mode 100644 index 0000000000000000000000000000000000000000..01a4d1c950f9d00380efc5a2df4efb96753b87d3 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-conda-specs.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh + +set -ex +export CHOST="${triplet}" +specdir=$PREFIX/lib/gcc/$CHOST/${gcc_version} +if [[ "$cross_target_platform" == "$target_platform" ]]; then + install -Dm644 -T ${SRC_DIR}/build/gcc/specs $specdir/conda.specs + + # Add specs when we're not cross compiling so that the toolchain works more like a system + # toolchain (i.e. conda installed libs can be #include <>'d and linked without adding any + # cmdline args or FLAGS and likewise the assumptions we have about rpath are built in) + # + # THIS IS INTENDED as a safety net for casual users who just want the native toolchain to work. + # It is not to be relied on by conda-forge package recipes and best practice is still to set the + # appropriate FLAGS vars (either via compiler activation scripts or explicitly in the recipe) + # + # We use double quotes here because we want $PREFIX and $CHOST to be expanded at build time + # and recorded in the specs file. It will undergo a prefix replacement when our compiler + # package is installed. + sed -i -e "/\*link_command:/,+1 s+%.*+& %{\!static:-rpath ${PREFIX}/lib -rpath-link ${PREFIX}/lib} -L ${PREFIX}/lib/stubs -L ${PREFIX}/lib+" $specdir/conda.specs + if [[ "$cross_target_platform" != "win-"* ]]; then + # put -disable-new-dtags at the front of the cmdline so that user provided -enable-new-dtags (in %l) can override it + sed -i -e "/\*link_command:/,+1 s+%(linker)+& -disable-new-dtags +" $specdir/conda.specs + fi + # use -idirafter to put the conda "system" includes where /usr/local/include would typically go + # in a system-packaged non-cross compiler + sed -i -e "/\*cpp_options:/,+1 s+%.*+& -idirafter ${PREFIX}/include+" $specdir/conda.specs + # cc1_options also get used for cc1plus... at least in 11.2.0 + sed -i -e "/\*cc1_options:/,+1 s+%.*+& -idirafter ${PREFIX}/include+" $specdir/conda.specs + +else + # does it even make sense to do anything here? Could do something with %:getenv(BUILD_PREFIX /include) + # but in the case that we aren't inside conda-build, it will cause gcc to fatal + # because it won't be set. Just explicitly making this fail for now so that the meta.yaml + # is consitent with when it creates the conda-gcc-specs package + false +fi diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-g++.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-g++.sh new file mode 100644 index 0000000000000000000000000000000000000000..f1cf84ba32fb914e5ef29ee9b11a6195049534f5 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-g++.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" +_libdir=libexec/gcc/${CHOST}/${PKG_VERSION} + +# libtool wants to use ranlib that is here, macOS install doesn't grok -t etc +# .. do we need this scoped over the whole file though? +#export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${CHOST}/buildtools/bin:${SRC_DIR}/.build/tools/bin:${PATH} + +pushd ${SRC_DIR}/build + +make -C gcc prefix=${PREFIX} c++.install-common + +# How it used to be: +# install -m755 -t ${PREFIX}/bin/ gcc/{cc1plus,lto1} +for file in cc1plus; do + if [[ -f gcc/${file}${EXEEXT} ]]; then + install -c gcc/${file}${EXEEXT} ${PREFIX}/${_libdir}/${file}${EXEEXT} + fi +done + +# Following 3 are in libstdcxx-devel +#make -C $CHOST/libstdc++-v3/src prefix=${PREFIX} install +#make -C $CHOST/libstdc++-v3/include prefix=${PREFIX} install +#make -C $CHOST/libstdc++-v3/libsupc++ prefix=${PREFIX} install +make -C $CHOST/libstdc++-v3/python prefix=${PREFIX} install + +# Probably don't want to do this for cross-compilers +# mkdir -p ${PREFIX}/share/gdb/auto-load/usr/lib/ +# cp ${SRC_DIR}/gcc_built/${CHOST}/sysroot/lib/libstdc++.so.6.*-gdb.py ${PREFIX}/share/gdb/auto-load/usr/lib/ + +make -C libcpp prefix=${PREFIX} install + +popd + +mkdir -p ${PREFIX}/lib/gcc/${CHOST}/${PKG_VERSION} + +set +x +# Strip executables, we may want to install to a different prefix +# and strip in there so that we do not change files that are not +# part of this package. +pushd ${PREFIX} + _files=$(find bin libexec -type f -not -name '*.dll') + for _file in ${_files}; do + _type="$( file "${_file}" | cut -d ' ' -f 2- )" + case "${_type}" in + *script*executable*) + ;; + *executable*) + ${BUILD_PREFIX}/bin/${CHOST}-strip --strip-all -v "${_file}" || : + ;; + esac + done +popd + +source ${RECIPE_DIR}/make_tool_links.sh diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-gcc.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-gcc.sh new file mode 100644 index 0000000000000000000000000000000000000000..da5e0e54e5b5cfd10c4e0b3b0e70bf30a61baf23 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-gcc.sh @@ -0,0 +1,262 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +_libdir=libexec/gcc/${TARGET}/${PKG_VERSION} + +# libtool wants to use ranlib that is here, macOS install doesn't grok -t etc +# .. do we need this scoped over the whole file though? +#export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${TARGET}/buildtools/bin:${SRC_DIR}/.build/tools/bin:${PATH} + +pushd ${SRC_DIR}/build + # We may not have built with plugin support so failure here is not fatal: + make prefix=${PREFIX} install-lto-plugin || true + + sed -i.bak 's/install-collect2: collect2 /install-collect2: collect2$(exeext) /g' gcc/Makefile + make -C gcc prefix=${PREFIX} install-driver install-cpp install-gcc-ar install-headers install-plugin install-lto-wrapper install-collect2 + # not sure if this is the same as the line above. Run both, just in case + make -C lto-plugin prefix=${PREFIX} install + install -dm755 ${PREFIX}/lib/bfd-plugins/ + + # statically linked, so this so does not exist + # ln -s $PREFIX/lib/gcc/$TARGET/liblto_plugin.so ${PREFIX}/lib/bfd-plugins/ + + make -C libcpp prefix=${PREFIX} install + + # Include languages we do not have any other place for here (and also lto1) + for file in gnat1 brig1 cc1 go1 lto1 cc1obj cc1objplus; do + if [[ -f gcc/${file}${EXEEXT} ]]; then + install -c gcc/${file}${EXEEXT} ${PREFIX}/${_libdir}/${file}${EXEEXT} + fi + done + + # https://github.com/gcc-mirror/gcc/blob/gcc-7_3_0-release/gcc/Makefile.in#L3481-L3526 + # Could have used install-common, but it also installs cxx binaries, which we + # don't want in this package. We could patch it, or use the loop below: + for file in gcov{,-tool,-dump}; do + if [[ -f gcc/${file}${EXEEXT} ]]; then + install -c gcc/${file}${EXEEXT} ${PREFIX}/bin/${TARGET}-${file}${EXEEXT} + fi + done + + make prefix=${PREFIX}/lib/gcc/${TARGET}/${gcc_version} install-libcc1 + install -d ${PREFIX}/share/gdb/auto-load/usr/lib + + make prefix=${PREFIX} install-fixincludes + make -C gcc prefix=${PREFIX} install-mkheaders + + if [[ -d ${TARGET}/libatomic ]]; then + make -C ${TARGET}/libatomic prefix=${PREFIX} install + fi + + if [[ -d ${TARGET}/libgomp ]]; then + make -C ${TARGET}/libgomp prefix=${PREFIX} install + fi + + if [[ -d ${TARGET}/libitm ]]; then + make -C ${TARGET}/libitm prefix=${PREFIX} install + fi + + if [[ -d ${TARGET}/libquadmath ]]; then + make -C ${TARGET}/libquadmath prefix=${PREFIX} install + fi + + if [[ -d ${TARGET}/libsanitizer ]]; then + make -C ${TARGET}/libsanitizer prefix=${PREFIX} install + fi + + if [[ -d ${TARGET}/libsanitizer/asan ]]; then + make -C ${TARGET}/libsanitizer/asan prefix=${PREFIX} install + fi + + if [[ -d ${TARGET}/libsanitizer/tsan ]]; then + make -C ${TARGET}/libsanitizer/tsan prefix=${PREFIX} install + fi + + make -C libiberty prefix=${PREFIX} install + # install PIC version of libiberty + if [[ "${TARGET}" != *mingw* ]]; then + install -m644 libiberty/pic/libiberty.a ${PREFIX}/lib/gcc/${TARGET}/${gcc_version} + else + install -m644 libiberty/libiberty.a ${PREFIX}/lib/gcc/${TARGET}/${gcc_version} + fi + + make -C gcc prefix=${PREFIX} install-man install-info + + make -C gcc prefix=${PREFIX} install-po + + # many packages expect this symlink + [[ -f ${PREFIX}/bin/${TARGET}-cc${EXEEXT} ]] && rm ${PREFIX}/bin/${TARGET}-cc${EXEEXT} + pushd ${PREFIX}/bin + if [[ "${HOST}" != *mingw* ]]; then + ln -s ${TARGET}-gcc${EXEEXT} ${TARGET}-cc${EXEEXT} + else + cp ${TARGET}-gcc${EXEEXT} ${TARGET}-cc${EXEEXT} + fi + popd + + # POSIX conformance launcher scripts for c89 and c99 + cat > ${PREFIX}/bin/${TARGET}-c89${EXEEXT} <<"EOF" +#!/bin/sh +fl="-std=c89" +for opt; do + case "$opt" in + -ansi|-std=c89|-std=iso9899:1990) fl="";; + -std=*) echo "`basename $0` called with non ANSI/ISO C option $opt" >&2 + exit 1;; + esac +done +exec ${TARGET}-c89${EXEEXT} $fl ${1+"$@"} +EOF + + cat > ${PREFIX}/bin/${TARGET}-c99${EXEEXT} <<"EOF" +#!/bin/sh +fl="-std=c99" +for opt; do + case "$opt" in + -std=c99|-std=iso9899:1999) fl="";; + -std=*) echo "`basename $0` called with non ISO C99 option $opt" >&2 + exit 1;; + esac +done +exec ${TARGET}-c99${EXEEXT} $fl ${1+"$@"} +EOF + + chmod 755 ${PREFIX}/bin/${TARGET}-c{8,9}9${EXEEXT} + + rm ${PREFIX}/bin/${TARGET}-gcc-${PKG_VERSION}${EXEEXT} + +popd + +# generate specfile so that we can patch loader link path +# link_libgcc should have the gcc's own libraries by default (-R) +# so that LD_LIBRARY_PATH isn't required for basic libraries. +# +# GF method here to create specs file and edit it. The other methods +# tried had no effect on the result. including: +# setting LINK_LIBGCC_SPECS on configure +# setting LINK_LIBGCC_SPECS on make +# setting LINK_LIBGCC_SPECS in gcc/Makefile +specdir=$PREFIX/lib/gcc/$TARGET/${gcc_version} +if [[ "$build_platform" == "$target_platform" ]]; then + $PREFIX/bin/${TARGET}-gcc${EXEEXT} -dumpspecs > $specdir/specs + # validate assumption that specs in build/gcc/specs are exactly the + # same as dumped specs so that I don't need to depend on gcc_impl in conda-gcc-specs subpackage + diff -s ${SRC_DIR}/build/gcc/specs $specdir/specs +elif [[ "$target_platform" == "$cross_target_platform" && ${TARGET} != *mingw* ]]; then + # For support of of native specs, we need this + # This is the only place where we need QEMU. + # Remove this elif condition for local experimentation if you + # do not have QEMU setup + $PREFIX/bin/${TARGET}-gcc -dumpspecs > $specdir/specs +else + $BUILD_PREFIX/bin/${TARGET}-gcc -dumpspecs > $specdir/specs + # validate assumption that specs in build/gcc/specs are exactly the + # same as dumped specs so that I don't need to depend on gcc_impl in conda-gcc-specs subpackage + diff -s ${SRC_DIR}/build/gcc/specs $specdir/specs +fi + +# make a copy of the specs without our additions so that people can choose not to use them +# by passing -specs=builtin.specs +cp $specdir/specs $specdir/builtin.specs + +# modify the default specs to only have %include_noerr that includes an optional conda.specs +# package installable via the conda-gcc-specs package where conda.specs (for $cross_target_platform +# == $target_platform) will add the minimal set of flags for the 'native' toolchains to be useable +# without anything additional set in the enviornment or extra cmdline args. +echo "%include_noerr " >> $specdir/specs + +# We use double quotes here because we want $PREFIX and $TARGET to be expanded at build time +# and recorded in the specs file. It will undergo a prefix replacement when our compiler +# package is installed. +sed -i -e "/\*link_command:/,+1 s+%.*+& %{!static:-rpath ${PREFIX}/lib}+" $specdir/specs + + +# Install Runtime Library Exception +install -Dm644 $SRC_DIR/COPYING.RUNTIME \ + ${PREFIX}/share/licenses/gcc/RUNTIME.LIBRARY.EXCEPTION + +set +x +# Strip executables, we may want to install to a different prefix +# and strip in there so that we do not change files that are not +# part of this package. +pushd ${PREFIX} + _files=$(find bin libexec -type f -not -name '*.dll') + for _file in ${_files}; do + _type="$( file "${_file}" | cut -d ' ' -f 2- )" + case "${_type}" in + *script*executable*) + ;; + *executable*) + ${BUILD_PREFIX}/bin/${TARGET}-strip --strip-all -v "${_file}" || : + ;; + esac + done +popd + +set -x + +#${PREFIX}/bin/${TARGET}-gcc "${RECIPE_DIR}"/c11threads.c -std=c11 + +mkdir -p ${PREFIX}/${TARGET}/lib +mkdir -p ${PREFIX}/lib/gcc/${TARGET}/${gcc_version} + +if [[ "$target_platform" == "$cross_target_platform" ]]; then + # making these this way so conda build doesn't muck with them + pushd ${PREFIX}/${TARGET}/lib + if [[ "${TARGET}" != *mingw* ]]; then + ln -sf ../../lib/libgomp.so libgomp.so + for lib in libgfortran libatomic libquadmath libitm lib{a,hwa,l,ub,t}san; do + for f in ${PREFIX}/lib/${lib}.so*; do + ln -s ../../lib/$(basename $f) ${PREFIX}/${TARGET}/lib/$(basename $f) + done + done + fi + + for f in ${PREFIX}/lib/*.spec; do + mv $f ${PREFIX}/${TARGET}/lib/$(basename $f) + done + if [[ "${TARGET}" != *mingw* ]]; then + for f in ${PREFIX}/lib/*.o; do + mv $f ${PREFIX}/${TARGET}/lib/$(basename $f) + done + fi + popd + for lib in asan atomic gomp hwasan itm lsan quadmath tsan ubsan; do + if [[ -f "${PREFIX}/lib/lib${lib}.a" ]]; then + mv ${PREFIX}/lib/lib${lib}.*a ${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/ + fi + done + for lib in libasan.so libatomic.so libgomp.so libhwasan.so libitm.so liblsan.so libquadmath.so libtsan.so libubsan.so libstdc++.so libstdc++.so.6 libgcc_s.so; do + if [[ -f "${PREFIX}/lib/${lib}" ]]; then + # install a shared library here since the directory ${PREFIX}/lib/gcc/${TARGET}/${gcc_version} + # has the highest preference and we want shared libraries to have the highest preference + rm ${PREFIX}/lib/${lib} + ln -sf ${PREFIX}/lib/${lib} ${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/ + fi + done +else + source ${RECIPE_DIR}/install-libgcc.sh + for lib in libcc1; do + mv ${PREFIX}/lib/${lib}.so* ${PREFIX}/${TARGET}/lib/ || true + mv ${PREFIX}/lib/${lib}.so* ${PREFIX}/${TARGET}/lib/ || true + done + rm -f ${PREFIX}/share/info/*.info + for lib in asan atomic gomp hwasan itm lsan quadmath tsan ubsan; do + if [[ -f "${PREFIX}/${TARGET}/lib/lib${lib}.a" ]]; then + mv ${PREFIX}/${TARGET}/lib/lib${lib}.*a ${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/ + fi + if [[ -f "${PREFIX}/${TARGET}/lib/lib${lib}.so" ]]; then + ln -sf ${PREFIX}/${TARGET}/lib/lib${lib}.so ${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/ + fi + done +fi + +if [[ -f ${PREFIX}/lib/libgomp.spec ]]; then + mv ${PREFIX}/lib/libgomp.spec ${PREFIX}/${TARGET}/lib/libgomp.spec +fi + +rm -f ${PREFIX}/share/info/dir + +source ${RECIPE_DIR}/make_tool_links.sh diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-gdb-pretty-printer.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-gdb-pretty-printer.sh new file mode 100644 index 0000000000000000000000000000000000000000..c73dfd015673e079a1d2df9e656fb2e20d7bca1a --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-gdb-pretty-printer.sh @@ -0,0 +1,10 @@ +set -e -x + +# install gcc's gdbhooks ... +mkdir -p "$SP_DIR"/gcc +cp $SRC_DIR/gcc/gcc/gdbhooks.py "$SP_DIR"/gcc/. + +# install libstdc++'s pretty printer support +cp -r $SRC_DIR/gcc/libstdc++-v3/python/libstdcxx "$SP_DIR"/. + +exit 0 diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-gfortran.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-gfortran.sh new file mode 100644 index 0000000000000000000000000000000000000000..46d877def15e561206381f98e1db227944f02256 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-gfortran.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" +_libdir=libexec/gcc/${CHOST}/${PKG_VERSION} + +# libtool wants to use ranlib that is here, macOS install doesn't grok -t etc +# .. do we need this scoped over the whole file though? +#export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${CHOST}/buildtools/bin:${SRC_DIR}/.build/tools/bin:${PATH} + +pushd ${SRC_DIR}/build + +# adapted from Arch install script from https://github.com/archlinuxarm/PKGBUILDs/blob/master/core/gcc/PKGBUILD +# We cannot make install since .la files are not relocatable so libtool deliberately prevents it: +# libtool: install: error: cannot install `libgfortran.la' to a directory not ending in ${SRC_DIR}/work/gcc_built/${CHOST}/lib/../lib +make -C ${CHOST}/libgfortran prefix=${PREFIX} all-multi libgfortran.spec ieee_arithmetic.mod ieee_exceptions.mod ieee_features.mod config.h +make -C gcc prefix=${PREFIX} fortran.install-{common,man,info} + +# How it used to be: +# install -Dm755 gcc/f951 ${PREFIX}/${_libdir}/f951 +for file in f951; do + if [[ -f gcc/${file}${EXEEXT} ]]; then + install -c gcc/${file}${EXEEXT} ${PREFIX}/${_libdir}/${file}${EXEEXT} + fi +done + +mkdir -p ${PREFIX}/${CHOST}/lib +cp ${CHOST}/libgfortran/libgfortran.spec ${PREFIX}/${CHOST}/lib + +pushd ${PREFIX}/bin + if [[ "${target_platform}" != "win-64" ]]; then + ln -sf ${CHOST}-gfortran${EXEEXT} ${CHOST}-f95${EXEEXT} + else + cp ${CHOST}-gfortran${EXEEXT} ${CHOST}-f95${EXEEXT} + fi +popd + +make install DESTDIR=$SRC_DIR/build-finclude +mkdir -p $PREFIX/lib/gcc/${CHOST}/${gcc_version}/finclude +mkdir -p $PREFIX/lib/gcc/${CHOST}/${gcc_version}/include +install -Dm644 $SRC_DIR/build-finclude/$PREFIX/lib/gcc/${CHOST}/${gcc_version}/finclude/* $PREFIX/lib/gcc/${CHOST}/${gcc_version}/finclude/ +install -Dm644 $SRC_DIR/build-finclude/$PREFIX/lib/gcc/${CHOST}/${gcc_version}/include/*.h $PREFIX/lib/gcc/${CHOST}/${gcc_version}/include/ + +# Install Runtime Library Exception +install -Dm644 $SRC_DIR/COPYING.RUNTIME \ + ${PREFIX}/share/licenses/gcc-fortran/RUNTIME.LIBRARY.EXCEPTION + +if [[ "${target_platform}" != "${cross_target_platform}" ]]; then + if [[ ${triplet} == *linux* ]]; then + cp -f --no-dereference ${SRC_DIR}/build/${CHOST}/libgfortran/.libs/libgfortran*.so* ${PREFIX}/${CHOST}/lib/ + fi +fi +cp -f --no-dereference ${SRC_DIR}/build/${CHOST}/libgfortran/.libs/libgfortran.*a ${PREFIX}/${CHOST}/lib/ + +set +x +# Strip executables, we may want to install to a different prefix +# and strip in there so that we do not change files that are not +# part of this package. +pushd ${PREFIX} + _files=$(find bin libexec -type f -not -name '*.dll') + for _file in ${_files}; do + _type="$( file "${_file}" | cut -d ' ' -f 2- )" + case "${_type}" in + *script*executable*) + ;; + *executable*) + ${BUILD_PREFIX}/bin/${CHOST}-strip --strip-all -v "${_file}" || : + ;; + esac + done +popd + +if [[ -f ${PREFIX}/lib/libgomp.spec ]]; then + mv ${PREFIX}/lib/libgomp.spec ${PREFIX}/${CHOST}/lib/libgomp.spec +fi + +rm -f ${PREFIX}/share/info/dir + +source ${RECIPE_DIR}/make_tool_links.sh diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libgcc-devel.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libgcc-devel.sh new file mode 100644 index 0000000000000000000000000000000000000000..6ba08fc16608017c3a0545c4d8984f9aa7586a25 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libgcc-devel.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" + +# libtool wants to use ranlib that is here, macOS install doesn't grok -t etc +# .. do we need this scoped over the whole file though? +#export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${CHOST}/buildtools/bin:${SRC_DIR}/.build/tools/bin:${PATH} + +pushd ${SRC_DIR}/build + +make -C ${CHOST}/libgcc prefix=${PREFIX} install + +# ${PREFIX}/lib/libgcc_s.so* goes into libgcc output, but +# avoid that the equivalents in ${PREFIX}/${CHOST}/lib end up +# in gcc_impl_{{ cross_target_platform }}, c.f. install-gcc.sh +mkdir -p ${PREFIX}/${CHOST}/lib +if [[ "${triplet}" == *linux* ]]; then + mv ${PREFIX}/lib/libgcc_s.so* ${PREFIX}/${CHOST}/lib +else + # import library, not static library + mv ${PREFIX}/lib/libgcc_s.a ${PREFIX}/${CHOST}/lib + rm ${PREFIX}/lib/libgcc_s*.dll || true +fi +# This is in gcc_impl as it is gcc specific and clang has the same header +rm -rf ${PREFIX}/lib/gcc/${CHOST}/${gcc_version}/include/unwind.h + +popd + diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libgcc-no-gomp.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libgcc-no-gomp.sh new file mode 100644 index 0000000000000000000000000000000000000000..e792608072235cedbc2836ec05a7bc9326d53862 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libgcc-no-gomp.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" + +# we have to remove existing links/files so that the libgcc install works +rm -rf ${PREFIX}/lib/* +rm -rf ${PREFIX}/share/* +rm -f ${PREFIX}/${CHOST}/lib/libgomp* + +# now run install of libgcc +# this reinstalls the wrong symlinks for openmp +source ${RECIPE_DIR}/install-libgcc.sh + +# remove and relink things for openmp +rm -f ${PREFIX}/lib/libgomp.so +rm -f ${PREFIX}/${CHOST}/lib/libgomp.so +rm -f ${PREFIX}/lib/libgomp.so.${libgomp_ver:0:1} +rm -f ${PREFIX}/${CHOST}/lib/libgomp.so.${libgomp_ver:0:1} +rm -f ${PREFIX}/${CHOST}/lib/libgomp.so.${libgomp_ver} + +# (re)make the right links +# note that this code is remaking more links than the ones we want in this +# package but that is ok +pushd ${PREFIX}/lib + if [[ "${TARGET}" != *mingw* ]]; then + ln -s libgomp.so.${libgomp_ver} libgomp.so.${libgomp_ver:0:1} + fi +popd diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libgcc.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libgcc.sh new file mode 100644 index 0000000000000000000000000000000000000000..34a2effaa2d99c20bf30004b03a5fed5ba1fdbdb --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libgcc.sh @@ -0,0 +1,82 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +# libtool wants to use ranlib that is here, macOS install doesn't grok -t etc +# .. do we need this scoped over the whole file though? +#export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${TARGET}/buildtools/bin:${SRC_DIR}/.build/tools/bin:${PATH} + +pushd ${SRC_DIR}/build + + if [[ "${PKG_NAME}" == "libgcc" ]]; then + make -C ${TARGET}/libgcc prefix=${PREFIX} install-shared + if [[ "${TARGET}" == *mingw* ]]; then + mv $PREFIX/lib/libgcc_s*.dll $PREFIX/bin + fi + elif [[ "${PKG_NAME}" != "gcc_impl"* ]]; then + # when building a cross compiler, above make line will clobber $PREFIX/lib/libgcc_s.so.1 + # and fail after some point for some architectures. To avoid that, we copy manually + pushd ${TARGET}/libgcc + mkdir -p ${PREFIX}/lib/gcc/${TARGET}/${gcc_version} + install -c -m 644 libgcc_eh.a ${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/libgcc_eh.a + chmod 644 ${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/libgcc_eh.a + ${TARGET}-ranlib ${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/libgcc_eh.a + + mkdir -p ${PREFIX}/${TARGET}/lib + if [[ "${triplet}" == *linux* ]]; then + install -c -m 644 ./libgcc_s.so.1 ${PREFIX}/${TARGET}/lib/libgcc_s.so.1 + cp $RECIPE_DIR/libgcc_s.so.ldscript ${PREFIX}/${TARGET}/lib/libgcc_s.so + else + # import library, not static library + install -c -m 644 ./shlib/libgcc_s.a ${PREFIX}/${TARGET}/lib/libgcc_s.a + fi + popd + fi + + # TODO :: Also do this for libgfortran (and libstdc++ too probably?) + if [[ -f ${TARGET}/libsanitizer/libtool ]]; then + sed -i.bak 's/.*cannot install.*/func_warning "Ignoring libtool error about cannot install to a directory not ending in"/' \ + ${TARGET}/libsanitizer/libtool + fi + for lib in libatomic libgomp libquadmath libitm libvtv libsanitizer/{a,hwa,l,ub,t}san; do + # TODO :: Also do this for libgfortran (and libstdc++ too probably?) + if [[ -f ${TARGET}/${lib}/libtool ]]; then + sed -i.bak 's/.*cannot install.*/func_warning "Ignoring libtool error about cannot install to a directory not ending in"/' \ + ${TARGET}/${lib}/libtool + fi + if [[ -d ${TARGET}/${lib} ]]; then + make -C ${TARGET}/${lib} prefix=${PREFIX} install-toolexeclibLTLIBRARIES + make -C ${TARGET}/${lib} prefix=${PREFIX} install-nodist_fincludeHEADERS || true + fi + done + + for lib in libgomp libquadmath; do + if [[ -d ${TARGET}/${lib} ]]; then + make -C ${TARGET}/${lib} prefix=${PREFIX} install-info + fi + done + +popd + +mkdir -p ${PREFIX}/lib + +if [[ "${PKG_NAME}" != "gcc_impl"* ]]; then + # no static libs + find ${PREFIX}/lib -name "*\.a" -exec rm -rf {} \; +fi +# no libtool files +find ${PREFIX}/lib -name "*\.la" -exec rm -rf {} \; + +if [[ "${PKG_NAME}" != gcc_impl* ]]; then + # mv ${PREFIX}/${TARGET}/lib/* ${PREFIX}/lib + # clean up empty folder + rm -rf ${PREFIX}/lib/gcc + rm -rf ${PREFIX}/lib/lib{a,hwa,l,ub,t}san.so* + + # Install Runtime Library Exception + install -Dm644 ${SRC_DIR}/COPYING.RUNTIME \ + ${PREFIX}/share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION +fi + +rm -f ${PREFIX}/share/info/dir diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libgfortran.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libgfortran.sh new file mode 100644 index 0000000000000000000000000000000000000000..031da5eca76ae9762aa193eb3310b7923fd844c6 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libgfortran.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +rm -f ${PREFIX}/lib/libgfortran* || true + +if [[ "${TARGET}" == *mingw* ]]; then + mkdir -p ${PREFIX}/bin/ + cp ${SRC_DIR}/build/${TARGET}/libgfortran/.libs/libgfortran*.dll ${PREFIX}/bin/ +else + mkdir -p ${PREFIX}/lib + cp -f --no-dereference ${SRC_DIR}/build/${TARGET}/libgfortran/.libs/libgfortran*.so* ${PREFIX}/lib/ +fi + +# Install Runtime Library Exception +install -Dm644 $SRC_DIR/COPYING.RUNTIME \ + ${PREFIX}/share/licenses/libgfortran/RUNTIME.LIBRARY.EXCEPTION diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libgomp.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libgomp.sh new file mode 100644 index 0000000000000000000000000000000000000000..cdd189f59dd81af7df42846c40b9300bf64dcd1e --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libgomp.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh + +cd build + +make -C ${triplet}/libgomp prefix=${PREFIX} install-toolexeclibLTLIBRARIES +rm ${PREFIX}/lib/libgomp.a ${PREFIX}/lib/libgomp.la + +if [[ "$target_platform" == "linux-"* ]]; then + rm ${PREFIX}/lib/libgomp.so.1 + rm ${PREFIX}/lib/libgomp.so + ln -sf ${PREFIX}/lib/libgomp.so.${libgomp_ver} ${PREFIX}/lib/libgomp.so +else + rm ${PREFIX}/lib/libgomp.dll.a +fi + +# Install Runtime Library Exception +install -Dm644 ${SRC_DIR}/COPYING.RUNTIME \ + ${PREFIX}/share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION.gomp_copy diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libsanitizer.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libsanitizer.sh new file mode 100644 index 0000000000000000000000000000000000000000..2ef36d3bb8c750e42929f231de9d22a6e0addd40 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libsanitizer.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" + +mkdir -p ${PREFIX}/lib + +pushd ${SRC_DIR}/build + + # TODO :: Also do this for libgfortran (and libstdc++ too probably?) + sed -i.bak 's/.*cannot install.*/func_warning "Ignoring libtool error about cannot install to a directory not ending in"/' \ + ${CHOST}/libsanitizer/libtool + for lib in libsanitizer/{a,hwa,l,ub,t}san; do + # TODO :: Also do this for libgfortran (and libstdc++ too probably?) + if [[ -f ${CHOST}/${lib}/libtool ]]; then + sed -i.bak 's/.*cannot install.*/func_warning "Ignoring libtool error about cannot install to a directory not ending in"/' \ + ${CHOST}/${lib}/libtool + fi + if [[ -d ${CHOST}/${lib} ]]; then + make -C ${CHOST}/${lib} prefix=${PREFIX} install-toolexeclibLTLIBRARIES + make -C ${CHOST}/${lib} prefix=${PREFIX} install-nodist_fincludeHEADERS || true + fi + done + +popd + +# no static libs +find ${PREFIX}/lib -name "*\.a" -exec rm -rf {} \; +# no libtool files +find ${PREFIX}/lib -name "*\.la" -exec rm -rf {} \; diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libstdc++-devel.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libstdc++-devel.sh new file mode 100644 index 0000000000000000000000000000000000000000..63b0439991dbb35a966fa02069d04899b13420f2 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libstdc++-devel.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" + +# libtool wants to use ranlib that is here, macOS install doesn't grok -t etc +# .. do we need this scoped over the whole file though? +# export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${CHOST}/buildtools/bin:${SRC_DIR}/.build/tools/bin:${PATH} + +pushd ${SRC_DIR}/build + +make -C $CHOST/libstdc++-v3/src prefix=${PREFIX} install +make -C $CHOST/libstdc++-v3/include prefix=${PREFIX} install +make -C $CHOST/libstdc++-v3/libsupc++ prefix=${PREFIX} install + +mkdir -p ${PREFIX}/lib/gcc/${CHOST}/${gcc_version} +mkdir -p ${PREFIX}/${CHOST}/lib + +if [[ "$target_platform" == "$cross_target_platform" ]]; then + mv $PREFIX/lib/lib*.a ${PREFIX}/lib/gcc/${CHOST}/${gcc_version}/ + if [[ "$target_platform" == linux-* ]]; then + mv ${PREFIX}/lib/libstdc++.so* ${PREFIX}/${CHOST}/lib + else + rm ${PREFIX}/bin/libstdc++*.dll + fi +else + mv $PREFIX/${CHOST}/lib/lib*.a ${PREFIX}/lib/gcc/${CHOST}/${gcc_version}/ +fi + +popd + diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libstdc++.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libstdc++.sh new file mode 100644 index 0000000000000000000000000000000000000000..3d878849ae7b3d9282a04a885cd29df782b7d038 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-libstdc++.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" + +# libtool wants to use ranlib that is here, macOS install doesn't grok -t etc +# .. do we need this scoped over the whole file though? +#export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${CHOST}/buildtools/bin:${SRC_DIR}/.build/tools/bin:${PATH} + +pushd ${SRC_DIR}/build + + make -C ${CHOST}/libstdc++-v3/src prefix=${PREFIX} install-toolexeclibLTLIBRARIES + make -C ${CHOST}/libstdc++-v3/po prefix=${PREFIX} install + +popd + +mkdir -p ${PREFIX}/lib +#mv ${PREFIX}/${CHOST}/lib/* ${PREFIX}/lib + +# no static libs +find ${PREFIX}/lib -name "*\.a" -exec rm -rf {} \; +# no libtool files +find ${PREFIX}/lib -name "*\.la" -exec rm -rf {} \; + +# Install Runtime Library Exception +install -Dm644 ${SRC_DIR}/COPYING.RUNTIME \ + ${PREFIX}/share/licenses/libstdc++/RUNTIME.LIBRARY.EXCEPTION diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-openmp_impl.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-openmp_impl.sh new file mode 100644 index 0000000000000000000000000000000000000000..c4ebad09aa18a43830fe2e9be9be97c9e965c354 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-openmp_impl.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +mkdir -p ${PREFIX}/lib + +pushd ${PREFIX}/lib/ + +if [[ "${TARGET}" != *mingw* ]]; then + ln -s libgomp.so.${libgomp_ver} libgomp.so.${libgomp_ver:0:1} +fi +popd diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-symlinks.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-symlinks.sh new file mode 100644 index 0000000000000000000000000000000000000000..fd4887286b42cf9e1effd5a1931b9dc3224a3d9a --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/install-symlinks.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh + +if [[ "$target_platform" == "win-"* ]]; then + symlink_or_copy="cp" +else + symlink_or_copy="ln -sf" +fi + +if [[ "${PKG_NAME}" == "gcc" ]]; then + for tool in cc cpp gcc gcc-ar gcc-nm gcc-ranlib gcov gcov-dump gcov-tool; do + $symlink_or_copy ${PREFIX}/bin/${triplet}-${tool}${EXEEXT} ${PREFIX}/bin/${tool}${EXEEXT} + done +elif [[ "${PKG_NAME}" == "gxx" ]]; then + $symlink_or_copy ${PREFIX}/bin/${triplet}-g++${EXEEXT} ${PREFIX}/bin/g++${EXEEXT} + $symlink_or_copy ${PREFIX}/bin/${triplet}-c++${EXEEXT} ${PREFIX}/bin/c++${EXEEXT} +elif [[ "${PKG_NAME}" == "gfortran" ]]; then + $symlink_or_copy ${PREFIX}/bin/${triplet}-gfortran${EXEEXT} ${PREFIX}/bin/gfortran${EXEEXT} +fi diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/libgcc_s.so.ldscript b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/libgcc_s.so.ldscript new file mode 100644 index 0000000000000000000000000000000000000000..c8e92242fc5b32888222e279088df08e791bd52c --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/libgcc_s.so.ldscript @@ -0,0 +1,4 @@ +/* GNU ld script + Use the shared library, but some functions are only in + the static library. */ +GROUP ( libgcc_s.so.1 -lgcc ) diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/make_tool_links.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/make_tool_links.sh new file mode 100644 index 0000000000000000000000000000000000000000..26ad874c355cef4faa81da40d32fd985742f6262 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/make_tool_links.sh @@ -0,0 +1,11 @@ +# When host=target, gcc installs un-prefixed tools together with prefixed-tools +# In the case of cpp, only un-prefixed cpp. Let's copy the un-prefixed tool +# to prefix-tool and delete the un-prefixed one to get back ct-ng behaviour +for tool in gcc g++ gfortran cpp gcc-ar gcc-nm gcc-ranlib c++; do + if [ -f ${PREFIX}/bin/${tool}${EXEEXT} ]; then + if [ ! -f ${PREFIX}/bin/${triplet}-${tool}${EXEEXT} ]; then + cp ${PREFIX}/bin/${tool}${EXEEXT} ${PREFIX}/bin/${triplet}-${tool}${EXEEXT} + fi + rm ${PREFIX}/bin/${tool}${EXEEXT} + fi +done diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/meta.yaml b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d03f46ee81c2daee15e45ed5cfec75271e09891e --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/meta.yaml @@ -0,0 +1,775 @@ +{% set version = gcc_version %} +{% set build_num = 7 %} + +{% if gcc_maj_ver is not defined %} +{% set gcc_maj_ver = 15 %} +{% endif %} + +# libgcc-devel is a noarch: generic package that is built for +# cross-compilers as well. Instead of skipping for cross-compilers, +# let's prioritize the native compilers package +{% if target_platform == cross_target_platform %} +{% set libgcc_devel_build_num = build_num + 100 %} +{% else %} +{% set libgcc_devel_build_num = build_num %} +{% endif %} + +{% if cross_target_platform is not defined %} +{% set cross_target_platform = "linux-64" %} +{% endif %} + +package: + name: gcc_compilers + version: {{ version }} + +source: + - url: + - https://ftp.gnu.org/gnu/gcc/gcc-{{ version }}/gcc-{{ version }}.tar.gz + - https://mirrors.ocf.berkeley.edu/gnu/gcc/gcc-{{ version }}/gcc-{{ version }}.tar.gz + sha256: 7294d65cc1a0558cb815af0ca8c7763d86f7a31199794ede3f630c0d1b0a5723 # [gcc_version == "15.2.0"] + sha256: ace8b8b0dbfe6abfc22f821cb093e195aa5498b7ccf7cd23e4424b9f14afed22 # [gcc_version == "14.3.0"] + sha256: bf0baf3e570c9c74c17c8201f0196c6924b4bd98c90e69d6b2ac0cd823f33bbc # [gcc_version == "13.4.0"] + patches: + - patches/0001-allow-commands-in-main-specfile.patch + - patches/0002-patch-zoneinfo_dir_override-to-point-to-our-tzdata.patch # [gcc_maj_ver != 13] + {% if cross_target_platform.startswith("linux-") %} + - patches/0003-add-ldl-to-libstdc___la_LDFLAGS.patch # [gcc_maj_ver != 13] + - patches/0004-Hardcode-HAVE_ALIGNED_ALLOC-1-in-libstdc-v3-configur.patch + {% else %} + # for GCC 15: https://github.com/msys2/MINGW-packages/tree/f59921184b35858d4ceb91679578de0d62475cbf/mingw-w64-gcc + # for GCC 14: https://github.com/msys2/MINGW-packages/tree/331bf945d21af562d228ed46bda21c8272d1e76e/mingw-w64-gcc + # for GCC 13: https://github.com/msys2/MINGW-packages/tree/4f1262b4e1072632eccf0958764f90d890b832ac/mingw-w64-gcc + - patches/mingw/{{ gcc_maj_ver }}/0002-Relocate-libintl.patch # [gcc_maj_ver == 13] + - patches/mingw/{{ gcc_maj_ver }}/0003-Windows-Follow-Posix-dir-exists-semantics-more-close.patch + - patches/mingw/{{ gcc_maj_ver }}/0005-Windows-Don-t-ignore-native-system-header-dir.patch + - patches/mingw/{{ gcc_maj_ver }}/0006-Windows-New-feature-to-allow-overriding.patch # [gcc_maj_ver == 13] + - patches/mingw/{{ gcc_maj_ver }}/0007-Build-EXTRA_GNATTOOLS-for-Ada.patch + - patches/mingw/{{ gcc_maj_ver }}/0008-Prettify-linking-no-undefined.patch + - patches/mingw/{{ gcc_maj_ver }}/0011-Enable-shared-gnat-implib.patch + - patches/mingw/{{ gcc_maj_ver }}/0012-Handle-spaces-in-path-for-default-manifest.patch + - patches/mingw/{{ gcc_maj_ver }}/0014-gcc-9-branch-clone_function_name_1-Retain-any-stdcall-suffix.patch + - patches/mingw/{{ gcc_maj_ver }}/0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch + - patches/mingw/{{ gcc_maj_ver }}/0021-PR14940-Allow-a-PCH-to-be-mapped-to-a-different-addr.patch # [gcc_maj_ver != 15] + - patches/mingw/{{ gcc_maj_ver }}/0140-gcc-diagnostic-color.patch + - patches/mingw/{{ gcc_maj_ver }}/0200-add-m-no-align-vector-insn-option-for-i386.patch + - patches/mingw/{{ gcc_maj_ver }}/0300-override-builtin-printf-format.patch # [gcc_maj_ver == 13] + - patches/mingw/{{ gcc_maj_ver }}/2000-enable-rust.patch # [gcc_maj_ver == 13] + - patches/mingw/{{ gcc_maj_ver }}/2001-fix-building-rust-on-mingw-w64.patch + - patches/mingw/{{ gcc_maj_ver }}/2f7e7bfa3c6327793cdcdcb5c770b93cecd49bd0.patch # [gcc_maj_ver == 13] + - patches/mingw/{{ gcc_maj_ver }}/3eeb4801d6f45f6250fc77a6d3ab4e0115f8cfdd.patch # [gcc_maj_ver == 13] + - patches/mingw/{{ gcc_maj_ver }}/9002-native-tls.patch # [gcc_maj_ver == 15] + {% endif %} + +build: + number: {{ build_num }} + skip: True # [win] + skip: true # [not (linux or win) or (win and cross_target_platform != "win-64")] + detect_binary_files_with_prefix: false + ignore_run_exports_from: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + +requirements: + build: + # Build dependencies are installed in setup_compilers.sh due to + # conda-build bugs + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + +outputs: + - name: libgcc-devel_{{ cross_target_platform }} + script: install-libgcc-devel.sh + build: + noarch: generic + number: {{ libgcc_devel_build_num }} + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + ignore_run_exports_from: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + overlinking_ignore_patterns: + - "*/lib/libgcc_s.so.*" + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run: + - __unix # [unix] + - __win # [win] + test: + commands: + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/crtbegin.o + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libgcc_eh.a + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libgcc.a + {% if cross_target_platform.startswith("linux-") %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgcc_s.so + {% else %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgcc_s.a + {% endif %} + about: + summary: The GNU C development libraries and object files + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: libstdcxx-devel_{{ cross_target_platform }} + script: install-libstdc++-devel.sh + build: + noarch: generic + number: {{ libgcc_devel_build_num }} + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + ignore_run_exports_from: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + overlinking_ignore_patterns: + - "*/lib/libstdc++.so.*" + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run: + - __unix # [unix] + - __win # [win] + test: + commands: + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libstdc++.a + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libstdc++fs.a + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libsupc++.a + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/include/c++/cstdio + {% if cross_target_platform.startswith("linux-") %} + - test -f ${PREFIX}/{{ triplet }}/lib/libstdc++.so + {% else %} + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libstdc++.dll.a + {% endif %} + about: + summary: The GNU C++ headers and development libraries + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: gcc_impl_{{ cross_target_platform }} + script: install-gcc.sh + build: + number: {{ build_num }} + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - '*' + ignore_run_exports_from: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + - {{ pin_subpackage("libgomp", exact=True) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libstdcxx", exact=True) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libgcc", exact=True) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libgfortran" ~ libgfortran_soname) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libsanitizer", exact=True) }} # [target_platform == cross_target_platform and not win] + run: + - binutils_impl_{{ cross_target_platform }} >={{ binutils_version }} + - {{ pin_subpackage("libgcc-devel_" ~ cross_target_platform, exact=True) }} + - {{ pin_subpackage("libsanitizer", exact=True) }} # [target_platform == cross_target_platform and not win] + # libstdcxx is a runtime dep of gcc because LTO requires it. + - {{ pin_subpackage("libstdcxx", max_pin=None) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libgcc", max_pin=None) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libgomp", max_pin=None) }} # [target_platform == cross_target_platform] + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + run_exports: + # impose this requirement across the build/host boundary + strong: + - libgcc >={{ gcc_version }} + test: + requires: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + files: + - tests + commands: + - echo {{ c_stdlib }} + - echo {{ c_stdlib_version }} + - test -f ${PREFIX}/{{ triplet }}/lib/libgomp.so # [target_platform == cross_target_platform] + - test `readlink ${PREFIX}/{{ triplet }}/lib/libgomp.so` == "../../lib/libgomp.so" # [target_platform == cross_target_platform] + - test -f ${PREFIX}/bin/{{ triplet }}-gcc + - test -f ${PREFIX}/bin/{{ triplet }}-cpp + - test ! -f ${PREFIX}/bin/gcc + - test ! -f ${PREFIX}/bin/cpp + - CC=$(${PREFIX}/bin/*-gcc -dumpmachine)-gcc + - ${CC} -Wall tests/aligned_alloc.c -c -o c_aligned.o -v -Wl,-v -march=native # [target_platform == cross_target_platform and (x86_64 or s390x)] + # This test does not work well with QEMU + - ${CC} -Wall tests/aligned_alloc.c -c -o c_aligned.o -v -Wl,-v -mcpu=native # [target_platform == cross_target_platform and (not x86_64 and not s390x and not ppc64le)] + - ${CC} -Wall tests/aligned_alloc.c -c -o c_aligned.o -v -fsanitize=address # [cross_target_platform != "win-64"] + - ${CC} -Wall tests/aligned_alloc.c -c -o c_aligned.o -v # [cross_target_platform != "win-64"] + - ${CC} -Wall c_aligned.o -o c_aligned -v && ./c_aligned # [cross_target_platform == target_platform and cross_target_platform != "win-64"] + - ${CC} -Wall c_aligned.o -o c_aligned -Wl,-rpath,/foo && {{ triplet }}-readelf -d c_aligned | grep RPATH | grep "/foo:${PREFIX}/lib" # [cross_target_platform == target_platform and cross_target_platform != "win-64"] + - ${CC} -Wall tests/hello_world.c -c -o hello_world.o -v + - ${CC} -Wall hello_world.o -o hello_world -v + {% if cross_target_platform.startswith("linux-") %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgcc_s.so + - test -f ${PREFIX}/{{ triplet }}/lib/libsanitizer.spec + - test -f ${PREFIX}/{{ triplet }}/lib/libasan_preinit.o + {% else %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgcc_s.a + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libquadmath.a + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libgomp.a + {% endif %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgomp.spec + about: + summary: GNU C Compiler + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: gcc + script: install-symlinks.sh + build: + skip: true # [target_platform != cross_target_platform] + track_features: # [not with_conda_specs] + - gcc_no_conda_specs # [not with_conda_specs] + requirements: + host: + - gcc_impl_{{ target_platform }} {{ gcc_version }}.* + run: + - gcc_impl_{{ target_platform }} {{ gcc_version }}.* + - conda-gcc-specs # [with_conda_specs] + test: + commands: + - ${PREFIX}/bin/gcc -v + - ${PREFIX}/bin/gcov -v + about: + summary: GNU C native compiler (symlinks) + home: https://github.com/conda-forge/ctng-compilers-feedstock + license: BSD-3-Clause + license_file: LICENSE + + - name: gcc-no-conda-specs + build: + skip: true # [with_conda_specs] + requirements: + run: + - gcc + run_constrained: + - conda-gcc-specs <0.0a0 + test: + commands: + - gcc --version + + - name: conda-gcc-specs + script: install-conda-specs.sh + build: + number: {{ build_num }} + skip: true # [cross_target_platform != target_platform] + detect_binary_files_with_prefix: false + requirements: + build: + run: + - {{ pin_subpackage("gcc_impl_" ~ cross_target_platform, max_pin='x.x.x.x') }} + test: + files: + - tests + commands: + - specdir=$PREFIX/lib/gcc/{{ triplet }}/{{ gcc_version }} + - test -f $specdir/conda.specs + - CC=$(${PREFIX}/bin/*-gcc -dumpmachine)-gcc + - echo | ${CC} -E -v -x c - |& grep '^Reading specs from' | awk '{print $NF}' | xargs readlink -e | awk -v ORS= '{print $1":"}' | grep "${specdir}/specs:${specdir}/conda.specs:" + - cp tests/libhowdy.h $PREFIX/include/ + - ${CC} -shared -fpic -o $PREFIX/lib/libhowdy.so tests/libhowdy.c + - ${CC} -o howdy-dso tests/howdy-dso.c -lhowdy + - ./howdy-dso + - grep RPATH <({{ triplet }}-readelf -d howdy-dso) + - "! grep RUNPATH <({{ triplet }}-readelf -d howdy-dso)" + - ${CC} -Wl,-enable-new-dtags -o howdy-dso-runpath tests/howdy-dso.c -lhowdy + - ./howdy-dso-runpath + - "! grep RPATH <({{ triplet }}-readelf -d howdy-dso-runpath)" + - grep RUNPATH <({{ triplet }}-readelf -d howdy-dso-runpath) + - echo | ${CC} -E -Wp,-v -x c - |& awk '/include <\.\.\.> search starts/,/^End of search/ {print}' | tail -n2 | head -n1 | grep "$PREFIX/include" + - echo | ${CC} -isystem "$PREFIX/include" -E -Wp,-v -x c - |& awk '/include <\.\.\.> search starts/, /^End of search/ {print}' | head -n2 | tail -n1 | grep "$PREFIX/include" + + about: + summary: conda-specific specfile for GNU C/C++ Compiler + description: | + When installed, this optional package provides a specfile that + directs gcc (and g++ or gfortran) to automatically: + * search for includes in $PREFIX/include + * link libraries in $PREFIX/lib + * set RPATH to $PREFIX/lib + * use RPATH instead of the newer RUNPATH + This package is intended to aid usability of the compiler + toolchain as a replacement for system-installed compilers. + It should not be used in recipes. Use the 'compiler()' + jinja function as described on + https://conda-forge.org/docs/maintainer/knowledge_base.html#dep-compilers + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + doc_url: https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html + + - name: gxx_impl_{{ cross_target_platform }} + script: install-g++.sh + build: + number: {{ build_num }} + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + ignore_run_exports_from: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + # For cpp and crt{i,n}.o + - {{ pin_subpackage("gcc_impl_" ~ cross_target_platform, exact=True) }} + run: + # For cpp and crt{i,n}.o + - {{ pin_subpackage("gcc_impl_" ~ cross_target_platform, exact=True) }} + # not needed due to pinning above but marks this build as using the new sysroots + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + - {{ pin_subpackage("libstdcxx-devel_" ~ cross_target_platform, exact=True) }} + # for C++20 chrono support + - tzdata + run_exports: + # impose this requirement across the build/host boundary + strong: + - libstdcxx >={{ gcc_version }} + test: + requires: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + - strace_{{ cross_target_platform }} + files: + - tests + commands: + - test -f ${PREFIX}/bin/{{ triplet }}-g++ + - CXX=$(${PREFIX}/bin/*-gcc -dumpmachine)-g++ + - ${CXX} -Wall tests/aligned_alloc.cpp -c -o cpp_aligned.o --std=c++17 # [cross_target_platform != "win-64"] + - ${CXX} -Wall cpp_aligned.o -o cpp_aligned --std=c++17 && ./cpp_aligned # [cross_target_platform == target_platform and cross_target_platform != "win-64"] + - ${CXX} -Wall tests/hello_world.cpp -c -o hello_world.o --std=c++17 + - ${CXX} -Wall hello_world.o -o hello_world --std=c++17 + + # test tzdb integration + {% if gcc_maj_ver|int >= 14 %} + - ${CXX} -isystem ${PREFIX}/include --std=c++20 -Wall tests/tzdb-override.cpp -c -o tzdb-override.o + - ${CXX} -isystem ${PREFIX}/include --std=c++20 -Wall tests/tzdb.cpp -c -o tzdb.o + {% if target_platform == cross_target_platform %} + - ${CXX} tzdb-override.o -o tzdb-override && ./tzdb-override + - ${CXX} tzdb.o -o tzdb && ./tzdb + - $PREFIX/usr/bin/strace ./tzdb 2>&1 | grep ${CONDA_PREFIX}/lib/../share/zoneinfo/tzdata.zi + # also test without any environment activation + - unset PREFIX + - unset CONDA_PREFIX + - ./tzdb + {% endif %} + {% endif %} + about: + summary: GNU C++ Compiler + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: gxx + script: install-symlinks.sh + build: + skip: true # [target_platform != cross_target_platform] + requirements: + host: + - gxx_impl_{{ target_platform }} {{ gcc_version }}.* + - gcc {{ gcc_version }}.* + run: + - gxx_impl_{{ target_platform }} {{ gcc_version }}.* + - gcc {{ gcc_version }}.* + test: + commands: + - ${PREFIX}/bin/g++ -v + - ${PREFIX}/bin/gcc -v + about: + summary: GNU C++ native compiler (symlinks) + home: https://github.com/conda-forge/ctng-compilers-feedstock + license: BSD-3-Clause + license_file: LICENSE + + - name: gfortran_impl_{{ cross_target_platform }} + script: install-gfortran.sh + build: + number: {{ build_num }} + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + ignore_run_exports_from: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + requirements: + build: + host: + # For cpp and crt{i,n}.o + - {{ pin_subpackage("gcc_impl_" ~ cross_target_platform, exact=True) }} + # not needed due to pinning above but marks this build as using the new sysroots + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run: + # For cpp and crt{i,n}.o + - gcc_impl_{{ cross_target_platform }} >={{ gcc_version }} + - {{ pin_subpackage("libgfortran" ~ libgfortran_soname, max_pin=None) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libgcc", max_pin=None) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libstdcxx", max_pin=None) }} # [target_platform == cross_target_platform] + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + run_exports: + # impose this requirement across the build/host boundary + strong: + - libgfortran{{ libgfortran_soname }} {{ gcc_version }}.* + - libgcc >={{ gcc_version }} + test: + requires: + - cmake >=3.11,<4 # [x86_64 or aarch64 or ppc64le] + - make + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + commands: + {% if cross_target_platform.startswith("linux-") %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgfortran.so + {% else %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgfortran.dll.a + {% endif %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgfortran.a + - test -f ${PREFIX}/bin/{{ triplet }}-gfortran + - find $PREFIX/lib -iname omp_lib.mod | grep '.' + - find $PREFIX/lib -iname omp_lib.h | grep '.' + - find $PREFIX/lib -iname ISO_Fortran_binding.h | grep '.' + - echo {{ gcc_maj_ver }} + - pushd tests/fortomp + - sh test_fort.sh # [target_platform == cross_target_platform and (x86_64 or aarch64 or ppc64le)] + files: + - tests/fortomp/* + about: + summary: GNU Fortran Compiler + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: gfortran + script: install-symlinks.sh + build: + skip: true # [target_platform != cross_target_platform] + requirements: + host: + - gfortran_impl_{{ target_platform }} {{ gcc_version }}.* + - gcc_impl_{{ target_platform }} {{ gcc_version }}.* + - gcc {{ gcc_version }}.* + run: + - gfortran_impl_{{ target_platform }} {{ gcc_version }}.* + - gcc_impl_{{ target_platform }} {{ gcc_version }}.* + - gcc {{ gcc_version }}.* + test: + commands: + - ${PREFIX}/bin/gfortran -v + - ${PREFIX}/bin/gcc -v + about: + summary: GNU Fortran native compiler (symlinks) + home: https://github.com/conda-forge/ctng-compilers-feedstock + license: BSD-3-Clause + license_file: LICENSE + + - name: libstdcxx + target: {{ cross_target_platform }} + script: install-libstdc++.sh + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform] + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + overlinking_ignore_patterns: + - "lib/libstdc++.so.*" + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + - {{ pin_subpackage("libgcc", exact=True) }} + run: + - {{ pin_subpackage("libgcc", exact=True) }} + run_constrained: + # avoid installing incompatible version of old name for this output + - libstdcxx-ng =={{ version }}=*_{{ build_num }} + test: + commands: + - test -f ${PREFIX}/lib/libstdc++.so + about: + summary: The GNU C++ Runtime Library + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: libsanitizer + target: {{ cross_target_platform }} + script: install-libsanitizer.sh + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform or win] + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + run_exports: + - libsanitizer {{ gcc_version }} + overlinking_ignore_patterns: + - "lib/libtsan.so.*" + - "lib/libasan.so.*" + - "lib/liblsan.so.*" + - "lib/libhwasan.so.*" + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run: + - libgcc >={{ gcc_version }} + - libstdcxx >={{ gcc_version }} + test: + requires: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + - gcc_impl_{{ cross_target_platform }} + commands: + - test -f ${PREFIX}/lib/libasan.so + - test -f ${PREFIX}/lib/libhwasan.so # [x86_64 or aarch64] + - file ${PREFIX}/bin/{{ triplet }}-gcc + - echo 'void main(){}' | {{ triplet }}-gcc -fsanitize=address -Wl,--fatal-warnings -x c - + about: + summary: The GCC runtime libraries for sanitizers + home: https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: libgomp + target: {{ cross_target_platform }} + script: install-libgomp.sh + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform] + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + run_exports: + strong: + - {{ pin_subpackage("_openmp_mutex", max_pin=None) }} + {% if cross_target_platform.startswith("win-") %} + - {{ pin_subpackage("libgomp", max_pin=None) }} + {% endif %} + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run_constrained: + - msys2-conda-epoch <0.0a0 # [win] + test: + requires: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + commands: + - test -f ${PREFIX}/lib/libgomp.so.{{ libgomp_ver }} + - test ! -f ${PREFIX}/lib/libgomp.so.{{ libgomp_ver[0:1] }} + about: + summary: The GCC OpenMP implementation. + home: https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: libgcc + target: {{ cross_target_platform }} + script: install-libgcc-no-gomp.sh + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform] + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + rpaths_patcher: patchelf + overlinking_ignore_patterns: + - "lib/libgcc_s.so.*" + requirements: + build: + host: + - {{ pin_subpackage("libgomp", exact=True) }} + - {{ pin_subpackage('_openmp_mutex', exact=True) }} + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run: + - {{ pin_subpackage("_openmp_mutex", max_pin=None) }} + run_constrained: + - {{ pin_subpackage("libgomp", exact=True) }} + - msys2-conda-epoch <0.0a0 # [win] + # avoid installing incompatible version of old name for this output + - libgcc-ng =={{ version }}=*_{{ build_num }} + test: + requires: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + commands: + - test -f ${PREFIX}/lib/libgcc_s.so + - test -f ${PREFIX}/lib/libgomp.so.{{ libgomp_ver[0:1] }} + - test `readlink ${PREFIX}/lib/libgomp.so.{{ libgomp_ver[0:1] }}` == "libgomp.so.{{ libgomp_ver }}" + about: + summary: The GCC low-level runtime library + home: https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: _openmp_mutex + script: install-openmp_impl.sh + version: {{ openmp_ver }} + build: + string: 3_gnu + skip: true # [target_platform != cross_target_platform] + run_exports: + strong: + - {{ pin_subpackage("_openmp_mutex", max_pin=None) }} + requirements: + build: + host: + - {{ pin_subpackage('libgomp', exact=True) }} + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run: + - libgomp >=7.5.0 + run_constrained: + # conflict with previous name + - openmp_impl <0.0a0 + - msys2-conda-epoch <0.0a0 # [win] + test: + commands: + - test -f ${PREFIX}/lib/libgomp.so.{{ libgomp_ver[0:1] }} + - test `readlink ${PREFIX}/lib/libgomp.so.{{ libgomp_ver[0:1] }}` == "libgomp.so.{{ libgomp_ver }}" + about: + summary: OpenMP Implementation Mutex + license: BSD-3-Clause + license_file: LICENSE + home: https://github.com/conda-forge/ctng-compilers-feedstock + + - name: libgfortran{{ libgfortran_soname }} + target: {{ cross_target_platform }} + script: install-libgfortran.sh + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform] + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + overlinking_ignore_patterns: + - "lib/libgfortran.so.*" + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run: + - libgcc >={{ gcc_version }} + run_constrained: + - libgfortran {{ gcc_version }} + test: + commands: + - test -f ${PREFIX}/lib/libgfortran.so + about: + summary: The GNU Fortran Runtime Library + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: libgfortran + target: {{ cross_target_platform }} + build: + skip: true # [target_platform != cross_target_platform] + number: {{ build_num }} + requirements: + run: + - {{ pin_subpackage('libgfortran' ~ libgfortran_soname, exact=True) }} + run_constrained: + # avoid installing incompatible version of old name for this output + - libgfortran-ng =={{ version }}=*_{{ build_num }} + test: + commands: + - test -f ${PREFIX}/lib/libgfortran.so + about: + summary: The GNU Fortran Runtime Library + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: gdb-pretty-printer + version: {{ gcc_version }} + script: install-gdb-pretty-printer.sh + build: + # skip until gdb 16.3 is on defaults (which is built against GCC 14.3.0) + skip: true + number: {{ build_num }} + ignore_run_exports: # [linux] + - libstdcxx # [linux] + requirements: + host: + - python + run: + - python + - gdb >= 16.3 + - libstdcxx >={{ gcc_version }} + about: + summary: GNU Compiler Collection Python Pretty Printers + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + # compatibility outputs for previous naming of the runtime libraries + # with "-ng" suffix; for windows the suffix had never been introduced + {% if not cross_target_platform.startswith("win-") %} + - name: libgcc-ng + target: {{ cross_target_platform }} + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform] + run_exports: + strong: + - libgcc + requirements: + host: + - {{ pin_subpackage("libgcc", exact=True) }} + run: + - {{ pin_subpackage("libgcc", exact=True) }} + test: + commands: + - echo "empty wrapper for compatibility with previous naming" + about: + summary: The GCC low-level runtime library + home: https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: libstdcxx-ng + target: {{ cross_target_platform }} + script: install-libstdc++.sh + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform] + run_exports: + strong: + - libstdcxx + requirements: + host: + - {{ pin_subpackage("libstdcxx", exact=True) }} + run: + - {{ pin_subpackage("libstdcxx", exact=True) }} + test: + commands: + - echo "empty wrapper for compatibility with previous naming" + about: + summary: The GNU C++ Runtime Library + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: libgfortran-ng + target: {{ cross_target_platform }} + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform] + run_exports: + strong: + - libgfortran + requirements: + host: + - {{ pin_subpackage('libgfortran', exact=True) }} + run: + - {{ pin_subpackage('libgfortran', exact=True) }} + test: + commands: + - echo "empty wrapper for compatibility with previous naming" + about: + summary: The GNU Fortran Runtime Library + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + {% endif %} + +about: + summary: GNU Compiler Collection + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + license_file: + - COPYING + - COPYING.LIB + - COPYING3 + - COPYING3.LIB + +extra: + feedstock-name: ctng-compilers-feedstock + recipe-maintainers: + - timsnyder + - xhochy + - isuruf + - beckermr diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/patches/0001-allow-commands-in-main-specfile.patch b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/patches/0001-allow-commands-in-main-specfile.patch new file mode 100644 index 0000000000000000000000000000000000000000..0e6ea6afa6429337186944117011253d9be4e64f --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/patches/0001-allow-commands-in-main-specfile.patch @@ -0,0 +1,23 @@ +From 10cf9f22dcb62db55cd2e9cbc587e2ab35a88889 Mon Sep 17 00:00:00 2001 +From: Tim Snyder +Date: Tue, 29 Mar 2022 22:33:27 +0000 +Subject: [PATCH 1/4] allow % commands in main specfile + +--- + gcc/gcc.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index fc9f1f545dc..28b947c7afd 100644 +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -2392,7 +2392,8 @@ read_specs (const char *filename, bool main_p, bool user_p) + /* Is this a special command that starts with '%'? */ + /* Don't allow this for the main specs file, since it would + encourage people to overwrite it. */ +- if (*p == '%' && !main_p) ++ /* ::conda-forge:: allow use of commands in main specs */ ++ if (*p == '%') + { + p1 = p; + while (*p && *p != '\n') diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/patches/0002-patch-zoneinfo_dir_override-to-point-to-our-tzdata.patch b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/patches/0002-patch-zoneinfo_dir_override-to-point-to-our-tzdata.patch new file mode 100644 index 0000000000000000000000000000000000000000..e63a7f8389e8f3c3e60994356076261b033c5fb8 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/patches/0002-patch-zoneinfo_dir_override-to-point-to-our-tzdata.patch @@ -0,0 +1,113 @@ +From 92dc5e74592f57dbc9c2b421e2e348d88d3439f6 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Fri, 21 Jun 2024 12:41:07 +1100 +Subject: [PATCH 2/4] patch zoneinfo_dir_override to point to our tzdata + +--- + libstdc++-v3/src/c++20/tzdb.cc | 78 ++++++++++++++++++++++++++++------ + 1 file changed, 65 insertions(+), 13 deletions(-) + +diff --git a/libstdc++-v3/src/c++20/tzdb.cc b/libstdc++-v3/src/c++20/tzdb.cc +index 72f20e7f828..8d4feb99902 100644 +--- a/libstdc++-v3/src/c++20/tzdb.cc ++++ b/libstdc++-v3/src/c++20/tzdb.cc +@@ -37,8 +37,12 @@ + #include // mutex + #include // filesystem::read_symlink + +-#ifndef _AIX +-# include // getenv ++#if defined(__linux__) ++# include // dladdr ++# include // free, malloc, realpath ++# include // memcpy, strlen ++#else defined(_WIN32) ++# include + #endif + + #if defined __GTHREADS && ATOMIC_POINTER_LOCK_FREE == 2 +@@ -64,25 +68,73 @@ + + namespace __gnu_cxx + { +-#ifdef _AIX +- // Cannot override weak symbols on AIX. +- const char* (*zoneinfo_dir_override)() = nullptr; +-#else +- [[gnu::weak]] const char* zoneinfo_dir_override(); +- +-#if defined(__APPLE__) || defined(__hpux__) \ +- || (defined(__VXWORKS__) && !defined(__RTP__)) +- // Need a weak definition for Mach-O et al. + [[gnu::weak]] const char* zoneinfo_dir_override() + { ++#ifdef _GLIBCXX_SHARED ++ // get path to library we're in, to determine our location relative to $PREFIX; ++ // with help from the MIT-licensed https://github.com/gpakosz/whereami ++ void* addr = __builtin_extract_return_addr(__builtin_return_address(0)); ++ char* this_lib; ++ int i; ++ // is included through ++ static std::string tz_dir; ++ if (!tz_dir.empty()) { ++ return tz_dir.c_str(); ++ } ++#ifdef _WIN32 ++ // we're in %PREFIX%\Library\bin\libstdc++-6.dll ++# define TO_PREFIX "/../.." ++ // needs single quotes for character (not string) literal ++# define PATH_SEP '\\' ++ wchar_t buffer[MAX_PATH]; ++ HMODULE hm = NULL; ++ // non-zero return means success ++ if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | ++ GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, ++ (LPCSTR) addr, &hm)) { ++ // returns length of string (not counting null byte), see ++ // https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulefilenamew#return-value ++ DWORD total_length = GetModuleFileNameW(hm, buffer, sizeof(buffer)); ++ if (total_length) { ++ this_lib = (char*)malloc(total_length + 1); ++ memcpy(this_lib, buffer, total_length); ++#else ++ // we're in $PREFIX/lib/libstdcxx.so ++# define TO_PREFIX "/.." ++# define PATH_SEP '/' ++ char buffer[PATH_MAX]; ++ Dl_info info; ++ ++ if (dladdr(addr, &info)) { ++ char* resolved = realpath(info.dli_fname, buffer); ++ if (resolved) { ++ int total_length = (int)strlen(resolved); ++ this_lib = (char*)malloc(total_length + 1); ++ memcpy(this_lib, resolved, total_length); ++#endif ++ ++ for (i = (int)total_length - 1; i >= 0; --i) { ++ if (this_lib[i] == PATH_SEP) { ++ // set to null byte so the string ends before the basename ++ this_lib[i] = '\0'; ++ break; ++ } ++ } ++ tz_dir = {this_lib}; ++ tz_dir += TO_PREFIX; ++ tz_dir += "/share/zoneinfo"; ++ // std::string constructor for tz_dir deep-copies ++ free(this_lib); ++ return tz_dir.c_str(); ++ } ++ } ++#endif // _GLIBCXX_SHARED + #ifdef _GLIBCXX_ZONEINFO_DIR + return _GLIBCXX_ZONEINFO_DIR; + #else + return nullptr; + #endif + } +-#endif +-#endif + } + + #if ! defined _GLIBCXX_ZONEINFO_DIR && ! defined _GLIBCXX_STATIC_TZDATA diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/patches/0003-add-ldl-to-libstdc___la_LDFLAGS.patch b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/patches/0003-add-ldl-to-libstdc___la_LDFLAGS.patch new file mode 100644 index 0000000000000000000000000000000000000000..a17bf01c996d5181529f52f35b2df040463adbe4 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/patches/0003-add-ldl-to-libstdc___la_LDFLAGS.patch @@ -0,0 +1,40 @@ +From c54fd2dea14134d3e51c17ca5442e0ae2dc16462 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Mon, 15 Jul 2024 19:16:05 +1100 +Subject: [PATCH 3/4] add `-ldl` to libstdc___la_LDFLAGS + +we want to link static-only here, to avoid having to add +`-ldl` everytime something links against libstdc++.so + +Co-Authored-By: Isuru Fernando +--- + libstdc++-v3/src/Makefile.am | 2 +- + libstdc++-v3/src/Makefile.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am +index 37ba1491dea..5b69f43ecd8 100644 +--- a/libstdc++-v3/src/Makefile.am ++++ b/libstdc++-v3/src/Makefile.am +@@ -161,7 +161,7 @@ libstdc___darwin_rpath += -Wl,-rpath,@loader_path + endif + + libstdc___la_LDFLAGS = \ +- -version-info $(libtool_VERSION) ${version_arg} -lm $(libstdc___darwin_rpath) ++ -version-info $(libtool_VERSION) ${version_arg} -lm -Bstatic -ldl -Bdynamic -Wl,--exclude-libs,libdl.a $(libstdc___darwin_rpath) + + libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS) $(lt_host_flags) + +diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in +index 1bdf0daa88f..ab28e14804e 100644 +--- a/libstdc++-v3/src/Makefile.in ++++ b/libstdc++-v3/src/Makefile.in +@@ -566,7 +566,7 @@ libstdc___la_DEPENDENCIES = \ + @ENABLE_DARWIN_AT_RPATH_TRUE@ -Wc,-nodefaultrpaths \ + @ENABLE_DARWIN_AT_RPATH_TRUE@ -Wl,-rpath,@loader_path + libstdc___la_LDFLAGS = \ +- -version-info $(libtool_VERSION) ${version_arg} -lm $(libstdc___darwin_rpath) ++ -version-info $(libtool_VERSION) ${version_arg} -lm -Bstatic -ldl -Bdynamic -Wl,--exclude-libs,libdl.a $(libstdc___darwin_rpath) + + libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS) $(lt_host_flags) + @GLIBCXX_LDBL_ALT128_COMPAT_FALSE@@GLIBCXX_LDBL_COMPAT_TRUE@LTCXXCOMPILE64 = $(LTCXXCOMPILE) diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/patches/0004-Hardcode-HAVE_ALIGNED_ALLOC-1-in-libstdc-v3-configur.patch b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/patches/0004-Hardcode-HAVE_ALIGNED_ALLOC-1-in-libstdc-v3-configur.patch new file mode 100644 index 0000000000000000000000000000000000000000..07a361cd6d709849c78bba0ece60ff63d8c2295e --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/patches/0004-Hardcode-HAVE_ALIGNED_ALLOC-1-in-libstdc-v3-configur.patch @@ -0,0 +1,57 @@ +From 86369ec6c37896394546f3b01f9c447c4f4188ae Mon Sep 17 00:00:00 2001 +From: Nehal J Wani +Date: Tue, 12 Jun 2018 05:26:24 +0000 +Subject: [PATCH 4/4] Hardcode HAVE_ALIGNED_ALLOC=1 in libstdc++-v3/configure + +--- + libstdc++-v3/configure | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure +index 18053ab7eae..44b6a72f775 100755 +--- a/libstdc++-v3/configure ++++ b/libstdc++-v3/configure +@@ -26405,6 +26405,11 @@ _ACEOF + fi + done + ++# The check above works only if aligned_alloc is present as a symbol in libc.so ++# Since we provide a header only implementation, override the value here ++cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_aligned_alloc" | $as_tr_cpp` 1 ++_ACEOF + + # For iconv support. + +@@ -38403,6 +38408,9 @@ _ACEOF + fi + done + ++cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_aligned_alloc" | $as_tr_cpp` 1 ++_ACEOF + ;; + + *-fuchsia*) +@@ -42318,6 +42326,10 @@ fi + done + + ++cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_aligned_alloc" | $as_tr_cpp` 1 ++_ACEOF ++ + ;; + *-mingw32*) + +@@ -45924,6 +45936,10 @@ _ACEOF + fi + done + ++cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_aligned_alloc" | $as_tr_cpp` 1 ++_ACEOF ++ + ;; + *-qnx6.1* | *-qnx6.2*) + SECTION_FLAGS='-ffunction-sections -fdata-sections' diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/setup_compiler.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/setup_compiler.sh new file mode 100644 index 0000000000000000000000000000000000000000..dcdd387ae719e4341ae316205f920118cd4b1a45 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/setup_compiler.sh @@ -0,0 +1,48 @@ +#!/bin/bash +if [[ ! -d $SRC_DIR/cf-compilers ]]; then + extra_pkgs=() + if [[ "$build_platform" != "$target_platform" ]]; then + # we need a compiler to target cross_target_platform. + # when build_platform == target_platform, the compiler + # just built can be used. + # when build_platform != target_platform, the compiler + # just built cannot be used, hence we need one that + # can be used. + extra_pkgs+=( + "gcc_impl_${cross_target_platform}=${gcc_version}" + "gxx_impl_${cross_target_platform}=${gcc_version}" + "gfortran_impl_${cross_target_platform}=${gcc_version}" + ) + fi + # Remove conda-forge/label/sysroot-with-crypt when GCC < 14 is dropped + conda create -p $SRC_DIR/cf-compilers --yes --quiet \ + "binutils_impl_${build_platform}" \ + "gcc_impl_${build_platform}" \ + "gxx_impl_${build_platform}" \ + "gfortran_impl_${build_platform}" \ + "binutils_impl_${target_platform}=${binutils_version}" \ + "gcc_impl_${target_platform}" \ + "gxx_impl_${target_platform}" \ + "gfortran_impl_${target_platform}" \ + "${c_stdlib}_${target_platform}=${c_stdlib_version}" \ + "binutils_impl_${cross_target_platform}=${binutils_version}" \ + "${cross_target_stdlib}_${cross_target_platform}=${cross_target_stdlib_version}" \ + make \ + ${extra_pkgs[@]} +fi + +export PATH=$SRC_DIR/cf-compilers/bin:$PATH +export BUILD_PREFIX=$SRC_DIR/cf-compilers + +if [[ "$target_platform" == "win-"* && "${PREFIX}" != *Library ]]; then + export PREFIX=${PREFIX}/Library +fi + +source $RECIPE_DIR/get_cpu_arch.sh + +if [[ "$target_platform" == "win-64" ]]; then + EXEEXT=".exe" +else + EXEEXT="" +fi +SYSROOT_DIR=${PREFIX}/${TARGET}/sysroot diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/aligned_alloc.c b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/aligned_alloc.c new file mode 100644 index 0000000000000000000000000000000000000000..287be94c7340a134a5d9a56ddc0f6c20acc0af74 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/aligned_alloc.c @@ -0,0 +1,9 @@ +#include +#include + +int main(void) +{ + int *p2 = (int*)aligned_alloc(1024, 1024*sizeof *p2); + printf("1024-byte aligned addr: %p\n", (void*)p2); + free(p2); +} diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/aligned_alloc.cpp b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/aligned_alloc.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1379c7547ae63e12433db910d243f159657aa0b6 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/aligned_alloc.cpp @@ -0,0 +1,18 @@ +#include +#include +#include +//#include + +int main(void) +{ + /// int *p2 = (int*)memalign(1024, 1024 * sizeof *p2); + int *p2; + int err = posix_memalign((void**)&p2, 1024, sizeof *p2); + printf("1024-byte aligned addr: %p\n", (void*)p2); + free(p2); + p2 = (int*)std::aligned_alloc(1024, 1); + printf("1024-byte aligned addr: %p\n", (void*)p2); + std::free(p2); + p2 = (int*)aligned_alloc(1024, 1024); + printf("1024-byte aligned addr: %p\n", (void*)p2); +} diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/fortomp/CMakeLists.txt b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/fortomp/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..491a48b42cb3ddfef5f8541f8db848e0ba844f84 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/fortomp/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.3 FATAL_ERROR) +project(fortomp + LANGUAGES Fortran) + +find_package(OpenMP REQUIRED) diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/fortomp/test_fort.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/fortomp/test_fort.sh new file mode 100644 index 0000000000000000000000000000000000000000..75731b653df023e75c4d2b73b2c345a3510faad9 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/fortomp/test_fort.sh @@ -0,0 +1,11 @@ +GFORTRAN=$(${PREFIX}/bin/*-gcc -dumpmachine)-gfortran +FFLAGS="-fopenmp -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe" + +cmake \ + -H${SRC_DIR} \ + -Bbuild \ + -DCMAKE_INSTALL_PREFIX=${PREFIX} \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_Fortran_COMPILER=${GFORTRAN} \ + -DCMAKE_Fortran_FLAGS="${FFLAGS}" \ + . diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/hello_world.c b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/hello_world.c new file mode 100644 index 0000000000000000000000000000000000000000..f6054fde81f8dfa4882cef918c408fa6b7255c3e --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/hello_world.c @@ -0,0 +1,5 @@ +#include + +int main() { + printf("hello world!\n"); +} diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/hello_world.cpp b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/hello_world.cpp new file mode 100644 index 0000000000000000000000000000000000000000..585eea4cee5b1176fd28267f3e27dbdb344fd31f --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/hello_world.cpp @@ -0,0 +1,6 @@ +#include + +int main(void) +{ + std::cout << "hello world!" << std::endl; +} diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/howdy-dso.c b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/howdy-dso.c new file mode 100644 index 0000000000000000000000000000000000000000..ea47ce0a03e061a965fc1e2cdaf310c038d4b44d --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/howdy-dso.c @@ -0,0 +1,6 @@ +#include + +int main(void) { + howdy(); + return 0; +} diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/libhowdy.c b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/libhowdy.c new file mode 100644 index 0000000000000000000000000000000000000000..6cd0dc522a8e4485f8173321a3dff2b21f079415 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/libhowdy.c @@ -0,0 +1,5 @@ +#include + +void howdy(void) { + printf("Howdy Y'all!\n"); +} diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/libhowdy.h b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/libhowdy.h new file mode 100644 index 0000000000000000000000000000000000000000..6234950e5a3ce9ff0209513f328d0ecfc71bac99 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/libhowdy.h @@ -0,0 +1,6 @@ +#ifndef _LIBHOWDY_H +#define _LIBHOWDY_H + +extern void howdy(void); + +#endif diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/tzdb-override.cpp b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/tzdb-override.cpp new file mode 100644 index 0000000000000000000000000000000000000000..73284e6245e5774322d67924db2f0907e5a6d668 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/tzdb-override.cpp @@ -0,0 +1,29 @@ +// We are using a weak symbol in linux and windows using a patch +// while upstream only has the definition and no implementation. +// Check that overriding works. + +// adapted from upstream tests +// https://github.com/gcc-mirror/gcc/blob/releases/gcc-14.1.0/libstdc%2B%2B-v3/testsuite/std/time/tzdb/1.cc +// https://github.com/gcc-mirror/gcc/blob/releases/gcc-14.1.0/libstdc%2B%2B-v3/testsuite/std/time/tzdb/leap_seconds.cc + +#include +#include +#include + +static bool override_used = false; + +namespace __gnu_cxx +{ + const char* zoneinfo_dir_override() { + override_used = true; + return "./"; + } +} + +using namespace std::chrono; + +int main() +{ + auto &a = get_tzdb(); + return !override_used; +} diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/tzdb.cpp b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/tzdb.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9ccf3f4d44cb32a75a7f9e0d4b8876e9d76693ca --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/tests/tzdb.cpp @@ -0,0 +1,95 @@ +// adapted from upstream tests +// https://github.com/gcc-mirror/gcc/blob/releases/gcc-14.1.0/libstdc%2B%2B-v3/testsuite/std/time/tzdb/1.cc +// https://github.com/gcc-mirror/gcc/blob/releases/gcc-14.1.0/libstdc%2B%2B-v3/testsuite/std/time/tzdb/leap_seconds.cc + +#include +#include +#include + +// https://github.com/gcc-mirror/gcc/blob/releases/gcc-14.1.0/libstdc%2B%2B-v3/testsuite/util/testsuite_hooks.h#L61-L70 +#define VERIFY(fn) \ + do \ + { \ + if (! (fn)) \ + { \ + __builtin_fprintf(stderr, \ + "%s:%d: %s: Assertion '%s' failed.\n", \ + __FILE__, __LINE__, __PRETTY_FUNCTION__, #fn); \ + __builtin_abort(); \ + } \ + } while (false) + + +using namespace std::chrono; + +void +test_version() +{ + const tzdb& db = get_tzdb(); + VERIFY( &db == &get_tzdb_list().front() ); + + const char* func; + try { + func = "remote_version"; + VERIFY( db.version == remote_version() ); + func = "reload_tzdb"; + const tzdb& reloaded = reload_tzdb(); + if (reloaded.version == db.version) + VERIFY( &reloaded == &db ); + } catch (const std::exception&) { + std::printf("std::chrono::%s() failed\n", func); + // on exception, we fail louder than the upstream reference test + exit(1); + } +} + +void +test_current() +{ + const tzdb& db = get_tzdb(); + const time_zone* tz = db.current_zone(); + VERIFY( tz == std::chrono::current_zone() ); +} + +void +test_locate() +{ + const tzdb& db = get_tzdb(); + const time_zone* tz = db.locate_zone("GMT"); + VERIFY( tz != nullptr ); + VERIFY( tz->name() == "Etc/GMT" ); + VERIFY( tz == std::chrono::locate_zone("GMT") ); + VERIFY( tz == db.locate_zone("Etc/GMT") ); + VERIFY( tz == db.locate_zone("Etc/GMT+0") ); + + VERIFY( db.locate_zone(db.current_zone()->name()) == db.current_zone() ); +} + +void +test_all_zones() +{ + const tzdb& db = get_tzdb(); + + for (const auto& zone : db.zones) + VERIFY( locate_zone(zone.name())->name() == zone.name() ); + + for (const auto& link : db.links) + VERIFY( locate_zone(link.name()) == locate_zone(link.target()) ); +} + +void +test_load_leapseconds() +{ + const auto& db = get_tzdb(); + + // this is correct as of tzdata 2024a + VERIFY( db.leap_seconds.size() == 27 ); +} + +int main() +{ + test_version(); + test_current(); + test_locate(); + test_load_leapseconds(); +} diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/uclibc.config b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/uclibc.config new file mode 100644 index 0000000000000000000000000000000000000000..1c51f52fd306d3a08ada254a04bb29b307ac7399 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/uclibc.config @@ -0,0 +1,295 @@ +# +# Automatically generated make config: don't edit +# Version: 0.9.32-git +# Fri Jul 9 22:31:59 2010 +# +# TARGET_alpha is not set +TARGET_arm=y +# TARGET_avr32 is not set +# TARGET_bfin is not set +# TARGET_cris is not set +# TARGET_e1 is not set +# TARGET_frv is not set +# TARGET_h8300 is not set +# TARGET_hppa is not set +# TARGET_i386 is not set +# TARGET_i960 is not set +# TARGET_ia64 is not set +# TARGET_m68k is not set +# TARGET_microblaze is not set +# TARGET_mips is not set +# TARGET_nios is not set +# TARGET_nios2 is not set +# TARGET_powerpc is not set +# TARGET_sh is not set +# TARGET_sh64 is not set +# TARGET_sparc is not set +# TARGET_v850 is not set +# TARGET_vax is not set +# TARGET_x86_64 is not set +# TARGET_xtensa is not set +# TARGET_c6x is not set + +# CONFIG_GENERIC_ARM is not set +# CONFIG_ARM610 is not set +# CONFIG_ARM710 is not set +# CONFIG_ARM7TDMI is not set +# CONFIG_ARM720T is not set +# CONFIG_ARM920T is not set +# CONFIG_ARM922T is not set +# CONFIG_ARM926T is not set +# CONFIG_ARM10T is not set +CONFIG_ARM1136JF_S=y +# CONFIG_ARM1176JZ_S is not set +# CONFIG_ARM1176JZF_S is not set +# CONFIG_ARM_CORTEX_M3 is not set +# CONFIG_ARM_CORTEX_M1 is not set +# CONFIG_ARM_SA110 is not set +# CONFIG_ARM_SA1100 is not set +# CONFIG_ARM_XSCALE is not set +# CONFIG_ARM_IWMMXT is not set + +# COMPILE_IN_THUMB_MODE is not set +USE_BX=y + +TARGET_SUBARCH="" +# +# Target Architecture Features and Options +# +TARGET_ARCH="arm" +FORCE_OPTIONS_FOR_ARCH=y +# +# Using ELF file format +# +ARCH_LITTLE_ENDIAN=y +# ARCH_BIG_ENDIAN is not set +ARCH_WANTS_LITTLE_ENDIAN=y +# ARCH_WANTS_BIG_ENDIAN is not set +ARCH_HAS_MMU=y +ARCH_USE_MMU=y +UCLIBC_HAS_FLOATS=y +UCLIBC_HAS_FPU=n +DO_C99_MATH=y +# DO_XSI_MATH is not set +# UCLIBC_HAS_FENV is not set +UCLIBC_HAS_LONG_DOUBLE_MATH=y +HAVE_DOT_CONFIG=y + +# +# General Library Settings +# +# HAVE_NO_PIC is not set +DOPIC=y +# ARCH_HAS_NO_SHARED is not set +# ARCH_HAS_NO_LDSO is not set +HAVE_SHARED=y +# FORCE_SHAREABLE_TEXT_SEGMENTS is not set +LDSO_LDD_SUPPORT=y +# LDSO_CACHE_SUPPORT is not set +LDSO_PRELOAD_ENV_SUPPORT=y +# LDSO_PRELOAD_FILE_SUPPORT is not set +# LDSO_STANDALONE_SUPPORT is not set +# LDSO_PRELINK_SUPPORT is not set +# UCLIBC_STATIC_LDCONFIG is not set +LDSO_RUNPATH=y +LDSO_SEARCH_INTERP_PATH=y +LDSO_LD_LIBRARY_PATH=y +# LDSO_NO_CLEANUP is not set +UCLIBC_CTOR_DTOR=y +# LDSO_GNU_HASH_SUPPORT is not set +# HAS_NO_THREADS is not set +UCLIBC_HAS_SYSLOG=y +UCLIBC_HAS_LFS=y +# MALLOC is not set +# MALLOC_SIMPLE is not set +MALLOC_STANDARD=y +MALLOC_GLIBC_COMPAT=y +UCLIBC_DYNAMIC_ATEXIT=y +# COMPAT_ATEXIT is not set +UCLIBC_SUSV3_LEGACY=y +# UCLIBC_SUSV3_LEGACY_MACROS is not set +UCLIBC_SUSV4_LEGACY=y +# UCLIBC_STRICT_HEADERS is not set +# UCLIBC_HAS_STUBS is not set +UCLIBC_HAS_SHADOW=y +UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y +UCLIBC_HAS___PROGNAME=y +UCLIBC_HAS_PTY=y +ASSUME_DEVPTS=y +UNIX98PTY_ONLY=y +UCLIBC_HAS_GETPT=y +UCLIBC_HAS_LIBUTIL=y +UCLIBC_HAS_TM_EXTENSIONS=y +UCLIBC_HAS_TZ_CACHING=y +UCLIBC_HAS_TZ_FILE=y +UCLIBC_HAS_TZ_FILE_READ_MANY=y +UCLIBC_TZ_FILE_PATH="/etc/TZ" +UCLIBC_FALLBACK_TO_ETC_LOCALTIME=y + +# +# Advanced Library Settings +# +UCLIBC_PWD_BUFFER_SIZE=256 +UCLIBC_GRP_BUFFER_SIZE=256 + +# +# Support various families of functions +# +UCLIBC_LINUX_MODULE_26=y +# UCLIBC_LINUX_MODULE_24 is not set +UCLIBC_LINUX_SPECIFIC=y +UCLIBC_HAS_GNU_ERROR=y +UCLIBC_BSD_SPECIFIC=y +UCLIBC_HAS_BSD_ERR=y +# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set +# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set +# UCLIBC_NTP_LEGACY is not set +# UCLIBC_SV4_DEPRECATED is not set +UCLIBC_HAS_REALTIME=y +UCLIBC_HAS_ADVANCED_REALTIME=y +UCLIBC_HAS_EPOLL=y +UCLIBC_HAS_XATTR=y +UCLIBC_HAS_PROFILING=y +UCLIBC_HAS_CRYPT_IMPL=y +# UCLIBC_HAS_SHA256_CRYPT_IMPL is not set +# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set +UCLIBC_HAS_CRYPT=y +UCLIBC_HAS_NETWORK_SUPPORT=y +UCLIBC_HAS_SOCKET=y +UCLIBC_HAS_IPV4=y +UCLIBC_HAS_IPV6=y +UCLIBC_HAS_RPC=n +UCLIBC_HAS_FULL_RPC=n +UCLIBC_HAS_REENTRANT_RPC=n +UCLIBC_USE_NETLINK=y +UCLIBC_SUPPORT_AI_ADDRCONFIG=y +# UCLIBC_HAS_BSD_RES_CLOSE is not set +UCLIBC_HAS_COMPAT_RES_STATE=y +# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set +UCLIBC_HAS_RESOLVER_SUPPORT=y +UCLIBC_HAS_LIBRESOLV_STUB=y +UCLIBC_HAS_LIBNSL_STUB=y + +# +# String and Stdio Support +# +# UCLIBC_HAS_STRING_GENERIC_OPT is not set +UCLIBC_HAS_STRING_ARCH_OPT=y +UCLIBC_HAS_CTYPE_TABLES=y +UCLIBC_HAS_CTYPE_SIGNED=y +# UCLIBC_HAS_CTYPE_UNSAFE is not set +UCLIBC_HAS_CTYPE_CHECKED=y +# UCLIBC_HAS_CTYPE_ENFORCED is not set +UCLIBC_HAS_WCHAR=y +UCLIBC_HAS_LOCALE=n +UCLIBC_HAS_HEXADECIMAL_FLOATS=y +# UCLIBC_HAS_GLIBC_DIGIT_GROUPING is not set +UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y +# USE_OLD_VFPRINTF is not set +UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9 +UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y +# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set +# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set +# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set +# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set +# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set +UCLIBC_HAS_STDIO_BUFSIZ_4096=y +# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set +UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y +# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set +# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set +# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set +# UCLIBC_HAS_STDIO_GETC_MACRO is not set +# UCLIBC_HAS_STDIO_PUTC_MACRO is not set +UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y +# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set +UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y +# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set +UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y +UCLIBC_HAS_PRINTF_M_SPEC=y +UCLIBC_HAS_ERRNO_MESSAGES=y +# UCLIBC_HAS_SYS_ERRLIST is not set +UCLIBC_HAS_SIGNUM_MESSAGES=y +# UCLIBC_HAS_SYS_SIGLIST is not set +UCLIBC_HAS_GNU_GETOPT=y +# UCLIBC_HAS_GNU_GETSUBOPT is not set + +# +# Big and Tall +# +UCLIBC_HAS_REGEX=y +# UCLIBC_HAS_REGEX_OLD is not set +UCLIBC_HAS_FNMATCH=y +# UCLIBC_HAS_FNMATCH_OLD is not set +# UCLIBC_HAS_WORDEXP is not set +UCLIBC_HAS_NFTW=y +UCLIBC_HAS_FTW=y +# UCLIBC_HAS_FTS is not set +UCLIBC_HAS_GLOB=y +UCLIBC_HAS_GNU_GLOB=y +UCLIBC_HAS_UTMPX=y + +# +# Library Installation Options +# +RUNTIME_PREFIX="/" +DEVEL_PREFIX="/usr/" +MULTILIB_DIR="lib" +HARDWIRED_ABSPATH=y + +# +# Security options +# +# UCLIBC_BUILD_PIE is not set +# UCLIBC_HAS_ARC4RANDOM is not set +# HAVE_NO_SSP is not set +UCLIBC_HAS_SSP=y +# UCLIBC_HAS_SSP_COMPAT is not set +# SSP_QUICK_CANARY is not set +PROPOLICE_BLOCK_ABRT=y +# PROPOLICE_BLOCK_SEGV is not set +# UCLIBC_BUILD_SSP is not set +UCLIBC_BUILD_RELRO=y +UCLIBC_BUILD_NOW=y +UCLIBC_BUILD_NOEXECSTACK=y + +# +# uClibc development/debugging options +# +UCLIBC_EXTRA_CFLAGS="" +# DODEBUG is not set +# DODEBUG_PT is not set +DOSTRIP=y +# DOASSERTS is not set +# SUPPORT_LD_DEBUG is not set +# SUPPORT_LD_DEBUG_EARLY is not set +# UCLIBC_MALLOC_DEBUGGING is not set +# UCLIBC_HAS_BACKTRACE is not set +WARNINGS="-Wall" +# EXTRA_WARNINGS is not set +# DOMULTI is not set +# UCLIBC_MJN3_ONLY is not set +# CONFIG_GENERIC_ARM is not set +# CONFIG_ARM610 is not set +# CONFIG_ARM710 is not set +# CONFIG_ARM7TDMI is not set +# CONFIG_ARM720T is not set +# CONFIG_ARM920T is not set +# CONFIG_ARM922T is not set +# CONFIG_ARM926T is not set +# CONFIG_ARM10T is not set +CONFIG_ARM1136JF_S=y +# CONFIG_ARM1176JZ_S is not set +# CONFIG_ARM1176JZF_S is not set +# CONFIG_ARM_SA110 is not set +# CONFIG_ARM_SA1100 is not set +# CONFIG_ARM_XSCALE is not set +# CONFIG_ARM_IWMMXT is not set +# CONFIG_ARM_OABI is not set +CONFIG_ARM_EABI=y +UCLIBC_HAS_THREADS=y +# LINUXTHREADS is not set +# LINUXTHREADS_NEW is not set +# LINUXTHREADS_OLD is not set +UCLIBC_HAS_THREADS_NATIVE=y +# PTHREADS_DEBUG_SUPPORT is not set diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/uclibc.config.minimal b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/uclibc.config.minimal new file mode 100644 index 0000000000000000000000000000000000000000..af041eabf04383938f4857a8ec85a6834b5c07b5 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/uclibc.config.minimal @@ -0,0 +1,2 @@ +UCLIBC_HAS_STDIO_GETC_MACRO=n +UCLIBC_HAS_STDIO_PUTC_MACRO=n diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/yum_requirements.txt b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/yum_requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..1017f133398ac40e5408f2f480b14d422da8b632 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/recipe/parent/yum_requirements.txt @@ -0,0 +1,12 @@ +wget +m4 +help2man +patch +gcc-gfortran +gcc-c++ +rsync +sed +findutils +make +file +strace diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/repodata_record.json b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..9ca17c1e65d11b970175d6966e7fe73d90dcb6ad --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/repodata_record.json @@ -0,0 +1,25 @@ +{ + "arch": "x86_64", + "build": "h69a1729_7", + "build_number": 7, + "channel": "https://repo.anaconda.com/pkgs/main/linux-64/", + "constrains": [ + "libgcc-ng ==15.2.0 *_7", + "libgomp 15.2.0 h4751f2c_7" + ], + "depends": [ + "__glibc >=2.28,<3.0.a0", + "_openmp_mutex >=4.5" + ], + "fn": "libgcc-15.2.0-h69a1729_7.conda", + "license": "GPL-3.0-only WITH GCC-exception-3.1", + "md5": "01fb1b8725fc7f66312b9d409758917a", + "name": "libgcc", + "platform": "linux", + "sha256": "baf9d8d16e2a8ae7a4d1b80f2c1a932deaca1a87c677a370f6ab4688482db47b", + "size": 825084, + "subdir": "linux-64", + "timestamp": 1762772576000, + "url": "https://repo.anaconda.com/pkgs/main/linux-64/libgcc-15.2.0-h69a1729_7.conda", + "version": "15.2.0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/test/run_test.sh b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/test/run_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..35995dc2c95e3db1b4a6d7feb97d323fac781849 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/test/run_test.sh @@ -0,0 +1,10 @@ + + +set -ex + + + +test -f ${PREFIX}/lib/libgcc_s.so +test -f ${PREFIX}/lib/libgomp.so.1 +test `readlink ${PREFIX}/lib/libgomp.so.1` == "libgomp.so.1.0.0" +exit 0 diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/test/test_time_dependencies.json b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/test/test_time_dependencies.json new file mode 100644 index 0000000000000000000000000000000000000000..f9b4fa3ace901164d68b54555c80e7a11512bbbe --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/info/test/test_time_dependencies.json @@ -0,0 +1 @@ +["sysroot_linux-64"] \ No newline at end of file diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/lib/libgcc_s.so b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/lib/libgcc_s.so new file mode 100644 index 0000000000000000000000000000000000000000..c8e92242fc5b32888222e279088df08e791bd52c --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/lib/libgcc_s.so @@ -0,0 +1,4 @@ +/* GNU ld script + Use the shared library, but some functions are only in + the static library. */ +GROUP ( libgcc_s.so.1 -lgcc ) diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/share/info/libgomp.info b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/share/info/libgomp.info new file mode 100644 index 0000000000000000000000000000000000000000..52357ea6f6a97cedb7a214be13468bc67483af61 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/share/info/libgomp.info @@ -0,0 +1,8676 @@ +This is libgomp.info, produced by makeinfo version 6.5 from +libgomp.texi. + +Copyright (C) 2006-2025 Free Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 or +any later version published by the Free Software Foundation; with the +Invariant Sections being "Funding Free Software", the Front-Cover texts +being (a) (see below), and with the Back-Cover Texts being (b) (see +below). A copy of the license is included in the section entitled "GNU +Free Documentation License". + + (a) The FSF's Front-Cover Text is: + + A GNU Manual + + (b) The FSF's Back-Cover Text is: + + You have freedom to copy and modify this GNU Manual, like GNU +software. Copies published by the Free Software Foundation raise funds +for GNU development. +INFO-DIR-SECTION GNU Libraries +START-INFO-DIR-ENTRY +* libgomp: (libgomp). GNU Offloading and Multi Processing Runtime Library. +END-INFO-DIR-ENTRY + + This manual documents libgomp, the GNU Offloading and Multi +Processing Runtime library. This is the GNU implementation of the +OpenMP and OpenACC APIs for parallel and accelerator programming in +C/C++ and Fortran. + + Published by the Free Software Foundation 51 Franklin Street, Fifth +Floor Boston, MA 02110-1301 USA + + Copyright (C) 2006-2025 Free Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 or +any later version published by the Free Software Foundation; with the +Invariant Sections being "Funding Free Software", the Front-Cover texts +being (a) (see below), and with the Back-Cover Texts being (b) (see +below). A copy of the license is included in the section entitled "GNU +Free Documentation License". + + (a) The FSF's Front-Cover Text is: + + A GNU Manual + + (b) The FSF's Back-Cover Text is: + + You have freedom to copy and modify this GNU Manual, like GNU +software. Copies published by the Free Software Foundation raise funds +for GNU development. + + +File: libgomp.info, Node: Top, Next: Enabling OpenMP + +Introduction +************ + +This manual documents the usage of libgomp, the GNU Offloading and Multi +Processing Runtime Library. This includes the GNU implementation of the +OpenMP (https://www.openmp.org) Application Programming Interface (API) +for multi-platform shared-memory parallel programming in C/C++ and +Fortran, and the GNU implementation of the OpenACC +(https://www.openacc.org) Application Programming Interface (API) for +offloading of code to accelerator devices in C/C++ and Fortran. + + Originally, libgomp implemented the GNU OpenMP Runtime Library. +Based on this, support for OpenACC and offloading (both OpenACC and +OpenMP 4's target construct) has been added later on, and the library's +name changed to GNU Offloading and Multi Processing Runtime Library. + +* Menu: + +* Enabling OpenMP:: How to enable OpenMP for your applications. +* OpenMP Implementation Status:: List of implemented features by OpenMP version +* OpenMP Runtime Library Routines: Runtime Library Routines. + The OpenMP runtime application programming + interface. +* OpenMP Environment Variables: Environment Variables. + Influencing OpenMP runtime behavior with + environment variables. +* Enabling OpenACC:: How to enable OpenACC for your + applications. +* OpenACC Runtime Library Routines:: The OpenACC runtime application + programming interface. +* OpenACC Environment Variables:: Influencing OpenACC runtime behavior with + environment variables. +* CUDA Streams Usage:: Notes on the implementation of + asynchronous operations. +* OpenACC Library Interoperability:: OpenACC library interoperability with the + NVIDIA CUBLAS library. +* OpenACC Profiling Interface:: +* OpenMP-Implementation Specifics:: Notes specifics of this OpenMP + implementation +* Offload-Target Specifics:: Notes on offload-target specific internals +* The libgomp ABI:: Notes on the external ABI presented by libgomp. +* Reporting Bugs:: How to report bugs in the GNU Offloading and + Multi Processing Runtime Library. +* Copying:: GNU general public license says + how you can copy and share libgomp. +* GNU Free Documentation License:: + How you can copy and share this manual. +* Funding:: How to help assure continued work for free + software. +* Library Index:: Index of this documentation. + + +File: libgomp.info, Node: Enabling OpenMP, Next: OpenMP Implementation Status, Up: Top + +1 Enabling OpenMP +***************** + +To activate the OpenMP extensions for C/C++ and Fortran, the +compile-time flag '-fopenmp' must be specified. For C and C++, this +enables the handling of the OpenMP directives using '#pragma omp' and +the '[[omp::directive(...)]]', '[[omp::sequence(...)]]' and +'[[omp::decl(...)]]' attributes. For Fortran, it enables for free +source form the '!$omp' sentinel for directives and the '!$' conditional +compilation sentinel and for fixed source form the 'c$omp', '*$omp' and +'!$omp' sentinels for directives and the 'c$', '*$' and '!$' conditional +compilation sentinels. The flag also arranges for automatic linking of +the OpenMP runtime library (*note Runtime Library Routines::). + + The '-fopenmp-simd' flag can be used to enable a subset of OpenMP +directives that do not require the linking of either the OpenMP runtime +library or the POSIX threads library. + + A complete description of all OpenMP directives may be found in the +OpenMP Application Program Interface (https://www.openmp.org) manuals. +See also *note OpenMP Implementation Status::. + + +File: libgomp.info, Node: OpenMP Implementation Status, Next: Runtime Library Routines, Prev: Enabling OpenMP, Up: Top + +2 OpenMP Implementation Status +****************************** + +* Menu: + +* OpenMP 4.5:: Feature completion status to 4.5 specification +* OpenMP 5.0:: Feature completion status to 5.0 specification +* OpenMP 5.1:: Feature completion status to 5.1 specification +* OpenMP 5.2:: Feature completion status to 5.2 specification +* OpenMP 6.0:: Feature completion status to 6.0 specification + +The '_OPENMP' preprocessor macro and Fortran's 'openmp_version' +parameter, provided by 'omp_lib.h' and the 'omp_lib' module, have the +value '201511' (i.e. OpenMP 4.5). + + +File: libgomp.info, Node: OpenMP 4.5, Next: OpenMP 5.0, Up: OpenMP Implementation Status + +2.1 OpenMP 4.5 +============== + +The OpenMP 4.5 specification is fully supported. + + +File: libgomp.info, Node: OpenMP 5.0, Next: OpenMP 5.1, Prev: OpenMP 4.5, Up: OpenMP Implementation Status + +2.2 OpenMP 5.0 +============== + +New features listed in Appendix B of the OpenMP specification +------------------------------------------------------------- + +Description Status Comments +----------------------------------------------------------------------- +Array shaping N +Array sections with non-unit strides in C N +and C++ +Iterators Y +'metadirective' directive Y +'declare variant' directive Y +TARGET-OFFLOAD-VAR ICV and Y +'OMP_TARGET_OFFLOAD' env variable +Nested-parallel changes to Y +MAX-ACTIVE-LEVELS-VAR ICV +'requires' directive Y See also + *note Offload-Target Specifics:: +'teams' construct outside an enclosing Y +target region +Non-rectangular loop nests P Full support for + C/C++, partial + for Fortran + (PR110735 + (https://gcc.gnu.org/PR110735)) +'!=' as relational-op in canonical loop Y +form for C/C++ +'nonmonotonic' as default loop schedule Y +modifier for worksharing-loop constructs +Collapse of associated loops that are Y +imperfectly nested loops +Clauses 'if', 'nontemporal' and Y +'order(concurrent)' in 'simd' construct +'atomic' constructs in 'simd' Y +'loop' construct Y +'order(concurrent)' clause Y +'scan' directive and 'in_scan' modifier Y +for the 'reduction' clause +'in_reduction' clause on 'task' Y +constructs +'in_reduction' clause on 'target' P 'nowait' only +constructs stub +'task_reduction' clause with 'taskgroup' Y +'task' modifier to 'reduction' clause Y +'affinity' clause to 'task' construct Y Stub only +'detach' clause to 'task' construct Y +'omp_fulfill_event' runtime routine Y +'reduction' and 'in_reduction' clauses on Y +'taskloop' and 'taskloop simd' constructs +'taskloop' construct cancelable by Y +'cancel' construct +'mutexinoutset' _dependence-type_ for Y +'depend' clause +Predefined memory spaces, memory Y See also +allocators, allocator traits *note Memory allocation:: +Memory management routines Y +'allocate' directive P C++ unsupported; + see also + *note Memory allocation:: +'allocate' clause P Clause has no + effect on + 'target' + (PR113436 + (https://gcc.gnu.org/PR113436)) +'use_device_addr' clause on 'target data' Y +'ancestor' modifier on 'device' clause Y +Implicit declare target directive Y +Discontiguous array section with 'target N +update' construct +C/C++'s lvalue expressions in 'to', Y +'from' and 'map' clauses +C/C++'s lvalue expressions in 'depend' Y +clauses +Nested 'declare target' directive Y +Combined 'master' constructs Y +'depend' clause on 'taskwait' Y +Weak memory ordering clauses on 'atomic' Y +and 'flush' construct +'hint' clause on the 'atomic' construct Y Stub only +'depobj' construct and depend objects Y +Lock hints were renamed to Y +synchronization hints +'conditional' modifier to 'lastprivate' Y +clause +Map-order clarifications P +'close' _map-type-modifier_ Y +Mapping C/C++ pointer variables and to P +assign the address of device memory +mapped by an array section +Mapping of Fortran pointer and Y +allocatable variables, including pointer +and allocatable components of variables +'defaultmap' extensions Y +'declare mapper' directive N +'omp_get_supported_active_levels' routine Y +Runtime routines and environment Y +variables to display runtime thread +affinity information +'omp_pause_resource' and Y +'omp_pause_resource_all' runtime routines +'omp_get_device_num' runtime routine Y +OMPT interface N +OMPD interface N + +Other new OpenMP 5.0 features +----------------------------- + +Description Status Comments +----------------------------------------------------------------------- +Supporting C++'s range-based for loop Y + + +File: libgomp.info, Node: OpenMP 5.1, Next: OpenMP 5.2, Prev: OpenMP 5.0, Up: OpenMP Implementation Status + +2.3 OpenMP 5.1 +============== + +New features listed in Appendix B of the OpenMP specification +------------------------------------------------------------- + +Description Status Comments +----------------------------------------------------------------------- +OpenMP directive as C++ attribute Y +specifiers +'omp_all_memory' reserved locator Y +_target_device trait_ in OpenMP Context Y +'target_device' selector set in context Y +selectors +C/C++'s 'declare variant' directive: N +elision support of preprocessed code +'declare variant': new clauses Y +'adjust_args' and 'append_args' +'dispatch' construct Y +device-specific ICV settings with Y +environment variables +'assume' and 'assumes' directives Y +'nothing' directive Y +'error' directive Y +'masked' construct Y +'scope' directive Y +Loop transformation constructs Y +'strict' modifier in the 'grainsize' and Y +'num_tasks' clauses of the 'taskloop' +construct +'align' clause in 'allocate' directive P Only C and + Fortran +'align' modifier in 'allocate' clause Y +'thread_limit' clause to 'target' Y +construct +'has_device_addr' clause to 'target' Y +construct +Iterators in 'target update' motion N +clauses and 'map' clauses +Indirect calls to the device version of a Y +procedure or function in 'target' regions +'interop' directive Y Cf. + *note Offload-Target Specifics:: +'omp_interop_t' object support in runtime Y +routines +'nowait' clause in 'taskwait' directive Y +Extensions to the 'atomic' directive Y +'seq_cst' clause on a 'flush' construct Y +'inoutset' argument to the 'depend' Y +clause +'private' and 'firstprivate' argument to Y +'default' clause in C and C++ +'present' argument to 'defaultmap' clause Y +'omp_set_num_teams', Y +'omp_set_teams_thread_limit', +'omp_get_max_teams', +'omp_get_teams_thread_limit' runtime +routines +'omp_target_is_accessible' runtime Y +routine +'omp_target_memcpy_async' and Y +'omp_target_memcpy_rect_async' runtime +routines +'omp_get_mapped_ptr' runtime routine Y +'omp_calloc', 'omp_realloc', Y +'omp_aligned_alloc' and +'omp_aligned_calloc' runtime routines +'omp_alloctrait_key_t' enum: Y +'omp_atv_serialized' added, +'omp_atv_default' changed +'omp_display_env' runtime routine Y +'ompt_scope_endpoint_t' enum: N +'ompt_scope_beginend' +'ompt_sync_region_t' enum additions N +'ompt_state_t' enum: N +'ompt_state_wait_barrier_implementation' +and 'ompt_state_wait_barrier_teams' +'ompt_callback_target_data_op_emi_t', N +'ompt_callback_target_emi_t', +'ompt_callback_target_map_emi_t' and +'ompt_callback_target_submit_emi_t' +'ompt_callback_error_t' type N +'OMP_PLACES' syntax extensions Y +'OMP_NUM_TEAMS' and Y +'OMP_TEAMS_THREAD_LIMIT' environment +variables + +Other new OpenMP 5.1 features +----------------------------- + +Description Status Comments +----------------------------------------------------------------------- +Support of strictly structured blocks in Y +Fortran +Support of structured block sequences in Y +C/C++ +'unconstrained' and 'reproducible' Y +modifiers on 'order' clause +Support 'begin/end declare target' syntax Y +in C/C++ +Pointer predetermined firstprivate N +getting initialized to address of +matching mapped list item per 5.1, Sect. +2.21.7.2 +For Fortran, diagnose placing declarative N +before/between 'USE', 'IMPORT', and +'IMPLICIT' as invalid +Optional comma between directive and Y +clause in the '#pragma' form +'indirect' clause in 'declare target' Y +'device_type(nohost)'/'device_type(host)' N +for variables +'present' modifier to the 'map', 'to' and Y +'from' clauses +Changed interaction between 'declare Y +target' and OpenMP context +Dynamic selector support in Y +'metadirective' +Dynamic selector support in 'declare P Fortran rejects +variant' non-constant + expressions in + dynamic + selectors; C/C++ + reject + expressions + using argument + variables. + (PR113904 + (https://gcc.gnu.org/PR113904)) + + +File: libgomp.info, Node: OpenMP 5.2, Next: OpenMP 6.0, Prev: OpenMP 5.1, Up: OpenMP Implementation Status + +2.4 OpenMP 5.2 +============== + +New features listed in Appendix B of the OpenMP specification +------------------------------------------------------------- + +Description Status Comments +----------------------------------------------------------------------- +'omp_in_explicit_task' routine and Y +EXPLICIT-TASK-VAR ICV +'omp'/'ompx'/'omx' sentinels and N/A warning for +'omp_'/'ompx_' namespaces 'ompx/omx' + sentinels(1) +Clauses on 'end' directive can be on Y +directive +'destroy' clause with destroy-var Y +argument on 'depobj' +Deprecation of no-argument 'destroy' N/A undeprecated in +clause on 'depobj' OpenMP 6 +'linear' clause syntax changes and 'step' Y +modifier +Deprecation of minus operator for N +reductions +Deprecation of separating 'map' modifiers N +without comma +'declare mapper' with iterator and N +'present' modifiers +If a matching mapped list item is not Y +found in the data environment, the +pointer retains its original value +New 'enter' clause as alias for 'to' on Y +declare target directive +Deprecation of 'to' clause on declare N +target directive +Extended list of directives permitted in Y +Fortran pure procedures +New 'allocators' directive for Fortran Y +Deprecation of 'allocate' directive for N +Fortran allocatables/pointers +Optional paired 'end' directive with Y +'dispatch' +New 'memspace' and 'traits' modifiers for N +'uses_allocators' +Deprecation of traits array following the N +allocator_handle expression in +'uses_allocators' +New 'otherwise' clause as alias for Y +'default' on metadirectives +Deprecation of 'default' clause on N Both 'otherwise' +metadirectives and 'default' + are accepted + without + diagnostics. +Deprecation of delimited form of 'declare N +target' +Reproducible semantics changed for N +'order(concurrent)' +'allocate' and 'firstprivate' clauses on Y +'scope' +'ompt_callback_work' N +Default map-type for the 'map' clause in Y +'target enter/exit data' +New 'doacross' clause as alias for Y +'depend' with 'source'/'sink' modifier +Deprecation of 'depend' with N +'source'/'sink' modifier +'omp_cur_iteration' keyword Y + +Other new OpenMP 5.2 features +----------------------------- + +Description Status Comments +----------------------------------------------------------------------- +For Fortran, optional comma between N +directive and clause +Conforming device numbers and Y +'omp_initial_device' and +'omp_invalid_device' enum/PARAMETER +Initial value of DEFAULT-DEVICE-VAR ICV Y +with 'OMP_TARGET_OFFLOAD=mandatory' +'all' as _implicit-behavior_ for Y +'defaultmap' +_interop_types_ in any position of the Y +modifier list for the 'init' clause of +the 'interop' construct +Invoke virtual member functions of C++ N +objects created on the host device on +other devices +'mapper' as map-type modifier in 'declare N +mapper' + + ---------- Footnotes ---------- + + (1) The 'ompx' sentinel as C/C++ pragma and C++ attributes are warned +for with '-Wunknown-pragmas' (implied by '-Wall') and '-Wattributes' +(enabled by default), respectively; for Fortran free-source code, there +is a warning enabled by default and, for fixed-source code, the 'omx' +sentinel is warned for with '-Wsurprising' (enabled by '-Wall'). +Unknown clauses are always rejected with an error. + + +File: libgomp.info, Node: OpenMP 6.0, Prev: OpenMP 5.2, Up: OpenMP Implementation Status + +2.5 OpenMP 6.0 +============== + +New features listed in Appendix B of the OpenMP specification +------------------------------------------------------------- + +Features deprecated in versions 5.0, 5.1 N/A Backward +and 5.2 were removed compatibility +Full support for C23 was added P +Full support for C++23 was added P +Full support for Fortran 2023 was added P +'_ALL' suffix to the device-scope P Host device +environment variables number wrongly + accepted +'num_threads' clause now accepts a list N +Abstract names added for N +'OMP_NUM_THREADS', 'OMP_THREAD_LIMIT' and +'OMP_TEAMS_THREAD_LIMIT' +Supporting increments with abstract names N +in 'OMP_PLACES' +Extension of 'OMP_DEFAULT_DEVICE' and new N +'OMP_AVAILABLE_DEVICES' environment vars +New 'uid' trait for target devices and N +for 'OMP_AVAILABLE_DEVICES' and +'OMP_DEFAULT_DEVICE' +New 'OMP_THREADS_RESERVE' environment N +variable +The 'decl' attribute was added to the C++ Y +attribute syntax +The OpenMP directive syntax was extended Y +to include C23 attribute specifiers +Support for pure directives in Fortran's N +'do concurrent' +All inarguable clauses take now an N +optional Boolean argument +The 'adjust_args' clause was extended to N +specify the argument by position and +supports variadic arguments +For Fortran, _locator list_ can be also N +function reference with data pointer +result +Concept of _assumed-size arrays_ in C and N +C++ +_directive-name-modifier_ accepted in all N +clauses +Extension of 'interop' operation of Y +'append_args', allowing all modifiers of +the 'init' clause +New argument-free version of 'depobj' N +with repeatable clauses and the 'init' +clause +Undeprecate omitting the argument to the Y +'depend' clause of the argument version +of the 'depend' construct +For Fortran, atomic with BLOCK construct N +and, for C/C++, with unlimited curly +braces supported +For Fortran, atomic with pointer N +comparison +For Fortran, atomic with enum and N +enumeration types +For Fortran, atomic compare with storing N +the comparison result +Canonical loop sequences and new N +'looprange' clause +For Fortran, handling polymorphic types P 'private' not +in data-sharing-attribute clauses supported +For Fortran, rejecting polymorphic types N not diagnosed +in data-mapping clauses (and mostly + unsupported) +New 'taskgraph' construct including N +'saved' modifier and 'replayable' clause +'default' clause on the 'target' N +directive and accepting variable +categories +Semantic change regarding the reference N +count update with 'use_device_ptr' and +'use_device_addr' +Support for inductions N +Reduction over private variables with N +'reduction' clause +Implicit reduction identifiers of C++ N +classes +New 'init_complete' clause to the 'scan' N +directive +'ref' modifier to the 'map' clause N +New 'storage' map-type modifier; N +context-dependent 'alloc' and 'release' +are aliases +Change of the _map-type_ property from N +_ultimate_ to _default_ +'self' modifier to 'map' and 'self' as N +'defaultmap' argument +Mapping of _assumed-size arrays_ in C, N +C++ and Fortran +'delete' as delete-modifier not as map N +type +For Fortran, the 'automap' modifier to N +the 'enter' clause of 'declare_target' +'groupprivate' directive N +'local' clause to 'declare_target' N +directive +'part_size' allocator trait for N +'interleaved' allocator partitions +'pin_device', 'preferred_device' and N +'target_access' allocator traits +'access' allocator trait changes N +New 'partitioner' value to 'partition' N +allocator trait +Semicolon-separated list to N +'uses_allocators' +New 'need_device_addr' modifier to N +'adjust_args' clause +'interop' clause to 'dispatch' Y +Scope requirement changes for N +'declare_target' +'message' and 'severity' clauses to N +'parallel' directive +'self_maps' clause to 'requires' Y +directive +'no_openmp_constructs' assumptions clause N +Restriction for 'ordered' regarding N +loop-transforming directives +'apply' clause to loop-transforming N +constructs +Non-constant values in the 'sizes' clause N +'fuse' loop-transformation construct N +'interchange' loop-transformation N +construct +'reverse' loop-transformation construct N +'split' loop-transformation construct N +'stripe' loop-transformation construct N +'tile' permitting association of grid and N +inter-tile loops +'strict' modifier keyword to N +'num_threads' +'safesync' clause to the 'parallel' N +construct +'omp_curr_progress_width' identifier N +'omp_get_max_progress_width' runtime N +routine +Lifted restrictions on N +'order(concurrent)' and, hence, the +'loop' construct +'atomic' permitted in a construct with N +'order(concurrent)' +Lifted restrictions on N +not-strictly-nested regions with +'order(concurrent)' +'workdistribute' directive for Fortran N +Fortran 'DO CONCURRENT' as associated N +loop in a 'loop' construct +New 'task_iteration' directive inside N +'taskloop' +'threadset' clause in task-generating N +constructs +New 'priority' clause to 'target', N +'target_enter_data', 'target_data', +'target_exit_data' and 'target_update' +New 'device_type' clause to the 'target' N +directive +'target_data' as composite construct N +'nowait' clause with reverse-offload N +'target' directives +Extended _prefer-type_ modifier to 'init' Y +clause +Boolean argument to 'nowait' and N +'nogroup' may be non constant +'memscope' clause to 'atomic' and 'flush' N +New 'transparent' clause for N +multi-generational task-dependence graphs +The 'cancel' construct now completes N +tasks with unfulfilled events +'omp_fulfill_event' routine was N +restricted regarding fulfillment of event +variables +Added rule for compound-directive names, N +permitting many more combinations +'omp_is_free_agent' and N +'omp_ancestor_is_free_agent' routines +'omp_get_device_from_uid' and Y +'omp_get_uid_from_device' routines +'omp_get_device_num_teams', N +'omp_set_device_num_teams', +'omp_get_device_teams_thread_limit', and +'omp_set_device_teams_thread_limit' +routines +'omp_target_memset' and N +'omp_target_memset_async' routines +Fortran version of the interop runtime Y +routines +Routines for obtaining memory N +spaces/allocators for shared/device +memory +'omp_get_memspace_num_resources' routine N +'omp_get_memspace_pagesize' routine N +'omp_get_submemspace' routine N +'omp_init_mempartitioner', N +'omp_destroy_mempartitioner', +'omp_init_mempartition', +'omp_destroy_mempartition', +'omp_mempartition_set_part', +'omp_mempartition_get_user_data' routines +Deprecation of the 'target_data_op', N +'target', 'target_map' and +'target_submit' callbacks and as values +that 'set_callback' must return +'ompt_target_data_transfer' and N +'ompt_target_data_transfer_async' values +in 'ompt_target_data_op_t' enum +The values N +'ompt_target_data_transfer_to_device', +'ompt_target_data_transfer_from_device', +'ompt_target_data_transfer_to_device_async' +and +'ompt_target_data_transfer_from_device_async' +of the 'target_data_op' OMPT type were +deprecated +'ompt_get_buffer_limits' OMPT routine N + +Deprecated features, unless listed above +---------------------------------------- + +Deprecation of omitting the optional N +white space to separate adjacent keywords +in the directive-name in Fortran (fixed +and free source form) +Deprecation of the combiner expression in N +the 'declare_reduction' argument +Deprecation of the Fortran include file N +'omp_lib.h' + +Other new OpenMP 6.0 features +----------------------------- + +Multi-word directives now use underscore N +by default +Relaxed Fortran restrictions to the N +'aligned' clause +Mapping lambda captures N +New 'omp_pause_stop_tool' constant for N +omp_pause_resource +In Fortran (fixed and free source form), N +spaces between directive names are +mandatory +Update of the map-type decay for mapping N +and 'declare_mapper' + + +File: libgomp.info, Node: Runtime Library Routines, Next: Environment Variables, Prev: OpenMP Implementation Status, Up: Top + +3 OpenMP Runtime Library Routines +********************************* + +The runtime routines described here are defined by Section 18 of the +OpenMP specification in version 5.2. + +* Menu: + +* Thread Team Routines:: +* Thread Affinity Routines:: +* Teams Region Routines:: +* Tasking Routines:: +* Resource Relinquishing Routines:: +* Device Information Routines:: +* Device Memory Routines:: +* Lock Routines:: +* Timing Routines:: +* Event Routine:: +* Interoperability Routines:: +* Memory Management Routines:: +* Environment Display Routine:: + + +File: libgomp.info, Node: Thread Team Routines, Next: Thread Affinity Routines, Up: Runtime Library Routines + +3.1 Thread Team Routines +======================== + +Routines controlling threads in the current contention group. They have +C linkage and do not throw exceptions. + +* Menu: + +* omp_set_num_threads:: Set upper team size limit +* omp_get_num_threads:: Size of the active team +* omp_get_max_threads:: Maximum number of threads of parallel region +* omp_get_thread_num:: Current thread ID +* omp_in_parallel:: Whether a parallel region is active +* omp_set_dynamic:: Enable/disable dynamic teams +* omp_get_dynamic:: Dynamic teams setting +* omp_get_cancellation:: Whether cancellation support is enabled +* omp_set_nested:: Enable/disable nested parallel regions +* omp_get_nested:: Nested parallel regions +* omp_set_schedule:: Set the runtime scheduling method +* omp_get_schedule:: Obtain the runtime scheduling method +* omp_get_teams_thread_limit:: Maximum number of threads imposed by teams +* omp_get_supported_active_levels:: Maximum number of active regions supported +* omp_set_max_active_levels:: Limits the number of active parallel regions +* omp_get_max_active_levels:: Current maximum number of active regions +* omp_get_level:: Number of parallel regions +* omp_get_ancestor_thread_num:: Ancestor thread ID +* omp_get_team_size:: Number of threads in a team +* omp_get_active_level:: Number of active parallel regions + + +File: libgomp.info, Node: omp_set_num_threads, Next: omp_get_num_threads, Up: Thread Team Routines + +3.1.1 'omp_set_num_threads' - Set upper team size limit +------------------------------------------------------- + +_Description_: + Specifies the number of threads used by default in subsequent + parallel sections, if those do not specify a 'num_threads' clause. + The argument of 'omp_set_num_threads' shall be a positive integer. + +_C/C++_: + _Prototype_: 'void omp_set_num_threads(int num_threads);' + +_Fortran_: + _Interface_: 'subroutine omp_set_num_threads(num_threads)' + 'integer, intent(in) :: num_threads' + +_See also_: + *note OMP_NUM_THREADS::, *note omp_get_num_threads::, *note + omp_get_max_threads:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.1. + + +File: libgomp.info, Node: omp_get_num_threads, Next: omp_get_max_threads, Prev: omp_set_num_threads, Up: Thread Team Routines + +3.1.2 'omp_get_num_threads' - Size of the active team +----------------------------------------------------- + +_Description_: + Returns the number of threads in the current team. In a sequential + section of the program 'omp_get_num_threads' returns 1. + + The default team size may be initialized at startup by the + 'OMP_NUM_THREADS' environment variable. At runtime, the size of + the current team may be set either by the 'NUM_THREADS' clause or + by 'omp_set_num_threads'. If none of the above were used to define + a specific value and 'OMP_DYNAMIC' is disabled, one thread per CPU + online is used. + +_C/C++_: + _Prototype_: 'int omp_get_num_threads(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_num_threads()' + +_See also_: + *note omp_get_max_threads::, *note omp_set_num_threads::, *note + OMP_NUM_THREADS:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.2. + + +File: libgomp.info, Node: omp_get_max_threads, Next: omp_get_thread_num, Prev: omp_get_num_threads, Up: Thread Team Routines + +3.1.3 'omp_get_max_threads' - Maximum number of threads of parallel region +-------------------------------------------------------------------------- + +_Description_: + Return the maximum number of threads used for the current parallel + region that does not use the clause 'num_threads'. + +_C/C++_: + _Prototype_: 'int omp_get_max_threads(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_max_threads()' + +_See also_: + *note omp_set_num_threads::, *note omp_set_dynamic::, *note + omp_get_thread_limit:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.3. + + +File: libgomp.info, Node: omp_get_thread_num, Next: omp_in_parallel, Prev: omp_get_max_threads, Up: Thread Team Routines + +3.1.4 'omp_get_thread_num' - Current thread ID +---------------------------------------------- + +_Description_: + Returns a unique thread identification number within the current + team. In a sequential parts of the program, 'omp_get_thread_num' + always returns 0. In parallel regions the return value varies from + 0 to 'omp_get_num_threads'-1 inclusive. The return value of the + primary thread of a team is always 0. + +_C/C++_: + _Prototype_: 'int omp_get_thread_num(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_thread_num()' + +_See also_: + *note omp_get_num_threads::, *note omp_get_ancestor_thread_num:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.4. + + +File: libgomp.info, Node: omp_in_parallel, Next: omp_set_dynamic, Prev: omp_get_thread_num, Up: Thread Team Routines + +3.1.5 'omp_in_parallel' - Whether a parallel region is active +------------------------------------------------------------- + +_Description_: + This function returns 'true' if currently running in parallel, + 'false' otherwise. Here, 'true' and 'false' represent their + language-specific counterparts. + +_C/C++_: + _Prototype_: 'int omp_in_parallel(void);' + +_Fortran_: + _Interface_: 'logical function omp_in_parallel()' + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.6. + + +File: libgomp.info, Node: omp_set_dynamic, Next: omp_get_dynamic, Prev: omp_in_parallel, Up: Thread Team Routines + +3.1.6 'omp_set_dynamic' - Enable/disable dynamic teams +------------------------------------------------------ + +_Description_: + Enable or disable the dynamic adjustment of the number of threads + within a team. The function takes the language-specific equivalent + of 'true' and 'false', where 'true' enables dynamic adjustment of + team sizes and 'false' disables it. + +_C/C++_: + _Prototype_: 'void omp_set_dynamic(int dynamic_threads);' + +_Fortran_: + _Interface_: 'subroutine omp_set_dynamic(dynamic_threads)' + 'logical, intent(in) :: dynamic_threads' + +_See also_: + *note OMP_DYNAMIC::, *note omp_get_dynamic:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.7. + + +File: libgomp.info, Node: omp_get_dynamic, Next: omp_get_cancellation, Prev: omp_set_dynamic, Up: Thread Team Routines + +3.1.7 'omp_get_dynamic' - Dynamic teams setting +----------------------------------------------- + +_Description_: + This function returns 'true' if enabled, 'false' otherwise. Here, + 'true' and 'false' represent their language-specific counterparts. + + The dynamic team setting may be initialized at startup by the + 'OMP_DYNAMIC' environment variable or at runtime using + 'omp_set_dynamic'. If undefined, dynamic adjustment is disabled by + default. + +_C/C++_: + _Prototype_: 'int omp_get_dynamic(void);' + +_Fortran_: + _Interface_: 'logical function omp_get_dynamic()' + +_See also_: + *note omp_set_dynamic::, *note OMP_DYNAMIC:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.8. + + +File: libgomp.info, Node: omp_get_cancellation, Next: omp_set_nested, Prev: omp_get_dynamic, Up: Thread Team Routines + +3.1.8 'omp_get_cancellation' - Whether cancellation support is enabled +---------------------------------------------------------------------- + +_Description_: + This function returns 'true' if cancellation is activated, 'false' + otherwise. Here, 'true' and 'false' represent their + language-specific counterparts. Unless 'OMP_CANCELLATION' is set + true, cancellations are deactivated. + +_C/C++_: + _Prototype_: 'int omp_get_cancellation(void);' + +_Fortran_: + _Interface_: 'logical function omp_get_cancellation()' + +_See also_: + *note OMP_CANCELLATION:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.9. + + +File: libgomp.info, Node: omp_set_nested, Next: omp_get_nested, Prev: omp_get_cancellation, Up: Thread Team Routines + +3.1.9 'omp_set_nested' - Enable/disable nested parallel regions +--------------------------------------------------------------- + +_Description_: + Enable or disable nested parallel regions, i.e., whether team + members are allowed to create new teams. The function takes the + language-specific equivalent of 'true' and 'false', where 'true' + enables dynamic adjustment of team sizes and 'false' disables it. + + Enabling nested parallel regions also sets the maximum number of + active nested regions to the maximum supported. Disabling nested + parallel regions sets the maximum number of active nested regions + to one. + + Note that the 'omp_set_nested' API routine was deprecated in the + OpenMP specification 5.0 in favor of 'omp_set_max_active_levels'. + +_C/C++_: + _Prototype_: 'void omp_set_nested(int nested);' + +_Fortran_: + _Interface_: 'subroutine omp_set_nested(nested)' + 'logical, intent(in) :: nested' + +_See also_: + *note omp_get_nested::, *note omp_set_max_active_levels::, *note + OMP_MAX_ACTIVE_LEVELS::, *note OMP_NESTED:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.10. + + +File: libgomp.info, Node: omp_get_nested, Next: omp_set_schedule, Prev: omp_set_nested, Up: Thread Team Routines + +3.1.10 'omp_get_nested' - Nested parallel regions +------------------------------------------------- + +_Description_: + This function returns 'true' if nested parallel regions are + enabled, 'false' otherwise. Here, 'true' and 'false' represent + their language-specific counterparts. + + The state of nested parallel regions at startup depends on several + environment variables. If 'OMP_MAX_ACTIVE_LEVELS' is defined and + is set to greater than one, then nested parallel regions will be + enabled. If not defined, then the value of the 'OMP_NESTED' + environment variable will be followed if defined. If neither are + defined, then if either 'OMP_NUM_THREADS' or 'OMP_PROC_BIND' are + defined with a list of more than one value, then nested parallel + regions are enabled. If none of these are defined, then nested + parallel regions are disabled by default. + + Nested parallel regions can be enabled or disabled at runtime using + 'omp_set_nested', or by setting the maximum number of nested + regions with 'omp_set_max_active_levels' to one to disable, or + above one to enable. + + Note that the 'omp_get_nested' API routine was deprecated in the + OpenMP specification 5.0 in favor of 'omp_get_max_active_levels'. + +_C/C++_: + _Prototype_: 'int omp_get_nested(void);' + +_Fortran_: + _Interface_: 'logical function omp_get_nested()' + +_See also_: + *note omp_get_max_active_levels::, *note omp_set_nested::, *note + OMP_MAX_ACTIVE_LEVELS::, *note OMP_NESTED:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.11. + + +File: libgomp.info, Node: omp_set_schedule, Next: omp_get_schedule, Prev: omp_get_nested, Up: Thread Team Routines + +3.1.11 'omp_set_schedule' - Set the runtime scheduling method +------------------------------------------------------------- + +_Description_: + Sets the runtime scheduling method. The KIND argument can have the + value 'omp_sched_static', 'omp_sched_dynamic', 'omp_sched_guided' + or 'omp_sched_auto'. Except for 'omp_sched_auto', the chunk size + is set to the value of CHUNK_SIZE if positive, or to the default + value if zero or negative. For 'omp_sched_auto' the CHUNK_SIZE + argument is ignored. + +_C/C++_ + _Prototype_: 'void omp_set_schedule(omp_sched_t kind, int + chunk_size);' + +_Fortran_: + _Interface_: 'subroutine omp_set_schedule(kind, chunk_size)' + 'integer(kind=omp_sched_kind) kind' + 'integer chunk_size' + +_See also_: + *note omp_get_schedule:: *note OMP_SCHEDULE:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.12. + + +File: libgomp.info, Node: omp_get_schedule, Next: omp_get_teams_thread_limit, Prev: omp_set_schedule, Up: Thread Team Routines + +3.1.12 'omp_get_schedule' - Obtain the runtime scheduling method +---------------------------------------------------------------- + +_Description_: + Obtain the runtime scheduling method. The KIND argument is set to + 'omp_sched_static', 'omp_sched_dynamic', 'omp_sched_guided' or + 'omp_sched_auto'. The second argument, CHUNK_SIZE, is set to the + chunk size. + +_C/C++_ + _Prototype_: 'void omp_get_schedule(omp_sched_t *kind, int + *chunk_size);' + +_Fortran_: + _Interface_: 'subroutine omp_get_schedule(kind, chunk_size)' + 'integer(kind=omp_sched_kind) kind' + 'integer chunk_size' + +_See also_: + *note omp_set_schedule::, *note OMP_SCHEDULE:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.13. + + +File: libgomp.info, Node: omp_get_teams_thread_limit, Next: omp_get_supported_active_levels, Prev: omp_get_schedule, Up: Thread Team Routines + +3.1.13 'omp_get_teams_thread_limit' - Maximum number of threads imposed by teams +-------------------------------------------------------------------------------- + +_Description_: + Return the maximum number of threads that are able to participate + in each team created by a teams construct. + +_C/C++_: + _Prototype_: 'int omp_get_teams_thread_limit(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_teams_thread_limit()' + +_See also_: + *note omp_set_teams_thread_limit::, *note OMP_TEAMS_THREAD_LIMIT:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.4.6. + + +File: libgomp.info, Node: omp_get_supported_active_levels, Next: omp_set_max_active_levels, Prev: omp_get_teams_thread_limit, Up: Thread Team Routines + +3.1.14 'omp_get_supported_active_levels' - Maximum number of active regions supported +------------------------------------------------------------------------------------- + +_Description_: + This function returns the maximum number of nested, active parallel + regions supported by this implementation. + +_C/C++_ + _Prototype_: 'int omp_get_supported_active_levels(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_supported_active_levels()' + +_See also_: + *note omp_get_max_active_levels::, *note + omp_set_max_active_levels:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.2.15. + + +File: libgomp.info, Node: omp_set_max_active_levels, Next: omp_get_max_active_levels, Prev: omp_get_supported_active_levels, Up: Thread Team Routines + +3.1.15 'omp_set_max_active_levels' - Limits the number of active parallel regions +--------------------------------------------------------------------------------- + +_Description_: + This function limits the maximum allowed number of nested, active + parallel regions. MAX_LEVELS must be less or equal to the value + returned by 'omp_get_supported_active_levels'. + +_C/C++_ + _Prototype_: 'void omp_set_max_active_levels(int max_levels);' + +_Fortran_: + _Interface_: 'subroutine omp_set_max_active_levels(max_levels)' + 'integer max_levels' + +_See also_: + *note omp_get_max_active_levels::, *note omp_get_active_level::, + *note omp_get_supported_active_levels:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.15. + + +File: libgomp.info, Node: omp_get_max_active_levels, Next: omp_get_level, Prev: omp_set_max_active_levels, Up: Thread Team Routines + +3.1.16 'omp_get_max_active_levels' - Current maximum number of active regions +----------------------------------------------------------------------------- + +_Description_: + This function obtains the maximum allowed number of nested, active + parallel regions. + +_C/C++_ + _Prototype_: 'int omp_get_max_active_levels(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_max_active_levels()' + +_See also_: + *note omp_set_max_active_levels::, *note omp_get_active_level:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.16. + + +File: libgomp.info, Node: omp_get_level, Next: omp_get_ancestor_thread_num, Prev: omp_get_max_active_levels, Up: Thread Team Routines + +3.1.17 'omp_get_level' - Obtain the current nesting level +--------------------------------------------------------- + +_Description_: + This function returns the nesting level for the parallel blocks, + which enclose the calling call. + +_C/C++_ + _Prototype_: 'int omp_get_level(void);' + +_Fortran_: + _Interface_: 'integer function omp_level()' + +_See also_: + *note omp_get_active_level:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.17. + + +File: libgomp.info, Node: omp_get_ancestor_thread_num, Next: omp_get_team_size, Prev: omp_get_level, Up: Thread Team Routines + +3.1.18 'omp_get_ancestor_thread_num' - Ancestor thread ID +--------------------------------------------------------- + +_Description_: + This function returns the thread identification number for the + given nesting level of the current thread. For values of LEVEL + outside zero to 'omp_get_level' -1 is returned; if LEVEL is + 'omp_get_level' the result is identical to 'omp_get_thread_num'. + +_C/C++_ + _Prototype_: 'int omp_get_ancestor_thread_num(int level);' + +_Fortran_: + _Interface_: 'integer function omp_get_ancestor_thread_num(level)' + 'integer level' + +_See also_: + *note omp_get_level::, *note omp_get_thread_num::, *note + omp_get_team_size:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.18. + + +File: libgomp.info, Node: omp_get_team_size, Next: omp_get_active_level, Prev: omp_get_ancestor_thread_num, Up: Thread Team Routines + +3.1.19 'omp_get_team_size' - Number of threads in a team +-------------------------------------------------------- + +_Description_: + This function returns the number of threads in a thread team to + which either the current thread or its ancestor belongs. For + values of LEVEL outside zero to 'omp_get_level', -1 is returned; if + LEVEL is zero, 1 is returned, and for 'omp_get_level', the result + is identical to 'omp_get_num_threads'. + +_C/C++_: + _Prototype_: 'int omp_get_team_size(int level);' + +_Fortran_: + _Interface_: 'integer function omp_get_team_size(level)' + 'integer level' + +_See also_: + *note omp_get_num_threads::, *note omp_get_level::, *note + omp_get_ancestor_thread_num:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.19. + + +File: libgomp.info, Node: omp_get_active_level, Prev: omp_get_team_size, Up: Thread Team Routines + +3.1.20 'omp_get_active_level' - Number of parallel regions +---------------------------------------------------------- + +_Description_: + This function returns the nesting level for the active parallel + blocks, which enclose the calling call. + +_C/C++_ + _Prototype_: 'int omp_get_active_level(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_active_level()' + +_See also_: + *note omp_get_level::, *note omp_get_max_active_levels::, *note + omp_set_max_active_levels:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.20. + + +File: libgomp.info, Node: Thread Affinity Routines, Next: Teams Region Routines, Prev: Thread Team Routines, Up: Runtime Library Routines + +3.2 Thread Affinity Routines +============================ + +Routines controlling and accessing thread-affinity policies. They have +C linkage and do not throw exceptions. + +* Menu: + +* omp_get_proc_bind:: Whether threads may be moved between CPUs + + +File: libgomp.info, Node: omp_get_proc_bind, Up: Thread Affinity Routines + +3.2.1 'omp_get_proc_bind' - Whether threads may be moved between CPUs +--------------------------------------------------------------------- + +_Description_: + This functions returns the currently active thread affinity policy, + which is set via 'OMP_PROC_BIND'. Possible values are + 'omp_proc_bind_false', 'omp_proc_bind_true', + 'omp_proc_bind_primary', 'omp_proc_bind_master', + 'omp_proc_bind_close' and 'omp_proc_bind_spread', where + 'omp_proc_bind_master' is an alias for 'omp_proc_bind_primary'. + +_C/C++_: + _Prototype_: 'omp_proc_bind_t omp_get_proc_bind(void);' + +_Fortran_: + _Interface_: 'integer(kind=omp_proc_bind_kind) function + omp_get_proc_bind()' + +_See also_: + *note OMP_PROC_BIND::, *note OMP_PLACES::, *note + GOMP_CPU_AFFINITY::, + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.22. + + +File: libgomp.info, Node: Teams Region Routines, Next: Tasking Routines, Prev: Thread Affinity Routines, Up: Runtime Library Routines + +3.3 Teams Region Routines +========================= + +Routines controlling the league of teams that are executed in a 'teams' +region. They have C linkage and do not throw exceptions. + +* Menu: + +* omp_get_num_teams:: Number of teams +* omp_get_team_num:: Get team number +* omp_set_num_teams:: Set upper teams limit for teams region +* omp_get_max_teams:: Maximum number of teams for teams region +* omp_set_teams_thread_limit:: Set upper thread limit for teams construct +* omp_get_thread_limit:: Maximum number of threads + + +File: libgomp.info, Node: omp_get_num_teams, Next: omp_get_team_num, Up: Teams Region Routines + +3.3.1 'omp_get_num_teams' - Number of teams +------------------------------------------- + +_Description_: + Returns the number of teams in the current team region. + +_C/C++_: + _Prototype_: 'int omp_get_num_teams(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_num_teams()' + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.32. + + +File: libgomp.info, Node: omp_get_team_num, Next: omp_set_num_teams, Prev: omp_get_num_teams, Up: Teams Region Routines + +3.3.2 'omp_get_team_num' - Get team number +------------------------------------------ + +_Description_: + Returns the team number of the calling thread. + +_C/C++_: + _Prototype_: 'int omp_get_team_num(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_team_num()' + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.33. + + +File: libgomp.info, Node: omp_set_num_teams, Next: omp_get_max_teams, Prev: omp_get_team_num, Up: Teams Region Routines + +3.3.3 'omp_set_num_teams' - Set upper teams limit for teams construct +--------------------------------------------------------------------- + +_Description_: + Specifies the upper bound for number of teams created by the teams + construct which does not specify a 'num_teams' clause. The + argument of 'omp_set_num_teams' shall be a positive integer. + +_C/C++_: + _Prototype_: 'void omp_set_num_teams(int num_teams);' + +_Fortran_: + _Interface_: 'subroutine omp_set_num_teams(num_teams)' + 'integer, intent(in) :: num_teams' + +_See also_: + *note OMP_NUM_TEAMS::, *note omp_get_num_teams::, *note + omp_get_max_teams:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.4.3. + + +File: libgomp.info, Node: omp_get_max_teams, Next: omp_set_teams_thread_limit, Prev: omp_set_num_teams, Up: Teams Region Routines + +3.3.4 'omp_get_max_teams' - Maximum number of teams of teams region +------------------------------------------------------------------- + +_Description_: + Return the maximum number of teams used for the teams region that + does not use the clause 'num_teams'. + +_C/C++_: + _Prototype_: 'int omp_get_max_teams(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_max_teams()' + +_See also_: + *note omp_set_num_teams::, *note omp_get_num_teams:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.4.4. + + +File: libgomp.info, Node: omp_set_teams_thread_limit, Next: omp_get_thread_limit, Prev: omp_get_max_teams, Up: Teams Region Routines + +3.3.5 'omp_set_teams_thread_limit' - Set upper thread limit for teams construct +------------------------------------------------------------------------------- + +_Description_: + Specifies the upper bound for number of threads that are available + for each team created by the teams construct which does not specify + a 'thread_limit' clause. The argument of + 'omp_set_teams_thread_limit' shall be a positive integer. + +_C/C++_: + _Prototype_: 'void omp_set_teams_thread_limit(int thread_limit);' + +_Fortran_: + _Interface_: 'subroutine omp_set_teams_thread_limit(thread_limit)' + 'integer, intent(in) :: thread_limit' + +_See also_: + *note OMP_TEAMS_THREAD_LIMIT::, *note omp_get_teams_thread_limit::, + *note omp_get_thread_limit:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.4.5. + + +File: libgomp.info, Node: omp_get_thread_limit, Prev: omp_set_teams_thread_limit, Up: Teams Region Routines + +3.3.6 'omp_get_thread_limit' - Maximum number of threads +-------------------------------------------------------- + +_Description_: + Return the maximum number of threads of the program. + +_C/C++_: + _Prototype_: 'int omp_get_thread_limit(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_thread_limit()' + +_See also_: + *note omp_get_max_threads::, *note OMP_THREAD_LIMIT:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.14. + + +File: libgomp.info, Node: Tasking Routines, Next: Resource Relinquishing Routines, Prev: Teams Region Routines, Up: Runtime Library Routines + +3.4 Tasking Routines +==================== + +Routines relating to explicit tasks. They have C linkage and do not +throw exceptions. + +* Menu: + +* omp_get_max_task_priority:: Maximum task priority value that can be set +* omp_in_explicit_task:: Whether a given task is an explicit task +* omp_in_final:: Whether in final or included task region + + +File: libgomp.info, Node: omp_get_max_task_priority, Next: omp_in_explicit_task, Up: Tasking Routines + +3.4.1 'omp_get_max_task_priority' - Maximum priority value +---------------------------------------------------------- + +that can be set for tasks. +_Description_: + This function obtains the maximum allowed priority number for + tasks. + +_C/C++_ + _Prototype_: 'int omp_get_max_task_priority(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_max_task_priority()' + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.29. + + +File: libgomp.info, Node: omp_in_explicit_task, Next: omp_in_final, Prev: omp_get_max_task_priority, Up: Tasking Routines + +3.4.2 'omp_in_explicit_task' - Whether a given task is an explicit task +----------------------------------------------------------------------- + +_Description_: + The function returns the EXPLICIT-TASK-VAR ICV; it returns true + when the encountering task was generated by a task-generating + construct such as 'target', 'task' or 'taskloop'. Otherwise, the + encountering task is in an implicit task region such as generated + by the implicit or explicit 'parallel' region and + 'omp_in_explicit_task' returns false. + +_C/C++_ + _Prototype_: 'int omp_in_explicit_task(void);' + +_Fortran_: + _Interface_: 'logical function omp_in_explicit_task()' + +_Reference_: + OpenMP specification v5.2 (https://www.openmp.org), Section 18.5.2. + + +File: libgomp.info, Node: omp_in_final, Prev: omp_in_explicit_task, Up: Tasking Routines + +3.4.3 'omp_in_final' - Whether in final or included task region +--------------------------------------------------------------- + +_Description_: + This function returns 'true' if currently running in a final or + included task region, 'false' otherwise. Here, 'true' and 'false' + represent their language-specific counterparts. + +_C/C++_: + _Prototype_: 'int omp_in_final(void);' + +_Fortran_: + _Interface_: 'logical function omp_in_final()' + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.21. + + +File: libgomp.info, Node: Resource Relinquishing Routines, Next: Device Information Routines, Prev: Tasking Routines, Up: Runtime Library Routines + +3.5 Resource Relinquishing Routines +=================================== + +Routines releasing resources used by the OpenMP runtime. They have C +linkage and do not throw exceptions. + +* Menu: + +* omp_pause_resource:: Release OpenMP resources on a device +* omp_pause_resource_all:: Release OpenMP resources on all devices + + +File: libgomp.info, Node: omp_pause_resource, Next: omp_pause_resource_all, Up: Resource Relinquishing Routines + +3.5.1 'omp_pause_resource' - Release OpenMP resources on a device +----------------------------------------------------------------- + +_Description_: + Free resources used by the OpenMP program and the runtime library + on and for the device specified by DEVICE_NUM; on success, zero is + returned and non-zero otherwise. + + The value of DEVICE_NUM must be a conforming device number. The + routine may not be called from within any explicit region and all + explicit threads that do not bind to the implicit parallel region + have finalized execution. + +_C/C++_: + _Prototype_: 'int omp_pause_resource(omp_pause_resource_t kind, int + device_num);' + +_Fortran_: + _Interface_: 'integer function omp_pause_resource(kind, device_num)' + 'integer (kind=omp_pause_resource_kind) kind' + 'integer device_num' + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.2.43. + + +File: libgomp.info, Node: omp_pause_resource_all, Prev: omp_pause_resource, Up: Resource Relinquishing Routines + +3.5.2 'omp_pause_resource_all' - Release OpenMP resources on all devices +------------------------------------------------------------------------ + +_Description_: + Free resources used by the OpenMP program and the runtime library + on all devices, including the host. On success, zero is returned + and non-zero otherwise. + + The routine may not be called from within any explicit region and + all explicit threads that do not bind to the implicit parallel + region have finalized execution. + +_C/C++_: + _Prototype_: 'int omp_pause_resource(omp_pause_resource_t kind);' + +_Fortran_: + _Interface_: 'integer function omp_pause_resource(kind)' + 'integer (kind=omp_pause_resource_kind) kind' + +_See also_: + *note omp_pause_resource:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.2.44. + + +File: libgomp.info, Node: Device Information Routines, Next: Device Memory Routines, Prev: Resource Relinquishing Routines, Up: Runtime Library Routines + +3.6 Device Information Routines +=============================== + +Routines related to devices available to an OpenMP program. They have C +linkage and do not throw exceptions. + +* Menu: + +* omp_get_num_procs:: Number of processors online +* omp_set_default_device:: Set the default device for target regions +* omp_get_default_device:: Get the default device for target regions +* omp_get_num_devices:: Number of target devices +* omp_get_device_num:: Get device that current thread is running on +* omp_get_device_from_uid:: Obtain the device number to a unique id +* omp_get_uid_from_device:: Obtain the unique id of a device +* omp_is_initial_device:: Whether executing on the host device +* omp_get_initial_device:: Device number of host device + + +File: libgomp.info, Node: omp_get_num_procs, Next: omp_set_default_device, Up: Device Information Routines + +3.6.1 'omp_get_num_procs' - Number of processors online +------------------------------------------------------- + +_Description_: + Returns the number of processors online on that device. + +_C/C++_: + _Prototype_: 'int omp_get_num_procs(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_num_procs()' + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.5. + + +File: libgomp.info, Node: omp_set_default_device, Next: omp_get_default_device, Prev: omp_get_num_procs, Up: Device Information Routines + +3.6.2 'omp_set_default_device' - Set the default device for target regions +-------------------------------------------------------------------------- + +_Description_: + Get the value of the _default-device-var_ ICV, which is used for + target regions without a device clause. The argument shall be a + nonnegative device number, 'omp_initial_device', or + 'omp_invalid_device'. + + The effect of running this routine in a 'target' region is + unspecified. + +_C/C++_: + _Prototype_: 'void omp_set_default_device(int device_num);' + +_Fortran_: + _Interface_: 'subroutine omp_set_default_device(device_num)' + 'integer device_num' + +_See also_: + *note OMP_DEFAULT_DEVICE::, *note omp_get_default_device:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.29. + + +File: libgomp.info, Node: omp_get_default_device, Next: omp_get_num_devices, Prev: omp_set_default_device, Up: Device Information Routines + +3.6.3 'omp_get_default_device' - Get the default device for target regions +-------------------------------------------------------------------------- + +_Description_: + Get the value of the _default-device-var_ ICV, which is used for + target regions without a device clause. The value is either a + nonnegative device number, 'omp_initial_device' or + 'omp_invalid_device'. Note that for the host, the ICV can have two + values: either the value of the named constant 'omp_initial_device' + or the value returned by the 'omp_get_num_devices' routine. + + The effect of running this routine in a 'target' region is + unspecified. + +_C/C++_: + _Prototype_: 'int omp_get_default_device(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_default_device()' + +_See also_: + *note OMP_DEFAULT_DEVICE::, *note omp_set_default_device::, *note + omp_get_initial_device:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.30. + + +File: libgomp.info, Node: omp_get_num_devices, Next: omp_get_device_num, Prev: omp_get_default_device, Up: Device Information Routines + +3.6.4 'omp_get_num_devices' - Number of target devices +------------------------------------------------------ + +_Description_: + Returns the number of available non-host devices. + + The effect of running this routine in a 'target' region is + unspecified. + +_C/C++_: + _Prototype_: 'int omp_get_num_devices(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_num_devices()' + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.31. + + +File: libgomp.info, Node: omp_get_device_num, Next: omp_get_device_from_uid, Prev: omp_get_num_devices, Up: Device Information Routines + +3.6.5 'omp_get_device_num' - Return device number of current device +------------------------------------------------------------------- + +_Description_: + This function returns a device number that represents the device + that the current thread is executing on. When called on the host, + it returns the same value as returned by the + 'omp_get_initial_device' function as required since OpenMP 5.0. + +_C/C++_ + _Prototype_: 'int omp_get_device_num(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_device_num()' + +_See also_: + *note omp_get_initial_device:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.2.37. + + +File: libgomp.info, Node: omp_get_device_from_uid, Next: omp_get_uid_from_device, Prev: omp_get_device_num, Up: Device Information Routines + +3.6.6 'omp_get_device_from_uid' - Obtain the device number to a unique id +------------------------------------------------------------------------- + +_Description_: + This function returns the device number associated with the passed + unique-identifier (UID) string. If no device with this UID is + available, the value 'omp_invalid_device' is returned. The effect + of running this routine in a 'target' region is unspecified. + + GCC treats the UID string case sensitive; for the initial device, + GCC currently only accepts the value 'OMP_INITIAL_DEVICE' and + returns for it the value of 'omp_initial_device'. + +_C/C++_: + _Prototype_: 'int omp_get_device_from_uid(const char *uid);' + +_Fortran_: + _Interface_: 'integer function omp_get_device_from_uid(uid)' + 'character(len=*), intent(in) :: uid' + +_See also_: + *note omp_get_uid_from_device::, *note Offload-Target Specifics:: + +_Reference_: + OpenMP specification v6.0 (https://www.openmp.org), Section 24.7 + + +File: libgomp.info, Node: omp_get_uid_from_device, Next: omp_is_initial_device, Prev: omp_get_device_from_uid, Up: Device Information Routines + +3.6.7 'omp_get_uid_from_device' - Obtain the unique id of a device +------------------------------------------------------------------ + +_Description_: + This function returns a pointer to a string that represents a + unique identifier (UID) for the device specified by DEVICE_NUM. It + returns a 'NULL' (C/C++) or a disassociated pointer (Fortran) for + 'omp_invalid_device'. The effect of running this routine in a + 'target' region is unspecified. + + GCC currently returns for initial device the value + 'OMP_INITIAL_DEVICE'. + +_C/C++_: + _Prototype_: 'const char *omp_get_uid_from_device(int device_num);' + +_Fortran_: + _Interface_: 'character(:) function + omp_get_uid_from_device(device_num)' + _Interface_: 'pointer :: omp_get_uid_from_device' + 'integer, intent(in) :: device_num' + +_See also_: + *note omp_get_uid_from_device::, *note Offload-Target Specifics:: + +_Reference_: + OpenMP specification v6.0 (https://www.openmp.org), Section 24.8 + + +File: libgomp.info, Node: omp_is_initial_device, Next: omp_get_initial_device, Prev: omp_get_uid_from_device, Up: Device Information Routines + +3.6.8 'omp_is_initial_device' - Whether executing on the host device +-------------------------------------------------------------------- + +_Description_: + This function returns 'true' if currently running on the host + device, 'false' otherwise. Here, 'true' and 'false' represent + their language-specific counterparts. + + Note that in GCC this function call is already folded to a constant + in the compiler; compile with '-fno-builtin-omp_is_initial_device' + if a run-time function is desired. + +_C/C++_: + _Prototype_: 'int omp_is_initial_device(void);' + +_Fortran_: + _Interface_: 'logical function omp_is_initial_device()' + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.34. + + +File: libgomp.info, Node: omp_get_initial_device, Prev: omp_is_initial_device, Up: Device Information Routines + +3.6.9 'omp_get_initial_device' - Return device number of initial device +----------------------------------------------------------------------- + +_Description_: + This function returns a device number that represents the host + device. Since OpenMP 5.1, this is equal to the value returned by + the 'omp_get_num_devices' function; since OpenMP 6.0 it may also + return the value of 'omp_initial_device'. + + The effect of running this routine in a 'target' region is + unspecified. + +_C/C++_ + _Prototype_: 'int omp_get_initial_device(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_initial_device()' + +_See also_: + *note omp_get_num_devices:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.35. + + +File: libgomp.info, Node: Device Memory Routines, Next: Lock Routines, Prev: Device Information Routines, Up: Runtime Library Routines + +3.7 Device Memory Routines +========================== + +Routines related to memory allocation and managing corresponding +pointers on devices. They have C linkage and do not throw exceptions. + +* Menu: + +* omp_target_alloc:: Allocate device memory +* omp_target_free:: Free device memory +* omp_target_is_present:: Check whether storage is mapped +* omp_target_is_accessible:: Check whether memory is device accessible +* omp_target_memcpy:: Copy data between devices +* omp_target_memcpy_async:: Copy data between devices asynchronously +* omp_target_memcpy_rect:: Copy a subvolume of data between devices +* omp_target_memcpy_rect_async:: Copy a subvolume of data between devices asynchronously +* omp_target_associate_ptr:: Associate a device pointer with a host pointer +* omp_target_disassociate_ptr:: Remove device-host pointer association +* omp_get_mapped_ptr:: Return device pointer to a host pointer + + +File: libgomp.info, Node: omp_target_alloc, Next: omp_target_free, Up: Device Memory Routines + +3.7.1 'omp_target_alloc' - Allocate device memory +------------------------------------------------- + +_Description_: + This routine allocates SIZE bytes of memory in the device + environment associated with the device number DEVICE_NUM. If + successful, a device pointer is returned, otherwise a null pointer. + + In GCC, when the device is the host or the device shares memory + with the host, the memory is allocated on the host; in that case, + when SIZE is zero, either NULL or a unique pointer value that can + later be successfully passed to 'omp_target_free' is returned. + When the allocation is not performed on the host, a null pointer is + returned when SIZE is zero; in that case, additionally a diagnostic + might be printed to standard error (stderr). + + Running this routine in a 'target' region except on the initial + device is not supported. + +_C/C++_ + _Prototype_: 'void *omp_target_alloc(size_t size, int device_num)' + +_Fortran_: + _Interface_: 'type(c_ptr) function omp_target_alloc(size, device_num) + bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_int, + c_size_t' + 'integer(c_size_t), value :: size' + 'integer(c_int), value :: device_num' + +_See also_: + *note omp_target_free::, *note omp_target_associate_ptr:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.1 + + +File: libgomp.info, Node: omp_target_free, Next: omp_target_is_present, Prev: omp_target_alloc, Up: Device Memory Routines + +3.7.2 'omp_target_free' - Free device memory +-------------------------------------------- + +_Description_: + This routine frees memory allocated by the 'omp_target_alloc' + routine. The DEVICE_PTR argument must be either a null pointer or + a device pointer returned by 'omp_target_alloc' for the specified + 'device_num'. The device number DEVICE_NUM must be a conforming + device number. + + Running this routine in a 'target' region except on the initial + device is not supported. + +_C/C++_ + _Prototype_: 'void omp_target_free(void *device_ptr, int device_num)' + +_Fortran_: + _Interface_: 'subroutine omp_target_free(device_ptr, device_num) + bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_int' + 'type(c_ptr), value :: device_ptr' + 'integer(c_int), value :: device_num' + +_See also_: + *note omp_target_alloc::, *note omp_target_disassociate_ptr:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.2 + + +File: libgomp.info, Node: omp_target_is_present, Next: omp_target_is_accessible, Prev: omp_target_free, Up: Device Memory Routines + +3.7.3 'omp_target_is_present' - Check whether storage is mapped +--------------------------------------------------------------- + +_Description_: + This routine tests whether storage, identified by the host pointer + PTR is mapped to the device specified by DEVICE_NUM. If so, it + returns a nonzero value and otherwise zero. + + In GCC, this includes self mapping such that + 'omp_target_is_present' returns _true_ when DEVICE_NUM specifies + the host or when the host and the device share memory. If PTR is a + null pointer, TRUE is returned and if DEVICE_NUM is an invalid + device number, FALSE is returned. + + If those conditions do not apply, _true_ is returned if the + association has been established by an explicit or implicit 'map' + clause, the 'declare target' directive or a call to the + 'omp_target_associate_ptr' routine. + + Running this routine in a 'target' region except on the initial + device is not supported. + +_C/C++_ + _Prototype_: 'int omp_target_is_present(const void *ptr,' + ' int device_num)' + +_Fortran_: + _Interface_: 'integer(c_int) function omp_target_is_present(ptr, &' + ' device_num) bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_int' + 'type(c_ptr), value :: ptr' + 'integer(c_int), value :: device_num' + +_See also_: + *note omp_target_associate_ptr:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.3 + + +File: libgomp.info, Node: omp_target_is_accessible, Next: omp_target_memcpy, Prev: omp_target_is_present, Up: Device Memory Routines + +3.7.4 'omp_target_is_accessible' - Check whether memory is device accessible +---------------------------------------------------------------------------- + +_Description_: + This routine tests whether memory, starting at the address given by + PTR and extending SIZE bytes, is accessibly on the device specified + by DEVICE_NUM. If so, it returns a nonzero value and otherwise + zero. + + The address given by PTR is interpreted to be in the address space + of the device and SIZE must be positive. + + Note that GCC's current implementation assumes that PTR is a valid + host pointer. Therefore, all addresses given by PTR are assumed to + be accessible on the initial device. And, to err on the safe side, + this memory is only available on a non-host device that can access + all host memory ([uniform] shared memory access). + + Running this routine in a 'target' region except on the initial + device is not supported. + +_C/C++_ + _Prototype_: 'int omp_target_is_accessible(const void *ptr,' + ' size_t size,' + ' int device_num)' + +_Fortran_: + _Interface_: 'integer(c_int) function omp_target_is_accessible(ptr, + &' + ' size, device_num) bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, + c_int' + 'type(c_ptr), value :: ptr' + 'integer(c_size_t), value :: size' + 'integer(c_int), value :: device_num' + +_See also_: + *note omp_target_associate_ptr:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.4 + + +File: libgomp.info, Node: omp_target_memcpy, Next: omp_target_memcpy_async, Prev: omp_target_is_accessible, Up: Device Memory Routines + +3.7.5 'omp_target_memcpy' - Copy data between devices +----------------------------------------------------- + +_Description_: + This routine copies LENGTH of bytes of data from the device + identified by device number SRC_DEVICE_NUM to device + DST_DEVICE_NUM. The data is copied from the source device from the + address provided by SRC, shifted by the offset of SRC_OFFSET bytes, + to the destination device's DST address shifted by DST_OFFSET. The + routine returns zero on success and non-zero otherwise. + + Running this routine in a 'target' region except on the initial + device is not supported. + +_C/C++_ + _Prototype_: 'int omp_target_memcpy(void *dst,' + ' const void *src,' + ' size_t length,' + ' size_t dst_offset,' + ' size_t src_offset,' + ' int dst_device_num,' + ' int src_device_num)' + +_Fortran_: + _Interface_: 'integer(c_int) function omp_target_memcpy( &' + ' dst, src, length, dst_offset, src_offset, &' + ' dst_device_num, src_device_num) bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, + c_int' + 'type(c_ptr), value :: dst, src' + 'integer(c_size_t), value :: length, dst_offset, + src_offset' + 'integer(c_int), value :: dst_device_num, + src_device_num' + +_See also_: + *note omp_target_memcpy_async::, *note omp_target_memcpy_rect:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.5 + + +File: libgomp.info, Node: omp_target_memcpy_async, Next: omp_target_memcpy_rect, Prev: omp_target_memcpy, Up: Device Memory Routines + +3.7.6 'omp_target_memcpy_async' - Copy data between devices asynchronously +-------------------------------------------------------------------------- + +_Description_: + This routine copies asynchronously LENGTH of bytes of data from the + device identified by device number SRC_DEVICE_NUM to device + DST_DEVICE_NUM. The data is copied from the source device from the + address provided by SRC, shifted by the offset of SRC_OFFSET bytes, + to the destination device's DST address shifted by DST_OFFSET. + Task dependence is expressed by passing an array of depend objects + to DEPOBJ_LIST, where the number of array elements is passed as + DEPOBJ_COUNT; if the count is zero, the DEPOBJ_LIST argument is + ignored. In C++ and Fortran, the DEPOBJ_LIST argument can also be + omitted in that case. The routine returns zero if the copying + process has successfully been started and non-zero otherwise. + + Running this routine in a 'target' region except on the initial + device is not supported. + +_C/C++_ + _Prototype_: 'int omp_target_memcpy_async(void *dst,' + ' const void *src,' + ' size_t length,' + ' size_t dst_offset,' + ' size_t src_offset,' + ' int dst_device_num,' + ' int src_device_num,' + ' int depobj_count,' + ' omp_depend_t *depobj_list)' + +_Fortran_: + _Interface_: 'integer(c_int) function omp_target_memcpy_async( &' + ' dst, src, length, dst_offset, src_offset, &' + ' dst_device_num, src_device_num, &' + ' depobj_count, depobj_list) bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, + c_int' + 'type(c_ptr), value :: dst, src' + 'integer(c_size_t), value :: length, dst_offset, + src_offset' + 'integer(c_int), value :: dst_device_num, + src_device_num, depobj_count' + 'integer(omp_depend_kind), optional :: depobj_list(*)' + +_See also_: + *note omp_target_memcpy::, *note omp_target_memcpy_rect_async:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.7 + + +File: libgomp.info, Node: omp_target_memcpy_rect, Next: omp_target_memcpy_rect_async, Prev: omp_target_memcpy_async, Up: Device Memory Routines + +3.7.7 'omp_target_memcpy_rect' - Copy a subvolume of data between devices +------------------------------------------------------------------------- + +_Description_: + This routine copies a subvolume of data from the device identified + by device number SRC_DEVICE_NUM to device DST_DEVICE_NUM. The + array has NUM_DIMS dimensions and each array element has a size of + ELEMENT_SIZE bytes. The VOLUME array specifies how many elements + per dimension are copied. The full sizes of the destination and + source arrays are given by the DST_DIMENSIONS and SRC_DIMENSIONS + arguments, respectively. The offset per dimension to the first + element to be copied is given by the DST_OFFSET and SRC_OFFSET + arguments. The routine returns zero on success and non-zero + otherwise. + + The OpenMP specification only requires that NUM_DIMS up to three is + supported. In order to find implementation-specific maximally + supported number of dimensions, the routine returns this value when + invoked with a null pointer to both the DST and SRC arguments. As + GCC supports arbitrary dimensions, it returns 'INT_MAX'. + + The device-number arguments must be conforming device numbers, the + SRC and DST must be either both null pointers or all of the + following must be fulfilled: ELEMENT_SIZE and NUM_DIMS must be + positive and the VOLUME, offset and dimension arrays must have at + least NUM_DIMS dimensions. + + Running this routine in a 'target' region is not supported except + on the initial device. + +_C/C++_ + _Prototype_: 'int omp_target_memcpy_rect(void *dst,' + ' const void *src,' + ' size_t element_size,' + ' int num_dims,' + ' const size_t *volume,' + ' const size_t *dst_offset,' + ' const size_t *src_offset,' + ' const size_t *dst_dimensions,' + ' const size_t *src_dimensions,' + ' int dst_device_num,' + ' int src_device_num)' + +_Fortran_: + _Interface_: 'integer(c_int) function omp_target_memcpy_rect( &' + ' dst, src, element_size, num_dims, volume, &' + ' dst_offset, src_offset, dst_dimensions, &' + ' src_dimensions, dst_device_num, src_device_num) + bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, + c_int' + 'type(c_ptr), value :: dst, src' + 'integer(c_size_t), value :: element_size, dst_offset, + src_offset' + 'integer(c_size_t), value :: volume, dst_dimensions, + src_dimensions' + 'integer(c_int), value :: num_dims, dst_device_num, + src_device_num' + +_See also_: + *note omp_target_memcpy_rect_async::, *note omp_target_memcpy::, + *note Offload-Target Specifics:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.6 + + +File: libgomp.info, Node: omp_target_memcpy_rect_async, Next: omp_target_associate_ptr, Prev: omp_target_memcpy_rect, Up: Device Memory Routines + +3.7.8 'omp_target_memcpy_rect_async' - Copy a subvolume of data between devices asynchronously +---------------------------------------------------------------------------------------------- + +_Description_: + This routine copies asynchronously a subvolume of data from the + device identified by device number SRC_DEVICE_NUM to device + DST_DEVICE_NUM. The array has NUM_DIMS dimensions and each array + element has a size of ELEMENT_SIZE bytes. The VOLUME array + specifies how many elements per dimension are copied. The full + sizes of the destination and source arrays are given by the + DST_DIMENSIONS and SRC_DIMENSIONS arguments, respectively. The + offset per dimension to the first element to be copied is given by + the DST_OFFSET and SRC_OFFSET arguments. Task dependence is + expressed by passing an array of depend objects to DEPOBJ_LIST, + where the number of array elements is passed as DEPOBJ_COUNT; if + the count is zero, the DEPOBJ_LIST argument is ignored. In C++ and + Fortran, the DEPOBJ_LIST argument can also be omitted in that case. + The routine returns zero on success and non-zero otherwise. + + The OpenMP specification only requires that NUM_DIMS up to three is + supported. In order to find implementation-specific maximally + supported number of dimensions, the routine returns this value when + invoked with a null pointer to both the DST and SRC arguments. As + GCC supports arbitrary dimensions, it returns 'INT_MAX'. + + The device-number arguments must be conforming device numbers, the + SRC and DST must be either both null pointers or all of the + following must be fulfilled: ELEMENT_SIZE and NUM_DIMS must be + positive and the VOLUME, offset and dimension arrays must have at + least NUM_DIMS dimensions. + + Running this routine in a 'target' region is not supported except + on the initial device. + +_C/C++_ + _Prototype_: 'int omp_target_memcpy_rect_async(void *dst,' + ' const void *src,' + ' size_t element_size,' + ' int num_dims,' + ' const size_t *volume,' + ' const size_t *dst_offset,' + ' const size_t *src_offset,' + ' const size_t *dst_dimensions,' + ' const size_t *src_dimensions,' + ' int dst_device_num,' + ' int src_device_num,' + ' int depobj_count,' + ' omp_depend_t *depobj_list)' + +_Fortran_: + _Interface_: 'integer(c_int) function omp_target_memcpy_rect_async( + &' + ' dst, src, element_size, num_dims, volume, &' + ' dst_offset, src_offset, dst_dimensions, &' + ' src_dimensions, dst_device_num, src_device_num, &' + ' depobj_count, depobj_list) bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, + c_int' + 'type(c_ptr), value :: dst, src' + 'integer(c_size_t), value :: element_size, dst_offset, + src_offset' + 'integer(c_size_t), value :: volume, dst_dimensions, + src_dimensions' + 'integer(c_int), value :: num_dims, dst_device_num, + src_device_num' + 'integer(c_int), value :: depobj_count' + 'integer(omp_depend_kind), optional :: depobj_list(*)' + +_See also_: + *note omp_target_memcpy_rect::, *note omp_target_memcpy_async::, + *note Offload-Target Specifics:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.8 + + +File: libgomp.info, Node: omp_target_associate_ptr, Next: omp_target_disassociate_ptr, Prev: omp_target_memcpy_rect_async, Up: Device Memory Routines + +3.7.9 'omp_target_associate_ptr' - Associate a device pointer with a host pointer +--------------------------------------------------------------------------------- + +_Description_: + This routine associates storage on the host with storage on a + device identified by DEVICE_NUM. The device pointer is usually + obtained by calling 'omp_target_alloc' or by other means (but not + by using the 'map' clauses or the 'declare target' directive). The + host pointer should point to memory that has a storage size of at + least SIZE. + + The DEVICE_OFFSET parameter specifies the offset into DEVICE_PTR + that is used as the base address for the device side of the + mapping; the storage size should be at least DEVICE_OFFSET plus + SIZE. + + After the association, the host pointer can be used in a 'map' + clause and in the 'to' and 'from' clauses of the 'target update' + directive to transfer data between the associated pointers. The + reference count of such associated storage is infinite. The + association can be removed by calling 'omp_target_disassociate_ptr' + which should be done before the lifetime of either storage ends. + + The routine returns nonzero ('EINVAL') when the DEVICE_NUM invalid, + for when the initial device or the associated device shares memory + with the host. 'omp_target_associate_ptr' returns zero if HOST_PTR + points into already associated storage that is fully inside of a + previously associated memory. Otherwise, if the association was + successful zero is returned; if none of the cases above apply, + nonzero ('EINVAL') is returned. + + The 'omp_target_is_present' routine can be used to test whether + associated storage for a device pointer exists. + + Running this routine in a 'target' region except on the initial + device is not supported. + +_C/C++_ + _Prototype_: 'int omp_target_associate_ptr(const void *host_ptr,' + ' const void *device_ptr,' + ' size_t size,' + ' size_t device_offset,' + ' int device_num)' + +_Fortran_: + _Interface_: 'integer(c_int) function + omp_target_associate_ptr(host_ptr, &' + ' device_ptr, size, device_offset, device_num) bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_int, + c_size_t' + 'type(c_ptr), value :: host_ptr, device_ptr' + 'integer(c_size_t), value :: size, device_offset' + 'integer(c_int), value :: device_num' + +_See also_: + *note omp_target_disassociate_ptr::, *note omp_target_is_present::, + *note omp_target_alloc:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.9 + + +File: libgomp.info, Node: omp_target_disassociate_ptr, Next: omp_get_mapped_ptr, Prev: omp_target_associate_ptr, Up: Device Memory Routines + +3.7.10 'omp_target_disassociate_ptr' - Remove device-host pointer association +----------------------------------------------------------------------------- + +_Description_: + This routine removes the storage association established by calling + 'omp_target_associate_ptr' and sets the reference count to zero, + even if 'omp_target_associate_ptr' was invoked multiple times for + for host pointer 'ptr'. If applicable, the device memory needs to + be freed by the user. + + If an associated device storage location for the DEVICE_NUM was + found and has infinite reference count, the association is removed + and zero is returned. In all other cases, nonzero ('EINVAL') is + returned and no other action is taken. + + Note that passing a host pointer where the association to the + device pointer was established with the 'declare target' directive + yields undefined behavior. + + Running this routine in a 'target' region except on the initial + device is not supported. + +_C/C++_ + _Prototype_: 'int omp_target_disassociate_ptr(const void *ptr,' + ' int device_num)' + +_Fortran_: + _Interface_: 'integer(c_int) function + omp_target_disassociate_ptr(ptr, &' + ' device_num) bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_int' + 'type(c_ptr), value :: ptr' + 'integer(c_int), value :: device_num' + +_See also_: + *note omp_target_associate_ptr:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.10 + + +File: libgomp.info, Node: omp_get_mapped_ptr, Prev: omp_target_disassociate_ptr, Up: Device Memory Routines + +3.7.11 'omp_get_mapped_ptr' - Return device pointer to a host pointer +--------------------------------------------------------------------- + +_Description_: + If the device number is refers to the initial device or to a device + with memory accessible from the host (shared memory), the + 'omp_get_mapped_ptr' routines returns the value of the passed PTR. + Otherwise, if associated storage to the passed host pointer PTR + exists on device associated with DEVICE_NUM, it returns that + pointer. In all other cases and in cases of an error, a null + pointer is returned. + + The association of storage location is established either via an + explicit or implicit 'map' clause, the 'declare target' directive + or the 'omp_target_associate_ptr' routine. + + Running this routine in a 'target' region except on the initial + device is not supported. + +_C/C++_ + _Prototype_: 'void *omp_get_mapped_ptr(const void *ptr, int + device_num);' + +_Fortran_: + _Interface_: 'type(c_ptr) function omp_get_mapped_ptr(ptr, + device_num) bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_int' + 'type(c_ptr), value :: ptr' + 'integer(c_int), value :: device_num' + +_See also_: + *note omp_target_associate_ptr:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.11 + + +File: libgomp.info, Node: Lock Routines, Next: Timing Routines, Prev: Device Memory Routines, Up: Runtime Library Routines + +3.8 Lock Routines +================= + +Initialize, set, test, unset and destroy simple and nested locks. The +routines have C linkage and do not throw exceptions. + +* Menu: + +* omp_init_lock:: Initialize simple lock +* omp_init_nest_lock:: Initialize nested lock +* omp_destroy_lock:: Destroy simple lock +* omp_destroy_nest_lock:: Destroy nested lock +* omp_set_lock:: Wait for and set simple lock +* omp_set_nest_lock:: Wait for and set simple lock +* omp_unset_lock:: Unset simple lock +* omp_unset_nest_lock:: Unset nested lock +* omp_test_lock:: Test and set simple lock if available +* omp_test_nest_lock:: Test and set nested lock if available + + +File: libgomp.info, Node: omp_init_lock, Next: omp_init_nest_lock, Up: Lock Routines + +3.8.1 'omp_init_lock' - Initialize simple lock +---------------------------------------------- + +_Description_: + Initialize a simple lock. After initialization, the lock is in an + unlocked state. + +_C/C++_: + _Prototype_: 'void omp_init_lock(omp_lock_t *lock);' + +_Fortran_: + _Interface_: 'subroutine omp_init_lock(svar)' + 'integer(omp_lock_kind), intent(out) :: svar' + +_See also_: + *note omp_destroy_lock:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.1. + + +File: libgomp.info, Node: omp_init_nest_lock, Next: omp_destroy_lock, Prev: omp_init_lock, Up: Lock Routines + +3.8.2 'omp_init_nest_lock' - Initialize nested lock +--------------------------------------------------- + +_Description_: + Initialize a nested lock. After initialization, the lock is in an + unlocked state and the nesting count is set to zero. + +_C/C++_: + _Prototype_: 'void omp_init_nest_lock(omp_nest_lock_t *lock);' + +_Fortran_: + _Interface_: 'subroutine omp_init_nest_lock(nvar)' + 'integer(omp_nest_lock_kind), intent(out) :: nvar' + +_See also_: + *note omp_destroy_nest_lock:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.1. + + +File: libgomp.info, Node: omp_destroy_lock, Next: omp_destroy_nest_lock, Prev: omp_init_nest_lock, Up: Lock Routines + +3.8.3 'omp_destroy_lock' - Destroy simple lock +---------------------------------------------- + +_Description_: + Destroy a simple lock. In order to be destroyed, a simple lock + must be in the unlocked state. + +_C/C++_: + _Prototype_: 'void omp_destroy_lock(omp_lock_t *lock);' + +_Fortran_: + _Interface_: 'subroutine omp_destroy_lock(svar)' + 'integer(omp_lock_kind), intent(inout) :: svar' + +_See also_: + *note omp_init_lock:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.3. + + +File: libgomp.info, Node: omp_destroy_nest_lock, Next: omp_set_lock, Prev: omp_destroy_lock, Up: Lock Routines + +3.8.4 'omp_destroy_nest_lock' - Destroy nested lock +--------------------------------------------------- + +_Description_: + Destroy a nested lock. In order to be destroyed, a nested lock + must be in the unlocked state and its nesting count must equal + zero. + +_C/C++_: + _Prototype_: 'void omp_destroy_nest_lock(omp_nest_lock_t *);' + +_Fortran_: + _Interface_: 'subroutine omp_destroy_nest_lock(nvar)' + 'integer(omp_nest_lock_kind), intent(inout) :: nvar' + +_See also_: + *note omp_init_lock:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.3. + + +File: libgomp.info, Node: omp_set_lock, Next: omp_set_nest_lock, Prev: omp_destroy_nest_lock, Up: Lock Routines + +3.8.5 'omp_set_lock' - Wait for and set simple lock +--------------------------------------------------- + +_Description_: + Before setting a simple lock, the lock variable must be initialized + by 'omp_init_lock'. The calling thread is blocked until the lock + is available. If the lock is already held by the current thread, a + deadlock occurs. + +_C/C++_: + _Prototype_: 'void omp_set_lock(omp_lock_t *lock);' + +_Fortran_: + _Interface_: 'subroutine omp_set_lock(svar)' + 'integer(omp_lock_kind), intent(inout) :: svar' + +_See also_: + *note omp_init_lock::, *note omp_test_lock::, *note + omp_unset_lock:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.4. + + +File: libgomp.info, Node: omp_set_nest_lock, Next: omp_unset_lock, Prev: omp_set_lock, Up: Lock Routines + +3.8.6 'omp_set_nest_lock' - Wait for and set nested lock +-------------------------------------------------------- + +_Description_: + Before setting a nested lock, the lock variable must be initialized + by 'omp_init_nest_lock'. The calling thread is blocked until the + lock is available. If the lock is already held by the current + thread, the nesting count for the lock is incremented. + +_C/C++_: + _Prototype_: 'void omp_set_nest_lock(omp_nest_lock_t *lock);' + +_Fortran_: + _Interface_: 'subroutine omp_set_nest_lock(nvar)' + 'integer(omp_nest_lock_kind), intent(inout) :: nvar' + +_See also_: + *note omp_init_nest_lock::, *note omp_unset_nest_lock:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.4. + + +File: libgomp.info, Node: omp_unset_lock, Next: omp_unset_nest_lock, Prev: omp_set_nest_lock, Up: Lock Routines + +3.8.7 'omp_unset_lock' - Unset simple lock +------------------------------------------ + +_Description_: + A simple lock about to be unset must have been locked by + 'omp_set_lock' or 'omp_test_lock' before. In addition, the lock + must be held by the thread calling 'omp_unset_lock'. Then, the + lock becomes unlocked. If one or more threads attempted to set the + lock before, one of them is chosen to, again, set the lock to + itself. + +_C/C++_: + _Prototype_: 'void omp_unset_lock(omp_lock_t *lock);' + +_Fortran_: + _Interface_: 'subroutine omp_unset_lock(svar)' + 'integer(omp_lock_kind), intent(inout) :: svar' + +_See also_: + *note omp_set_lock::, *note omp_test_lock:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.5. + + +File: libgomp.info, Node: omp_unset_nest_lock, Next: omp_test_lock, Prev: omp_unset_lock, Up: Lock Routines + +3.8.8 'omp_unset_nest_lock' - Unset nested lock +----------------------------------------------- + +_Description_: + A nested lock about to be unset must have been locked by + 'omp_set_nested_lock' or 'omp_test_nested_lock' before. In + addition, the lock must be held by the thread calling + 'omp_unset_nested_lock'. If the nesting count drops to zero, the + lock becomes unlocked. If one ore more threads attempted to set + the lock before, one of them is chosen to, again, set the lock to + itself. + +_C/C++_: + _Prototype_: 'void omp_unset_nest_lock(omp_nest_lock_t *lock);' + +_Fortran_: + _Interface_: 'subroutine omp_unset_nest_lock(nvar)' + 'integer(omp_nest_lock_kind), intent(inout) :: nvar' + +_See also_: + *note omp_set_nest_lock:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.5. + + +File: libgomp.info, Node: omp_test_lock, Next: omp_test_nest_lock, Prev: omp_unset_nest_lock, Up: Lock Routines + +3.8.9 'omp_test_lock' - Test and set simple lock if available +------------------------------------------------------------- + +_Description_: + Before setting a simple lock, the lock variable must be initialized + by 'omp_init_lock'. Contrary to 'omp_set_lock', 'omp_test_lock' + does not block if the lock is not available. This function returns + 'true' upon success, 'false' otherwise. Here, 'true' and 'false' + represent their language-specific counterparts. + +_C/C++_: + _Prototype_: 'int omp_test_lock(omp_lock_t *lock);' + +_Fortran_: + _Interface_: 'logical function omp_test_lock(svar)' + 'integer(omp_lock_kind), intent(inout) :: svar' + +_See also_: + *note omp_init_lock::, *note omp_set_lock::, *note omp_set_lock:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.6. + + +File: libgomp.info, Node: omp_test_nest_lock, Prev: omp_test_lock, Up: Lock Routines + +3.8.10 'omp_test_nest_lock' - Test and set nested lock if available +------------------------------------------------------------------- + +_Description_: + Before setting a nested lock, the lock variable must be initialized + by 'omp_init_nest_lock'. Contrary to 'omp_set_nest_lock', + 'omp_test_nest_lock' does not block if the lock is not available. + If the lock is already held by the current thread, the new nesting + count is returned. Otherwise, the return value equals zero. + +_C/C++_: + _Prototype_: 'int omp_test_nest_lock(omp_nest_lock_t *lock);' + +_Fortran_: + _Interface_: 'logical function omp_test_nest_lock(nvar)' + 'integer(omp_nest_lock_kind), intent(inout) :: nvar' + +_See also_: + *note omp_init_lock::, *note omp_set_lock::, *note omp_set_lock:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.6. + + +File: libgomp.info, Node: Timing Routines, Next: Event Routine, Prev: Lock Routines, Up: Runtime Library Routines + +3.9 Timing Routines +=================== + +Portable, thread-based, wall clock timer. The routines have C linkage +and do not throw exceptions. + +* Menu: + +* omp_get_wtick:: Get timer precision. +* omp_get_wtime:: Elapsed wall clock time. + + +File: libgomp.info, Node: omp_get_wtick, Next: omp_get_wtime, Up: Timing Routines + +3.9.1 'omp_get_wtick' - Get timer precision +------------------------------------------- + +_Description_: + Gets the timer precision, i.e., the number of seconds between two + successive clock ticks. + +_C/C++_: + _Prototype_: 'double omp_get_wtick(void);' + +_Fortran_: + _Interface_: 'double precision function omp_get_wtick()' + +_See also_: + *note omp_get_wtime:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.4.2. + + +File: libgomp.info, Node: omp_get_wtime, Prev: omp_get_wtick, Up: Timing Routines + +3.9.2 'omp_get_wtime' - Elapsed wall clock time +----------------------------------------------- + +_Description_: + Elapsed wall clock time in seconds. The time is measured per + thread, no guarantee can be made that two distinct threads measure + the same time. Time is measured from some "time in the past", + which is an arbitrary time guaranteed not to change during the + execution of the program. + +_C/C++_: + _Prototype_: 'double omp_get_wtime(void);' + +_Fortran_: + _Interface_: 'double precision function omp_get_wtime()' + +_See also_: + *note omp_get_wtick:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.4.1. + + +File: libgomp.info, Node: Event Routine, Next: Interoperability Routines, Prev: Timing Routines, Up: Runtime Library Routines + +3.10 Event Routine +================== + +Support for event objects. The routine has C linkage and do not throw +exceptions. + +* Menu: + +* omp_fulfill_event:: Fulfill and destroy an OpenMP event. + + +File: libgomp.info, Node: omp_fulfill_event, Up: Event Routine + +3.10.1 'omp_fulfill_event' - Fulfill and destroy an OpenMP event +---------------------------------------------------------------- + +_Description_: + Fulfill the event associated with the event handle argument. + Currently, it is only used to fulfill events generated by detach + clauses on task constructs - the effect of fulfilling the event is + to allow the task to complete. + + The result of calling 'omp_fulfill_event' with an event handle + other than that generated by a detach clause is undefined. Calling + it with an event handle that has already been fulfilled is also + undefined. + +_C/C++_: + _Prototype_: 'void omp_fulfill_event(omp_event_handle_t event);' + +_Fortran_: + _Interface_: 'subroutine omp_fulfill_event(event)' + 'integer (kind=omp_event_handle_kind) :: event' + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.5.1. + + +File: libgomp.info, Node: Interoperability Routines, Next: Memory Management Routines, Prev: Event Routine, Up: Runtime Library Routines + +3.11 Interoperability Routines +============================== + +Routines to obtain properties from an object of OpenMP interop type. +They have C linkage and do not throw exceptions. + +* Menu: + +* omp_get_num_interop_properties:: Get the number of implementation-specific properties +* omp_get_interop_int:: Obtain integer-valued interoperability property +* omp_get_interop_ptr:: Obtain pointer-valued interoperability property +* omp_get_interop_str:: Obtain string-valued interoperability property +* omp_get_interop_name:: Obtain the name of an interop_property value as string +* omp_get_interop_type_desc:: Obtain type and description to an interop_property +* omp_get_interop_rc_desc:: Obtain error string to an interop_rc error code + + +File: libgomp.info, Node: omp_get_num_interop_properties, Next: omp_get_interop_int, Up: Interoperability Routines + +3.11.1 'omp_get_num_interop_properties' - Get the number of implementation-specific properties +---------------------------------------------------------------------------------------------- + +_Description_: + The 'omp_get_num_interop_properties' function returns the number of + implementation-defined interoperability properties available for + the passed INTEROP, extending the OpenMP-defined properties. The + available OpenMP interop_property-type values range from + 'omp_ipr_first' to the value returned by + 'omp_get_num_interop_properties' minus one. + + No implementation-defined properties are currently defined in GCC. + +_C/C++_: + _Prototype_: 'int omp_get_num_interop_properties(const omp_interop_t + interop)' + +_Fortran_: + _Interface_: 'integer function + omp_get_num_interop_properties(interop)' + 'integer(omp_interop_kind), intent(in) :: interop' + +_See also_: + *note omp_get_interop_name::, *note omp_get_interop_type_desc:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.12.1, + OpenMP specification v6.0 (https://www.openmp.org), Section 26.1 + + +File: libgomp.info, Node: omp_get_interop_int, Next: omp_get_interop_ptr, Prev: omp_get_num_interop_properties, Up: Interoperability Routines + +3.11.2 'omp_get_interop_int' - Obtain integer-valued interoperability property +------------------------------------------------------------------------------ + +_Description_: + The 'omp_get_interop_int' function returns the integer value + associated with the PROPERTY_ID interoperability property of the + passed INTEROP object. The RET_CODE argument is optional, i.e. it + can be omitted in C++ and Fortran or used with 'NULL' as argument + in C and C++. If successful, RET_CODE (if present) is set to + 'omp_irc_success'. + + In GCC, the effect of running this routine in a 'target' region + that is not the initial device is unspecified. + +_C/C++_: + _Prototype_: 'omp_intptr_t omp_get_interop_int(const omp_interop_t + interop, omp_interop_property_t property_id, + omp_interop_rc_t *ret_code)' + +_Fortran_: + _Interface_: 'integer(c_intptr_t) function + omp_get_interop_int(interop, property_id, ret_code)' + 'use, intrinsic :: iso_c_binding, only : c_intptr_t' + 'integer(omp_interop_kind), intent(in) :: interop' + 'integer(omp_interop_property_kind) property_id' + 'integer(omp_interop_rc_kind), optional, intent(out) :: + ret_code' + +_See also_: + *note omp_get_interop_ptr::, *note omp_get_interop_str::, *note + omp_get_interop_rc_desc::, *note Offload-Target Specifics:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.12.2, + OpenMP specification v6.0 (https://www.openmp.org), Section 26.2 + + +File: libgomp.info, Node: omp_get_interop_ptr, Next: omp_get_interop_str, Prev: omp_get_interop_int, Up: Interoperability Routines + +3.11.3 'omp_get_interop_ptr' - Obtain pointer-valued interoperability property +------------------------------------------------------------------------------ + +_Description_: + The 'omp_get_interop_int' function returns the pointer value + associated with the PROPERTY_ID interoperability property of the + passed INTEROP object. The RET_CODE argument is optional, i.e. it + can be omitted in C++ and Fortran or used with 'NULL' as argument + in C and C++. If successful, RET_CODE (if present) is set to + 'omp_irc_success'. + + In GCC, the effect of running this routine in a 'target' region + that is not the initial device is unspecified. + +_C/C++_: + _Prototype_: 'void *omp_get_interop_ptr(const omp_interop_t interop, + omp_interop_property_t property_id, omp_interop_rc_t + *ret_code)' + +_Fortran_: + _Interface_: 'type(c_ptr) function omp_get_interop_int(interop, + property_id, ret_code)' + 'use, intrinsic :: iso_c_binding, only : c_ptr' + 'integer(omp_interop_kind), intent(in) :: interop' + 'integer(omp_interop_property_kind) property_id' + 'integer(omp_interop_rc_kind), optional, intent(out) :: + ret_code' + +_See also_: + *note omp_get_interop_int::, *note omp_get_interop_str::, *note + omp_get_interop_rc_desc::, *note Offload-Target Specifics:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.12.3, + OpenMP specification v6.0 (https://www.openmp.org), Section 26.3 + + +File: libgomp.info, Node: omp_get_interop_str, Next: omp_get_interop_name, Prev: omp_get_interop_ptr, Up: Interoperability Routines + +3.11.4 'omp_get_interop_str' - Obtain string-valued interoperability property +----------------------------------------------------------------------------- + +_Description_: + The 'omp_get_interop_str' function returns the string value + associated with the PROPERTY_ID interoperability property of the + passed INTEROP object. The RET_CODE argument is optional, i.e. it + can be omitted in C++ and Fortran or used with 'NULL' as argument + in C and C++. If successful, RET_CODE (if present) is set to + 'omp_irc_success'. + + In GCC, the effect of running this routine in a 'target' region + that is not the initial device is unspecified. + +_C/C++_: + _Prototype_: 'const char *omp_get_interop_str(const omp_interop_t + interop, omp_interop_property_t property_id, + omp_interop_rc_t *ret_code)' + +_Fortran_: + _Interface_: 'character(:) function omp_get_interop_str(interop, + property_id, ret_code)' + 'pointer :: omp_get_interop_str' + 'integer(omp_interop_kind), intent(in) :: interop' + 'integer(omp_interop_property_kind) property_id' + 'integer(omp_interop_rc_kind), optional, intent(out) :: + ret_code' + +_See also_: + *note omp_get_interop_int::, *note omp_get_interop_ptr::, *note + omp_get_interop_rc_desc::, *note Offload-Target Specifics:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.12.4, + OpenMP specification v6.0 (https://www.openmp.org), Section 26.4 + + +File: libgomp.info, Node: omp_get_interop_name, Next: omp_get_interop_type_desc, Prev: omp_get_interop_str, Up: Interoperability Routines + +3.11.5 'omp_get_interop_name' - Obtain the name of an 'interop_property' value as string +---------------------------------------------------------------------------------------- + +_Description_: + The 'omp_get_interop_name' function returns the name of the + property itself as string; for the properties specified by the + OpenMP specification, the name matches the name of the named + constant with the 'omp_ipr_' prefix removed. + +_C/C++_: + _Prototype_: 'const char *omp_get_interop_name(const omp_interop_t + interop, omp_interop_property_t property_id)' + +_Fortran_: + _Interface_: 'character(:) function omp_get_interop_name(interop, + property_id)' + 'pointer :: omp_get_interop_name' + 'integer(omp_interop_kind), intent(in) :: interop' + 'integer(omp_interop_property_kind) property_id' + +_See also_: + *note omp_get_num_interop_properties::, *note + omp_get_interop_type_desc:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.12.5, + OpenMP specification v6.0 (https://www.openmp.org), Section 26.5 + + +File: libgomp.info, Node: omp_get_interop_type_desc, Next: omp_get_interop_rc_desc, Prev: omp_get_interop_name, Up: Interoperability Routines + +3.11.6 'omp_get_interop_type_desc' - Obtain type and description to an 'interop_property' +----------------------------------------------------------------------------------------- + +_Description_: + The 'omp_get_interop_type_desc' function returns a string that + describes in human-readable form the data type associated with the + PROPERTY_ID interoperability property of the passed INTEROP object. + + In GCC, this function returns the name of the C/C++ data type for + this property or 'N/A' if this property is not available for the + given foreign runtime. If INTEROP is 'omp_interop_none' or for + invalid property values, a null pointer is returned. The effect of + running this routine in a 'target' region that is not the initial + device is unspecified. + +_C/C++_: + _Prototype_: 'const char *omp_get_interop_type_desc(const + omp_interop_t interop, omp_interop_property_t + property_id)' + +_Fortran_: + _Interface_: 'character(:) function + omp_get_interop_type_desc(interop, property_id)' + 'pointer :: omp_get_interop_type_desc' + 'integer(omp_interop_kind), intent(in) :: interop' + 'integer(omp_interop_property_kind) property_id' + +_See also_: + *note omp_get_num_interop_properties::, *note + omp_get_interop_name::, *note Offload-Target Specifics:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.12.6, + OpenMP specification v6.0 (https://www.openmp.org), Section 26.6 + + +File: libgomp.info, Node: omp_get_interop_rc_desc, Prev: omp_get_interop_type_desc, Up: Interoperability Routines + +3.11.7 'omp_get_interop_rc_desc' - Obtain error string to an 'interop_rc' error code +------------------------------------------------------------------------------------ + +_Description_: + The 'omp_get_interop_rc_desc' function returns a string value + describing the RET_CODE in human-readable form. + + The behavior is unspecified if value of RET_CODE was not set by an + interoperability routine invoked for INTEROP. + +_C/C++_: + _Prototype_: 'const char *omp_get_interop_rc_desc(const omp_interop_t + interop, omp_interop_rc_t ret_code)' + +_Fortran_: + _Interface_: 'character(:) function omp_get_interop_rc_desc(interop, + property_id, ret_code)' + 'pointer :: omp_get_interop_rc_desc' + 'integer(omp_interop_kind), intent(in) :: interop' + 'integer (omp_interop_rc_kind) ret_code' + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.12.7, + OpenMP specification v6.0 (https://www.openmp.org), Section 26.7 + + +File: libgomp.info, Node: Memory Management Routines, Next: Environment Display Routine, Prev: Interoperability Routines, Up: Runtime Library Routines + +3.12 Memory Management Routines +=============================== + +Routines to manage and allocate memory on the current device. They have +C linkage and do not throw exceptions. + +* Menu: + +* omp_init_allocator:: Create an allocator +* omp_destroy_allocator:: Destroy an allocator +* omp_set_default_allocator:: Set the default allocator +* omp_get_default_allocator:: Get the default allocator +* omp_alloc:: Memory allocation with an allocator +* omp_aligned_alloc:: Memory allocation with an allocator and alignment +* omp_free:: Freeing memory allocated with OpenMP routines +* omp_calloc:: Allocate nullified memory with an allocator +* omp_aligned_calloc:: Allocate nullified aligned memory with an allocator +* omp_realloc:: Reallocate memory allocated with OpenMP routines + + +File: libgomp.info, Node: omp_init_allocator, Next: omp_destroy_allocator, Up: Memory Management Routines + +3.12.1 'omp_init_allocator' - Create an allocator +------------------------------------------------- + +_Description_: + Create an allocator that uses the specified memory space and has + the specified traits; if an allocator that fulfills the + requirements cannot be created, 'omp_null_allocator' is returned. + + The predefined memory spaces and available traits can be found at + *note Memory allocation::, where the trait names have to be + prefixed by 'omp_atk_' (e.g. 'omp_atk_pinned') and the named trait + values by 'omp_atv_' (e.g. 'omp_atv_true'); additionally, + 'omp_atv_default' may be used as trait value to specify that the + default value should be used. + +_C/C++_: + _Prototype_: 'omp_allocator_handle_t omp_init_allocator(' + ' omp_memspace_handle_t memspace,' + ' int ntraits,' + ' const omp_alloctrait_t traits[]);' + +_Fortran_: + _Interface_: 'function omp_init_allocator(memspace, ntraits, traits)' + 'integer (omp_allocator_handle_kind) :: + omp_init_allocator' + 'integer (omp_memspace_handle_kind), intent(in) :: + memspace' + 'integer, intent(in) :: ntraits' + 'type (omp_alloctrait), intent(in) :: traits(*)' + +_See also_: + *note Memory allocation::, *note OMP_ALLOCATOR::, *note + omp_destroy_allocator:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.7.2 + + +File: libgomp.info, Node: omp_destroy_allocator, Next: omp_set_default_allocator, Prev: omp_init_allocator, Up: Memory Management Routines + +3.12.2 'omp_destroy_allocator' - Destroy an allocator +----------------------------------------------------- + +_Description_: + Releases all resources used by a memory allocator, which must not + represent a predefined memory allocator. Accessing memory after + its allocator has been destroyed has unspecified behavior. Passing + 'omp_null_allocator' to the routine is permitted but has no effect. + +_C/C++_: + _Prototype_: 'void omp_destroy_allocator (omp_allocator_handle_t + allocator);' + +_Fortran_: + _Interface_: 'subroutine omp_destroy_allocator(allocator)' + 'integer (omp_allocator_handle_kind), intent(in) :: + allocator' + +_See also_: + *note omp_init_allocator:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.7.3 + + +File: libgomp.info, Node: omp_set_default_allocator, Next: omp_get_default_allocator, Prev: omp_destroy_allocator, Up: Memory Management Routines + +3.12.3 'omp_set_default_allocator' - Set the default allocator +-------------------------------------------------------------- + +_Description_: + Sets the default allocator that is used when no allocator has been + specified in the 'allocate' or 'allocator' clause or if an OpenMP + memory routine is invoked with the 'omp_null_allocator' allocator. + +_C/C++_: + _Prototype_: 'void omp_set_default_allocator(omp_allocator_handle_t + allocator);' + +_Fortran_: + _Interface_: 'subroutine omp_set_default_allocator(allocator)' + 'integer (omp_allocator_handle_kind), intent(in) :: + allocator' + +_See also_: + *note omp_get_default_allocator::, *note omp_init_allocator::, + *note OMP_ALLOCATOR::, *note Memory allocation:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.7.4 + + +File: libgomp.info, Node: omp_get_default_allocator, Next: omp_alloc, Prev: omp_set_default_allocator, Up: Memory Management Routines + +3.12.4 'omp_get_default_allocator' - Get the default allocator +-------------------------------------------------------------- + +_Description_: + The routine returns the default allocator that is used when no + allocator has been specified in the 'allocate' or 'allocator' + clause or if an OpenMP memory routine is invoked with the + 'omp_null_allocator' allocator. + +_C/C++_: + _Prototype_: 'omp_allocator_handle_t omp_get_default_allocator();' + +_Fortran_: + _Interface_: 'function omp_get_default_allocator()' + 'integer (omp_allocator_handle_kind) :: + omp_get_default_allocator' + +_See also_: + *note omp_set_default_allocator::, *note OMP_ALLOCATOR:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.7.5 + + +File: libgomp.info, Node: omp_alloc, Next: omp_aligned_alloc, Prev: omp_get_default_allocator, Up: Memory Management Routines + +3.12.5 'omp_alloc' - Memory allocation with an allocator +-------------------------------------------------------- + +_Description_: + Allocate memory with the specified allocator, which can either be a + predefined allocator, an allocator handle or 'omp_null_allocator'. + If the allocators is 'omp_null_allocator', the allocator specified + by the DEF-ALLOCATOR-VAR ICV is used. SIZE must be a nonnegative + number denoting the number of bytes to be allocated; if SIZE is + zero, 'omp_alloc' will return a null pointer. If successful, a + pointer to the allocated memory is returned, otherwise the + 'fallback' trait of the allocator determines the behavior. The + content of the allocated memory is unspecified. + + In 'target' regions, either the 'dynamic_allocators' clause must + appear on a 'requires' directive in the same compilation unit - or + the ALLOCATOR argument may only be a constant expression with the + value of one of the predefined allocators and may not be + 'omp_null_allocator'. + + Memory allocated by 'omp_alloc' must be freed using 'omp_free'. + +_C_: + _Prototype_: 'void* omp_alloc(size_t size,' + ' omp_allocator_handle_t allocator)' + +_C++_: + _Prototype_: 'void* omp_alloc(size_t size,' + ' omp_allocator_handle_t allocator=omp_null_allocator)' + +_Fortran_: + _Interface_: 'type(c_ptr) function omp_alloc(size, allocator) + bind(C)' + 'use, intrinsic :: iso_c_binding, only : c_ptr, + c_size_t' + 'integer (c_size_t), value :: size' + 'integer (omp_allocator_handle_kind), value :: + allocator' + +_See also_: + *note OMP_ALLOCATOR::, *note Memory allocation::, *note + omp_set_default_allocator::, *note omp_free::, *note + omp_init_allocator:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.7.6 + + +File: libgomp.info, Node: omp_aligned_alloc, Next: omp_free, Prev: omp_alloc, Up: Memory Management Routines + +3.12.6 'omp_aligned_alloc' - Memory allocation with an allocator and alignment +------------------------------------------------------------------------------ + +_Description_: + Allocate memory with the specified allocator, which can either be a + predefined allocator, an allocator handle or 'omp_null_allocator'. + If the allocators is 'omp_null_allocator', the allocator specified + by the DEF-ALLOCATOR-VAR ICV is used. ALIGNMENT must be a positive + power of two and SIZE must be a nonnegative number that is a + multiple of the alignment and denotes the number of bytes to be + allocated; if SIZE is zero, 'omp_aligned_alloc' will return a null + pointer. The alignment will be at least the maximal value required + by 'alignment' trait of the allocator and the value of the passed + ALIGNMENT argument. If successful, a pointer to the allocated + memory is returned, otherwise the 'fallback' trait of the allocator + determines the behavior. The content of the allocated memory is + unspecified. + + In 'target' regions, either the 'dynamic_allocators' clause must + appear on a 'requires' directive in the same compilation unit - or + the ALLOCATOR argument may only be a constant expression with the + value of one of the predefined allocators and may not be + 'omp_null_allocator'. + + Memory allocated by 'omp_aligned_alloc' must be freed using + 'omp_free'. + +_C_: + _Prototype_: 'void* omp_aligned_alloc(size_t alignment,' + ' size_t size,' + ' omp_allocator_handle_t allocator)' + +_C++_: + _Prototype_: 'void* omp_aligned_alloc(size_t alignment,' + ' size_t size,' + ' omp_allocator_handle_t allocator=omp_null_allocator)' + +_Fortran_: + _Interface_: 'type(c_ptr) function omp_aligned_alloc(alignment, size, + allocator) bind(C)' + 'use, intrinsic :: iso_c_binding, only : c_ptr, + c_size_t' + 'integer (c_size_t), value :: alignment, size' + 'integer (omp_allocator_handle_kind), value :: + allocator' + +_See also_: + *note OMP_ALLOCATOR::, *note Memory allocation::, *note + omp_set_default_allocator::, *note omp_free::, *note + omp_init_allocator:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.13.6 + + +File: libgomp.info, Node: omp_free, Next: omp_calloc, Prev: omp_aligned_alloc, Up: Memory Management Routines + +3.12.7 'omp_free' - Freeing memory allocated with OpenMP routines +----------------------------------------------------------------- + +_Description_: + The 'omp_free' routine deallocates memory previously allocated by + an OpenMP memory-management routine. The PTR argument must point + to such memory or be a null pointer; if it is a null pointer, no + operation is performed. If specified, the ALLOCATOR argument must + be either the memory allocator that was used for the allocation or + 'omp_null_allocator'; if it is 'omp_null_allocator', the + implementation will determine the value automatically. + + Calling 'omp_free' invokes undefined behavior if the memory was + already deallocated or when the used allocator has already been + destroyed. + +_C_: + _Prototype_: 'void omp_free(void *ptr,' + ' omp_allocator_handle_t allocator)' + +_C++_: + _Prototype_: 'void omp_free(void *ptr,' + ' omp_allocator_handle_t allocator=omp_null_allocator)' + +_Fortran_: + _Interface_: 'subroutine omp_free(ptr, allocator) bind(C)' + 'use, intrinsic :: iso_c_binding, only : c_ptr' + 'type (c_ptr), value :: ptr' + 'integer (omp_allocator_handle_kind), value :: + allocator' + +_See also_: + *note omp_alloc::, *note omp_aligned_alloc::, *note omp_calloc::, + *note omp_aligned_calloc::, *note omp_realloc:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.7.7 + + +File: libgomp.info, Node: omp_calloc, Next: omp_aligned_calloc, Prev: omp_free, Up: Memory Management Routines + +3.12.8 'omp_calloc' - Allocate nullified memory with an allocator +----------------------------------------------------------------- + +_Description_: + Allocate zero-initialized memory with the specified allocator, + which can either be a predefined allocator, an allocator handle or + 'omp_null_allocator'. If the allocators is 'omp_null_allocator', + the allocator specified by the DEF-ALLOCATOR-VAR ICV is used. The + to-be allocated memory is for an array with NMEMB elements, each + having a size of SIZE bytes. Both NMEMB and SIZE must be + nonnegative numbers; if either of them is zero, 'omp_calloc' will + return a null pointer. If successful, a pointer to the + zero-initialized allocated memory is returned, otherwise the + 'fallback' trait of the allocator determines the behavior. + + In 'target' regions, either the 'dynamic_allocators' clause must + appear on a 'requires' directive in the same compilation unit - or + the ALLOCATOR argument may only be a constant expression with the + value of one of the predefined allocators and may not be + 'omp_null_allocator'. + + Memory allocated by 'omp_calloc' must be freed using 'omp_free'. + +_C_: + _Prototype_: 'void* omp_calloc(size_t nmemb, size_t size,' + ' omp_allocator_handle_t allocator)' + +_C++_: + _Prototype_: 'void* omp_calloc(size_t nmemb, size_t size,' + ' omp_allocator_handle_t allocator=omp_null_allocator)' + +_Fortran_: + _Interface_: 'type(c_ptr) function omp_calloc(nmemb, size, allocator) + bind(C)' + 'use, intrinsic :: iso_c_binding, only : c_ptr, + c_size_t' + 'integer (c_size_t), value :: nmemb, size' + 'integer (omp_allocator_handle_kind), value :: + allocator' + +_See also_: + *note OMP_ALLOCATOR::, *note Memory allocation::, *note + omp_set_default_allocator::, *note omp_free::, *note + omp_init_allocator:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.13.8 + + +File: libgomp.info, Node: omp_aligned_calloc, Next: omp_realloc, Prev: omp_calloc, Up: Memory Management Routines + +3.12.9 'omp_aligned_calloc' - Allocate aligned nullified memory with an allocator +--------------------------------------------------------------------------------- + +_Description_: + Allocate zero-initialized memory with the specified allocator, + which can either be a predefined allocator, an allocator handle or + 'omp_null_allocator'. If the allocators is 'omp_null_allocator', + the allocator specified by the DEF-ALLOCATOR-VAR ICV is used. The + to-be allocated memory is for an array with NMEMB elements, each + having a size of SIZE bytes. Both NMEMB and SIZE must be + nonnegative numbers; if either of them is zero, + 'omp_aligned_calloc' will return a null pointer. ALIGNMENT must be + a positive power of two and SIZE must be a multiple of the + alignment; the alignment will be at least the maximal value + required by 'alignment' trait of the allocator and the value of the + passed ALIGNMENT argument. If successful, a pointer to the + zero-initialized allocated memory is returned, otherwise the + 'fallback' trait of the allocator determines the behavior. + + In 'target' regions, either the 'dynamic_allocators' clause must + appear on a 'requires' directive in the same compilation unit - or + the ALLOCATOR argument may only be a constant expression with the + value of one of the predefined allocators and may not be + 'omp_null_allocator'. + + Memory allocated by 'omp_aligned_calloc' must be freed using + 'omp_free'. + +_C_: + _Prototype_: 'void* omp_aligned_calloc(size_t nmemb, size_t size,' + ' omp_allocator_handle_t allocator)' + +_C++_: + _Prototype_: 'void* omp_aligned_calloc(size_t nmemb, size_t size,' + ' omp_allocator_handle_t allocator=omp_null_allocator)' + +_Fortran_: + _Interface_: 'type(c_ptr) function omp_aligned_calloc(nmemb, size, + allocator) bind(C)' + 'use, intrinsic :: iso_c_binding, only : c_ptr, + c_size_t' + 'integer (c_size_t), value :: nmemb, size' + 'integer (omp_allocator_handle_kind), value :: + allocator' + +_See also_: + *note OMP_ALLOCATOR::, *note Memory allocation::, *note + omp_set_default_allocator::, *note omp_free::, *note + omp_init_allocator:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.13.8 + + +File: libgomp.info, Node: omp_realloc, Prev: omp_aligned_calloc, Up: Memory Management Routines + +3.12.10 'omp_realloc' - Reallocate memory allocated with OpenMP routines +------------------------------------------------------------------------ + +_Description_: + The 'omp_realloc' routine deallocates memory to which PTR points to + and allocates new memory with the specified ALLOCATOR argument; the + new memory will have the content of the old memory up to the + minimum of the old size and the new SIZE, otherwise the content of + the returned memory is unspecified. If the new allocator is the + same as the old one, the routine tries to resize the existing + memory allocation, returning the same address as PTR if successful. + PTR must point to memory allocated by an OpenMP memory-management + routine. + + The ALLOCATOR and FREE_ALLOCATOR arguments must be a predefined + allocator, an allocator handle or 'omp_null_allocator'. If + FREE_ALLOCATOR is 'omp_null_allocator', the implementation + automatically determines the allocator used for the allocation of + PTR. If ALLOCATOR is 'omp_null_allocator' and PTR is not a null + pointer, the same allocator as 'free_allocator' is used and when + PTR is a null pointer the allocator specified by the + DEF-ALLOCATOR-VAR ICV is used. + + The SIZE must be a nonnegative number denoting the number of bytes + to be allocated; if SIZE is zero, 'omp_realloc' will return free + the memory and return a null pointer. When SIZE is nonzero: if + successful, a pointer to the allocated memory is returned, + otherwise the 'fallback' trait of the allocator determines the + behavior. + + In 'target' regions, either the 'dynamic_allocators' clause must + appear on a 'requires' directive in the same compilation unit - or + the FREE_ALLOCATOR and ALLOCATOR arguments may only be a constant + expression with the value of one of the predefined allocators and + may not be 'omp_null_allocator'. + + Memory allocated by 'omp_realloc' must be freed using 'omp_free'. + Calling 'omp_free' invokes undefined behavior if the memory was + already deallocated or when the used allocator has already been + destroyed. + +_C_: + _Prototype_: 'void* omp_realloc(void *ptr, size_t size,' + ' omp_allocator_handle_t allocator,' + ' omp_allocator_handle_t free_allocator)' + +_C++_: + _Prototype_: 'void* omp_realloc(void *ptr, size_t size,' + ' omp_allocator_handle_t allocator=omp_null_allocator,' + ' omp_allocator_handle_t + free_allocator=omp_null_allocator)' + +_Fortran_: + _Interface_: 'type(c_ptr) function omp_realloc(ptr, size, allocator, + free_allocator) bind(C)' + 'use, intrinsic :: iso_c_binding, only : c_ptr, + c_size_t' + 'type(C_ptr), value :: ptr' + 'integer (c_size_t), value :: size' + 'integer (omp_allocator_handle_kind), value :: + allocator, free_allocator' + +_See also_: + *note OMP_ALLOCATOR::, *note Memory allocation::, *note + omp_set_default_allocator::, *note omp_free::, *note + omp_init_allocator:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.7.9 + + +File: libgomp.info, Node: Environment Display Routine, Prev: Memory Management Routines, Up: Runtime Library Routines + +3.13 Environment Display Routine +================================ + +Routine to display the OpenMP version number and the initial value of +ICVs. It has C linkage and does not throw exceptions. + +* Menu: + +* omp_display_env:: print the initial ICV values + + +File: libgomp.info, Node: omp_display_env, Up: Environment Display Routine + +3.13.1 'omp_display_env' - print the initial ICV values +------------------------------------------------------- + +_Description_: + Each time this routine is invoked, the OpenMP version number and + initial value of internal control variables (ICVs) is printed on + 'stderr'. The displayed values are those at startup after + evaluating the environment variables; later calls to API routines + or clauses used in enclosing constructs do not affect the output. + + If the VERBOSE argument is 'false', only the OpenMP version and + standard OpenMP ICVs are shown; if it is 'true', additionally, the + GCC-specific ICVs are shown. + + The output consists of multiple lines and starts with 'OPENMP + DISPLAY ENVIRONMENT BEGIN' followed by the name-value lines and + ends with 'OPENMP DISPLAY ENVIRONMENT END'. The NAME is followed + by an equal sign and the VALUE is enclosed in single quotes. + + The first line has as NAME either '_OPENMP' or 'openmp_version' and + shows as value the supported OpenMP version number (4-digit year, + 2-digit month) of the implementation, matching the value of the + '_OPENMP' macro and, in Fortran, the named constant + 'openmp_version'. + + In each of the succeeding lines, the NAME matches the + environment-variable name of an ICV and shows its value. Those + line are might be prefixed by pair of brackets and a space, where + the brackets enclose a comma-separated list of devices to which the + ICV-value combination applies to; the value can either be a numeric + device number or an abstract name denoting all devices ('all'), the + initial host device ('host') or all devices but the host + ('device'). Note that the same ICV might be printed multiple times + for multiple devices, even if all have the same value. + + The effect when invoked from within a 'target' region is + unspecified. + +_C/C++_: + _Prototype_: 'void omp_display_env(int verbose)' + +_Fortran_: + _Interface_: 'subroutine omp_display_env(verbose)' + 'logical, intent(in) :: verbose' + +_Example_: + Note that the GCC-specific ICVs, such as the shown + 'GOMP_SPINCOUNT', are only printed when VERBOSE set to 'true'. + + OPENMP DISPLAY ENVIRONMENT BEGIN + _OPENMP = '201511' + [host] OMP_DYNAMIC = 'FALSE' + [host] OMP_NESTED = 'FALSE' + [all] OMP_CANCELLATION = 'FALSE' + ... + [host] GOMP_SPINCOUNT = '300000' + OPENMP DISPLAY ENVIRONMENT END + +_See also_: + *note OMP_DISPLAY_ENV::, *note Environment Variables::, *note + Implementation-defined ICV Initialization:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.15 + + +File: libgomp.info, Node: Environment Variables, Next: Enabling OpenACC, Prev: Runtime Library Routines, Up: Top + +4 OpenMP Environment Variables +****************************** + +The environment variables which beginning with 'OMP_' are defined by +section 4 of the OpenMP specification in version 4.5 or in a later +version of the specification, while those beginning with 'GOMP_' are GNU +extensions. Most 'OMP_' environment variables have an associated +internal control variable (ICV). + + For any OpenMP environment variable that sets an ICV and is neither +'OMP_DEFAULT_DEVICE' nor has global ICV scope, associated +device-specific environment variables exist. For them, the environment +variable without suffix affects the host. The suffix '_DEV_' followed +by a non-negative device number less that the number of available +devices sets the ICV for the corresponding device. The suffix '_DEV' +sets the ICV of all non-host devices for which a device-specific +corresponding environment variable has not been set while the '_ALL' +suffix sets the ICV of all host and non-host devices for which a more +specific corresponding environment variable is not set. + +* Menu: + +* OMP_ALLOCATOR:: Set the default allocator +* OMP_AFFINITY_FORMAT:: Set the format string used for affinity display +* OMP_CANCELLATION:: Set whether cancellation is activated +* OMP_DISPLAY_AFFINITY:: Display thread affinity information +* OMP_DISPLAY_ENV:: Show OpenMP version and environment variables +* OMP_DEFAULT_DEVICE:: Set the device used in target regions +* OMP_DYNAMIC:: Dynamic adjustment of threads +* OMP_MAX_ACTIVE_LEVELS:: Set the maximum number of nested parallel regions +* OMP_MAX_TASK_PRIORITY:: Set the maximum task priority value +* OMP_NESTED:: Nested parallel regions +* OMP_NUM_TEAMS:: Specifies the number of teams to use by teams region +* OMP_NUM_THREADS:: Specifies the number of threads to use +* OMP_PROC_BIND:: Whether threads may be moved between CPUs +* OMP_PLACES:: Specifies on which CPUs the threads should be placed +* OMP_STACKSIZE:: Set default thread stack size +* OMP_SCHEDULE:: How threads are scheduled +* OMP_TARGET_OFFLOAD:: Controls offloading behavior +* OMP_TEAMS_THREAD_LIMIT:: Set the maximum number of threads imposed by teams +* OMP_THREAD_LIMIT:: Set the maximum number of threads +* OMP_WAIT_POLICY:: How waiting threads are handled +* GOMP_CPU_AFFINITY:: Bind threads to specific CPUs +* GOMP_DEBUG:: Enable debugging output +* GOMP_STACKSIZE:: Set default thread stack size +* GOMP_SPINCOUNT:: Set the busy-wait spin count +* GOMP_RTEMS_THREAD_POOLS:: Set the RTEMS specific thread pools + + +File: libgomp.info, Node: OMP_ALLOCATOR, Next: OMP_AFFINITY_FORMAT, Up: Environment Variables + +4.1 'OMP_ALLOCATOR' - Set the default allocator +=============================================== + +_ICV:_ DEF-ALLOCATOR-VAR +_Scope:_ data environment +_Description_: + Sets the default allocator that is used when no allocator has been + specified in the 'allocate' or 'allocator' clause or if an OpenMP + memory routine is invoked with the 'omp_null_allocator' allocator. + If unset, 'omp_default_mem_alloc' is used. + + The value can either be a predefined allocator or a predefined + memory space or a predefined memory space followed by a colon and a + comma-separated list of memory trait and value pairs, separated by + '='. + + See *note Memory allocation:: for a list of supported prefedined + allocators, memory spaces, and traits. + + Note: The corresponding device environment variables are currently + not supported. Therefore, the non-host DEF-ALLOCATOR-VAR ICVs are + always initialized to 'omp_default_mem_alloc'. However, on all + devices, the 'omp_set_default_allocator' API routine can be used to + change value. + + Examples: + OMP_ALLOCATOR=omp_high_bw_mem_alloc + OMP_ALLOCATOR=omp_large_cap_mem_space + OMP_ALLOCATOR=omp_low_lat_mem_space:pinned=true,partition=nearest + +_See also_: + *note Memory allocation::, *note omp_get_default_allocator::, *note + omp_set_default_allocator::, *note Offload-Target Specifics:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 6.21 + + +File: libgomp.info, Node: OMP_AFFINITY_FORMAT, Next: OMP_CANCELLATION, Prev: OMP_ALLOCATOR, Up: Environment Variables + +4.2 'OMP_AFFINITY_FORMAT' - Set the format string used for affinity display +=========================================================================== + +_ICV:_ AFFINITY-FORMAT-VAR +_Scope:_ device +_Description_: + Sets the format string used when displaying OpenMP thread affinity + information. Special values are output using '%' followed by an + optional size specification and then either the single-character + field type or its long name enclosed in curly braces; using '%%' + displays a literal percent. The size specification consists of an + optional '0.' or '.' followed by a positive integer, specifying the + minimal width of the output. With '0.' and numerical values, the + output is padded with zeros on the left; with '.', the output is + padded by spaces on the left; otherwise, the output is padded by + spaces on the right. If unset, the value is "'level %L thread %i + affinity %A'". + + Supported field types are: + + t team_num value returned by 'omp_get_team_num' + T num_teams value returned by 'omp_get_num_teams' + L nesting_level value returned by 'omp_get_level' + n thread_num value returned by 'omp_get_thread_num' + N num_threads value returned by 'omp_get_num_threads' + a ancestor_tnum value returned by + 'omp_get_ancestor_thread_num(omp_get_level()-1)' + H host name of the host that executes the thread + P process_id process identifier + i native_thread_id native thread identifier + A thread_affinity comma separated list of integer values or + ranges, representing the processors on + which a process might execute, subject to + affinity mechanisms + + For instance, after setting + + OMP_AFFINITY_FORMAT="%0.2a!%n!%.4L!%N;%.2t;%0.2T;%{team_num};%{num_teams};%A" + + with either 'OMP_DISPLAY_AFFINITY' being set or when calling + 'omp_display_affinity' with 'NULL' or an empty string, the program + might display the following: + + 00!0! 1!4; 0;01;0;1;0-11 + 00!3! 1!4; 0;01;0;1;0-11 + 00!2! 1!4; 0;01;0;1;0-11 + 00!1! 1!4; 0;01;0;1;0-11 + +_See also_: + *note OMP_DISPLAY_AFFINITY:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 6.14 + + +File: libgomp.info, Node: OMP_CANCELLATION, Next: OMP_DISPLAY_AFFINITY, Prev: OMP_AFFINITY_FORMAT, Up: Environment Variables + +4.3 'OMP_CANCELLATION' - Set whether cancellation is activated +============================================================== + +_ICV:_ CANCEL-VAR +_Scope:_ global +_Description_: + If set to 'TRUE', the cancellation is activated. If set to 'FALSE' + or if unset, cancellation is disabled and the 'cancel' construct is + ignored. + +_See also_: + *note omp_get_cancellation:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.11 + + +File: libgomp.info, Node: OMP_DISPLAY_AFFINITY, Next: OMP_DISPLAY_ENV, Prev: OMP_CANCELLATION, Up: Environment Variables + +4.4 'OMP_DISPLAY_AFFINITY' - Display thread affinity information +================================================================ + +_ICV:_ DISPLAY-AFFINITY-VAR +_Scope:_ global +_Description_: + If set to 'FALSE' or if unset, affinity displaying is disabled. If + set to 'TRUE', the runtime displays affinity information about + OpenMP threads in a parallel region upon entering the region and + every time any change occurs. + +_See also_: + *note OMP_AFFINITY_FORMAT:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 6.13 + + +File: libgomp.info, Node: OMP_DISPLAY_ENV, Next: OMP_DEFAULT_DEVICE, Prev: OMP_DISPLAY_AFFINITY, Up: Environment Variables + +4.5 'OMP_DISPLAY_ENV' - Show OpenMP version and environment variables +===================================================================== + +_ICV:_ none +_Scope:_ not applicable +_Description_: + If set to 'TRUE', the runtime displays the same information to + 'stderr' as shown by the 'omp_display_env' routine invoked with + VERBOSE argument set to 'false'. If set to 'VERBOSE', the same + information is shown as invoking the routine with VERBOSE set to + 'true'. If unset or set to 'FALSE', this information is not shown. + The result for any other value is unspecified. + +_See also_: + *note omp_display_env:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.12 + + +File: libgomp.info, Node: OMP_DEFAULT_DEVICE, Next: OMP_DYNAMIC, Prev: OMP_DISPLAY_ENV, Up: Environment Variables + +4.6 'OMP_DEFAULT_DEVICE' - Set the device used in target regions +================================================================ + +_ICV:_ DEFAULT-DEVICE-VAR +_Scope:_ data environment +_Description_: + Set to choose the device which is used in a 'target' region, unless + the value is overridden by 'omp_set_default_device' or by a + 'device' clause. The value shall be the nonnegative device number. + If no device with the given device number exists, the code is + executed on the host. If unset, 'OMP_TARGET_OFFLOAD' is + 'mandatory' and no non-host devices are available, it is set to + 'omp_invalid_device'. Otherwise, if unset, device number 0 is + used. + +_See also_: + *note omp_get_default_device::, *note omp_set_default_device::, + *note OMP_TARGET_OFFLOAD:: + +_Reference_: + OpenMP specification v5.2 (https://www.openmp.org), Section 21.2.7 + + +File: libgomp.info, Node: OMP_DYNAMIC, Next: OMP_MAX_ACTIVE_LEVELS, Prev: OMP_DEFAULT_DEVICE, Up: Environment Variables + +4.7 'OMP_DYNAMIC' - Dynamic adjustment of threads +================================================= + +_ICV:_ DYN-VAR +_Scope:_ global +_Description_: + Enable or disable the dynamic adjustment of the number of threads + within a team. The value of this environment variable shall be + 'TRUE' or 'FALSE'. If undefined, dynamic adjustment is disabled by + default. + +_See also_: + *note omp_set_dynamic:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.3 + + +File: libgomp.info, Node: OMP_MAX_ACTIVE_LEVELS, Next: OMP_MAX_TASK_PRIORITY, Prev: OMP_DYNAMIC, Up: Environment Variables + +4.8 'OMP_MAX_ACTIVE_LEVELS' - Set the maximum number of nested parallel regions +=============================================================================== + +_ICV:_ MAX-ACTIVE-LEVELS-VAR +_Scope:_ data environment +_Description_: + Specifies the initial value for the maximum number of nested + parallel regions. The value of this variable shall be a positive + integer. If undefined, then if 'OMP_NESTED' is defined and set to + true, or if 'OMP_NUM_THREADS' or 'OMP_PROC_BIND' are defined and + set to a list with more than one item, the maximum number of nested + parallel regions is initialized to the largest number supported, + otherwise it is set to one. + +_See also_: + *note omp_set_max_active_levels::, *note OMP_NESTED::, *note + OMP_PROC_BIND::, *note OMP_NUM_THREADS:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.9 + + +File: libgomp.info, Node: OMP_MAX_TASK_PRIORITY, Next: OMP_NESTED, Prev: OMP_MAX_ACTIVE_LEVELS, Up: Environment Variables + +4.9 'OMP_MAX_TASK_PRIORITY' - Set the maximum priority +====================================================== + +number that can be set for a task. +_ICV:_ MAX-TASK-PRIORITY-VAR +_Scope:_ global +_Description_: + Specifies the initial value for the maximum priority value that can + be set for a task. The value of this variable shall be a + non-negative integer, and zero is allowed. If undefined, the + default priority is 0. + +_See also_: + *note omp_get_max_task_priority:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.14 + + +File: libgomp.info, Node: OMP_NESTED, Next: OMP_NUM_TEAMS, Prev: OMP_MAX_TASK_PRIORITY, Up: Environment Variables + +4.10 'OMP_NESTED' - Nested parallel regions +=========================================== + +_ICV:_ MAX-ACTIVE-LEVELS-VAR +_Scope:_ data environment +_Description_: + Enable or disable nested parallel regions, i.e., whether team + members are allowed to create new teams. The value of this + environment variable shall be 'TRUE' or 'FALSE'. If set to 'TRUE', + the number of maximum active nested regions supported is by default + set to the maximum supported, otherwise it is set to one. If + 'OMP_MAX_ACTIVE_LEVELS' is defined, its setting overrides this + setting. If both are undefined, nested parallel regions are + enabled if 'OMP_NUM_THREADS' or 'OMP_PROC_BINDS' are defined to a + list with more than one item, otherwise they are disabled by + default. + + Note that the 'OMP_NESTED' environment variable was deprecated in + the OpenMP specification 5.0 in favor of 'OMP_MAX_ACTIVE_LEVELS'. + +_See also_: + *note omp_set_max_active_levels::, *note omp_set_nested::, *note + OMP_MAX_ACTIVE_LEVELS:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.6 + + +File: libgomp.info, Node: OMP_NUM_TEAMS, Next: OMP_NUM_THREADS, Prev: OMP_NESTED, Up: Environment Variables + +4.11 'OMP_NUM_TEAMS' - Specifies the number of teams to use by teams region +=========================================================================== + +_ICV:_ NTEAMS-VAR +_Scope:_ device +_Description_: + Specifies the upper bound for number of teams to use in teams + regions without explicit 'num_teams' clause. The value of this + variable shall be a positive integer. If undefined it defaults to + 0 which means implementation defined upper bound. + +_See also_: + *note omp_set_num_teams:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 6.23 + + +File: libgomp.info, Node: OMP_NUM_THREADS, Next: OMP_PROC_BIND, Prev: OMP_NUM_TEAMS, Up: Environment Variables + +4.12 'OMP_NUM_THREADS' - Specifies the number of threads to use +=============================================================== + +_ICV:_ NTHREADS-VAR +_Scope:_ data environment +_Description_: + Specifies the default number of threads to use in parallel regions. + The value of this variable shall be a comma-separated list of + positive integers; the value specifies the number of threads to use + for the corresponding nested level. Specifying more than one item + in the list automatically enables nesting by default. If undefined + one thread per CPU is used. + + When a list with more than value is specified, it also affects the + MAX-ACTIVE-LEVELS-VAR ICV as described in *note + OMP_MAX_ACTIVE_LEVELS::. + +_See also_: + *note omp_set_num_threads::, *note OMP_MAX_ACTIVE_LEVELS:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.2 + + +File: libgomp.info, Node: OMP_PROC_BIND, Next: OMP_PLACES, Prev: OMP_NUM_THREADS, Up: Environment Variables + +4.13 'OMP_PROC_BIND' - Whether threads may be moved between CPUs +================================================================ + +_ICV:_ BIND-VAR +_Scope:_ data environment +_Description_: + Specifies whether threads may be moved between processors. If set + to 'TRUE', OpenMP threads should not be moved; if set to 'FALSE' + they may be moved. Alternatively, a comma separated list with the + values 'PRIMARY', 'MASTER', 'CLOSE' and 'SPREAD' can be used to + specify the thread affinity policy for the corresponding nesting + level. With 'PRIMARY' and 'MASTER' the worker threads are in the + same place partition as the primary thread. With 'CLOSE' those are + kept close to the primary thread in contiguous place partitions. + And with 'SPREAD' a sparse distribution across the place partitions + is used. Specifying more than one item in the list automatically + enables nesting by default. + + When a list is specified, it also affects the MAX-ACTIVE-LEVELS-VAR + ICV as described in *note OMP_MAX_ACTIVE_LEVELS::. + + When undefined, 'OMP_PROC_BIND' defaults to 'TRUE' when + 'OMP_PLACES' or 'GOMP_CPU_AFFINITY' is set and 'FALSE' otherwise. + +_See also_: + *note omp_get_proc_bind::, *note GOMP_CPU_AFFINITY::, *note + OMP_PLACES::, *note OMP_MAX_ACTIVE_LEVELS:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.4 + + +File: libgomp.info, Node: OMP_PLACES, Next: OMP_STACKSIZE, Prev: OMP_PROC_BIND, Up: Environment Variables + +4.14 'OMP_PLACES' - Specifies on which CPUs the threads should be placed +======================================================================== + +_ICV:_ PLACE-PARTITION-VAR +_Scope:_ implicit tasks +_Description_: + The thread placement can be either specified using an abstract name + or by an explicit list of the places. The abstract names + 'threads', 'cores', 'sockets', 'll_caches' and 'numa_domains' can + be optionally followed by a positive number in parentheses, which + denotes the how many places shall be created. With 'threads' each + place corresponds to a single hardware thread; 'cores' to a single + core with the corresponding number of hardware threads; with + 'sockets' the place corresponds to a single socket; with + 'll_caches' to a set of cores that shares the last level cache on + the device; and 'numa_domains' to a set of cores for which their + closest memory on the device is the same memory and at a similar + distance from the cores. The resulting placement can be shown by + setting the 'OMP_DISPLAY_ENV' environment variable. + + Alternatively, the placement can be specified explicitly as + comma-separated list of places. A place is specified by set of + nonnegative numbers in curly braces, denoting the hardware threads. + The curly braces can be omitted when only a single number has been + specified. The hardware threads belonging to a place can either be + specified as comma-separated list of nonnegative thread numbers or + using an interval. Multiple places can also be either specified by + a comma-separated list of places or by an interval. To specify an + interval, a colon followed by the count is placed after the + hardware thread number or the place. Optionally, the length can be + followed by a colon and the stride number - otherwise a unit stride + is assumed. Placing an exclamation mark ('!') directly before a + curly brace or numbers inside the curly braces (excluding + intervals) excludes those hardware threads. + + For instance, the following specifies the same places list: + '"{0,1,2}, {3,4,6}, {7,8,9}, {10,11,12}"'; '"{0:3}, {3:3}, {7:3}, + {10:3}"'; and '"{0:2}:4:3"'. + + If 'OMP_PLACES' and 'GOMP_CPU_AFFINITY' are unset and + 'OMP_PROC_BIND' is either unset or 'false', threads may be moved + between CPUs following no placement policy. + +_See also_: + *note OMP_PROC_BIND::, *note GOMP_CPU_AFFINITY::, *note + omp_get_proc_bind::, *note OMP_DISPLAY_ENV:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.5 + + +File: libgomp.info, Node: OMP_STACKSIZE, Next: OMP_SCHEDULE, Prev: OMP_PLACES, Up: Environment Variables + +4.15 'OMP_STACKSIZE' - Set default thread stack size +==================================================== + +_ICV:_ STACKSIZE-VAR +_Scope:_ device +_Description_: + Set the default thread stack size in kilobytes, unless the number + is suffixed by 'B', 'K', 'M' or 'G', in which case the size is, + respectively, in bytes, kilobytes, megabytes or gigabytes. This is + different from 'pthread_attr_setstacksize' which gets the number of + bytes as an argument. If the stack size cannot be set due to + system constraints, an error is reported and the initial stack size + is left unchanged. If undefined, the stack size is system + dependent. + +_See also_: + *note GOMP_STACKSIZE:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.7 + + +File: libgomp.info, Node: OMP_SCHEDULE, Next: OMP_TARGET_OFFLOAD, Prev: OMP_STACKSIZE, Up: Environment Variables + +4.16 'OMP_SCHEDULE' - How threads are scheduled +=============================================== + +_ICV:_ RUN-SCHED-VAR +_Scope:_ data environment +_Description_: + Allows to specify 'schedule type' and 'chunk size'. The value of + the variable shall have the form: 'type[,chunk]' where 'type' is + one of 'static', 'dynamic', 'guided' or 'auto' The optional 'chunk' + size shall be a positive integer. If undefined, dynamic scheduling + and a chunk size of 1 is used. + +_See also_: + *note omp_set_schedule:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Sections + 2.7.1.1 and 4.1 + + +File: libgomp.info, Node: OMP_TARGET_OFFLOAD, Next: OMP_TEAMS_THREAD_LIMIT, Prev: OMP_SCHEDULE, Up: Environment Variables + +4.17 'OMP_TARGET_OFFLOAD' - Controls offloading behavior +======================================================== + +_ICV:_ TARGET-OFFLOAD-VAR +_Scope:_ global +_Description_: + Specifies the behavior with regard to offloading code to a device. + This variable can be set to one of three values - 'MANDATORY', + 'DISABLED' or 'DEFAULT'. + + If set to 'MANDATORY', the program terminates with an error if any + device construct or device memory routine uses a device that is + unavailable or not supported by the implementation, or uses a + non-conforming device number. If set to 'DISABLED', then + offloading is disabled and all code runs on the host. If set to + 'DEFAULT', the program tries offloading to the device first, then + falls back to running code on the host if it cannot. + + If undefined, then the program behaves as if 'DEFAULT' was set. + + Note: Even with 'MANDATORY', no run-time termination is performed + when the device number in a 'device' clause or argument to a device + memory routine is for host, which includes using the device number + in the DEFAULT-DEVICE-VAR ICV. However, the initial value of the + DEFAULT-DEVICE-VAR ICV is affected by 'MANDATORY'. + +_See also_: + *note OMP_DEFAULT_DEVICE:: + +_Reference_: + OpenMP specification v5.2 (https://www.openmp.org), Section 21.2.8 + + +File: libgomp.info, Node: OMP_TEAMS_THREAD_LIMIT, Next: OMP_THREAD_LIMIT, Prev: OMP_TARGET_OFFLOAD, Up: Environment Variables + +4.18 'OMP_TEAMS_THREAD_LIMIT' - Set the maximum number of threads imposed by teams +================================================================================== + +_ICV:_ TEAMS-THREAD-LIMIT-VAR +_Scope:_ device +_Description_: + Specifies an upper bound for the number of threads to use by each + contention group created by a teams construct without explicit + 'thread_limit' clause. The value of this variable shall be a + positive integer. If undefined, the value of 0 is used which + stands for an implementation defined upper limit. + +_See also_: + *note OMP_THREAD_LIMIT::, *note omp_set_teams_thread_limit:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 6.24 + + +File: libgomp.info, Node: OMP_THREAD_LIMIT, Next: OMP_WAIT_POLICY, Prev: OMP_TEAMS_THREAD_LIMIT, Up: Environment Variables + +4.19 'OMP_THREAD_LIMIT' - Set the maximum number of threads +=========================================================== + +_ICV:_ THREAD-LIMIT-VAR +_Scope:_ data environment +_Description_: + Specifies the number of threads to use for the whole program. The + value of this variable shall be a positive integer. If undefined, + the number of threads is not limited. + +_See also_: + *note OMP_NUM_THREADS::, *note omp_get_thread_limit:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.10 + + +File: libgomp.info, Node: OMP_WAIT_POLICY, Next: GOMP_CPU_AFFINITY, Prev: OMP_THREAD_LIMIT, Up: Environment Variables + +4.20 'OMP_WAIT_POLICY' - How waiting threads are handled +======================================================== + +_Description_: + Specifies whether waiting threads should be active or passive. If + the value is 'PASSIVE', waiting threads should not consume CPU + power while waiting; while the value is 'ACTIVE' specifies that + they should. If undefined, threads wait actively for a short time + before waiting passively. + +_See also_: + *note GOMP_SPINCOUNT:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.8 + + +File: libgomp.info, Node: GOMP_CPU_AFFINITY, Next: GOMP_DEBUG, Prev: OMP_WAIT_POLICY, Up: Environment Variables + +4.21 'GOMP_CPU_AFFINITY' - Bind threads to specific CPUs +======================================================== + +_Description_: + Binds threads to specific CPUs. The variable should contain a + space-separated or comma-separated list of CPUs. This list may + contain different kinds of entries: either single CPU numbers in + any order, a range of CPUs (M-N) or a range with some stride + (M-N:S). CPU numbers are zero based. For example, + 'GOMP_CPU_AFFINITY="0 3 1-2 4-15:2"' binds the initial thread to + CPU 0, the second to CPU 3, the third to CPU 1, the fourth to CPU + 2, the fifth to CPU 4, the sixth through tenth to CPUs 6, 8, 10, + 12, and 14 respectively and then starts assigning back from the + beginning of the list. 'GOMP_CPU_AFFINITY=0' binds all threads to + CPU 0. + + There is no libgomp library routine to determine whether a CPU + affinity specification is in effect. As a workaround, + language-specific library functions, e.g., 'getenv' in C or + 'GET_ENVIRONMENT_VARIABLE' in Fortran, may be used to query the + setting of the 'GOMP_CPU_AFFINITY' environment variable. A defined + CPU affinity on startup cannot be changed or disabled during the + runtime of the application. + + If both 'GOMP_CPU_AFFINITY' and 'OMP_PROC_BIND' are set, + 'OMP_PROC_BIND' has a higher precedence. If neither has been set + and 'OMP_PROC_BIND' is unset, or when 'OMP_PROC_BIND' is set to + 'FALSE', the host system handles the assignment of threads to CPUs. + +_See also_: + *note OMP_PLACES::, *note OMP_PROC_BIND:: + + +File: libgomp.info, Node: GOMP_DEBUG, Next: GOMP_STACKSIZE, Prev: GOMP_CPU_AFFINITY, Up: Environment Variables + +4.22 'GOMP_DEBUG' - Enable debugging output +=========================================== + +_Description_: + Enable debugging output. The variable should be set to '0' + (disabled, also the default if not set), or '1' (enabled). + + If enabled, some debugging output is printed during execution. + This is currently not specified in more detail, and subject to + change. + + +File: libgomp.info, Node: GOMP_STACKSIZE, Next: GOMP_SPINCOUNT, Prev: GOMP_DEBUG, Up: Environment Variables + +4.23 'GOMP_STACKSIZE' - Set default thread stack size +===================================================== + +_Description_: + Set the default thread stack size in kilobytes. This is different + from 'pthread_attr_setstacksize' which gets the number of bytes as + an argument. If the stack size cannot be set due to system + constraints, an error is reported and the initial stack size is + left unchanged. If undefined, the stack size is system dependent. + +_See also_: + *note OMP_STACKSIZE:: + +_Reference_: + GCC Patches Mailinglist + (https://gcc.gnu.org/ml/gcc-patches/2006-06/msg00493.html), GCC + Patches Mailinglist + (https://gcc.gnu.org/ml/gcc-patches/2006-06/msg00496.html) + + +File: libgomp.info, Node: GOMP_SPINCOUNT, Next: GOMP_RTEMS_THREAD_POOLS, Prev: GOMP_STACKSIZE, Up: Environment Variables + +4.24 'GOMP_SPINCOUNT' - Set the busy-wait spin count +==================================================== + +_Description_: + Determines how long a threads waits actively with consuming CPU + power before waiting passively without consuming CPU power. The + value may be either 'INFINITE', 'INFINITY' to always wait actively + or an integer which gives the number of spins of the busy-wait + loop. The integer may optionally be followed by the following + suffixes acting as multiplication factors: 'k' (kilo, thousand), + 'M' (mega, million), 'G' (giga, billion), or 'T' (tera, trillion). + If undefined, 0 is used when 'OMP_WAIT_POLICY' is 'PASSIVE', + 300,000 is used when 'OMP_WAIT_POLICY' is undefined and 30 billion + is used when 'OMP_WAIT_POLICY' is 'ACTIVE'. If there are more + OpenMP threads than available CPUs, 1000 and 100 spins are used for + 'OMP_WAIT_POLICY' being 'ACTIVE' or undefined, respectively; unless + the 'GOMP_SPINCOUNT' is lower or 'OMP_WAIT_POLICY' is 'PASSIVE'. + +_See also_: + *note OMP_WAIT_POLICY:: + + +File: libgomp.info, Node: GOMP_RTEMS_THREAD_POOLS, Prev: GOMP_SPINCOUNT, Up: Environment Variables + +4.25 'GOMP_RTEMS_THREAD_POOLS' - Set the RTEMS specific thread pools +==================================================================== + +_Description_: + This environment variable is only used on the RTEMS real-time + operating system. It determines the scheduler instance specific + thread pools. The format for 'GOMP_RTEMS_THREAD_POOLS' is a list + of optional '[$]@' + configurations separated by ':' where: + * '' is the thread pool count for this + scheduler instance. + * '$' is an optional priority for the worker threads + of a thread pool according to 'pthread_setschedparam'. In + case a priority value is omitted, then a worker thread + inherits the priority of the OpenMP primary thread that + created it. The priority of the worker thread is not changed + after creation, even if a new OpenMP primary thread using the + worker has a different priority. + * '@' is the scheduler instance name according + to the RTEMS application configuration. + In case no thread pool configuration is specified for a scheduler + instance, then each OpenMP primary thread of this scheduler + instance uses its own dynamically allocated thread pool. To limit + the worker thread count of the thread pools, each OpenMP primary + thread must call 'omp_set_num_threads'. +_Example_: + Lets suppose we have three scheduler instances 'IO', 'WRK0', and + 'WRK1' with 'GOMP_RTEMS_THREAD_POOLS' set to '"1@WRK0:3$4@WRK1"'. + Then there are no thread pool restrictions for scheduler instance + 'IO'. In the scheduler instance 'WRK0' there is one thread pool + available. Since no priority is specified for this scheduler + instance, the worker thread inherits the priority of the OpenMP + primary thread that created it. In the scheduler instance 'WRK1' + there are three thread pools available and their worker threads run + at priority four. + + +File: libgomp.info, Node: Enabling OpenACC, Next: OpenACC Runtime Library Routines, Prev: Environment Variables, Up: Top + +5 Enabling OpenACC +****************** + +To activate the OpenACC extensions for C/C++ and Fortran, the +compile-time flag '-fopenacc' must be specified. This enables the +OpenACC directive '#pragma acc' in C/C++ and, in Fortran, the '!$acc' +sentinel in free source form and the 'c$acc', '*$acc' and '!$acc' +sentinels in fixed source form. The flag also arranges for automatic +linking of the OpenACC runtime library (*note OpenACC Runtime Library +Routines::). + + See for more information. + + A complete description of all OpenACC directives accepted may be +found in the OpenACC (https://www.openacc.org) Application Programming +Interface manual, version 2.6. + + +File: libgomp.info, Node: OpenACC Runtime Library Routines, Next: OpenACC Environment Variables, Prev: Enabling OpenACC, Up: Top + +6 OpenACC Runtime Library Routines +********************************** + +The runtime routines described here are defined by section 3 of the +OpenACC specifications in version 2.6. They have C linkage, and do not +throw exceptions. Generally, they are available only for the host, with +the exception of 'acc_on_device', which is available for both the host +and the acceleration device. + +* Menu: + +* acc_get_num_devices:: Get number of devices for the given device + type. +* acc_set_device_type:: Set type of device accelerator to use. +* acc_get_device_type:: Get type of device accelerator to be used. +* acc_set_device_num:: Set device number to use. +* acc_get_device_num:: Get device number to be used. +* acc_get_property:: Get device property. +* acc_async_test:: Tests for completion of a specific asynchronous + operation. +* acc_async_test_all:: Tests for completion of all asynchronous + operations. +* acc_wait:: Wait for completion of a specific asynchronous + operation. +* acc_wait_all:: Waits for completion of all asynchronous + operations. +* acc_wait_all_async:: Wait for completion of all asynchronous + operations. +* acc_wait_async:: Wait for completion of asynchronous operations. +* acc_init:: Initialize runtime for a specific device type. +* acc_shutdown:: Shuts down the runtime for a specific device + type. +* acc_on_device:: Whether executing on a particular device +* acc_malloc:: Allocate device memory. +* acc_free:: Free device memory. +* acc_copyin:: Allocate device memory and copy host memory to + it. +* acc_present_or_copyin:: If the data is not present on the device, + allocate device memory and copy from host + memory. +* acc_create:: Allocate device memory and map it to host + memory. +* acc_present_or_create:: If the data is not present on the device, + allocate device memory and map it to host + memory. +* acc_copyout:: Copy device memory to host memory. +* acc_delete:: Free device memory. +* acc_update_device:: Update device memory from mapped host memory. +* acc_update_self:: Update host memory from mapped device memory. +* acc_map_data:: Map previously allocated device memory to host + memory. +* acc_unmap_data:: Unmap device memory from host memory. +* acc_deviceptr:: Get device pointer associated with specific + host address. +* acc_hostptr:: Get host pointer associated with specific + device address. +* acc_is_present:: Indicate whether host variable / array is + present on device. +* acc_memcpy_to_device:: Copy host memory to device memory. +* acc_memcpy_from_device:: Copy device memory to host memory. +* acc_attach:: Let device pointer point to device-pointer target. +* acc_detach:: Let device pointer point to host-pointer target. + +API routines for target platforms. + +* acc_get_current_cuda_device:: Get CUDA device handle. +* acc_get_current_cuda_context::Get CUDA context handle. +* acc_get_cuda_stream:: Get CUDA stream handle. +* acc_set_cuda_stream:: Set CUDA stream handle. + +API routines for the OpenACC Profiling Interface. + +* acc_prof_register:: Register callbacks. +* acc_prof_unregister:: Unregister callbacks. +* acc_prof_lookup:: Obtain inquiry functions. +* acc_register_library:: Library registration. + + +File: libgomp.info, Node: acc_get_num_devices, Next: acc_set_device_type, Up: OpenACC Runtime Library Routines + +6.1 'acc_get_num_devices' - Get number of devices for given device type +======================================================================= + +_Description_ + This function returns a value indicating the number of devices + available for the device type specified in DEVICETYPE. + +_C/C++_: + _Prototype_: 'int acc_get_num_devices(acc_device_t devicetype);' + +_Fortran_: + _Interface_: 'integer function acc_get_num_devices(devicetype)' + 'integer(kind=acc_device_kind) devicetype' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.1. + + +File: libgomp.info, Node: acc_set_device_type, Next: acc_get_device_type, Prev: acc_get_num_devices, Up: OpenACC Runtime Library Routines + +6.2 'acc_set_device_type' - Set type of device accelerator to use. +================================================================== + +_Description_ + This function indicates to the runtime library which device type, + specified in DEVICETYPE, to use when executing a parallel or + kernels region. + +_C/C++_: + _Prototype_: 'acc_set_device_type(acc_device_t devicetype);' + +_Fortran_: + _Interface_: 'subroutine acc_set_device_type(devicetype)' + 'integer(kind=acc_device_kind) devicetype' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.2. + + +File: libgomp.info, Node: acc_get_device_type, Next: acc_set_device_num, Prev: acc_set_device_type, Up: OpenACC Runtime Library Routines + +6.3 'acc_get_device_type' - Get type of device accelerator to be used. +====================================================================== + +_Description_ + This function returns what device type will be used when executing + a parallel or kernels region. + + This function returns 'acc_device_none' if 'acc_get_device_type' is + called from 'acc_ev_device_init_start', 'acc_ev_device_init_end' + callbacks of the OpenACC Profiling Interface (*note OpenACC + Profiling Interface::), that is, if the device is currently being + initialized. + +_C/C++_: + _Prototype_: 'acc_device_t acc_get_device_type(void);' + +_Fortran_: + _Interface_: 'function acc_get_device_type(void)' + 'integer(kind=acc_device_kind) acc_get_device_type' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.3. + + +File: libgomp.info, Node: acc_set_device_num, Next: acc_get_device_num, Prev: acc_get_device_type, Up: OpenACC Runtime Library Routines + +6.4 'acc_set_device_num' - Set device number to use. +==================================================== + +_Description_ + This function will indicate to the runtime which device number, + specified by DEVICENUM, associated with the specified device type + DEVICETYPE. + +_C/C++_: + _Prototype_: 'acc_set_device_num(int devicenum, acc_device_t + devicetype);' + +_Fortran_: + _Interface_: 'subroutine acc_set_device_num(devicenum, devicetype)' + 'integer devicenum' + 'integer(kind=acc_device_kind) devicetype' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.4. + + +File: libgomp.info, Node: acc_get_device_num, Next: acc_get_property, Prev: acc_set_device_num, Up: OpenACC Runtime Library Routines + +6.5 'acc_get_device_num' - Get device number to be used. +======================================================== + +_Description_ + This function returns which device number associated with the + specified device type DEVICETYPE, will be used when executing a + parallel or kernels region. + +_C/C++_: + _Prototype_: 'int acc_get_device_num(acc_device_t devicetype);' + +_Fortran_: + _Interface_: 'function acc_get_device_num(devicetype)' + 'integer(kind=acc_device_kind) devicetype' + 'integer acc_get_device_num' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.5. + + +File: libgomp.info, Node: acc_get_property, Next: acc_async_test, Prev: acc_get_device_num, Up: OpenACC Runtime Library Routines + +6.6 'acc_get_property' - Get device property. +============================================= + +_Description_ + These routines return the value of the specified PROPERTY for the + device being queried according to DEVICENUM and DEVICETYPE. + Integer-valued and string-valued properties are returned by + 'acc_get_property' and 'acc_get_property_string' respectively. The + Fortran 'acc_get_property_string' subroutine returns the string + retrieved in its fourth argument while the remaining entry points + are functions, which pass the return value as their result. + + Note for Fortran, only: the OpenACC technical committee corrected + and, hence, modified the interface introduced in OpenACC 2.6. The + kind-value parameter 'acc_device_property' has been renamed to + 'acc_device_property_kind' for consistency and the return type of + the 'acc_get_property' function is now a 'c_size_t' integer instead + of a 'acc_device_property' integer. The parameter + 'acc_device_property' is still provided, but might be removed in a + future version of GCC. + +_C/C++_: + _Prototype_: 'size_t acc_get_property(int devicenum, acc_device_t + devicetype, acc_device_property_t property);' + _Prototype_: 'const char *acc_get_property_string(int devicenum, + acc_device_t devicetype, acc_device_property_t + property);' + +_Fortran_: + _Interface_: 'function acc_get_property(devicenum, devicetype, + property)' + _Interface_: 'subroutine acc_get_property_string(devicenum, + devicetype, property, string)' + 'use ISO_C_Binding, only: c_size_t' + 'integer devicenum' + 'integer(kind=acc_device_kind) devicetype' + 'integer(kind=acc_device_property_kind) property' + 'integer(kind=c_size_t) acc_get_property' + 'character(*) string' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.6. + + +File: libgomp.info, Node: acc_async_test, Next: acc_async_test_all, Prev: acc_get_property, Up: OpenACC Runtime Library Routines + +6.7 'acc_async_test' - Test for completion of a specific asynchronous operation. +================================================================================ + +_Description_ + This function tests for completion of the asynchronous operation + specified in ARG. In C/C++, a non-zero value is returned to + indicate the specified asynchronous operation has completed while + Fortran returns 'true'. If the asynchronous operation has not + completed, C/C++ returns zero and Fortran returns 'false'. + +_C/C++_: + _Prototype_: 'int acc_async_test(int arg);' + +_Fortran_: + _Interface_: 'function acc_async_test(arg)' + 'integer(kind=acc_handle_kind) arg' + 'logical acc_async_test' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.9. + + +File: libgomp.info, Node: acc_async_test_all, Next: acc_wait, Prev: acc_async_test, Up: OpenACC Runtime Library Routines + +6.8 'acc_async_test_all' - Tests for completion of all asynchronous operations. +=============================================================================== + +_Description_ + This function tests for completion of all asynchronous operations. + In C/C++, a non-zero value is returned to indicate all asynchronous + operations have completed while Fortran returns 'true'. If any + asynchronous operation has not completed, C/C++ returns zero and + Fortran returns 'false'. + +_C/C++_: + _Prototype_: 'int acc_async_test_all(void);' + +_Fortran_: + _Interface_: 'function acc_async_test()' + 'logical acc_get_device_num' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.10. + + +File: libgomp.info, Node: acc_wait, Next: acc_wait_all, Prev: acc_async_test_all, Up: OpenACC Runtime Library Routines + +6.9 'acc_wait' - Wait for completion of a specific asynchronous operation. +========================================================================== + +_Description_ + This function waits for completion of the asynchronous operation + specified in ARG. + +_C/C++_: + _Prototype_: 'acc_wait(arg);' + _Prototype 'acc_async_wait(arg);' + (OpenACC 1.0 + compatibility)_: + +_Fortran_: + _Interface_: 'subroutine acc_wait(arg)' + 'integer(acc_handle_kind) arg' + _Interface 'subroutine acc_async_wait(arg)' + (OpenACC 1.0 + compatibility)_: + 'integer(acc_handle_kind) arg' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.11. + + +File: libgomp.info, Node: acc_wait_all, Next: acc_wait_all_async, Prev: acc_wait, Up: OpenACC Runtime Library Routines + +6.10 'acc_wait_all' - Waits for completion of all asynchronous operations. +========================================================================== + +_Description_ + This function waits for the completion of all asynchronous + operations. + +_C/C++_: + _Prototype_: 'acc_wait_all(void);' + _Prototype 'acc_async_wait_all(void);' + (OpenACC 1.0 + compatibility)_: + +_Fortran_: + _Interface_: 'subroutine acc_wait_all()' + _Interface 'subroutine acc_async_wait_all()' + (OpenACC 1.0 + compatibility)_: + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.13. + + +File: libgomp.info, Node: acc_wait_all_async, Next: acc_wait_async, Prev: acc_wait_all, Up: OpenACC Runtime Library Routines + +6.11 'acc_wait_all_async' - Wait for completion of all asynchronous operations. +=============================================================================== + +_Description_ + This function enqueues a wait operation on the queue ASYNC for any + and all asynchronous operations that have been previously enqueued + on any queue. + +_C/C++_: + _Prototype_: 'acc_wait_all_async(int async);' + +_Fortran_: + _Interface_: 'subroutine acc_wait_all_async(async)' + 'integer(acc_handle_kind) async' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.14. + + +File: libgomp.info, Node: acc_wait_async, Next: acc_init, Prev: acc_wait_all_async, Up: OpenACC Runtime Library Routines + +6.12 'acc_wait_async' - Wait for completion of asynchronous operations. +======================================================================= + +_Description_ + This function enqueues a wait operation on queue ASYNC for any and + all asynchronous operations enqueued on queue ARG. + +_C/C++_: + _Prototype_: 'acc_wait_async(int arg, int async);' + +_Fortran_: + _Interface_: 'subroutine acc_wait_async(arg, async)' + 'integer(acc_handle_kind) arg, async' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.12. + + +File: libgomp.info, Node: acc_init, Next: acc_shutdown, Prev: acc_wait_async, Up: OpenACC Runtime Library Routines + +6.13 'acc_init' - Initialize runtime for a specific device type. +================================================================ + +_Description_ + This function initializes the runtime for the device type specified + in DEVICETYPE. + +_C/C++_: + _Prototype_: 'acc_init(acc_device_t devicetype);' + +_Fortran_: + _Interface_: 'subroutine acc_init(devicetype)' + 'integer(acc_device_kind) devicetype' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.7. + + +File: libgomp.info, Node: acc_shutdown, Next: acc_on_device, Prev: acc_init, Up: OpenACC Runtime Library Routines + +6.14 'acc_shutdown' - Shuts down the runtime for a specific device type. +======================================================================== + +_Description_ + This function shuts down the runtime for the device type specified + in DEVICETYPE. + +_C/C++_: + _Prototype_: 'acc_shutdown(acc_device_t devicetype);' + +_Fortran_: + _Interface_: 'subroutine acc_shutdown(devicetype)' + 'integer(acc_device_kind) devicetype' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.8. + + +File: libgomp.info, Node: acc_on_device, Next: acc_malloc, Prev: acc_shutdown, Up: OpenACC Runtime Library Routines + +6.15 'acc_on_device' - Whether executing on a particular device +=============================================================== + +_Description_: + This function returns whether the program is executing on a + particular device specified in DEVICETYPE. In C/C++ a non-zero + value is returned to indicate the device is executing on the + specified device type. In Fortran, 'true' is returned. If the + program is not executing on the specified device type C/C++ returns + zero, while Fortran returns 'false'. + + Note that in GCC, depending on DEVICETYPE, the function call might + be folded to a constant in the compiler; compile with + '-fno-builtin-acc_on_device' if a run-time function is desired. + +_C/C++_: + _Prototype_: 'acc_on_device(acc_device_t devicetype);' + +_Fortran_: + _Interface_: 'function acc_on_device(devicetype)' + 'integer(acc_device_kind) devicetype' + 'logical acc_on_device' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.17. + + +File: libgomp.info, Node: acc_malloc, Next: acc_free, Prev: acc_on_device, Up: OpenACC Runtime Library Routines + +6.16 'acc_malloc' - Allocate device memory. +=========================================== + +_Description_ + This function allocates BYTES bytes of device memory. It returns + the device address of the allocated memory. + +_C/C++_: + _Prototype_: 'd_void* acc_malloc(size_t bytes);' + +_Fortran_: + _Interface_: 'type(c_ptr) function acc_malloc(bytes)' + 'integer(c_size_t), value :: bytes' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.18. openacc specification v3.3 (https://www.openacc.org), + section 3.2.16. + + +File: libgomp.info, Node: acc_free, Next: acc_copyin, Prev: acc_malloc, Up: OpenACC Runtime Library Routines + +6.17 'acc_free' - Free device memory. +===================================== + +_Description_ + Free previously allocated device memory at the device address + 'data_dev'. + +_C/C++_: + _Prototype_: 'void acc_free(d_void *data_dev);' + +_Fortran_: + _Interface_: 'subroutine acc_free(data_dev)' + 'type(c_ptr), value :: data_dev' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.19. openacc specification v3.3 (https://www.openacc.org), + section 3.2.17. + + +File: libgomp.info, Node: acc_copyin, Next: acc_present_or_copyin, Prev: acc_free, Up: OpenACC Runtime Library Routines + +6.18 'acc_copyin' - Allocate device memory and copy host memory to it. +====================================================================== + +_Description_ + In C/C++, this function allocates LEN bytes of device memory and + maps it to the specified host address in A. The device address of + the newly allocated device memory is returned. + + In Fortran, two (2) forms are supported. In the first form, A + specifies a contiguous array section. The second form A specifies + a variable or array element and LEN specifies the length in bytes. + +_C/C++_: + _Prototype_: 'void *acc_copyin(h_void *a, size_t len);' + _Prototype_: 'void *acc_copyin_async(h_void *a, size_t len, int + async);' + +_Fortran_: + _Interface_: 'subroutine acc_copyin(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_copyin(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + _Interface_: 'subroutine acc_copyin_async(a, async)' + 'type, dimension(:[,:]...) :: a' + 'integer(acc_handle_kind) :: async' + _Interface_: 'subroutine acc_copyin_async(a, len, async)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + 'integer(acc_handle_kind) :: async' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.20. + + +File: libgomp.info, Node: acc_present_or_copyin, Next: acc_create, Prev: acc_copyin, Up: OpenACC Runtime Library Routines + +6.19 'acc_present_or_copyin' - If the data is not present on the device, allocate device memory and copy from host memory. +========================================================================================================================== + +_Description_ + This function tests if the host data specified by A and of length + LEN is present or not. If it is not present, device memory is + allocated and the host memory copied. The device address of the + newly allocated device memory is returned. + + In Fortran, two (2) forms are supported. In the first form, A + specifies a contiguous array section. The second form A specifies + a variable or array element and LEN specifies the length in bytes. + + Note that 'acc_present_or_copyin' and 'acc_pcopyin' exist for + backward compatibility with OpenACC 2.0; use *note acc_copyin:: + instead. + +_C/C++_: + _Prototype_: 'void *acc_present_or_copyin(h_void *a, size_t len);' + _Prototype_: 'void *acc_pcopyin(h_void *a, size_t len);' + +_Fortran_: + _Interface_: 'subroutine acc_present_or_copyin(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_present_or_copyin(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + _Interface_: 'subroutine acc_pcopyin(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_pcopyin(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.20. + + +File: libgomp.info, Node: acc_create, Next: acc_present_or_create, Prev: acc_present_or_copyin, Up: OpenACC Runtime Library Routines + +6.20 'acc_create' - Allocate device memory and map it to host memory. +===================================================================== + +_Description_ + This function allocates device memory and maps it to host memory + specified by the host address A with a length of LEN bytes. In + C/C++, the function returns the device address of the allocated + device memory. + + In Fortran, two (2) forms are supported. In the first form, A + specifies a contiguous array section. The second form A specifies + a variable or array element and LEN specifies the length in bytes. + +_C/C++_: + _Prototype_: 'void *acc_create(h_void *a, size_t len);' + _Prototype_: 'void *acc_create_async(h_void *a, size_t len, int + async);' + +_Fortran_: + _Interface_: 'subroutine acc_create(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_create(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + _Interface_: 'subroutine acc_create_async(a, async)' + 'type, dimension(:[,:]...) :: a' + 'integer(acc_handle_kind) :: async' + _Interface_: 'subroutine acc_create_async(a, len, async)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + 'integer(acc_handle_kind) :: async' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.21. + + +File: libgomp.info, Node: acc_present_or_create, Next: acc_copyout, Prev: acc_create, Up: OpenACC Runtime Library Routines + +6.21 'acc_present_or_create' - If the data is not present on the device, allocate device memory and map it to host memory. +========================================================================================================================== + +_Description_ + This function tests if the host data specified by A and of length + LEN is present or not. If it is not present, device memory is + allocated and mapped to host memory. In C/C++, the device address + of the newly allocated device memory is returned. + + In Fortran, two (2) forms are supported. In the first form, A + specifies a contiguous array section. The second form A specifies + a variable or array element and LEN specifies the length in bytes. + + Note that 'acc_present_or_create' and 'acc_pcreate' exist for + backward compatibility with OpenACC 2.0; use *note acc_create:: + instead. + +_C/C++_: + _Prototype_: 'void *acc_present_or_create(h_void *a, size_t len)' + _Prototype_: 'void *acc_pcreate(h_void *a, size_t len)' + +_Fortran_: + _Interface_: 'subroutine acc_present_or_create(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_present_or_create(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + _Interface_: 'subroutine acc_pcreate(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_pcreate(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.21. + + +File: libgomp.info, Node: acc_copyout, Next: acc_delete, Prev: acc_present_or_create, Up: OpenACC Runtime Library Routines + +6.22 'acc_copyout' - Copy device memory to host memory. +======================================================= + +_Description_ + This function copies mapped device memory to host memory which is + specified by host address A for a length LEN bytes in C/C++. + + In Fortran, two (2) forms are supported. In the first form, A + specifies a contiguous array section. The second form A specifies + a variable or array element and LEN specifies the length in bytes. + +_C/C++_: + _Prototype_: 'acc_copyout(h_void *a, size_t len);' + _Prototype_: 'acc_copyout_async(h_void *a, size_t len, int async);' + _Prototype_: 'acc_copyout_finalize(h_void *a, size_t len);' + _Prototype_: 'acc_copyout_finalize_async(h_void *a, size_t len, int + async);' + +_Fortran_: + _Interface_: 'subroutine acc_copyout(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_copyout(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + _Interface_: 'subroutine acc_copyout_async(a, async)' + 'type, dimension(:[,:]...) :: a' + 'integer(acc_handle_kind) :: async' + _Interface_: 'subroutine acc_copyout_async(a, len, async)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + 'integer(acc_handle_kind) :: async' + _Interface_: 'subroutine acc_copyout_finalize(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_copyout_finalize(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + _Interface_: 'subroutine acc_copyout_finalize_async(a, async)' + 'type, dimension(:[,:]...) :: a' + 'integer(acc_handle_kind) :: async' + _Interface_: 'subroutine acc_copyout_finalize_async(a, len, async)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + 'integer(acc_handle_kind) :: async' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.22. + + +File: libgomp.info, Node: acc_delete, Next: acc_update_device, Prev: acc_copyout, Up: OpenACC Runtime Library Routines + +6.23 'acc_delete' - Free device memory. +======================================= + +_Description_ + This function frees previously allocated device memory specified by + the device address A and the length of LEN bytes. + + In Fortran, two (2) forms are supported. In the first form, A + specifies a contiguous array section. The second form A specifies + a variable or array element and LEN specifies the length in bytes. + +_C/C++_: + _Prototype_: 'acc_delete(h_void *a, size_t len);' + _Prototype_: 'acc_delete_async(h_void *a, size_t len, int async);' + _Prototype_: 'acc_delete_finalize(h_void *a, size_t len);' + _Prototype_: 'acc_delete_finalize_async(h_void *a, size_t len, int + async);' + +_Fortran_: + _Interface_: 'subroutine acc_delete(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_delete(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + _Interface_: 'subroutine acc_delete_async(a, async)' + 'type, dimension(:[,:]...) :: a' + 'integer(acc_handle_kind) :: async' + _Interface_: 'subroutine acc_delete_async(a, len, async)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + 'integer(acc_handle_kind) :: async' + _Interface_: 'subroutine acc_delete_finalize(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_delete_finalize(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + _Interface_: 'subroutine acc_delete_async_finalize(a, async)' + 'type, dimension(:[,:]...) :: a' + 'integer(acc_handle_kind) :: async' + _Interface_: 'subroutine acc_delete_async_finalize(a, len, async)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + 'integer(acc_handle_kind) :: async' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.23. + + +File: libgomp.info, Node: acc_update_device, Next: acc_update_self, Prev: acc_delete, Up: OpenACC Runtime Library Routines + +6.24 'acc_update_device' - Update device memory from mapped host memory. +======================================================================== + +_Description_ + This function updates the device copy from the previously mapped + host memory. The host memory is specified with the host address A + and a length of LEN bytes. + + In Fortran, two (2) forms are supported. In the first form, A + specifies a contiguous array section. The second form A specifies + a variable or array element and LEN specifies the length in bytes. + +_C/C++_: + _Prototype_: 'acc_update_device(h_void *a, size_t len);' + _Prototype_: 'acc_update_device(h_void *a, size_t len, async);' + +_Fortran_: + _Interface_: 'subroutine acc_update_device(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_update_device(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + _Interface_: 'subroutine acc_update_device_async(a, async)' + 'type, dimension(:[,:]...) :: a' + 'integer(acc_handle_kind) :: async' + _Interface_: 'subroutine acc_update_device_async(a, len, async)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + 'integer(acc_handle_kind) :: async' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.24. + + +File: libgomp.info, Node: acc_update_self, Next: acc_map_data, Prev: acc_update_device, Up: OpenACC Runtime Library Routines + +6.25 'acc_update_self' - Update host memory from mapped device memory. +====================================================================== + +_Description_ + This function updates the host copy from the previously mapped + device memory. The host memory is specified with the host address + A and a length of LEN bytes. + + In Fortran, two (2) forms are supported. In the first form, A + specifies a contiguous array section. The second form A specifies + a variable or array element and LEN specifies the length in bytes. + +_C/C++_: + _Prototype_: 'acc_update_self(h_void *a, size_t len);' + _Prototype_: 'acc_update_self_async(h_void *a, size_t len, int + async);' + +_Fortran_: + _Interface_: 'subroutine acc_update_self(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_update_self(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + _Interface_: 'subroutine acc_update_self_async(a, async)' + 'type, dimension(:[,:]...) :: a' + 'integer(acc_handle_kind) :: async' + _Interface_: 'subroutine acc_update_self_async(a, len, async)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + 'integer(acc_handle_kind) :: async' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.25. + + +File: libgomp.info, Node: acc_map_data, Next: acc_unmap_data, Prev: acc_update_self, Up: OpenACC Runtime Library Routines + +6.26 'acc_map_data' - Map previously allocated device memory to host memory. +============================================================================ + +_Description_ + This function maps previously allocated device and host memory. + The device memory is specified with the device address DATA_DEV. + The host memory is specified with the host address DATA_ARG and a + length of BYTES. + +_C/C++_: + _Prototype_: 'void acc_map_data(h_void *data_arg, d_void *data_dev, + size_t bytes);' + +_Fortran_: + _Interface_: 'subroutine acc_map_data(data_arg, data_dev, bytes)' + 'type(*), dimension(*) :: data_arg' + 'type(c_ptr), value :: data_dev' + 'integer(c_size_t), value :: bytes' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.26. OpenACC specification v3.3 (https://www.openacc.org), + section 3.2.21. + + +File: libgomp.info, Node: acc_unmap_data, Next: acc_deviceptr, Prev: acc_map_data, Up: OpenACC Runtime Library Routines + +6.27 'acc_unmap_data' - Unmap device memory from host memory. +============================================================= + +_Description_ + This function unmaps previously mapped device and host memory. The + latter specified by DATA_ARG. + +_C/C++_: + _Prototype_: 'void acc_unmap_data(h_void *data_arg);' + +_Fortran_: + _Interface_: 'subroutine acc_unmap_data(data_arg)' + 'type(*), dimension(*) :: data_arg' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.27. OpenACC specification v3.3 (https://www.openacc.org), + section 3.2.22. + + +File: libgomp.info, Node: acc_deviceptr, Next: acc_hostptr, Prev: acc_unmap_data, Up: OpenACC Runtime Library Routines + +6.28 'acc_deviceptr' - Get device pointer associated with specific host address. +================================================================================ + +_Description_ + This function returns the device address that has been mapped to + the host address specified by DATA_ARG. + +_C/C++_: + _Prototype_: 'void *acc_deviceptr(h_void *data_arg);' + +_Fortran_: + _Interface_: 'type(c_ptr) function acc_deviceptr(data_arg)' + 'type(*), dimension(*) :: data_arg' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.28. OpenACC specification v3.3 (https://www.openacc.org), + section 3.2.23. + + +File: libgomp.info, Node: acc_hostptr, Next: acc_is_present, Prev: acc_deviceptr, Up: OpenACC Runtime Library Routines + +6.29 'acc_hostptr' - Get host pointer associated with specific device address. +============================================================================== + +_Description_ + This function returns the host address that has been mapped to the + device address specified by DATA_DEV. + +_C/C++_: + _Prototype_: 'void *acc_hostptr(d_void *data_dev);' + +_Fortran_: + _Interface_: 'type(c_ptr) function acc_hostptr(data_dev)' + 'type(c_ptr), value :: data_dev' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.29. OpenACC specification v3.3 (https://www.openacc.org), + section 3.2.24. + + +File: libgomp.info, Node: acc_is_present, Next: acc_memcpy_to_device, Prev: acc_hostptr, Up: OpenACC Runtime Library Routines + +6.30 'acc_is_present' - Indicate whether host variable / array is present on device. +==================================================================================== + +_Description_ + This function indicates whether the specified host address in A and + a length of LEN bytes is present on the device. In C/C++, a + non-zero value is returned to indicate the presence of the mapped + memory on the device. A zero is returned to indicate the memory is + not mapped on the device. + + In Fortran, two (2) forms are supported. In the first form, A + specifies a contiguous array section. The second form A specifies + a variable or array element and LEN specifies the length in bytes. + If the host memory is mapped to device memory, then a 'true' is + returned. Otherwise, a 'false' is return to indicate the mapped + memory is not present. + +_C/C++_: + _Prototype_: 'int acc_is_present(h_void *a, size_t len);' + +_Fortran_: + _Interface_: 'function acc_is_present(a)' + 'type, dimension(:[,:]...) :: a' + 'logical acc_is_present' + _Interface_: 'function acc_is_present(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + 'logical acc_is_present' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.30. + + +File: libgomp.info, Node: acc_memcpy_to_device, Next: acc_memcpy_from_device, Prev: acc_is_present, Up: OpenACC Runtime Library Routines + +6.31 'acc_memcpy_to_device' - Copy host memory to device memory. +================================================================ + +_Description_ + This function copies host memory specified by host address of + DATA_HOST_SRC to device memory specified by the device address + DATA_DEV_DEST for a length of BYTES bytes. + +_C/C++_: + _Prototype_: 'void acc_memcpy_to_device(d_void* data_dev_dest,' + 'h_void* data_host_src, size_t bytes);' + _Prototype_: 'void acc_memcpy_to_device_async(d_void* data_dev_dest,' + 'h_void* data_host_src, size_t bytes, int async_arg);' + +_Fortran_: + _Interface_: 'subroutine acc_memcpy_to_device(data_dev_dest, &' + 'data_host_src, bytes)' + _Interface_: 'subroutine acc_memcpy_to_device_async(data_dev_dest, &' + 'data_host_src, bytes, async_arg)' + 'type(c_ptr), value :: data_dev_dest' + 'type(*), dimension(*) :: data_host_src' + 'integer(c_size_t), value :: bytes' + 'integer(acc_handle_kind), value :: async_arg' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.31 OpenACC specification v3.3 (https://www.openacc.org), + section 3.2.26. + + +File: libgomp.info, Node: acc_memcpy_from_device, Next: acc_attach, Prev: acc_memcpy_to_device, Up: OpenACC Runtime Library Routines + +6.32 'acc_memcpy_from_device' - Copy device memory to host memory. +================================================================== + +_Description_ + This function copies device memory specified by device address of + DATA_DEV_SRC to host memory specified by the host address + DATA_HOST_DEST for a length of BYTES bytes. + +_C/C++_: + _Prototype_: 'void acc_memcpy_from_device(h_void* data_host_dest,' + 'd_void* data_dev_src, size_t bytes);' + _Prototype_: 'void acc_memcpy_from_device_async(h_void* + data_host_dest,' + 'd_void* data_dev_src, size_t bytes, int async_arg);' + +_Fortran_: + _Interface_: 'subroutine acc_memcpy_from_device(data_host_dest, &' + 'data_dev_src, bytes)' + _Interface_: 'subroutine acc_memcpy_from_device_async(data_host_dest, + &' + 'data_dev_src, bytes, async_arg)' + 'type(*), dimension(*) :: data_host_dest' + 'type(c_ptr), value :: data_dev_src' + 'integer(c_size_t), value :: bytes' + 'integer(acc_handle_kind), value :: async_arg' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.32. OpenACC specification v3.3 (https://www.openacc.org), + section 3.2.27. + + +File: libgomp.info, Node: acc_attach, Next: acc_detach, Prev: acc_memcpy_from_device, Up: OpenACC Runtime Library Routines + +6.33 'acc_attach' - Let device pointer point to device-pointer target. +====================================================================== + +_Description_ + This function updates a pointer on the device from pointing to a + host-pointer address to pointing to the corresponding device data. + +_C/C++_: + _Prototype_: 'void acc_attach(h_void **ptr_addr);' + _Prototype_: 'void acc_attach_async(h_void **ptr_addr, int async);' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.34. + + +File: libgomp.info, Node: acc_detach, Next: acc_get_current_cuda_device, Prev: acc_attach, Up: OpenACC Runtime Library Routines + +6.34 'acc_detach' - Let device pointer point to host-pointer target. +==================================================================== + +_Description_ + This function updates a pointer on the device from pointing to a + device-pointer address to pointing to the corresponding host data. + +_C/C++_: + _Prototype_: 'void acc_detach(h_void **ptr_addr);' + _Prototype_: 'void acc_detach_async(h_void **ptr_addr, int async);' + _Prototype_: 'void acc_detach_finalize(h_void **ptr_addr);' + _Prototype_: 'void acc_detach_finalize_async(h_void **ptr_addr, int + async);' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.35. + + +File: libgomp.info, Node: acc_get_current_cuda_device, Next: acc_get_current_cuda_context, Prev: acc_detach, Up: OpenACC Runtime Library Routines + +6.35 'acc_get_current_cuda_device' - Get CUDA device handle. +============================================================ + +_Description_ + This function returns the CUDA device handle. This handle is the + same as used by the CUDA Runtime or Driver API's. + +_C/C++_: + _Prototype_: 'void *acc_get_current_cuda_device(void);' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + A.2.1.1. + + +File: libgomp.info, Node: acc_get_current_cuda_context, Next: acc_get_cuda_stream, Prev: acc_get_current_cuda_device, Up: OpenACC Runtime Library Routines + +6.36 'acc_get_current_cuda_context' - Get CUDA context handle. +============================================================== + +_Description_ + This function returns the CUDA context handle. This handle is the + same as used by the CUDA Runtime or Driver API's. + +_C/C++_: + _Prototype_: 'void *acc_get_current_cuda_context(void);' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + A.2.1.2. + + +File: libgomp.info, Node: acc_get_cuda_stream, Next: acc_set_cuda_stream, Prev: acc_get_current_cuda_context, Up: OpenACC Runtime Library Routines + +6.37 'acc_get_cuda_stream' - Get CUDA stream handle. +==================================================== + +_Description_ + This function returns the CUDA stream handle for the queue ASYNC. + This handle is the same as used by the CUDA Runtime or Driver + API's. + +_C/C++_: + _Prototype_: 'void *acc_get_cuda_stream(int async);' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + A.2.1.3. + + +File: libgomp.info, Node: acc_set_cuda_stream, Next: acc_prof_register, Prev: acc_get_cuda_stream, Up: OpenACC Runtime Library Routines + +6.38 'acc_set_cuda_stream' - Set CUDA stream handle. +==================================================== + +_Description_ + This function associates the stream handle specified by STREAM with + the queue ASYNC. + + This cannot be used to change the stream handle associated with + 'acc_async_sync'. + + The return value is not specified. + +_C/C++_: + _Prototype_: 'int acc_set_cuda_stream(int async, void *stream);' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + A.2.1.4. + + +File: libgomp.info, Node: acc_prof_register, Next: acc_prof_unregister, Prev: acc_set_cuda_stream, Up: OpenACC Runtime Library Routines + +6.39 'acc_prof_register' - Register callbacks. +============================================== + +_Description_: + This function registers callbacks. + +_C/C++_: + _Prototype_: 'void acc_prof_register (acc_event_t, acc_prof_callback, + acc_register_t);' + +_See also_: + *note OpenACC Profiling Interface:: + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section 5.3. + + +File: libgomp.info, Node: acc_prof_unregister, Next: acc_prof_lookup, Prev: acc_prof_register, Up: OpenACC Runtime Library Routines + +6.40 'acc_prof_unregister' - Unregister callbacks. +================================================== + +_Description_: + This function unregisters callbacks. + +_C/C++_: + _Prototype_: 'void acc_prof_unregister (acc_event_t, + acc_prof_callback, acc_register_t);' + +_See also_: + *note OpenACC Profiling Interface:: + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section 5.3. + + +File: libgomp.info, Node: acc_prof_lookup, Next: acc_register_library, Prev: acc_prof_unregister, Up: OpenACC Runtime Library Routines + +6.41 'acc_prof_lookup' - Obtain inquiry functions. +================================================== + +_Description_: + Function to obtain inquiry functions. + +_C/C++_: + _Prototype_: 'acc_query_fn acc_prof_lookup (const char *);' + +_See also_: + *note OpenACC Profiling Interface:: + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section 5.3. + + +File: libgomp.info, Node: acc_register_library, Prev: acc_prof_lookup, Up: OpenACC Runtime Library Routines + +6.42 'acc_register_library' - Library registration. +=================================================== + +_Description_: + Function for library registration. + +_C/C++_: + _Prototype_: 'void acc_register_library (acc_prof_reg, acc_prof_reg, + acc_prof_lookup_func);' + +_See also_: + *note OpenACC Profiling Interface::, *note ACC_PROFLIB:: + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section 5.3. + + +File: libgomp.info, Node: OpenACC Environment Variables, Next: CUDA Streams Usage, Prev: OpenACC Runtime Library Routines, Up: Top + +7 OpenACC Environment Variables +******************************* + +The variables 'ACC_DEVICE_TYPE' and 'ACC_DEVICE_NUM' are defined by +section 4 of the OpenACC specification in version 2.0. The variable +'ACC_PROFLIB' is defined by section 4 of the OpenACC specification in +version 2.6. + +* Menu: + +* ACC_DEVICE_TYPE:: +* ACC_DEVICE_NUM:: +* ACC_PROFLIB:: + + +File: libgomp.info, Node: ACC_DEVICE_TYPE, Next: ACC_DEVICE_NUM, Up: OpenACC Environment Variables + +7.1 'ACC_DEVICE_TYPE' +===================== + +_Description_: + Control the default device type to use when executing compute + regions. If unset, the code can be run on any device type, + favoring a non-host device type. + + Supported values in GCC (if compiled in) are + * 'host' + * 'nvidia' + * 'radeon' +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section 4.1. + + +File: libgomp.info, Node: ACC_DEVICE_NUM, Next: ACC_PROFLIB, Prev: ACC_DEVICE_TYPE, Up: OpenACC Environment Variables + +7.2 'ACC_DEVICE_NUM' +==================== + +_Description_: + Control which device, identified by device number, is the default + device. The value must be a nonnegative integer less than the + number of devices. If unset, device number zero is used. +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section 4.2. + + +File: libgomp.info, Node: ACC_PROFLIB, Prev: ACC_DEVICE_NUM, Up: OpenACC Environment Variables + +7.3 'ACC_PROFLIB' +================= + +_Description_: + Semicolon-separated list of dynamic libraries that are loaded as + profiling libraries. Each library must provide at least the + 'acc_register_library' routine. Each library file is found as + described by the documentation of 'dlopen' of your operating + system. +_See also_: + *note acc_register_library::, *note OpenACC Profiling Interface:: + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section 4.3. + + +File: libgomp.info, Node: CUDA Streams Usage, Next: OpenACC Library Interoperability, Prev: OpenACC Environment Variables, Up: Top + +8 CUDA Streams Usage +******************** + +This applies to the 'nvptx' plugin only. + + The library provides elements that perform asynchronous movement of +data and asynchronous operation of computing constructs. This +asynchronous functionality is implemented by making use of CUDA +streams(1). + + The primary means by that the asynchronous functionality is accessed +is through the use of those OpenACC directives which make use of the +'async' and 'wait' clauses. When the 'async' clause is first used with +a directive, it creates a CUDA stream. If an 'async-argument' is used +with the 'async' clause, then the stream is associated with the +specified 'async-argument'. + + Following the creation of an association between a CUDA stream and +the 'async-argument' of an 'async' clause, both the 'wait' clause and +the 'wait' directive can be used. When either the clause or directive +is used after stream creation, it creates a rendezvous point whereby +execution waits until all operations associated with the +'async-argument', that is, stream, have completed. + + Normally, the management of the streams that are created as a result +of using the 'async' clause, is done without any intervention by the +caller. This implies the association between the 'async-argument' and +the CUDA stream is maintained for the lifetime of the program. However, +this association can be changed through the use of the library function +'acc_set_cuda_stream'. When the function 'acc_set_cuda_stream' is +called, the CUDA stream that was originally associated with the 'async' +clause is destroyed. Caution should be taken when changing the +association as subsequent references to the 'async-argument' refer to a +different CUDA stream. + + ---------- Footnotes ---------- + + (1) See "Stream Management" in "CUDA Driver API", TRM-06703-001, +Version 5.5, for additional information + + +File: libgomp.info, Node: OpenACC Library Interoperability, Next: OpenACC Profiling Interface, Prev: CUDA Streams Usage, Up: Top + +9 OpenACC Library Interoperability +********************************** + +9.1 Introduction +================ + +The OpenACC library uses the CUDA Driver API, and may interact with +programs that use the Runtime library directly, or another library based +on the Runtime library, e.g., CUBLAS(1). This chapter describes the use +cases and what changes are required in order to use both the OpenACC +library and the CUBLAS and Runtime libraries within a program. + +9.2 First invocation: NVIDIA CUBLAS library API +=============================================== + +In this first use case (see below), a function in the CUBLAS library is +called prior to any of the functions in the OpenACC library. More +specifically, the function 'cublasCreate()'. + + When invoked, the function initializes the library and allocates the +hardware resources on the host and the device on behalf of the caller. +Once the initialization and allocation has completed, a handle is +returned to the caller. The OpenACC library also requires +initialization and allocation of hardware resources. Since the CUBLAS +library has already allocated the hardware resources for the device, all +that is left to do is to initialize the OpenACC library and acquire the +hardware resources on the host. + + Prior to calling the OpenACC function that initializes the library +and allocate the host hardware resources, you need to acquire the device +number that was allocated during the call to 'cublasCreate()'. The +invoking of the runtime library function 'cudaGetDevice()' accomplishes +this. Once acquired, the device number is passed along with the device +type as parameters to the OpenACC library function +'acc_set_device_num()'. + + Once the call to 'acc_set_device_num()' has completed, the OpenACC +library uses the context that was created during the call to +'cublasCreate()'. In other words, both libraries share the same +context. + + /* Create the handle */ + s = cublasCreate(&h); + if (s != CUBLAS_STATUS_SUCCESS) + { + fprintf(stderr, "cublasCreate failed %d\n", s); + exit(EXIT_FAILURE); + } + + /* Get the device number */ + e = cudaGetDevice(&dev); + if (e != cudaSuccess) + { + fprintf(stderr, "cudaGetDevice failed %d\n", e); + exit(EXIT_FAILURE); + } + + /* Initialize OpenACC library and use device 'dev' */ + acc_set_device_num(dev, acc_device_nvidia); + + Use Case 1 + +9.3 First invocation: OpenACC library API +========================================= + +In this second use case (see below), a function in the OpenACC library +is called prior to any of the functions in the CUBLAS library. More +specifically, the function 'acc_set_device_num()'. + + In the use case presented here, the function 'acc_set_device_num()' +is used to both initialize the OpenACC library and allocate the hardware +resources on the host and the device. In the call to the function, the +call parameters specify which device to use and what device type to use, +i.e., 'acc_device_nvidia'. It should be noted that this is but one +method to initialize the OpenACC library and allocate the appropriate +hardware resources. Other methods are available through the use of +environment variables and these is discussed in the next section. + + Once the call to 'acc_set_device_num()' has completed, other OpenACC +functions can be called as seen with multiple calls being made to +'acc_copyin()'. In addition, calls can be made to functions in the +CUBLAS library. In the use case a call to 'cublasCreate()' is made +subsequent to the calls to 'acc_copyin()'. As seen in the previous use +case, a call to 'cublasCreate()' initializes the CUBLAS library and +allocates the hardware resources on the host and the device. However, +since the device has already been allocated, 'cublasCreate()' only +initializes the CUBLAS library and allocates the appropriate hardware +resources on the host. The context that was created as part of the +OpenACC initialization is shared with the CUBLAS library, similarly to +the first use case. + + dev = 0; + + acc_set_device_num(dev, acc_device_nvidia); + + /* Copy the first set to the device */ + d_X = acc_copyin(&h_X[0], N * sizeof (float)); + if (d_X == NULL) + { + fprintf(stderr, "copyin error h_X\n"); + exit(EXIT_FAILURE); + } + + /* Copy the second set to the device */ + d_Y = acc_copyin(&h_Y1[0], N * sizeof (float)); + if (d_Y == NULL) + { + fprintf(stderr, "copyin error h_Y1\n"); + exit(EXIT_FAILURE); + } + + /* Create the handle */ + s = cublasCreate(&h); + if (s != CUBLAS_STATUS_SUCCESS) + { + fprintf(stderr, "cublasCreate failed %d\n", s); + exit(EXIT_FAILURE); + } + + /* Perform saxpy using CUBLAS library function */ + s = cublasSaxpy(h, N, &alpha, d_X, 1, d_Y, 1); + if (s != CUBLAS_STATUS_SUCCESS) + { + fprintf(stderr, "cublasSaxpy failed %d\n", s); + exit(EXIT_FAILURE); + } + + /* Copy the results from the device */ + acc_memcpy_from_device(&h_Y1[0], d_Y, N * sizeof (float)); + + Use Case 2 + +9.4 OpenACC library and environment variables +============================================= + +There are two environment variables associated with the OpenACC library +that may be used to control the device type and device number: +'ACC_DEVICE_TYPE' and 'ACC_DEVICE_NUM', respectively. These two +environment variables can be used as an alternative to calling +'acc_set_device_num()'. As seen in the second use case, the device type +and device number were specified using 'acc_set_device_num()'. If +however, the aforementioned environment variables were set, then the +call to 'acc_set_device_num()' would not be required. + + The use of the environment variables is only relevant when an OpenACC +function is called prior to a call to 'cudaCreate()'. If 'cudaCreate()' +is called prior to a call to an OpenACC function, then you must call +'acc_set_device_num()'(2) + + ---------- Footnotes ---------- + + (1) See section 2.26, "Interactions with the CUDA Driver API" in +"CUDA Runtime API", Version 5.5, and section 2.27, "VDPAU +Interoperability", in "CUDA Driver API", TRM-06703-001, Version 5.5, for +additional information on library interoperability. + + (2) More complete information about 'ACC_DEVICE_TYPE' and +'ACC_DEVICE_NUM' can be found in sections 4.1 and 4.2 of the OpenACC +(https://www.openacc.org) Application Programming Interface”, Version +2.6. + + +File: libgomp.info, Node: OpenACC Profiling Interface, Next: OpenMP-Implementation Specifics, Prev: OpenACC Library Interoperability, Up: Top + +10 OpenACC Profiling Interface +****************************** + +10.1 Implementation Status and Implementation-Defined Behavior +============================================================== + +We're implementing the OpenACC Profiling Interface as defined by the +OpenACC 2.6 specification. We're clarifying some aspects here as +_implementation-defined behavior_, while they're still under discussion +within the OpenACC Technical Committee. + + This implementation is tuned to keep the performance impact as low as +possible for the (very common) case that the Profiling Interface is not +enabled. This is relevant, as the Profiling Interface affects all the +_hot_ code paths (in the target code, not in the offloaded code). Users +of the OpenACC Profiling Interface can be expected to understand that +performance is impacted to some degree once the Profiling Interface is +enabled: for example, because of the _runtime_ (libgomp) calling into a +third-party _library_ for every event that has been registered. + + We're not yet accounting for the fact that 'OpenACC events may occur +during event processing'. We just handle one case specially, as +required by CUDA 9.0 'nvprof', that 'acc_get_device_type' (*note +acc_get_device_type::)) may be called from 'acc_ev_device_init_start', +'acc_ev_device_init_end' callbacks. + + We're not yet implementing initialization via a +'acc_register_library' function that is either statically linked in, or +dynamically via 'LD_PRELOAD'. Initialization via 'acc_register_library' +functions dynamically loaded via the 'ACC_PROFLIB' environment variable +does work, as does directly calling 'acc_prof_register', +'acc_prof_unregister', 'acc_prof_lookup'. + + As currently there are no inquiry functions defined, calls to +'acc_prof_lookup' always returns 'NULL'. + + There aren't separate _start_, _stop_ events defined for the event +types 'acc_ev_create', 'acc_ev_delete', 'acc_ev_alloc', 'acc_ev_free'. +It's not clear if these should be triggered before or after the actual +device-specific call is made. We trigger them after. + + Remarks about data provided to callbacks: + +'acc_prof_info.event_type' + It's not clear if for _nested_ event callbacks (for example, + 'acc_ev_enqueue_launch_start' as part of a parent compute + construct), this should be set for the nested event + ('acc_ev_enqueue_launch_start'), or if the value of the parent + construct should remain ('acc_ev_compute_construct_start'). In + this implementation, the value generally corresponds to the + innermost nested event type. + +'acc_prof_info.device_type' + + * For 'acc_ev_compute_construct_start', and in presence of an + 'if' clause with _false_ argument, this still refers to the + offloading device type. It's not clear if that's the expected + behavior. + + * Complementary to the item before, for + 'acc_ev_compute_construct_end', this is set to + 'acc_device_host' in presence of an 'if' clause with _false_ + argument. It's not clear if that's the expected behavior. + +'acc_prof_info.thread_id' + Always '-1'; not yet implemented. + +'acc_prof_info.async' + + * Not yet implemented correctly for + 'acc_ev_compute_construct_start'. + + * In a compute construct, for host-fallback + execution/'acc_device_host' it always is 'acc_async_sync'. It + is unclear if that is the expected behavior. + + * For 'acc_ev_device_init_start' and 'acc_ev_device_init_end', + it will always be 'acc_async_sync'. It is unclear if that is + the expected behavior. + +'acc_prof_info.async_queue' + There is no 'limited number of asynchronous queues' in libgomp. + This always has the same value as 'acc_prof_info.async'. + +'acc_prof_info.src_file' + Always 'NULL'; not yet implemented. + +'acc_prof_info.func_name' + Always 'NULL'; not yet implemented. + +'acc_prof_info.line_no' + Always '-1'; not yet implemented. + +'acc_prof_info.end_line_no' + Always '-1'; not yet implemented. + +'acc_prof_info.func_line_no' + Always '-1'; not yet implemented. + +'acc_prof_info.func_end_line_no' + Always '-1'; not yet implemented. + +'acc_event_info.event_type', 'acc_event_info.*.event_type' + Relating to 'acc_prof_info.event_type' discussed above, in this + implementation, this will always be the same value as + 'acc_prof_info.event_type'. + +'acc_event_info.*.parent_construct' + + * Will be 'acc_construct_parallel' for all OpenACC compute + constructs as well as many OpenACC Runtime API calls; should + be the one matching the actual construct, or + 'acc_construct_runtime_api', respectively. + + * Will be 'acc_construct_enter_data' or + 'acc_construct_exit_data' when processing variable mappings + specified in OpenACC _declare_ directives; should be + 'acc_construct_declare'. + + * For implicit 'acc_ev_device_init_start', + 'acc_ev_device_init_end', and explicit as well as implicit + 'acc_ev_alloc', 'acc_ev_free', 'acc_ev_enqueue_upload_start', + 'acc_ev_enqueue_upload_end', 'acc_ev_enqueue_download_start', + and 'acc_ev_enqueue_download_end', will be + 'acc_construct_parallel'; should reflect the real parent + construct. + +'acc_event_info.*.implicit' + For 'acc_ev_alloc', 'acc_ev_free', 'acc_ev_enqueue_upload_start', + 'acc_ev_enqueue_upload_end', 'acc_ev_enqueue_download_start', and + 'acc_ev_enqueue_download_end', this currently will be '1' also for + explicit usage. + +'acc_event_info.data_event.var_name' + Always 'NULL'; not yet implemented. + +'acc_event_info.data_event.host_ptr' + For 'acc_ev_alloc', and 'acc_ev_free', this is always 'NULL'. + +'typedef union acc_api_info' + ... as printed in '5.2.3. Third Argument: API-Specific + Information'. This should obviously be 'typedef _struct_ + acc_api_info'. + +'acc_api_info.device_api' + Possibly not yet implemented correctly for + 'acc_ev_compute_construct_start', 'acc_ev_device_init_start', + 'acc_ev_device_init_end': will always be 'acc_device_api_none' for + these event types. For 'acc_ev_enter_data_start', it will be + 'acc_device_api_none' in some cases. + +'acc_api_info.device_type' + Always the same as 'acc_prof_info.device_type'. + +'acc_api_info.vendor' + Always '-1'; not yet implemented. + +'acc_api_info.device_handle' + Always 'NULL'; not yet implemented. + +'acc_api_info.context_handle' + Always 'NULL'; not yet implemented. + +'acc_api_info.async_handle' + Always 'NULL'; not yet implemented. + + Remarks about certain event types: + +'acc_ev_device_init_start', 'acc_ev_device_init_end' + + * When a compute construct triggers implicit + 'acc_ev_device_init_start' and 'acc_ev_device_init_end' + events, they currently aren't _nested within_ the + corresponding 'acc_ev_compute_construct_start' and + 'acc_ev_compute_construct_end', but they're currently observed + _before_ 'acc_ev_compute_construct_start'. It's not clear + what to do: the standard asks us provide a lot of details to + the 'acc_ev_compute_construct_start' callback, without + (implicitly) initializing a device before? + + * Callbacks for these event types will not be invoked for calls + to the 'acc_set_device_type' and 'acc_set_device_num' + functions. It's not clear if they should be. + +'acc_ev_enter_data_start', 'acc_ev_enter_data_end', 'acc_ev_exit_data_start', 'acc_ev_exit_data_end' + + * Callbacks for these event types will also be invoked for + OpenACC _host_data_ constructs. It's not clear if they should + be. + + * Callbacks for these event types will also be invoked when + processing variable mappings specified in OpenACC _declare_ + directives. It's not clear if they should be. + + Callbacks for the following event types will be invoked, but dispatch +and information provided therein has not yet been thoroughly reviewed: + + * 'acc_ev_alloc' + * 'acc_ev_free' + * 'acc_ev_update_start', 'acc_ev_update_end' + * 'acc_ev_enqueue_upload_start', 'acc_ev_enqueue_upload_end' + * 'acc_ev_enqueue_download_start', 'acc_ev_enqueue_download_end' + + During device initialization, and finalization, respectively, +callbacks for the following event types will not yet be invoked: + + * 'acc_ev_alloc' + * 'acc_ev_free' + + Callbacks for the following event types have not yet been +implemented, so currently won't be invoked: + + * 'acc_ev_device_shutdown_start', 'acc_ev_device_shutdown_end' + * 'acc_ev_runtime_shutdown' + * 'acc_ev_create', 'acc_ev_delete' + * 'acc_ev_wait_start', 'acc_ev_wait_end' + + For the following runtime library functions, not all expected +callbacks will be invoked (mostly concerning implicit device +initialization): + + * 'acc_get_num_devices' + * 'acc_set_device_type' + * 'acc_get_device_type' + * 'acc_set_device_num' + * 'acc_get_device_num' + * 'acc_init' + * 'acc_shutdown' + + Aside from implicit device initialization, for the following runtime +library functions, no callbacks will be invoked for shared-memory +offloading devices (it's not clear if they should be): + + * 'acc_malloc' + * 'acc_free' + * 'acc_copyin', 'acc_present_or_copyin', 'acc_copyin_async' + * 'acc_create', 'acc_present_or_create', 'acc_create_async' + * 'acc_copyout', 'acc_copyout_async', 'acc_copyout_finalize', + 'acc_copyout_finalize_async' + * 'acc_delete', 'acc_delete_async', 'acc_delete_finalize', + 'acc_delete_finalize_async' + * 'acc_update_device', 'acc_update_device_async' + * 'acc_update_self', 'acc_update_self_async' + * 'acc_map_data', 'acc_unmap_data' + * 'acc_memcpy_to_device', 'acc_memcpy_to_device_async' + * 'acc_memcpy_from_device', 'acc_memcpy_from_device_async' + + +File: libgomp.info, Node: OpenMP-Implementation Specifics, Next: Offload-Target Specifics, Prev: OpenACC Profiling Interface, Up: Top + +11 OpenMP-Implementation Specifics +********************************** + +* Menu: + +* Implementation-defined ICV Initialization:: +* OpenMP Context Selectors:: +* Memory allocation:: + + +File: libgomp.info, Node: Implementation-defined ICV Initialization, Next: OpenMP Context Selectors, Up: OpenMP-Implementation Specifics + +11.1 Implementation-defined ICV Initialization +============================================== + +AFFINITY-FORMAT-VAR See *note OMP_AFFINITY_FORMAT::. +DEF-ALLOCATOR-VAR See *note OMP_ALLOCATOR::. +MAX-ACTIVE-LEVELS-VAR See *note OMP_MAX_ACTIVE_LEVELS::. +DYN-VAR See *note OMP_DYNAMIC::. +NTHREADS-VAR See *note OMP_NUM_THREADS::. +NUM-DEVICES-VAR Number of non-host devices found by GCC's + run-time library +NUM-PROCS-VAR The number of CPU cores on the initial device, + except that affinity settings might lead to a + smaller number. On non-host devices, the value + of the NTHREADS-VAR ICV. +PLACE-PARTITION-VAR See *note OMP_PLACES::. +RUN-SCHED-VAR See *note OMP_SCHEDULE::. +STACKSIZE-VAR See *note OMP_STACKSIZE::. +THREAD-LIMIT-VAR See *note OMP_TEAMS_THREAD_LIMIT:: +WAIT-POLICY-VAR See *note OMP_WAIT_POLICY:: and + *note GOMP_SPINCOUNT:: + + +File: libgomp.info, Node: OpenMP Context Selectors, Next: Memory allocation, Prev: Implementation-defined ICV Initialization, Up: OpenMP-Implementation Specifics + +11.2 OpenMP Context Selectors +============================= + +'vendor' is always 'gnu'. References are to the GCC manual. + + For the host compiler, 'kind' always matches 'host', 'cpu' and 'any'; +for the offloading architectures AMD GCN and Nvidia PTX, 'kind' always +matches 'nohost', 'gpu' and 'any'. For the x86 family of computers, AMD +GCN and Nvidia PTX the following traits are supported in addition; while +OpenMP is supported on more architectures, GCC currently does not match +any 'arch' or 'isa' traits for those. + +'arch' 'isa' +----------------------------------------------------------------------- +'x86', 'x86_64', 'i386', 'i486', 'i586', See '-m...' flags in +'i686', 'ia32' "x86 Options" + (without '-m') +'amdgcn', 'gcn' See '-march=' in + "AMD GCN Options" +'nvptx', 'nvptx64' See '-march=' in + "Nvidia PTX Options" + + +File: libgomp.info, Node: Memory allocation, Prev: OpenMP Context Selectors, Up: OpenMP-Implementation Specifics + +11.3 Memory allocation +====================== + +The description below applies to: + + * Explicit use of the OpenMP API routines, see *note Memory + Management Routines::. + * The 'allocate' clause, except when the 'allocator' modifier is a + constant expression with value 'omp_default_mem_alloc' and no + 'align' modifier has been specified. (In that case, the normal + 'malloc' allocation is used.) + * The 'allocate' directive for variables in static memory; while the + alignment is honored, the normal static memory is used. + * Using the 'allocate' directive for automatic/stack variables, + except when the 'allocator' clause is a constant expression with + value 'omp_default_mem_alloc' and no 'align' clause has been + specified. (In that case, the normal allocation is used: stack + allocation and, sometimes for Fortran, also 'malloc' [depending on + flags such as '-fstack-arrays'].) + * In Fortran, the 'allocators' directive and the executable + 'allocate' directive for Fortran pointers and allocatables is + supported, but requires that files containing those directives has + to be compiled with '-fopenmp-allocators'. Additionally, all files + that might explicitly or implicitly deallocate memory allocated + that way must also be compiled with that option. + * The used alignment is the maximum of the value the 'align' clause + and the alignment of the type after honoring, if present, the + 'aligned' ('GNU::aligned') attribute and C's '_Alignas' and C++'s + 'alignas'. However, the 'align' clause of the 'allocate' directive + has no effect on the value of C's '_Alignof' and C++'s 'alignof'. + + GCC supports the following predefined allocators and predefined +memory spaces: + +Predefined allocators Associated predefined memory + spaces +------------------------------------------------------------------ +omp_default_mem_alloc omp_default_mem_space +omp_large_cap_mem_alloc omp_large_cap_mem_space +omp_const_mem_alloc omp_const_mem_space +omp_high_bw_mem_alloc omp_high_bw_mem_space +omp_low_lat_mem_alloc omp_low_lat_mem_space +omp_cgroup_mem_alloc omp_low_lat_mem_space + (implementation defined) +omp_pteam_mem_alloc omp_low_lat_mem_space + (implementation defined) +omp_thread_mem_alloc omp_low_lat_mem_space + (implementation defined) +ompx_gnu_pinned_mem_alloc omp_default_mem_space (GNU + extension) + + Each predefined allocator, including 'omp_null_allocator', has a +corresponding allocator class template that meet the C++ allocator +completeness requirements. These are located in the 'omp::allocator' +namespace, and the 'ompx::allocator' namespace for gnu extensions. This +allows the allocator-aware C++ standard library containers to use OpenMP +allocation routines; for instance: + + std::vector> vec; + + The following allocator templates are supported: + +Predefined allocators Associated allocator template +------------------------------------------------------------------ +omp_null_allocator omp::allocator::null_allocator +omp_default_mem_alloc omp::allocator::default_mem +omp_large_cap_mem_alloc omp::allocator::large_cap_mem +omp_const_mem_alloc omp::allocator::const_mem +omp_high_bw_mem_alloc omp::allocator::high_bw_mem +omp_low_lat_mem_alloc omp::allocator::low_lat_mem +omp_cgroup_mem_alloc omp::allocator::cgroup_mem +omp_pteam_mem_alloc omp::allocator::pteam_mem +omp_thread_mem_alloc omp::allocator::thread_mem +ompx_gnu_pinned_mem_alloc ompx::allocator::gnu_pinned_mem + + The following traits are available when constructing a new allocator; +if a trait is not specified or with the value 'default', the specified +default value is used for that trait. The predefined allocators use the +default values of each trait, except that the 'omp_cgroup_mem_alloc', +'omp_pteam_mem_alloc', and 'omp_thread_mem_alloc' allocators have the +'access' trait set to 'cgroup', 'pteam', and 'thread', respectively. +For each trait, a named constant prefixed by 'omp_atk_' exists; for each +non-numeric value, a named constant prefixed by 'omp_atv_' exists. + +Trait Allowed values Default value +-------------------------------------------------------------------- +'sync_hint' 'contended', 'uncontended', 'contended' + 'serialized', 'private' +'alignment' Positive integer being a 1 byte + power of two +'access' 'all', 'cgroup', 'pteam', 'all' + 'thread' +'pool_size' Positive integer (bytes) See below. +'fallback' 'default_mem_fb', See below + 'null_fb', 'abort_fb', + 'allocator_fb' +'fb_data' _allocator handle_ (none) +'pinned' 'true', 'false' See below +'partition' 'environment', 'nearest', 'environment' + 'blocked', 'interleaved' + + For the 'fallback' trait, the default value is 'null_fb' for the +'omp_default_mem_alloc' allocator and any allocator that is associated +with device memory; for all other allocators, it is 'default_mem_fb' by +default. + + For the 'pinned' trait, the default value is 'true' for predefined +allocator 'ompx_gnu_pinned_mem_alloc' (a GNU extension), and 'false' for +all others. + + The following description applies to the initial device (the host) +and largely also to non-host devices; for the latter, also see *note +Offload-Target Specifics::. + + For the memory spaces, the following applies: + * 'omp_default_mem_space' is supported + * 'omp_const_mem_space' maps to 'omp_default_mem_space' + * 'omp_low_lat_mem_space' is only available on supported devices, and + maps to 'omp_default_mem_space' otherwise. + * 'omp_large_cap_mem_space' maps to 'omp_default_mem_space', unless + the memkind library is available + * 'omp_high_bw_mem_space' maps to 'omp_default_mem_space', unless the + memkind library is available + + On Linux systems, where the memkind library +(https://github.com/memkind/memkind) ('libmemkind.so.0') is available at +runtime and the respective memkind kind is supported, it is used when +creating memory allocators requesting + + * the 'partition' trait 'interleaved' except when the memory space is + 'omp_large_cap_mem_space' (uses 'MEMKIND_HBW_INTERLEAVE') + * the memory space is 'omp_high_bw_mem_space' (uses + 'MEMKIND_HBW_PREFERRED') + * the memory space is 'omp_large_cap_mem_space' (uses + 'MEMKIND_DAX_KMEM_ALL' or, if not available, 'MEMKIND_DAX_KMEM') + + On Linux systems, where the numa library +(https://github.com/numactl/numactl) ('libnuma.so.1') is available at +runtime, it used when creating memory allocators requesting + + * the 'partition' trait 'nearest', except when both the libmemkind + library is available and the memory space is either + 'omp_large_cap_mem_space' or 'omp_high_bw_mem_space' + + Note that the numa library will round up the allocation size to a +multiple of the system page size; therefore, consider using it only with +large data or by sharing allocations via the 'pool_size' trait. +Furthermore, the Linux kernel does not guarantee that an allocation will +always be on the nearest NUMA node nor that after reallocation the same +node will be used. Note additionally that, on Linux, the default +setting of the memory placement policy is to use the current node; +therefore, unless the memory placement policy has been overridden, the +'partition' trait 'environment' (the default) will be effectively a +'nearest' allocation. + + Additional notes regarding the traits: + * The 'pinned' trait is supported on Linux hosts, but is subject to + the OS 'ulimit'/'rlimit' locked memory settings. It currently uses + 'mmap' and is therefore optimized for few allocations, including + large data. If the conditions for numa or memkind allocations are + fulfilled, those allocators are used instead. + * The default for the 'pool_size' trait is no pool and for every + (re)allocation the associated library routine is called, which + might internally use a memory pool. Currently, the same applies + when a 'pool_size' has been specified, except that once allocations + exceed the the pool size, the action of the 'fallback' trait + applies. + * For the 'partition' trait, the partition part size will be the same + as the requested size (i.e. 'interleaved' or 'blocked' has no + effect), except for 'interleaved' when the memkind library is + available. Furthermore, for 'nearest' and unless the numa library + is available, the memory might not be on the same NUMA node as + thread that allocated the memory; on Linux, this is in particular + the case when the memory placement policy is set to preferred. + * The 'access' trait has no effect such that memory is always + accessible by all threads. (Except on supported no-host devices.) + * The 'sync_hint' trait has no effect. + + See also: *note Offload-Target Specifics:: + + +File: libgomp.info, Node: Offload-Target Specifics, Next: The libgomp ABI, Prev: OpenMP-Implementation Specifics, Up: Top + +12 Offload-Target Specifics +*************************** + +The following sections present notes on the offload-target specifics + +* Menu: + +* AMD Radeon:: +* nvptx:: + + +File: libgomp.info, Node: AMD Radeon, Next: nvptx, Up: Offload-Target Specifics + +12.1 AMD Radeon (GCN) +===================== + +* Menu: + +* Foreign-runtime support for AMD GPUs:: + +On the hardware side, there is the hierarchy (fine to coarse): + * work item (thread) + * wavefront + * work group + * compute unit (CU) + + All OpenMP and OpenACC levels are used, i.e. + * OpenMP's simd and OpenACC's vector map to work items (thread) + * OpenMP's threads ("parallel") and OpenACC's workers map to + wavefronts + * OpenMP's teams and OpenACC's gang use a threadpool with the size of + the number of teams or gangs, respectively. + + The used sizes are + * Number of teams is the specified 'num_teams' (OpenMP) or + 'num_gangs' (OpenACC) or otherwise the number of CU. It is limited + by two times the number of CU. + * Number of wavefronts is 4 for gfx900 and 16 otherwise; + 'num_threads' (OpenMP) and 'num_workers' (OpenACC) overrides this + if smaller. + * The wavefront has 102 scalars and 64 vectors + * Number of workitems is always 64 + * The hardware permits maximally 40 workgroups/CU and 16 + wavefronts/workgroup up to a limit of 40 wavefronts in total per + CU. + * 80 scalars registers and 24 vector registers in non-kernel + functions (the chosen procedure-calling API). + * For the kernel itself: as many as register pressure demands (number + of teams and number of threads, scaled down if registers are + exhausted) + + The implementation remark: + * I/O within OpenMP target regions and OpenACC compute regions is + supported using the C library 'printf' functions and the Fortran + 'print'/'write' statements. + * Reverse offload regions (i.e. 'target' regions with + 'device(ancestor:1)') are processed serially per 'target' region + such that the next reverse offload region is only executed after + the previous one returned. + * OpenMP code that has a 'requires' directive with 'self_maps' or + 'unified_shared_memory' is only supported if all AMD GPUs have the + 'HSA_AMD_SYSTEM_INFO_SVM_ACCESSIBLE_BY_DEFAULT' property; for + discrete GPUs, this may require setting the 'HSA_XNACK' environment + variable to '1'; for systems with both an APU and a discrete GPU + that does not support XNACK, consider using 'ROCR_VISIBLE_DEVICES' + to enable only the APU. If not supported, all AMD GPU devices are + removed from the list of available devices ("host fallback"). + * The available stack size can be changed using the 'GCN_STACK_SIZE' + environment variable; the default is 32 kiB per thread. + * Low-latency memory ('omp_low_lat_mem_space') is supported when the + the 'access' trait is set to 'cgroup'. The default pool size is + automatically scaled to share the 64 kiB LDS memory between the + number of teams configured to run on each compute-unit, but may be + adjusted at runtime by setting environment variable + 'GOMP_GCN_LOWLAT_POOL=BYTES'. + * 'omp_low_lat_mem_alloc' cannot be used with true low-latency memory + because the definition implies the 'omp_atv_all' trait; main + graphics memory is used instead. + * 'omp_cgroup_mem_alloc', 'omp_pteam_mem_alloc', and + 'omp_thread_mem_alloc', all use low-latency memory as first + preference, and fall back to main graphics memory when the + low-latency pool is exhausted. + * The OpenMP routines 'omp_target_memcpy_rect' and + 'omp_target_memcpy_rect_async' and the 'target update' directive + for non-contiguous list items use the 3D memory-copy function of + the HSA library. Higher dimensions call this functions in a loop + and are therefore supported. + * The unique identifier (UID), used with OpenMP's API UID routines, + is the value returned by the HSA runtime library for + 'HSA_AMD_AGENT_INFO_UUID'. For GPUs, it is currently 'GPU-' + followed by 16 lower-case hex digits, yielding a string like + 'GPU-f914a2142fc3413a'. The output matches the one used by + 'rocminfo'. + + +File: libgomp.info, Node: Foreign-runtime support for AMD GPUs, Up: AMD Radeon + +12.1.1 OpenMP 'interop' - Foreign-Runtime Support for AMD GPUs +-------------------------------------------------------------- + +On AMD GPUs, the foreign runtimes are HIP (C++ Heterogeneous-Compute +Interface for Portability) and HSA (Heterogeneous System Architecture), +where HIP is the default. The interop object is created using OpenMP's +'interop' directive or, implicitly, when invoking a 'declare variant' +procedure that has the 'append_args' clause. In either case, the +'prefer_type' modifier determines whether HIP or HSA is used. + + When specifying the 'targetsync' modifier: For HIP, a stream is +created using 'hipStreamCreate'. For HSA, a queue is created of type +'HSA_QUEUE_TYPE_MULTI' with a queue size of 64. + + Invoke the *note Interoperability Routines:: on an interop object to +obtain the following properties. For properties with integral (int), +pointer (ptr), or string (str) data type, call 'omp_get_interop_int', +'omp_get_interop_ptr', or 'omp_get_interop_str', respectively. Note +that 'device_num' is the OpenMP device number while 'device' is the HIP +device number or HSA device handle. + + When using HIP with C and C++, the '__HIP_PLATFORM_AMD__' +preprocessor macro must be defined before including the HIP header +files. + + For the API routine call, add the prefix 'omp_ipr_' to the property +name; for instance: + omp_interop_rc_t ret; + int device_num = omp_get_interop_int (my_interop_obj, omp_ipr_device_num, &ret); + +Available properties for an HIP interop object: + +Property C data type API routine value (if + constant) +----------------------------------------------------------------------- +'fr_id' 'omp_interop_fr_t' int 'omp_fr_hip' +'fr_name' 'const char *' str '"hip"' +'vendor' 'int' int '1' +'vendor_name' 'const char *' str '"amd"' +'device_num' 'int' int +'platform' N/A +'device' 'hipDevice_t' int +'device_context''hipCtx_t' ptr +'targetsync' 'hipStream_t' ptr + +Available properties for an HSA interop object: + +Property C data type API routine value (if + constant) +----------------------------------------------------------------------- +'fr_id' 'omp_interop_fr_t' int 'omp_fr_hsa' +'fr_name' 'const char *' str '"hsa"' +'vendor' 'int' int '1' +'vendor_name' 'const char *' str '"amd"' +'device_num' 'int' int +'platform' N/A +'device' 'hsa_agent *' ptr +'device_context'N/A +'targetsync' 'hsa_queue *' ptr + + +File: libgomp.info, Node: nvptx, Prev: AMD Radeon, Up: Offload-Target Specifics + +12.2 nvptx +========== + +* Menu: + +* Foreign-runtime support for Nvidia GPUs:: + +On the hardware side, there is the hierarchy (fine to coarse): + * thread + * warp + * thread block + * streaming multiprocessor + + All OpenMP and OpenACC levels are used, i.e. + * OpenMP's simd and OpenACC's vector map to threads + * OpenMP's threads ("parallel") and OpenACC's workers map to warps + * OpenMP's teams and OpenACC's gang use a threadpool with the size of + the number of teams or gangs, respectively. + + The used sizes are + * The 'warp_size' is always 32 + * CUDA kernel launched: 'dim={#teams,1,1}, + blocks={#threads,warp_size,1}'. + * The number of teams is limited by the number of blocks the device + can host simultaneously. + + Additional information can be obtained by setting the environment +variable to 'GOMP_DEBUG=1' (very verbose; grep for 'kernel.*launch' for +launch parameters). + + GCC generates generic PTX ISA code, which is just-in-time compiled by +CUDA, which caches the JIT in the user's directory (see CUDA +documentation; can be tuned by the environment variables +'CUDA_CACHE_{DISABLE,MAXSIZE,PATH}'. + + Note: While PTX ISA is generic, the '-mptx=' and '-march=' +commandline options still affect the used PTX ISA code and, thus, the +requirements on CUDA version and hardware. + + The implementation remark: + * I/O within OpenMP target regions and OpenACC compute regions is + supported using the C library 'printf' functions. Additionally, + the Fortran 'print'/'write' statements are supported within OpenMP + target regions, but not yet within OpenACC compute regions. + * Compilation OpenMP code that contains 'requires reverse_offload' + requires at least '-march=sm_35', compiling for '-march=sm_30' is + not supported. + * For code containing reverse offload (i.e. 'target' regions with + 'device(ancestor:1)'), there is a slight performance penalty for + _all_ target regions, consisting mostly of shutdown delay Per + device, reverse offload regions are processed serially such that + the next reverse offload region is only executed after the previous + one returned. + * OpenMP code that has a 'requires' directive with 'self_maps' or + 'unified_shared_memory' runs on nvptx devices if and only if all of + those support the 'pageableMemoryAccess' property;(1) otherwise, + all nvptx device are removed from the list of available devices + ("host fallback"). + * The default per-warp stack size is 128 kiB; see also '-msoft-stack' + in the GCC manual. + * Low-latency memory ('omp_low_lat_mem_space') is supported when the + the 'access' trait is set to 'cgroup', and libgomp has been built + for PTX ISA version 4.1 or higher (such as in GCC's default + configuration). The default pool size is 8 kiB per team, but may + be adjusted at runtime by setting environment variable + 'GOMP_NVPTX_LOWLAT_POOL=BYTES'. The maximum value is limited by + the available hardware, and care should be taken that the selected + pool size does not unduly limit the number of teams that can run + simultaneously. + * 'omp_low_lat_mem_alloc' cannot be used with true low-latency memory + because the definition implies the 'omp_atv_all' trait; main + graphics memory is used instead. + * 'omp_cgroup_mem_alloc', 'omp_pteam_mem_alloc', and + 'omp_thread_mem_alloc', all use low-latency memory as first + preference, and fall back to main graphics memory when the + low-latency pool is exhausted. + * The OpenMP routines 'omp_target_memcpy_rect' and + 'omp_target_memcpy_rect_async' and the 'target update' directive + for non-contiguous list items use the 2D and 3D memory-copy + functions of the CUDA library. Higher dimensions call those + functions in a loop and are therefore supported. + * The unique identifier (UID), used with OpenMP's API UID routines, + consists of the 'GPU-' prefix followed by the 16-bytes UUID as + returned by the CUDA runtime library. This UUID is output in + grouped lower-case hex digits; the grouping of those 32 digits is: + 8 digits, hyphen, 4 digits, hyphen, 4 digits, hyphen, 16 digits. + This leads to a string like + 'GPU-a8081c9e-f03e-18eb-1827-bf5ba95afa5d'. The output matches the + format used by 'nvidia-smi'. + + ---------- Footnotes ---------- + + (1) + + + +File: libgomp.info, Node: Foreign-runtime support for Nvidia GPUs, Up: nvptx + +12.2.1 OpenMP 'interop' - Foreign-Runtime Support for Nvidia GPUs +----------------------------------------------------------------- + +On Nvidia GPUs, the foreign runtimes APIs are the CUDA runtime API, the +CUDA driver API, and HIP, the C++ Heterogeneous-Compute Interface for +Portability that is--on CUDA-based systems--a very thin layer on top of +the CUDA API. By default, CUDA is used. The interop object is created +using OpenMP's 'interop' directive or, implicitly, when invoking a +'declare variant' procedure that has the 'append_args' clause. In +either case, the 'prefer_type' modifier determines whether CUDA, CUDA +driver, or HSA is used. + + When specifying the 'targetsync' modifier, a CUDA stream is created +using the 'CU_STREAM_DEFAULT' flag. + + Invoke the *note Interoperability Routines:: on an interop object to +obtain the following properties. For properties with integral (int), +pointer (ptr), or string (str) data type, call 'omp_get_interop_int', +'omp_get_interop_ptr', or 'omp_get_interop_str', respectively. Note +that 'device_num' is the OpenMP device number while 'device' is the +CUDA, CUDA Driver, or HIP device number. + + When using HIP with C and C++, the '__HIP_PLATFORM_NVIDIA__' +preprocessor macro must be defined before including the HIP header +files. + + For the API routine call, add the prefix 'omp_ipr_' to the property +name; for instance: + omp_interop_rc_t ret; + int device_num = omp_get_interop_int (my_interop_obj, omp_ipr_device_num, &ret); + +Available properties for a CUDA runtime API interop object: + +Property C data type API routine value (if + constant) +----------------------------------------------------------------------- +'fr_id' 'omp_interop_fr_t' int 'omp_fr_cuda' +'fr_name' 'const char *' str '"cuda"' +'vendor' 'int' int '11' +'vendor_name' 'const char *' str '"nvidia"' +'device_num' 'int' int +'platform' N/A +'device' 'int' int +'device_context'N/A +'targetsync' 'cudaStream_t' ptr + +Available properties for a CUDA driver API interop object: + +Property C data type API routine value (if + constant) +----------------------------------------------------------------------- +'fr_id' 'omp_interop_fr_t' int 'omp_fr_cuda_driver' +'fr_name' 'const char *' str '"cuda_driver"' +'vendor' 'int' int '11' +'vendor_name' 'const char *' str '"nvidia"' +'device_num' 'int' int +'platform' N/A +'device' 'CUdevice' int +'device_context''CUcontext' ptr +'targetsync' 'CUstream' ptr + +Available properties for an HIP interop object: + +Property C data type API routine value (if + constant) +----------------------------------------------------------------------- +'fr_id' 'omp_interop_fr_t' int 'omp_fr_hip' +'fr_name' 'const char *' str '"hip"' +'vendor' 'int' int '11' +'vendor_name' 'const char *' str '"nvidia"' +'device_num' 'int' int +'platform' N/A +'device' 'hipDevice_t' int +'device_context''hipCtx_t' ptr +'targetsync' 'hipStream_t' ptr + + +File: libgomp.info, Node: The libgomp ABI, Next: Reporting Bugs, Prev: Offload-Target Specifics, Up: Top + +13 The libgomp ABI +****************** + +The following sections present notes on the external ABI as presented by +libgomp. Only maintainers should need them. + +* Menu: + +* Implementing MASTER construct:: +* Implementing CRITICAL construct:: +* Implementing ATOMIC construct:: +* Implementing FLUSH construct:: +* Implementing BARRIER construct:: +* Implementing THREADPRIVATE construct:: +* Implementing PRIVATE clause:: +* Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses:: +* Implementing REDUCTION clause:: +* Implementing PARALLEL construct:: +* Implementing FOR construct:: +* Implementing ORDERED construct:: +* Implementing SECTIONS construct:: +* Implementing SINGLE construct:: +* Implementing OpenACC's PARALLEL construct:: + + +File: libgomp.info, Node: Implementing MASTER construct, Next: Implementing CRITICAL construct, Up: The libgomp ABI + +13.1 Implementing MASTER construct +================================== + + if (omp_get_thread_num () == 0) + block + + Alternately, we generate two copies of the parallel subfunction and +only include this in the version run by the primary thread. Surely this +is not worthwhile though... + + +File: libgomp.info, Node: Implementing CRITICAL construct, Next: Implementing ATOMIC construct, Prev: Implementing MASTER construct, Up: The libgomp ABI + +13.2 Implementing CRITICAL construct +==================================== + +Without a specified name, + + void GOMP_critical_start (void); + void GOMP_critical_end (void); + + so that we don't get COPY relocations from libgomp to the main +application. + + With a specified name, use omp_set_lock and omp_unset_lock with name +being transformed into a variable declared like + + omp_lock_t gomp_critical_user_ __attribute__((common)) + + Ideally the ABI would specify that all zero is a valid unlocked +state, and so we wouldn't need to initialize this at startup. + + +File: libgomp.info, Node: Implementing ATOMIC construct, Next: Implementing FLUSH construct, Prev: Implementing CRITICAL construct, Up: The libgomp ABI + +13.3 Implementing ATOMIC construct +================================== + +The target should implement the '__sync' builtins. + + Failing that we could add + + void GOMP_atomic_enter (void) + void GOMP_atomic_exit (void) + + which reuses the regular lock code, but with yet another lock object +private to the library. + + +File: libgomp.info, Node: Implementing FLUSH construct, Next: Implementing BARRIER construct, Prev: Implementing ATOMIC construct, Up: The libgomp ABI + +13.4 Implementing FLUSH construct +================================= + +Expands to the '__sync_synchronize' builtin. + + +File: libgomp.info, Node: Implementing BARRIER construct, Next: Implementing THREADPRIVATE construct, Prev: Implementing FLUSH construct, Up: The libgomp ABI + +13.5 Implementing BARRIER construct +=================================== + + void GOMP_barrier (void) + + +File: libgomp.info, Node: Implementing THREADPRIVATE construct, Next: Implementing PRIVATE clause, Prev: Implementing BARRIER construct, Up: The libgomp ABI + +13.6 Implementing THREADPRIVATE construct +========================================= + +In _most_ cases we can map this directly to '__thread'. Except that OMP +allows constructors for C++ objects. We can either refuse to support +this (how often is it used?) or we can implement something akin to +.ctors. + + Even more ideally, this ctor feature is handled by extensions to the +main pthreads library. Failing that, we can have a set of entry points +to register ctor functions to be called. + + +File: libgomp.info, Node: Implementing PRIVATE clause, Next: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses, Prev: Implementing THREADPRIVATE construct, Up: The libgomp ABI + +13.7 Implementing PRIVATE clause +================================ + +In association with a PARALLEL, or within the lexical extent of a +PARALLEL block, the variable becomes a local variable in the parallel +subfunction. + + In association with FOR or SECTIONS blocks, create a new automatic +variable within the current function. This preserves the semantic of +new variable creation. + + +File: libgomp.info, Node: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses, Next: Implementing REDUCTION clause, Prev: Implementing PRIVATE clause, Up: The libgomp ABI + +13.8 Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses +========================================================================= + +This seems simple enough for PARALLEL blocks. Create a private struct +for communicating between the parent and subfunction. In the parent, +copy in values for scalar and "small" structs; copy in addresses for +others TREE_ADDRESSABLE types. In the subfunction, copy the value into +the local variable. + + It is not clear what to do with bare FOR or SECTION blocks. The only +thing I can figure is that we do something like: + + #pragma omp for firstprivate(x) lastprivate(y) + for (int i = 0; i < n; ++i) + body; + + which becomes + + { + int x = x, y; + + // for stuff + + if (i == n) + y = y; + } + + where the "x=x" and "y=y" assignments actually have different uids +for the two variables, i.e. not something you could write directly in +C. Presumably this only makes sense if the "outer" x and y are global +variables. + + COPYPRIVATE would work the same way, except the structure broadcast +would have to happen via SINGLE machinery instead. + + +File: libgomp.info, Node: Implementing REDUCTION clause, Next: Implementing PARALLEL construct, Prev: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses, Up: The libgomp ABI + +13.9 Implementing REDUCTION clause +================================== + +The private struct mentioned in the previous section should have a +pointer to an array of the type of the variable, indexed by the thread's +TEAM_ID. The thread stores its final value into the array, and after +the barrier, the primary thread iterates over the array to collect the +values. + + +File: libgomp.info, Node: Implementing PARALLEL construct, Next: Implementing FOR construct, Prev: Implementing REDUCTION clause, Up: The libgomp ABI + +13.10 Implementing PARALLEL construct +===================================== + + #pragma omp parallel + { + body; + } + + becomes + + void subfunction (void *data) + { + use data; + body; + } + + setup data; + GOMP_parallel_start (subfunction, &data, num_threads); + subfunction (&data); + GOMP_parallel_end (); + + void GOMP_parallel_start (void (*fn)(void *), void *data, unsigned num_threads) + + The FN argument is the subfunction to be run in parallel. + + The DATA argument is a pointer to a structure used to communicate +data in and out of the subfunction, as discussed above with respect to +FIRSTPRIVATE et al. + + The NUM_THREADS argument is 1 if an IF clause is present and false, +or the value of the NUM_THREADS clause, if present, or 0. + + The function needs to create the appropriate number of threads and/or +launch them from the dock. It needs to create the team structure and +assign team ids. + + void GOMP_parallel_end (void) + + Tears down the team and returns us to the previous +'omp_in_parallel()' state. + + +File: libgomp.info, Node: Implementing FOR construct, Next: Implementing ORDERED construct, Prev: Implementing PARALLEL construct, Up: The libgomp ABI + +13.11 Implementing FOR construct +================================ + + #pragma omp parallel for + for (i = lb; i <= ub; i++) + body; + + becomes + + void subfunction (void *data) + { + long _s0, _e0; + while (GOMP_loop_static_next (&_s0, &_e0)) + { + long _e1 = _e0, i; + for (i = _s0; i < _e1; i++) + body; + } + GOMP_loop_end_nowait (); + } + + GOMP_parallel_loop_static (subfunction, NULL, 0, lb, ub+1, 1, 0); + subfunction (NULL); + GOMP_parallel_end (); + + #pragma omp for schedule(runtime) + for (i = 0; i < n; i++) + body; + + becomes + + { + long i, _s0, _e0; + if (GOMP_loop_runtime_start (0, n, 1, &_s0, &_e0)) + do { + long _e1 = _e0; + for (i = _s0, i < _e0; i++) + body; + } while (GOMP_loop_runtime_next (&_s0, _&e0)); + GOMP_loop_end (); + } + + Note that while it looks like there is trickiness to propagating a +non-constant STEP, there isn't really. We're explicitly allowed to +evaluate it as many times as we want, and any variables involved should +automatically be handled as PRIVATE or SHARED like any other variables. +So the expression should remain evaluable in the subfunction. We can +also pull it into a local variable if we like, but since its supposed to +remain unchanged, we can also not if we like. + + If we have SCHEDULE(STATIC), and no ORDERED, then we ought to be able +to get away with no work-sharing context at all, since we can simply +perform the arithmetic directly in each thread to divide up the +iterations. Which would mean that we wouldn't need to call any of these +routines. + + There are separate routines for handling loops with an ORDERED +clause. Bookkeeping for that is non-trivial... + + +File: libgomp.info, Node: Implementing ORDERED construct, Next: Implementing SECTIONS construct, Prev: Implementing FOR construct, Up: The libgomp ABI + +13.12 Implementing ORDERED construct +==================================== + + void GOMP_ordered_start (void) + void GOMP_ordered_end (void) + + +File: libgomp.info, Node: Implementing SECTIONS construct, Next: Implementing SINGLE construct, Prev: Implementing ORDERED construct, Up: The libgomp ABI + +13.13 Implementing SECTIONS construct +===================================== + +A block as + + #pragma omp sections + { + #pragma omp section + stmt1; + #pragma omp section + stmt2; + #pragma omp section + stmt3; + } + + becomes + + for (i = GOMP_sections_start (3); i != 0; i = GOMP_sections_next ()) + switch (i) + { + case 1: + stmt1; + break; + case 2: + stmt2; + break; + case 3: + stmt3; + break; + } + GOMP_barrier (); + + +File: libgomp.info, Node: Implementing SINGLE construct, Next: Implementing OpenACC's PARALLEL construct, Prev: Implementing SECTIONS construct, Up: The libgomp ABI + +13.14 Implementing SINGLE construct +=================================== + +A block like + + #pragma omp single + { + body; + } + + becomes + + if (GOMP_single_start ()) + body; + GOMP_barrier (); + + while + + #pragma omp single copyprivate(x) + body; + + becomes + + datap = GOMP_single_copy_start (); + if (datap == NULL) + { + body; + data.x = x; + GOMP_single_copy_end (&data); + } + else + x = datap->x; + GOMP_barrier (); + + +File: libgomp.info, Node: Implementing OpenACC's PARALLEL construct, Prev: Implementing SINGLE construct, Up: The libgomp ABI + +13.15 Implementing OpenACC's PARALLEL construct +=============================================== + + void GOACC_parallel () + + +File: libgomp.info, Node: Reporting Bugs, Next: Copying, Prev: The libgomp ABI, Up: Top + +14 Reporting Bugs +***************** + +Bugs in the GNU Offloading and Multi Processing Runtime Library should +be reported via Bugzilla (https://gcc.gnu.org/bugzilla/). Please add +"openacc", or "openmp", or both to the keywords field in the bug report, +as appropriate. + + +File: libgomp.info, Node: Copying, Next: GNU Free Documentation License, Prev: Reporting Bugs, Up: Top + +GNU General Public License +************************** + + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + + Everyone is permitted to copy and distribute verbatim copies of this + license document, but changing it is not allowed. + +Preamble +======== + +The GNU General Public License is a free, copyleft license for software +and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program-to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + +TERMS AND CONDITIONS +==================== + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public + License. + + "Copyright" also means copyright-like laws that apply to other + kinds of works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this + License. Each licensee is addressed as "you". "Licensees" and + "recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the + work in a fashion requiring copyright permission, other than the + making of an exact copy. The resulting work is called a "modified + version" of the earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work + based on the Program. + + To "propagate" a work means to do anything with it that, without + permission, would make you directly or secondarily liable for + infringement under applicable copyright law, except executing it on + a computer or modifying a private copy. Propagation includes + copying, distribution (with or without modification), making + available to the public, and in some countries other activities as + well. + + To "convey" a work means any kind of propagation that enables other + parties to make or receive copies. Mere interaction with a user + through a computer network, with no transfer of a copy, is not + conveying. + + An interactive user interface displays "Appropriate Legal Notices" + to the extent that it includes a convenient and prominently visible + feature that (1) displays an appropriate copyright notice, and (2) + tells the user that there is no warranty for the work (except to + the extent that warranties are provided), that licensees may convey + the work under this License, and how to view a copy of this + License. If the interface presents a list of user commands or + options, such as a menu, a prominent item in the list meets this + criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work + for making modifications to it. "Object code" means any non-source + form of a work. + + A "Standard Interface" means an interface that either is an + official standard defined by a recognized standards body, or, in + the case of interfaces specified for a particular programming + language, one that is widely used among developers working in that + language. + + The "System Libraries" of an executable work include anything, + other than the work as a whole, that (a) is included in the normal + form of packaging a Major Component, but which is not part of that + Major Component, and (b) serves only to enable use of the work with + that Major Component, or to implement a Standard Interface for + which an implementation is available to the public in source code + form. A "Major Component", in this context, means a major + essential component (kernel, window system, and so on) of the + specific operating system (if any) on which the executable work + runs, or a compiler used to produce the work, or an object code + interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all + the source code needed to generate, install, and (for an executable + work) run the object code and to modify the work, including scripts + to control those activities. However, it does not include the + work's System Libraries, or general-purpose tools or generally + available free programs which are used unmodified in performing + those activities but which are not part of the work. For example, + Corresponding Source includes interface definition files associated + with source files for the work, and the source code for shared + libraries and dynamically linked subprograms that the work is + specifically designed to require, such as by intimate data + communication or control flow between those subprograms and other + parts of the work. + + The Corresponding Source need not include anything that users can + regenerate automatically from other parts of the Corresponding + Source. + + The Corresponding Source for a work in source code form is that + same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of + copyright on the Program, and are irrevocable provided the stated + conditions are met. This License explicitly affirms your unlimited + permission to run the unmodified Program. The output from running + a covered work is covered by this License only if the output, given + its content, constitutes a covered work. This License acknowledges + your rights of fair use or other equivalent, as provided by + copyright law. + + You may make, run and propagate covered works that you do not + convey, without conditions so long as your license otherwise + remains in force. You may convey covered works to others for the + sole purpose of having them make modifications exclusively for you, + or provide you with facilities for running those works, provided + that you comply with the terms of this License in conveying all + material for which you do not control copyright. Those thus making + or running the covered works for you must do so exclusively on your + behalf, under your direction and control, on terms that prohibit + them from making any copies of your copyrighted material outside + their relationship with you. + + Conveying under any other circumstances is permitted solely under + the conditions stated below. Sublicensing is not allowed; section + 10 makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological + measure under any applicable law fulfilling obligations under + article 11 of the WIPO copyright treaty adopted on 20 December + 1996, or similar laws prohibiting or restricting circumvention of + such measures. + + When you convey a covered work, you waive any legal power to forbid + circumvention of technological measures to the extent such + circumvention is effected by exercising rights under this License + with respect to the covered work, and you disclaim any intention to + limit operation or modification of the work as a means of + enforcing, against the work's users, your or third parties' legal + rights to forbid circumvention of technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you + receive it, in any medium, provided that you conspicuously and + appropriately publish on each copy an appropriate copyright notice; + keep intact all notices stating that this License and any + non-permissive terms added in accord with section 7 apply to the + code; keep intact all notices of the absence of any warranty; and + give all recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, + and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to + produce it from the Program, in the form of source code under the + terms of section 4, provided that you also meet all of these + conditions: + + a. The work must carry prominent notices stating that you + modified it, and giving a relevant date. + + b. The work must carry prominent notices stating that it is + released under this License and any conditions added under + section 7. This requirement modifies the requirement in + section 4 to "keep intact all notices". + + c. You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable + section 7 additional terms, to the whole of the work, and all + its parts, regardless of how they are packaged. This License + gives no permission to license the work in any other way, but + it does not invalidate such permission if you have separately + received it. + + d. If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has + interactive interfaces that do not display Appropriate Legal + Notices, your work need not make them do so. + + A compilation of a covered work with other separate and independent + works, which are not by their nature extensions of the covered + work, and which are not combined with it such as to form a larger + program, in or on a volume of a storage or distribution medium, is + called an "aggregate" if the compilation and its resulting + copyright are not used to limit the access or legal rights of the + compilation's users beyond what the individual works permit. + Inclusion of a covered work in an aggregate does not cause this + License to apply to the other parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms + of sections 4 and 5, provided that you also convey the + machine-readable Corresponding Source under the terms of this + License, in one of these ways: + + a. Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b. Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that + product model, to give anyone who possesses the object code + either (1) a copy of the Corresponding Source for all the + software in the product that is covered by this License, on a + durable physical medium customarily used for software + interchange, for a price no more than your reasonable cost of + physically performing this conveying of source, or (2) access + to copy the Corresponding Source from a network server at no + charge. + + c. Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, + and only if you received the object code with such an offer, + in accord with subsection 6b. + + d. Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to + the Corresponding Source in the same way through the same + place at no further charge. You need not require recipients + to copy the Corresponding Source along with the object code. + If the place to copy the object code is a network server, the + Corresponding Source may be on a different server (operated by + you or a third party) that supports equivalent copying + facilities, provided you maintain clear directions next to the + object code saying where to find the Corresponding Source. + Regardless of what server hosts the Corresponding Source, you + remain obligated to ensure that it is available for as long as + needed to satisfy these requirements. + + e. Convey the object code using peer-to-peer transmission, + provided you inform other peers where the object code and + Corresponding Source of the work are being offered to the + general public at no charge under subsection 6d. + + A separable portion of the object code, whose source code is + excluded from the Corresponding Source as a System Library, need + not be included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means + any tangible personal property which is normally used for personal, + family, or household purposes, or (2) anything designed or sold for + incorporation into a dwelling. In determining whether a product is + a consumer product, doubtful cases shall be resolved in favor of + coverage. For a particular product received by a particular user, + "normally used" refers to a typical or common use of that class of + product, regardless of the status of the particular user or of the + way in which the particular user actually uses, or expects or is + expected to use, the product. A product is a consumer product + regardless of whether the product has substantial commercial, + industrial or non-consumer uses, unless such uses represent the + only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, + procedures, authorization keys, or other information required to + install and execute modified versions of a covered work in that + User Product from a modified version of its Corresponding Source. + The information must suffice to ensure that the continued + functioning of the modified object code is in no case prevented or + interfered with solely because modification has been made. + + If you convey an object code work under this section in, or with, + or specifically for use in, a User Product, and the conveying + occurs as part of a transaction in which the right of possession + and use of the User Product is transferred to the recipient in + perpetuity or for a fixed term (regardless of how the transaction + is characterized), the Corresponding Source conveyed under this + section must be accompanied by the Installation Information. But + this requirement does not apply if neither you nor any third party + retains the ability to install modified object code on the User + Product (for example, the work has been installed in ROM). + + The requirement to provide Installation Information does not + include a requirement to continue to provide support service, + warranty, or updates for a work that has been modified or installed + by the recipient, or for the User Product in which it has been + modified or installed. Access to a network may be denied when the + modification itself materially and adversely affects the operation + of the network or violates the rules and protocols for + communication across the network. + + Corresponding Source conveyed, and Installation Information + provided, in accord with this section must be in a format that is + publicly documented (and with an implementation available to the + public in source code form), and must require no special password + or key for unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of + this License by making exceptions from one or more of its + conditions. Additional permissions that are applicable to the + entire Program shall be treated as though they were included in + this License, to the extent that they are valid under applicable + law. If additional permissions apply only to part of the Program, + that part may be used separately under those permissions, but the + entire Program remains governed by this License without regard to + the additional permissions. + + When you convey a copy of a covered work, you may at your option + remove any additional permissions from that copy, or from any part + of it. (Additional permissions may be written to require their own + removal in certain cases when you modify the work.) You may place + additional permissions on material, added by you to a covered work, + for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material + you add to a covered work, you may (if authorized by the copyright + holders of that material) supplement the terms of this License with + terms: + + a. Disclaiming warranty or limiting liability differently from + the terms of sections 15 and 16 of this License; or + + b. Requiring preservation of specified reasonable legal notices + or author attributions in that material or in the Appropriate + Legal Notices displayed by works containing it; or + + c. Prohibiting misrepresentation of the origin of that material, + or requiring that modified versions of such material be marked + in reasonable ways as different from the original version; or + + d. Limiting the use for publicity purposes of names of licensors + or authors of the material; or + + e. Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f. Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified + versions of it) with contractual assumptions of liability to + the recipient, for any liability that these contractual + assumptions directly impose on those licensors and authors. + + All other non-permissive additional terms are considered "further + restrictions" within the meaning of section 10. If the Program as + you received it, or any part of it, contains a notice stating that + it is governed by this License along with a term that is a further + restriction, you may remove that term. If a license document + contains a further restriction but permits relicensing or conveying + under this License, you may add to a covered work material governed + by the terms of that license document, provided that the further + restriction does not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you + must place, in the relevant source files, a statement of the + additional terms that apply to those files, or a notice indicating + where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in + the form of a separately written license, or stated as exceptions; + the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly + provided under this License. Any attempt otherwise to propagate or + modify it is void, and will automatically terminate your rights + under this License (including any patent licenses granted under the + third paragraph of section 11). + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly and + finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from + that copyright holder, and you cure the violation prior to 30 days + after your receipt of the notice. + + Termination of your rights under this section does not terminate + the licenses of parties who have received copies or rights from you + under this License. If your rights have been terminated and not + permanently reinstated, you do not qualify to receive new licenses + for the same material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or + run a copy of the Program. Ancillary propagation of a covered work + occurring solely as a consequence of using peer-to-peer + transmission to receive a copy likewise does not require + acceptance. However, nothing other than this License grants you + permission to propagate or modify any covered work. These actions + infringe copyright if you do not accept this License. Therefore, + by modifying or propagating a covered work, you indicate your + acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically + receives a license from the original licensors, to run, modify and + propagate that work, subject to this License. You are not + responsible for enforcing compliance by third parties with this + License. + + An "entity transaction" is a transaction transferring control of an + organization, or substantially all assets of one, or subdividing an + organization, or merging organizations. If propagation of a + covered work results from an entity transaction, each party to that + transaction who receives a copy of the work also receives whatever + licenses to the work the party's predecessor in interest had or + could give under the previous paragraph, plus a right to possession + of the Corresponding Source of the work from the predecessor in + interest, if the predecessor has it or can get it with reasonable + efforts. + + You may not impose any further restrictions on the exercise of the + rights granted or affirmed under this License. For example, you + may not impose a license fee, royalty, or other charge for exercise + of rights granted under this License, and you may not initiate + litigation (including a cross-claim or counterclaim in a lawsuit) + alleging that any patent claim is infringed by making, using, + selling, offering for sale, or importing the Program or any portion + of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this + License of the Program or a work on which the Program is based. + The work thus licensed is called the contributor's "contributor + version". + + A contributor's "essential patent claims" are all patent claims + owned or controlled by the contributor, whether already acquired or + hereafter acquired, that would be infringed by some manner, + permitted by this License, of making, using, or selling its + contributor version, but do not include claims that would be + infringed only as a consequence of further modification of the + contributor version. For purposes of this definition, "control" + includes the right to grant patent sublicenses in a manner + consistent with the requirements of this License. + + Each contributor grants you a non-exclusive, worldwide, + royalty-free patent license under the contributor's essential + patent claims, to make, use, sell, offer for sale, import and + otherwise run, modify and propagate the contents of its contributor + version. + + In the following three paragraphs, a "patent license" is any + express agreement or commitment, however denominated, not to + enforce a patent (such as an express permission to practice a + patent or covenant not to sue for patent infringement). To "grant" + such a patent license to a party means to make such an agreement or + commitment not to enforce a patent against the party. + + If you convey a covered work, knowingly relying on a patent + license, and the Corresponding Source of the work is not available + for anyone to copy, free of charge and under the terms of this + License, through a publicly available network server or other + readily accessible means, then you must either (1) cause the + Corresponding Source to be so available, or (2) arrange to deprive + yourself of the benefit of the patent license for this particular + work, or (3) arrange, in a manner consistent with the requirements + of this License, to extend the patent license to downstream + recipients. "Knowingly relying" means you have actual knowledge + that, but for the patent license, your conveying the covered work + in a country, or your recipient's use of the covered work in a + country, would infringe one or more identifiable patents in that + country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or + arrangement, you convey, or propagate by procuring conveyance of, a + covered work, and grant a patent license to some of the parties + receiving the covered work authorizing them to use, propagate, + modify or convey a specific copy of the covered work, then the + patent license you grant is automatically extended to all + recipients of the covered work and works based on it. + + A patent license is "discriminatory" if it does not include within + the scope of its coverage, prohibits the exercise of, or is + conditioned on the non-exercise of one or more of the rights that + are specifically granted under this License. You may not convey a + covered work if you are a party to an arrangement with a third + party that is in the business of distributing software, under which + you make payment to the third party based on the extent of your + activity of conveying the work, and under which the third party + grants, to any of the parties who would receive the covered work + from you, a discriminatory patent license (a) in connection with + copies of the covered work conveyed by you (or copies made from + those copies), or (b) primarily for and in connection with specific + products or compilations that contain the covered work, unless you + entered into that arrangement, or that patent license was granted, + prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting + any implied license or other defenses to infringement that may + otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement + or otherwise) that contradict the conditions of this License, they + do not excuse you from the conditions of this License. If you + cannot convey a covered work so as to satisfy simultaneously your + obligations under this License and any other pertinent obligations, + then as a consequence you may not convey it at all. For example, + if you agree to terms that obligate you to collect a royalty for + further conveying from those to whom you convey the Program, the + only way you could satisfy both those terms and this License would + be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have + permission to link or combine any covered work with a work licensed + under version 3 of the GNU Affero General Public License into a + single combined work, and to convey the resulting work. The terms + of this License will continue to apply to the part which is the + covered work, but the special requirements of the GNU Affero + General Public License, section 13, concerning interaction through + a network will apply to the combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new + versions of the GNU General Public License from time to time. Such + new versions will be similar in spirit to the present version, but + may differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the + Program specifies that a certain numbered version of the GNU + General Public License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that numbered version or of any later version published by the Free + Software Foundation. If the Program does not specify a version + number of the GNU General Public License, you may choose any + version ever published by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future + versions of the GNU General Public License can be used, that + proxy's public statement of acceptance of a version permanently + authorizes you to choose that version for the Program. + + Later license versions may give you additional or different + permissions. However, no additional obligations are imposed on any + author or copyright holder as a result of your choosing to follow a + later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY + APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE + COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE + RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. + SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL + NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN + WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES + AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR + DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR + CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE + THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA + BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD + PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF + THE POSSIBILITY OF SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided + above cannot be given local legal effect according to their terms, + reviewing courts shall apply local law that most closely + approximates an absolute waiver of all civil liability in + connection with the Program, unless a warranty or assumption of + liability accompanies a copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS +=========================== + +How to Apply These Terms to Your New Programs +============================================= + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. + Copyright (C) YEAR NAME OF AUTHOR + + 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 . + + Also add information on how to contact you by electronic and paper +mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + PROGRAM Copyright (C) YEAR NAME OF AUTHOR + This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type 'show c' for details. + + The hypothetical commands 'show w' and 'show c' should show the +appropriate parts of the General Public License. Of course, your +program's commands might be different; for a GUI interface, you would +use an "about box". + + You should also get your employer (if you work as a programmer) or +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. For more information on this, and how to apply and follow +the GNU GPL, see . + + The GNU General Public License does not permit incorporating your +program into proprietary programs. If your program is a subroutine +library, you may consider it more useful to permit linking proprietary +applications with the library. If this is what you want to do, use the +GNU Lesser General Public License instead of this License. But first, +please read . + + +File: libgomp.info, Node: GNU Free Documentation License, Next: Funding, Prev: Copying, Up: Top + +GNU Free Documentation License +****************************** + + Version 1.3, 3 November 2008 + + Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + functional and useful document "free" in the sense of freedom: to + assure everyone the effective freedom to copy and redistribute it, + with or without modifying it, either commercially or + noncommercially. Secondarily, this License preserves for the + author and publisher a way to get credit for their work, while not + being considered responsible for modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. We + recommend this License principally for works whose purpose is + instruction or reference. + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work, in any medium, + that contains a notice placed by the copyright holder saying it can + be distributed under the terms of this License. Such a notice + grants a world-wide, royalty-free license, unlimited in duration, + to use that work under the conditions stated herein. The + "Document", below, refers to any such manual or work. Any member + of the public is a licensee, and is addressed as "you". You accept + the license if you copy, modify or distribute the work in a way + requiring permission under copyright law. + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter section + of the Document that deals exclusively with the relationship of the + publishers or authors of the Document to the Document's overall + subject (or to related matters) and contains nothing that could + fall directly within that overall subject. (Thus, if the Document + is in part a textbook of mathematics, a Secondary Section may not + explain any mathematics.) The relationship could be a matter of + historical connection with the subject or with related matters, or + of legal, commercial, philosophical, ethical or political position + regarding them. + + The "Invariant Sections" are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in the + notice that says that the Document is released under this License. + If a section does not fit the above definition of Secondary then it + is not allowed to be designated as Invariant. The Document may + contain zero Invariant Sections. If the Document does not identify + any Invariant Sections then there are none. + + The "Cover Texts" are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. A + Front-Cover Text may be at most 5 words, and a Back-Cover Text may + be at most 25 words. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, that is suitable for revising the document + straightforwardly with generic text editors or (for images composed + of pixels) generic paint programs or (for drawings) some widely + available drawing editor, and that is suitable for input to text + formatters or for automatic translation to a variety of formats + suitable for input to text formatters. A copy made in an otherwise + Transparent file format whose markup, or absence of markup, has + been arranged to thwart or discourage subsequent modification by + readers is not Transparent. An image format is not Transparent if + used for any substantial amount of text. A copy that is not + "Transparent" is called "Opaque". + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and standard-conforming + simple HTML, PostScript or PDF designed for human modification. + Examples of transparent image formats include PNG, XCF and JPG. + Opaque formats include proprietary formats that can be read and + edited only by proprietary word processors, SGML or XML for which + the DTD and/or processing tools are not generally available, and + the machine-generated HTML, PostScript or PDF produced by some word + processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. + + The "publisher" means any person or entity that distributes copies + of the Document to the public. + + A section "Entitled XYZ" means a named subunit of the Document + whose title either is precisely XYZ or contains XYZ in parentheses + following text that translates XYZ in another language. (Here XYZ + stands for a specific section name mentioned below, such as + "Acknowledgements", "Dedications", "Endorsements", or "History".) + To "Preserve the Title" of such a section when you modify the + Document means that it remains a section "Entitled XYZ" according + to this definition. + + The Document may include Warranty Disclaimers next to the notice + which states that this License applies to the Document. These + Warranty Disclaimers are considered to be included by reference in + this License, but only as regards disclaiming warranties: any other + implication that these Warranty Disclaimers may have is void and + has no effect on the meaning of this License. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow the + conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies (or copies in media that commonly + have printed covers) of the Document, numbering more than 100, and + the Document's license notice requires Cover Texts, you must + enclose the copies in covers that carry, clearly and legibly, all + these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the title + equally prominent and visible. You may add other material on the + covers in addition. Copying with changes limited to the covers, as + long as they preserve the title of the Document and satisfy these + conditions, can be treated as verbatim copying in other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a machine-readable + Transparent copy along with each Opaque copy, or state in or with + each Opaque copy a computer-network location from which the general + network-using public has access to download using public-standard + network protocols a complete Transparent copy of the Document, free + of added material. If you use the latter option, you must take + reasonably prudent steps, when you begin distribution of Opaque + copies in quantity, to ensure that this Transparent copy will + remain thus accessible at the stated location until at least one + year after the last time you distribute an Opaque copy (directly or + through your agents or retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of copies, + to give them a chance to provide you with an updated version of the + Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with the + Modified Version filling the role of the Document, thus licensing + distribution and modification of the Modified Version to whoever + possesses a copy of it. In addition, you must do these things in + the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of previous + versions (which should, if there were any, be listed in the + History section of the Document). You may use the same title + as a previous version if the original publisher of that + version gives permission. + + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in + the Modified Version, together with at least five of the + principal authors of the Document (all of its principal + authors, if it has fewer than five), unless they release you + from this requirement. + + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + + D. Preserve all the copyright notices of the Document. + + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified + Version under the terms of this License, in the form shown in + the Addendum below. + + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + + H. Include an unaltered copy of this License. + + I. Preserve the section Entitled "History", Preserve its Title, + and add to it an item stating at least the title, year, new + authors, and publisher of the Modified Version as given on the + Title Page. If there is no section Entitled "History" in the + Document, create one stating the title, year, authors, and + publisher of the Document as given on its Title Page, then add + an item describing the Modified Version as stated in the + previous sentence. + + J. Preserve the network location, if any, given in the Document + for public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in the + "History" section. You may omit a network location for a work + that was published at least four years before the Document + itself, or if the original publisher of the version it refers + to gives permission. + + K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section + all the substance and tone of each of the contributor + acknowledgements and/or dedications given therein. + + L. Preserve all the Invariant Sections of the Document, unaltered + in their text and in their titles. Section numbers or the + equivalent are not considered part of the section titles. + + M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. + + N. Do not retitle any existing section to be Entitled + "Endorsements" or to conflict in title with any Invariant + Section. + + O. Preserve any Warranty Disclaimers. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option designate + some or all of these sections as invariant. To do this, add their + titles to the list of Invariant Sections in the Modified Version's + license notice. These titles must be distinct from any other + section titles. + + You may add a section Entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties--for example, statements of peer review or that the text + has been approved by an organization as the authoritative + definition of a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end of + the list of Cover Texts in the Modified Version. Only one passage + of Front-Cover Text and one of Back-Cover Text may be added by (or + through arrangements made by) any one entity. If the Document + already includes a cover text for the same cover, previously added + by you or by arrangement made by the same entity you are acting on + behalf of, you may not add another; but you may replace the old + one, on explicit permission from the previous publisher that added + the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination all + of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice, and that you preserve all + their Warranty Disclaimers. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections Entitled + "History" in the various original documents, forming one section + Entitled "History"; likewise combine any sections Entitled + "Acknowledgements", and any sections Entitled "Dedications". You + must delete all sections Entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the documents + in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow this + License in all other respects regarding verbatim copying of that + document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of a + storage or distribution medium, is called an "aggregate" if the + copyright resulting from the compilation is not used to limit the + legal rights of the compilation's users beyond what the individual + works permit. When the Document is included in an aggregate, this + License does not apply to the other works in the aggregate which + are not themselves derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one half + of the entire aggregate, the Document's Cover Texts may be placed + on covers that bracket the Document within the aggregate, or the + electronic equivalent of covers if the Document is in electronic + form. Otherwise they must appear on printed covers that bracket + the whole aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License, and all the license notices in the + Document, and any Warranty Disclaimers, provided that you also + include the original English version of this License and the + original versions of those notices and disclaimers. In case of a + disagreement between the translation and the original version of + this License or a notice or disclaimer, the original version will + prevail. + + If a section in the Document is Entitled "Acknowledgements", + "Dedications", or "History", the requirement (section 4) to + Preserve its Title (section 1) will typically require changing the + actual title. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense, or distribute it is void, + and will automatically terminate your rights under this License. + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly and + finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from + that copyright holder, and you cure the violation prior to 30 days + after your receipt of the notice. + + Termination of your rights under this section does not terminate + the licenses of parties who have received copies or rights from you + under this License. If your rights have been terminated and not + permanently reinstated, receipt of a copy of some or all of the + same material does not give you any rights to use it. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + . + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If the + Document does not specify a version number of this License, you may + choose any version ever published (not as a draft) by the Free + Software Foundation. If the Document specifies that a proxy can + decide which future versions of this License can be used, that + proxy's public statement of acceptance of a version permanently + authorizes you to choose that version for the Document. + + 11. RELICENSING + + "Massive Multiauthor Collaboration Site" (or "MMC Site") means any + World Wide Web server that publishes copyrightable works and also + provides prominent facilities for anybody to edit those works. A + public wiki that anybody can edit is an example of such a server. + A "Massive Multiauthor Collaboration" (or "MMC") contained in the + site means any set of copyrightable works thus published on the MMC + site. + + "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 + license published by Creative Commons Corporation, a not-for-profit + corporation with a principal place of business in San Francisco, + California, as well as future copyleft versions of that license + published by that same organization. + + "Incorporate" means to publish or republish a Document, in whole or + in part, as part of another Document. + + An MMC is "eligible for relicensing" if it is licensed under this + License, and if all works that were first published under this + License somewhere other than this MMC, and subsequently + incorporated in whole or in part into the MMC, (1) had no cover + texts or invariant sections, and (2) were thus incorporated prior + to November 1, 2008. + + The operator of an MMC Site may republish an MMC contained in the + site under CC-BY-SA on the same site at any time before August 1, + 2009, provided the MMC is eligible for relicensing. + +ADDENDUM: How to use this License for your documents +==================================================== + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. + + If you have Invariant Sections, Front-Cover Texts and Back-Cover +Texts, replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with + the Front-Cover Texts being LIST, and with the Back-Cover Texts + being LIST. + + If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of free +software license, such as the GNU General Public License, to permit +their use in free software. + + +File: libgomp.info, Node: Funding, Next: Library Index, Prev: GNU Free Documentation License, Up: Top + +Funding Free Software +********************* + +If you want to have more free software a few years from now, it makes +sense for you to help encourage people to contribute funds for its +development. The most effective approach known is to encourage +commercial redistributors to donate. + + Users of free software systems can boost the pace of development by +encouraging for-a-fee distributors to donate part of their selling price +to free software developers--the Free Software Foundation, and others. + + The way to convince distributors to do this is to demand it and +expect it from them. So when you compare distributors, judge them +partly by how much they give to free software development. Show +distributors they must compete to be the one who gives the most. + + To make this approach work, you must insist on numbers that you can +compare, such as, "We will donate ten dollars to the Frobnitz project +for each disk sold." Don't be satisfied with a vague promise, such as +"A portion of the profits are donated," since it doesn't give a basis +for comparison. + + Even a precise fraction "of the profits from this disk" is not very +meaningful, since creative accounting and unrelated business decisions +can greatly alter what fraction of the sales price counts as profit. If +the price you pay is $50, ten percent of the profit is probably less +than a dollar; it might be a few cents, or nothing at all. + + Some redistributors do development work themselves. This is useful +too; but to keep everyone honest, you need to inquire how much they do, +and what kind. Some kinds of development make much more long-term +difference than others. For example, maintaining a separate version of +a program contributes very little; maintaining the standard version of a +program for the whole community contributes much. Easy new ports +contribute little, since someone else would surely do them; difficult +ports such as adding a new CPU to the GNU Compiler Collection contribute +more; major new features or packages contribute the most. + + By establishing the idea that supporting further development is "the +proper thing to do" when distributing free software for a fee, we can +assure a steady flow of resources into making more free software. + + Copyright (C) 1994 Free Software Foundation, Inc. + Verbatim copying and redistribution of this section is permitted + without royalty; alteration is not permitted. + + +File: libgomp.info, Node: Library Index, Prev: Funding, Up: Top + +Library Index +************* + +[index] +* Menu: + +* acc_get_property: acc_get_property. (line 6) +* acc_get_property_string: acc_get_property. (line 6) +* Environment Variable: OMP_ALLOCATOR. (line 6) +* Environment Variable <1>: OMP_AFFINITY_FORMAT. (line 6) +* Environment Variable <2>: OMP_CANCELLATION. (line 6) +* Environment Variable <3>: OMP_DISPLAY_AFFINITY. (line 6) +* Environment Variable <4>: OMP_DISPLAY_ENV. (line 6) +* Environment Variable <5>: OMP_DEFAULT_DEVICE. (line 6) +* Environment Variable <6>: OMP_DYNAMIC. (line 6) +* Environment Variable <7>: OMP_MAX_ACTIVE_LEVELS. (line 6) +* Environment Variable <8>: OMP_MAX_TASK_PRIORITY. (line 6) +* Environment Variable <9>: OMP_NESTED. (line 6) +* Environment Variable <10>: OMP_NUM_TEAMS. (line 6) +* Environment Variable <11>: OMP_NUM_THREADS. (line 6) +* Environment Variable <12>: OMP_PROC_BIND. (line 6) +* Environment Variable <13>: OMP_PLACES. (line 6) +* Environment Variable <14>: OMP_STACKSIZE. (line 6) +* Environment Variable <15>: OMP_SCHEDULE. (line 6) +* Environment Variable <16>: OMP_TARGET_OFFLOAD. (line 6) +* Environment Variable <17>: OMP_TEAMS_THREAD_LIMIT. + (line 6) +* Environment Variable <18>: OMP_THREAD_LIMIT. (line 6) +* Environment Variable <19>: OMP_WAIT_POLICY. (line 6) +* Environment Variable <20>: GOMP_CPU_AFFINITY. (line 6) +* Environment Variable <21>: GOMP_DEBUG. (line 6) +* Environment Variable <22>: GOMP_STACKSIZE. (line 6) +* Environment Variable <23>: GOMP_SPINCOUNT. (line 6) +* Environment Variable <24>: GOMP_RTEMS_THREAD_POOLS. + (line 6) +* FDL, GNU Free Documentation License: GNU Free Documentation License. + (line 6) +* Implementation specific setting: OMP_NESTED. (line 6) +* Implementation specific setting <1>: OMP_NUM_THREADS. (line 6) +* Implementation specific setting <2>: OMP_SCHEDULE. (line 6) +* Implementation specific setting <3>: OMP_TARGET_OFFLOAD. (line 6) +* Implementation specific setting <4>: GOMP_STACKSIZE. (line 6) +* Implementation specific setting <5>: GOMP_SPINCOUNT. (line 6) +* Implementation specific setting <6>: GOMP_RTEMS_THREAD_POOLS. + (line 6) +* Implementation specific setting <7>: Implementation-defined ICV Initialization. + (line 6) +* Introduction: Top. (line 6) + + + +Tag Table: +Node: Top2083 +Node: Enabling OpenMP4900 +Node: OpenMP Implementation Status6081 +Node: OpenMP 4.56760 +Node: OpenMP 5.06936 +Node: OpenMP 5.111965 +Node: OpenMP 5.217100 +Ref: OpenMP 5.2-Footnote-120611 +Node: OpenMP 6.021012 +Node: Runtime Library Routines29803 +Node: Thread Team Routines30466 +Node: omp_set_num_threads32053 +Node: omp_get_num_threads32899 +Node: omp_get_max_threads33990 +Node: omp_get_thread_num34745 +Node: omp_in_parallel35614 +Node: omp_set_dynamic36264 +Node: omp_get_dynamic37131 +Node: omp_get_cancellation38006 +Node: omp_set_nested38800 +Node: omp_get_nested40119 +Node: omp_set_schedule41861 +Node: omp_get_schedule42940 +Node: omp_get_teams_thread_limit43888 +Node: omp_get_supported_active_levels44656 +Node: omp_set_max_active_levels45461 +Node: omp_get_max_active_levels46410 +Node: omp_get_level47133 +Node: omp_get_ancestor_thread_num47767 +Node: omp_get_team_size48689 +Node: omp_get_active_level49660 +Node: Thread Affinity Routines50352 +Node: omp_get_proc_bind50752 +Node: Teams Region Routines51724 +Node: omp_get_num_teams52432 +Node: omp_get_team_num52918 +Node: omp_set_num_teams53417 +Node: omp_get_max_teams54289 +Node: omp_set_teams_thread_limit54981 +Node: omp_get_thread_limit55986 +Node: Tasking Routines56586 +Node: omp_get_max_task_priority57097 +Node: omp_in_explicit_task57680 +Node: omp_in_final58570 +Node: Resource Relinquishing Routines59213 +Node: omp_pause_resource59685 +Node: omp_pause_resource_all60778 +Node: Device Information Routines61765 +Node: omp_get_num_procs62720 +Node: omp_set_default_device63241 +Node: omp_get_default_device64221 +Node: omp_get_num_devices65365 +Node: omp_get_device_num65995 +Node: omp_get_device_from_uid66821 +Node: omp_get_uid_from_device67989 +Node: omp_is_initial_device69168 +Node: omp_get_initial_device70063 +Node: Device Memory Routines70954 +Node: omp_target_alloc71994 +Node: omp_target_free73569 +Node: omp_target_is_present74757 +Node: omp_target_is_accessible76429 +Node: omp_target_memcpy78243 +Node: omp_target_memcpy_async80057 +Node: omp_target_memcpy_rect82521 +Node: omp_target_memcpy_rect_async85764 +Node: omp_target_associate_ptr89659 +Node: omp_target_disassociate_ptr92624 +Node: omp_get_mapped_ptr94377 +Node: Lock Routines95920 +Node: omp_init_lock96768 +Node: omp_init_nest_lock97393 +Node: omp_destroy_lock98115 +Node: omp_destroy_nest_lock98790 +Node: omp_set_lock99528 +Node: omp_set_nest_lock100386 +Node: omp_unset_lock101282 +Node: omp_unset_nest_lock102211 +Node: omp_test_lock103205 +Node: omp_test_nest_lock104183 +Node: Timing Routines105171 +Node: omp_get_wtick105548 +Node: omp_get_wtime106103 +Node: Event Routine106872 +Node: omp_fulfill_event107204 +Node: Interoperability Routines108196 +Node: omp_get_num_interop_properties109072 +Node: omp_get_interop_int110381 +Node: omp_get_interop_ptr112154 +Node: omp_get_interop_str113896 +Node: omp_get_interop_name115628 +Node: omp_get_interop_type_desc116934 +Node: omp_get_interop_rc_desc118657 +Node: Memory Management Routines119830 +Node: omp_init_allocator120758 +Node: omp_destroy_allocator122391 +Node: omp_set_default_allocator123375 +Node: omp_get_default_allocator124409 +Node: omp_alloc125350 +Node: omp_aligned_alloc127453 +Node: omp_free129983 +Node: omp_calloc131638 +Node: omp_aligned_calloc133857 +Node: omp_realloc136409 +Node: Environment Display Routine139795 +Node: omp_display_env140171 +Node: Environment Variables143006 +Node: OMP_ALLOCATOR145787 +Node: OMP_AFFINITY_FORMAT147382 +Node: OMP_CANCELLATION149990 +Node: OMP_DISPLAY_AFFINITY150590 +Node: OMP_DISPLAY_ENV151285 +Node: OMP_DEFAULT_DEVICE152135 +Node: OMP_DYNAMIC153143 +Node: OMP_MAX_ACTIVE_LEVELS153770 +Node: OMP_MAX_TASK_PRIORITY154795 +Node: OMP_NESTED155498 +Node: OMP_NUM_TEAMS156747 +Node: OMP_NUM_THREADS157456 +Node: OMP_PROC_BIND158472 +Node: OMP_PLACES159993 +Node: OMP_STACKSIZE162729 +Node: OMP_SCHEDULE163631 +Node: OMP_TARGET_OFFLOAD164378 +Node: OMP_TEAMS_THREAD_LIMIT165865 +Node: OMP_THREAD_LIMIT166718 +Node: OMP_WAIT_POLICY167378 +Node: GOMP_CPU_AFFINITY168070 +Node: GOMP_DEBUG169788 +Node: GOMP_STACKSIZE170290 +Node: GOMP_SPINCOUNT171121 +Node: GOMP_RTEMS_THREAD_POOLS172325 +Node: Enabling OpenACC174500 +Node: OpenACC Runtime Library Routines175322 +Node: acc_get_num_devices179603 +Node: acc_set_device_type180329 +Node: acc_get_device_type181093 +Node: acc_set_device_num182106 +Node: acc_get_device_num182923 +Node: acc_get_property183722 +Node: acc_async_test185934 +Node: acc_async_test_all186905 +Node: acc_wait187788 +Node: acc_wait_all188651 +Node: acc_wait_all_async189412 +Node: acc_wait_async190164 +Node: acc_init190872 +Node: acc_shutdown191517 +Node: acc_on_device192184 +Node: acc_malloc193374 +Node: acc_free194082 +Node: acc_copyin194726 +Node: acc_present_or_copyin196313 +Node: acc_create198081 +Node: acc_present_or_create199713 +Node: acc_copyout201489 +Node: acc_delete203793 +Node: acc_update_device206040 +Node: acc_update_self207614 +Node: acc_map_data209204 +Node: acc_unmap_data210276 +Node: acc_deviceptr211018 +Node: acc_hostptr211813 +Node: acc_is_present212597 +Node: acc_memcpy_to_device214124 +Node: acc_memcpy_from_device215559 +Node: acc_attach217044 +Node: acc_detach217711 +Node: acc_get_current_cuda_device218550 +Node: acc_get_current_cuda_context219135 +Node: acc_get_cuda_stream219735 +Node: acc_set_cuda_stream220326 +Node: acc_prof_register220997 +Node: acc_prof_unregister221556 +Node: acc_prof_lookup222123 +Node: acc_register_library222644 +Node: OpenACC Environment Variables223210 +Node: ACC_DEVICE_TYPE223699 +Node: ACC_DEVICE_NUM224226 +Node: ACC_PROFLIB224697 +Node: CUDA Streams Usage225303 +Ref: CUDA Streams Usage-Footnote-1227195 +Node: OpenACC Library Interoperability227304 +Ref: OpenACC Library Interoperability-Footnote-1233653 +Ref: OpenACC Library Interoperability-Footnote-2233905 +Node: OpenACC Profiling Interface234113 +Node: OpenMP-Implementation Specifics244111 +Node: Implementation-defined ICV Initialization244430 +Node: OpenMP Context Selectors245601 +Node: Memory allocation246880 +Node: Offload-Target Specifics256359 +Node: AMD Radeon256650 +Node: Foreign-runtime support for AMD GPUs260672 +Node: nvptx263607 +Ref: nvptx-Footnote-1268050 +Node: Foreign-runtime support for Nvidia GPUs268142 +Node: The libgomp ABI271872 +Node: Implementing MASTER construct272722 +Node: Implementing CRITICAL construct273139 +Node: Implementing ATOMIC construct273880 +Node: Implementing FLUSH construct274363 +Node: Implementing BARRIER construct274636 +Node: Implementing THREADPRIVATE construct274907 +Node: Implementing PRIVATE clause275562 +Node: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses276145 +Node: Implementing REDUCTION clause277471 +Node: Implementing PARALLEL construct278031 +Node: Implementing FOR construct279290 +Node: Implementing ORDERED construct281290 +Node: Implementing SECTIONS construct281598 +Node: Implementing SINGLE construct282366 +Node: Implementing OpenACC's PARALLEL construct283080 +Node: Reporting Bugs283340 +Node: Copying283703 +Node: GNU Free Documentation License321255 +Node: Funding346383 +Node: Library Index348909 + +End Tag Table diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/share/info/libquadmath.info b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/share/info/libquadmath.info new file mode 100644 index 0000000000000000000000000000000000000000..f2ca06db6d3d776de9ad0c968f896ec77ff87cc8 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/share/info/libquadmath.info @@ -0,0 +1,811 @@ +This is libquadmath.info, produced by makeinfo version 6.5 from +libquadmath.texi. + +Copyright (C) 2010-2025 Free Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.2 or any later version published by the Free Software + Foundation; with no Invariant Sections, with the Front-Cover Texts + being "A GNU Manual," and with the Back-Cover Texts as in (a) + below. A copy of the license is included in the section entitled + "GNU Free Documentation License." + + (a) The FSF's Back-Cover Text is: "You have the freedom to copy and + modify this GNU manual. +INFO-DIR-SECTION GNU Libraries +START-INFO-DIR-ENTRY +* libquadmath: (libquadmath). GCC Quad-Precision Math Library +END-INFO-DIR-ENTRY + + This manual documents the GCC Quad-Precision Math Library API. + + Published by the Free Software Foundation 51 Franklin Street, Fifth +Floor Boston, MA 02110-1301 USA + + Copyright (C) 2010-2025 Free Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.2 or any later version published by the Free Software + Foundation; with no Invariant Sections, with the Front-Cover Texts + being "A GNU Manual," and with the Back-Cover Texts as in (a) + below. A copy of the license is included in the section entitled + "GNU Free Documentation License." + + (a) The FSF's Back-Cover Text is: "You have the freedom to copy and + modify this GNU manual. + + +File: libquadmath.info, Node: Top, Next: Typedef and constants, Up: (dir) + +Introduction +************ + +This manual documents the usage of libquadmath, the GCC Quad-Precision +Math Library Application Programming Interface (API). + +* Menu: + +* Typedef and constants:: Defined data types and constants +* Math Library Routines:: The Libquadmath math runtime application + programming interface. +* I/O Library Routines:: The Libquadmath I/O runtime application + programming interface. +* GNU Free Documentation License:: + How you can copy and share this manual. +* Reporting Bugs:: How to report bugs in GCC Libquadmath. + + +File: libquadmath.info, Node: Typedef and constants, Next: Math Library Routines, Prev: Top, Up: Top + +1 Typedef and constants +*********************** + +The following data type has been defined via 'typedef'. + +'__complex128': '__float128'-based complex number + + The following macros are defined, which give the numeric limits of +the '__float128' data type. + +'FLT128_MAX': largest finite number +'FLT128_MIN': smallest positive number with full precision +'FLT128_EPSILON': difference between 1 and the next larger + representable number +'FLT128_DENORM_MIN': smallest positive denormalized number +'FLT128_MANT_DIG': number of digits in the mantissa (bit precision) +'FLT128_MIN_EXP': maximal negative exponent +'FLT128_MAX_EXP': maximal positive exponent +'FLT128_DIG': number of decimal digits in the mantissa +'FLT128_MIN_10_EXP': maximal negative decimal exponent +'FLT128_MAX_10_EXP': maximal positive decimal exponent + + The following mathematical constants of type '__float128' are +defined. + +'M_Eq': the constant e (Euler's number) +'M_LOG2Eq': base 2 logarithm of e +'M_LOG10Eq': decimal (base 10) logarithm of e +'M_LN2q': natural logarithm of 2 +'M_LN10q': natural logarithm of 10 +'M_PIq': pi +'M_PI_2q': pi divided by two +'M_PI_4q': pi divided by four +'M_1_PIq': one divided by pi +'M_2_PIq': two divided by pi +'M_2_SQRTPIq': two divided by square root of pi +'M_SQRT2q': square root of 2 +'M_SQRT1_2q': one divided by square root of 2 + + +File: libquadmath.info, Node: Math Library Routines, Next: I/O Library Routines, Prev: Typedef and constants, Up: Top + +2 Math Library Routines +*********************** + +The following mathematical functions are available: + +'acosq': arc cosine function +'acoshq': inverse hyperbolic cosine function +'asinq': arc sine function +'asinhq': inverse hyperbolic sine function +'atanq': arc tangent function +'atanhq': inverse hyperbolic tangent function +'atan2q': arc tangent function +'cbrtq': cube root function +'ceilq': ceiling value function +'copysignq': copy sign of a number +'coshq': hyperbolic cosine function +'cosq': cosine function +'erfq': error function +'erfcq': complementary error function +'exp2q': base 2 exponential function +'expq': exponential function +'expm1q': exponential minus 1 function +'fabsq': absolute value function +'fdimq': positive difference function +'finiteq': check finiteness of value +'floorq': floor value function +'fmaq': fused multiply and add +'fmaxq': determine maximum of two values +'fminq': determine minimum of two values +'fmodq': remainder value function +'frexpq': extract mantissa and exponent +'hypotq': Eucledian distance function +'ilogbq': get exponent of the value +'isinfq': check for infinity +'isnanq': check for not a number +'issignalingq': check for signaling not a number +'j0q': Bessel function of the first kind, first order +'j1q': Bessel function of the first kind, second order +'jnq': Bessel function of the first kind, N-th order +'ldexpq': load exponent of the value +'lgammaq': logarithmic gamma function +'llrintq': round to nearest integer value +'llroundq': round to nearest integer value away from zero +'logbq': get exponent of the value +'logq': natural logarithm function +'log10q': base 10 logarithm function +'log1pq': compute natural logarithm of the value plus one +'log2q': base 2 logarithm function +'lrintq': round to nearest integer value +'lroundq': round to nearest integer value away from zero +'modfq': decompose the floating-point number +'nanq': return quiet NaN +'nearbyintq': round to nearest integer +'nextafterq': next representable floating-point number +'powq': power function +'remainderq': remainder function +'remquoq': remainder and part of quotient +'rintq': round-to-nearest integral value +'roundq': round-to-nearest integral value, return '__float128' +'scalblnq': compute exponent using 'FLT_RADIX' +'scalbnq': compute exponent using 'FLT_RADIX' +'signbitq': return sign bit +'sincosq': calculate sine and cosine simultaneously +'sinhq': hyperbolic sine function +'sinq': sine function +'sqrtq': square root function +'tanq': tangent function +'tanhq': hyperbolic tangent function +'tgammaq': true gamma function +'truncq': round to integer, towards zero +'y0q': Bessel function of the second kind, first order +'y1q': Bessel function of the second kind, second order +'ynq': Bessel function of the second kind, N-th order +'cabsq' complex absolute value function +'cargq': calculate the argument +'cimagq' imaginary part of complex number +'crealq': real part of complex number +'cacoshq': complex arc hyperbolic cosine function +'cacosq': complex arc cosine function +'casinhq': complex arc hyperbolic sine function +'casinq': complex arc sine function +'catanhq': complex arc hyperbolic tangent function +'catanq': complex arc tangent function +'ccosq' complex cosine function: +'ccoshq': complex hyperbolic cosine function +'cexpq': complex exponential function +'cexpiq': computes the exponential function of "i" times a + real value +'clogq': complex natural logarithm +'clog10q': complex base 10 logarithm +'conjq': complex conjugate function +'cpowq': complex power function +'cprojq': project into Riemann Sphere +'csinq': complex sine function +'csinhq': complex hyperbolic sine function +'csqrtq': complex square root +'ctanq': complex tangent function +'ctanhq': complex hyperbolic tangent function + + +File: libquadmath.info, Node: I/O Library Routines, Next: GNU Free Documentation License, Prev: Math Library Routines, Up: Top + +3 I/O Library Routines +********************** + +* Menu: + +* 'strtoflt128': strtoflt128, Convert from string +* 'quadmath_snprintf': quadmath_snprintf, Convert to string + + +File: libquadmath.info, Node: strtoflt128, Next: quadmath_snprintf, Up: I/O Library Routines + +3.1 'strtoflt128' -- Convert from string +======================================== + +The function 'strtoflt128' converts a string into a '__float128' number. + +Syntax + '__float128 strtoflt128 (const char *s, char **sp)' + +_Arguments_: + S input string + SP the address of the next character in the string + + The argument SP contains, if not 'NULL', the address of the next + character following the parts of the string, which have been read. + +Example + #include + + int main () + { + __float128 r; + + r = strtoflt128 ("1.2345678", NULL); + + return 0; + } + + +File: libquadmath.info, Node: quadmath_snprintf, Prev: strtoflt128, Up: I/O Library Routines + +3.2 'quadmath_snprintf' -- Convert to string +============================================ + +The function 'quadmath_snprintf' converts a '__float128' floating-point +number into a string. It is a specialized alternative to 'snprintf', +where the format string is restricted to a single conversion specifier +with 'Q' modifier and conversion specifier 'e', 'E', 'f', 'F', 'g', 'G', +'a' or 'A', with no extra characters before or after the conversion +specifier. The '%m$' or '*m$' style must not be used in the format. + +Syntax + 'int quadmath_snprintf (char *s, size_t size, const char *format, + ...)' + +_Arguments_: + S output string + SIZE byte size of the string, including trailing NUL + FORMAT conversion specifier string + +Note + On some targets when supported by the C library hooks are installed + for 'printf' family of functions, so that 'printf ("%Qe", 1.2Q);' + etc. works too. + +Example + #include + #include + #include + + int main () + { + __float128 r; + int prec = 20; + int width = 46; + char buf[128]; + + r = 2.0q; + r = sqrtq (r); + int n = quadmath_snprintf (buf, sizeof buf, "%+-#*.20Qe", width, r); + if ((size_t) n < sizeof buf) + printf ("%s\n", buf); + /* Prints: +1.41421356237309504880e+00 */ + quadmath_snprintf (buf, sizeof buf, "%Qa", r); + if ((size_t) n < sizeof buf) + printf ("%s\n", buf); + /* Prints: 0x1.6a09e667f3bcc908b2fb1366ea96p+0 */ + n = quadmath_snprintf (NULL, 0, "%+-#46.*Qe", prec, r); + if (n > -1) + { + char *str = malloc (n + 1); + if (str) + { + quadmath_snprintf (str, n + 1, "%+-#46.*Qe", prec, r); + printf ("%s\n", str); + /* Prints: +1.41421356237309504880e+00 */ + } + free (str); + } + return 0; + } + + +File: libquadmath.info, Node: GNU Free Documentation License, Next: Reporting Bugs, Prev: I/O Library Routines, Up: Top + +GNU Free Documentation License +****************************** + + Version 1.3, 3 November 2008 + + Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + functional and useful document "free" in the sense of freedom: to + assure everyone the effective freedom to copy and redistribute it, + with or without modifying it, either commercially or + noncommercially. Secondarily, this License preserves for the + author and publisher a way to get credit for their work, while not + being considered responsible for modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. We + recommend this License principally for works whose purpose is + instruction or reference. + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work, in any medium, + that contains a notice placed by the copyright holder saying it can + be distributed under the terms of this License. Such a notice + grants a world-wide, royalty-free license, unlimited in duration, + to use that work under the conditions stated herein. The + "Document", below, refers to any such manual or work. Any member + of the public is a licensee, and is addressed as "you". You accept + the license if you copy, modify or distribute the work in a way + requiring permission under copyright law. + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter section + of the Document that deals exclusively with the relationship of the + publishers or authors of the Document to the Document's overall + subject (or to related matters) and contains nothing that could + fall directly within that overall subject. (Thus, if the Document + is in part a textbook of mathematics, a Secondary Section may not + explain any mathematics.) The relationship could be a matter of + historical connection with the subject or with related matters, or + of legal, commercial, philosophical, ethical or political position + regarding them. + + The "Invariant Sections" are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in the + notice that says that the Document is released under this License. + If a section does not fit the above definition of Secondary then it + is not allowed to be designated as Invariant. The Document may + contain zero Invariant Sections. If the Document does not identify + any Invariant Sections then there are none. + + The "Cover Texts" are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. A + Front-Cover Text may be at most 5 words, and a Back-Cover Text may + be at most 25 words. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, that is suitable for revising the document + straightforwardly with generic text editors or (for images composed + of pixels) generic paint programs or (for drawings) some widely + available drawing editor, and that is suitable for input to text + formatters or for automatic translation to a variety of formats + suitable for input to text formatters. A copy made in an otherwise + Transparent file format whose markup, or absence of markup, has + been arranged to thwart or discourage subsequent modification by + readers is not Transparent. An image format is not Transparent if + used for any substantial amount of text. A copy that is not + "Transparent" is called "Opaque". + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and standard-conforming + simple HTML, PostScript or PDF designed for human modification. + Examples of transparent image formats include PNG, XCF and JPG. + Opaque formats include proprietary formats that can be read and + edited only by proprietary word processors, SGML or XML for which + the DTD and/or processing tools are not generally available, and + the machine-generated HTML, PostScript or PDF produced by some word + processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. + + The "publisher" means any person or entity that distributes copies + of the Document to the public. + + A section "Entitled XYZ" means a named subunit of the Document + whose title either is precisely XYZ or contains XYZ in parentheses + following text that translates XYZ in another language. (Here XYZ + stands for a specific section name mentioned below, such as + "Acknowledgements", "Dedications", "Endorsements", or "History".) + To "Preserve the Title" of such a section when you modify the + Document means that it remains a section "Entitled XYZ" according + to this definition. + + The Document may include Warranty Disclaimers next to the notice + which states that this License applies to the Document. These + Warranty Disclaimers are considered to be included by reference in + this License, but only as regards disclaiming warranties: any other + implication that these Warranty Disclaimers may have is void and + has no effect on the meaning of this License. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow the + conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies (or copies in media that commonly + have printed covers) of the Document, numbering more than 100, and + the Document's license notice requires Cover Texts, you must + enclose the copies in covers that carry, clearly and legibly, all + these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the title + equally prominent and visible. You may add other material on the + covers in addition. Copying with changes limited to the covers, as + long as they preserve the title of the Document and satisfy these + conditions, can be treated as verbatim copying in other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a machine-readable + Transparent copy along with each Opaque copy, or state in or with + each Opaque copy a computer-network location from which the general + network-using public has access to download using public-standard + network protocols a complete Transparent copy of the Document, free + of added material. If you use the latter option, you must take + reasonably prudent steps, when you begin distribution of Opaque + copies in quantity, to ensure that this Transparent copy will + remain thus accessible at the stated location until at least one + year after the last time you distribute an Opaque copy (directly or + through your agents or retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of copies, + to give them a chance to provide you with an updated version of the + Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with the + Modified Version filling the role of the Document, thus licensing + distribution and modification of the Modified Version to whoever + possesses a copy of it. In addition, you must do these things in + the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of previous + versions (which should, if there were any, be listed in the + History section of the Document). You may use the same title + as a previous version if the original publisher of that + version gives permission. + + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in + the Modified Version, together with at least five of the + principal authors of the Document (all of its principal + authors, if it has fewer than five), unless they release you + from this requirement. + + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + + D. Preserve all the copyright notices of the Document. + + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified + Version under the terms of this License, in the form shown in + the Addendum below. + + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + + H. Include an unaltered copy of this License. + + I. Preserve the section Entitled "History", Preserve its Title, + and add to it an item stating at least the title, year, new + authors, and publisher of the Modified Version as given on the + Title Page. If there is no section Entitled "History" in the + Document, create one stating the title, year, authors, and + publisher of the Document as given on its Title Page, then add + an item describing the Modified Version as stated in the + previous sentence. + + J. Preserve the network location, if any, given in the Document + for public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in the + "History" section. You may omit a network location for a work + that was published at least four years before the Document + itself, or if the original publisher of the version it refers + to gives permission. + + K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section + all the substance and tone of each of the contributor + acknowledgements and/or dedications given therein. + + L. Preserve all the Invariant Sections of the Document, unaltered + in their text and in their titles. Section numbers or the + equivalent are not considered part of the section titles. + + M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. + + N. Do not retitle any existing section to be Entitled + "Endorsements" or to conflict in title with any Invariant + Section. + + O. Preserve any Warranty Disclaimers. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option designate + some or all of these sections as invariant. To do this, add their + titles to the list of Invariant Sections in the Modified Version's + license notice. These titles must be distinct from any other + section titles. + + You may add a section Entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties--for example, statements of peer review or that the text + has been approved by an organization as the authoritative + definition of a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end of + the list of Cover Texts in the Modified Version. Only one passage + of Front-Cover Text and one of Back-Cover Text may be added by (or + through arrangements made by) any one entity. If the Document + already includes a cover text for the same cover, previously added + by you or by arrangement made by the same entity you are acting on + behalf of, you may not add another; but you may replace the old + one, on explicit permission from the previous publisher that added + the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination all + of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice, and that you preserve all + their Warranty Disclaimers. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections Entitled + "History" in the various original documents, forming one section + Entitled "History"; likewise combine any sections Entitled + "Acknowledgements", and any sections Entitled "Dedications". You + must delete all sections Entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the documents + in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow this + License in all other respects regarding verbatim copying of that + document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of a + storage or distribution medium, is called an "aggregate" if the + copyright resulting from the compilation is not used to limit the + legal rights of the compilation's users beyond what the individual + works permit. When the Document is included in an aggregate, this + License does not apply to the other works in the aggregate which + are not themselves derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one half + of the entire aggregate, the Document's Cover Texts may be placed + on covers that bracket the Document within the aggregate, or the + electronic equivalent of covers if the Document is in electronic + form. Otherwise they must appear on printed covers that bracket + the whole aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License, and all the license notices in the + Document, and any Warranty Disclaimers, provided that you also + include the original English version of this License and the + original versions of those notices and disclaimers. In case of a + disagreement between the translation and the original version of + this License or a notice or disclaimer, the original version will + prevail. + + If a section in the Document is Entitled "Acknowledgements", + "Dedications", or "History", the requirement (section 4) to + Preserve its Title (section 1) will typically require changing the + actual title. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense, or distribute it is void, + and will automatically terminate your rights under this License. + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly and + finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from + that copyright holder, and you cure the violation prior to 30 days + after your receipt of the notice. + + Termination of your rights under this section does not terminate + the licenses of parties who have received copies or rights from you + under this License. If your rights have been terminated and not + permanently reinstated, receipt of a copy of some or all of the + same material does not give you any rights to use it. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + . + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If the + Document does not specify a version number of this License, you may + choose any version ever published (not as a draft) by the Free + Software Foundation. If the Document specifies that a proxy can + decide which future versions of this License can be used, that + proxy's public statement of acceptance of a version permanently + authorizes you to choose that version for the Document. + + 11. RELICENSING + + "Massive Multiauthor Collaboration Site" (or "MMC Site") means any + World Wide Web server that publishes copyrightable works and also + provides prominent facilities for anybody to edit those works. A + public wiki that anybody can edit is an example of such a server. + A "Massive Multiauthor Collaboration" (or "MMC") contained in the + site means any set of copyrightable works thus published on the MMC + site. + + "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 + license published by Creative Commons Corporation, a not-for-profit + corporation with a principal place of business in San Francisco, + California, as well as future copyleft versions of that license + published by that same organization. + + "Incorporate" means to publish or republish a Document, in whole or + in part, as part of another Document. + + An MMC is "eligible for relicensing" if it is licensed under this + License, and if all works that were first published under this + License somewhere other than this MMC, and subsequently + incorporated in whole or in part into the MMC, (1) had no cover + texts or invariant sections, and (2) were thus incorporated prior + to November 1, 2008. + + The operator of an MMC Site may republish an MMC contained in the + site under CC-BY-SA on the same site at any time before August 1, + 2009, provided the MMC is eligible for relicensing. + +ADDENDUM: How to use this License for your documents +==================================================== + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. + + If you have Invariant Sections, Front-Cover Texts and Back-Cover +Texts, replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with + the Front-Cover Texts being LIST, and with the Back-Cover Texts + being LIST. + + If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of free +software license, such as the GNU General Public License, to permit +their use in free software. + + +File: libquadmath.info, Node: Reporting Bugs, Prev: GNU Free Documentation License, Up: Top + +4 Reporting Bugs +**************** + +Bugs in the GCC Quad-Precision Math Library implementation should be +reported via . + + + +Tag Table: +Node: Top1633 +Node: Typedef and constants2367 +Node: Math Library Routines3808 +Node: I/O Library Routines7645 +Node: strtoflt1287970 +Node: quadmath_snprintf8730 +Node: GNU Free Documentation License10941 +Node: Reporting Bugs36093 + +End Tag Table diff --git a/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION new file mode 100644 index 0000000000000000000000000000000000000000..e1b3c69c179dfaff5744ea4bf853e6b0d90c9ef9 --- /dev/null +++ b/miniconda3/pkgs/libgcc-15.2.0-h69a1729_7/share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION @@ -0,0 +1,73 @@ +GCC RUNTIME LIBRARY EXCEPTION + +Version 3.1, 31 March 2009 + +Copyright (C) 2009 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +This GCC Runtime Library Exception ("Exception") is an additional +permission under section 7 of the GNU General Public License, version +3 ("GPLv3"). It applies to a given file (the "Runtime Library") that +bears a notice placed by the copyright holder of the file stating that +the file is governed by GPLv3 along with this Exception. + +When you use GCC to compile a program, GCC may combine portions of +certain GCC header files and runtime libraries with the compiled +program. The purpose of this Exception is to allow compilation of +non-GPL (including proprietary) programs to use, in this way, the +header files and runtime libraries covered by this Exception. + +0. Definitions. + +A file is an "Independent Module" if it either requires the Runtime +Library for execution after a Compilation Process, or makes use of an +interface provided by the Runtime Library, but is not otherwise based +on the Runtime Library. + +"GCC" means a version of the GNU Compiler Collection, with or without +modifications, governed by version 3 (or a specified later version) of +the GNU General Public License (GPL) with the option of using any +subsequent versions published by the FSF. + +"GPL-compatible Software" is software whose conditions of propagation, +modification and use would permit combination with GCC in accord with +the license of GCC. + +"Target Code" refers to output from any compiler for a real or virtual +target processor architecture, in executable form or suitable for +input to an assembler, loader, linker and/or execution +phase. Notwithstanding that, Target Code does not include data in any +format that is used as a compiler intermediate representation, or used +for producing a compiler intermediate representation. + +The "Compilation Process" transforms code entirely represented in +non-intermediate languages designed for human-written code, and/or in +Java Virtual Machine byte code, into Target Code. Thus, for example, +use of source code generators and preprocessors need not be considered +part of the Compilation Process, since the Compilation Process can be +understood as starting with the output of the generators or +preprocessors. + +A Compilation Process is "Eligible" if it is done using GCC, alone or +with other GPL-compatible software, or if it is done without using any +work based on GCC. For example, using non-GPL-compatible Software to +optimize any GCC intermediate representations would not qualify as an +Eligible Compilation Process. + +1. Grant of Additional Permission. + +You have permission to propagate a work of Target Code formed by +combining the Runtime Library with Independent Modules, even if such +propagation would otherwise violate the terms of GPLv3, provided that +all Target Code was generated by Eligible Compilation Processes. You +may then convey such a combination under terms of your choice, +consistent with the licensing of the Independent Modules. + +2. No Weakening of GCC Copyleft. + +The availability of this Exception does not imply any general +presumption that third-party software is unaffected by the copyleft +requirements of the license of GCC. + diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/about.json b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..123d403a6b172e178c760e7f389ec6029fc4e193 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/about.json @@ -0,0 +1,164 @@ +{ + "channels": [ + "https://repo.anaconda.com/pkgs/main", + "https://repo.anaconda.com/pkgs/r", + "https://repo.anaconda.com/pkgs/r" + ], + "conda_build_version": "25.1.2", + "conda_version": "25.1.1", + "env_vars": { + "CIO_TEST": "" + }, + "extra": { + "copy_test_source_files": true, + "feedstock-name": "ctng-compilers-feedstock", + "final": true, + "parent_recipe": { + "name": "gcc_compilers", + "path": "/home/task_176276935360828/ctng-compilers-feedstock/recipe", + "version": "15.2.0" + }, + "recipe-maintainers": [ + "timsnyder", + "xhochy", + "isuruf", + "beckermr" + ] + }, + "home": "https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html", + "identifiers": [], + "keywords": [], + "license": "GPL-3.0-only WITH GCC-exception-3.1", + "root_pkgs": [ + "_libgcc_mutex 0.1 main", + "ca-certificates 2025.9.9 h06a4308_0", + "ld_impl_linux-64 2.40 h12ee557_0", + "libstdcxx-ng 11.2.0 h1234567_1", + "nlohmann_json 3.11.2 h6a678d5_0", + "pybind11-abi 5 hd3eb1b0_0", + "tzdata 2025a h04d1e81_0", + "libgomp 11.2.0 h1234567_1", + "_openmp_mutex 5.1 1_gnu", + "libgcc-ng 11.2.0 h1234567_1", + "bzip2 1.0.8 h5eee18b_6", + "c-ares 1.19.1 h5eee18b_0", + "cpp-expected 1.1.0 hdb19cb5_0", + "expat 2.6.4 h6a678d5_0", + "fmt 9.1.0 hdb19cb5_1", + "icu 73.1 h6a678d5_0", + "libev 4.33 h7f8727e_1", + "libffi 3.4.4 h6a678d5_1", + "libuuid 1.41.5 h5eee18b_0", + "lz4-c 1.9.4 h6a678d5_1", + "ncurses 6.4 h6a678d5_0", + "liblief 0.12.3 h6a678d5_0", + "reproc 14.2.4 h6a678d5_2", + "simdjson 3.10.1 hdb19cb5_0", + "xz 5.4.6 h5eee18b_1", + "yaml-cpp 0.8.0 h6a678d5_1", + "zlib 1.2.13 h5eee18b_1", + "libedit 3.1.20230828 h5eee18b_0", + "libnghttp2 1.57.0 h2d74bed_0", + "libssh2 1.11.1 h251f7ec_0", + "libxml2 2.13.5 hfdd30dd_0", + "pcre2 10.42 hebb0a14_1", + "readline 8.2 h5eee18b_0", + "reproc-cpp 14.2.4 h6a678d5_2", + "spdlog 1.11.0 hdb19cb5_0", + "tk 8.6.14 h39e8969_0", + "zstd 1.5.6 hc292b87_0", + "krb5 1.20.1 h143b758_1", + "libarchive 3.7.7 hfab0078_0", + "libsolv 0.7.30 he621ea3_1", + "sqlite 3.45.3 h5eee18b_0", + "libcurl 8.11.1 hc9e6f67_0", + "python 3.12.9 h5148396_0", + "libmamba 2.0.5 haf1ee3a_1", + "menuinst 2.2.0 py312h06a4308_1", + "anaconda-anon-usage 0.5.0 py312hfc0e8ea_100", + "annotated-types 0.6.0 py312h06a4308_0", + "archspec 0.2.3 pyhd3eb1b0_0", + "boltons 24.1.0 py312h06a4308_0", + "brotli-python 1.0.9 py312h6a678d5_9", + "charset-normalizer 3.3.2 pyhd3eb1b0_0", + "distro 1.9.0 py312h06a4308_0", + "frozendict 2.4.2 py312h06a4308_0", + "idna 3.7 py312h06a4308_0", + "jsonpointer 2.1 pyhd3eb1b0_0", + "libmambapy 2.0.5 py312hdb19cb5_1", + "mdurl 0.1.0 py312h06a4308_0", + "packaging 24.2 py312h06a4308_0", + "platformdirs 3.10.0 py312h06a4308_0", + "pluggy 1.5.0 py312h06a4308_0", + "pycosat 0.6.6 py312h5eee18b_2", + "pycparser 2.21 pyhd3eb1b0_0", + "pygments 2.15.1 py312h06a4308_1", + "pysocks 1.7.1 py312h06a4308_0", + "ruamel.yaml.clib 0.2.8 py312h5eee18b_0", + "setuptools 75.8.0 py312h06a4308_0", + "tqdm 4.67.1 py312he106c6f_0", + "truststore 0.10.0 py312h06a4308_0", + "typing_extensions 4.12.2 py312h06a4308_0", + "wheel 0.45.1 py312h06a4308_0", + "cffi 1.17.1 py312h1fdaa30_1", + "jsonpatch 1.33 py312h06a4308_1", + "markdown-it-py 2.2.0 py312h06a4308_1", + "pip 25.0 py312h06a4308_0", + "ruamel.yaml 0.18.6 py312h5eee18b_0", + "typing-extensions 4.12.2 py312h06a4308_0", + "urllib3 2.3.0 py312h06a4308_0", + "cryptography 43.0.3 py312h7825ff9_1", + "pydantic-core 2.27.1 py312h4aa5aa6_0", + "requests 2.32.3 py312h06a4308_1", + "rich 13.9.4 py312h06a4308_0", + "zstandard 0.23.0 py312h2c38b39_1", + "conda-content-trust 0.2.0 py312h06a4308_1", + "conda-package-streaming 0.11.0 py312h06a4308_0", + "pydantic 2.10.3 py312h06a4308_0", + "conda-package-handling 2.4.0 py312h06a4308_0", + "conda 25.1.1 py312h06a4308_0", + "conda-anaconda-tos 0.1.2 py312h06a4308_0", + "conda-libmamba-solver 25.1.1 pyhd3eb1b0_0", + "libsodium 1.0.20 heac8642_0", + "openssl 3.0.18 hd6dcaed_0", + "patch 2.8 hb25bd0a_0", + "patchelf 0.17.2 h6a678d5_0", + "yaml 0.2.5 h7b6447c_0", + "argcomplete 3.6.2 py312h06a4308_0", + "attrs 24.3.0 py312h06a4308_0", + "certifi 2025.8.3 py312h06a4308_0", + "chardet 5.2.0 py312h06a4308_0", + "click 8.2.1 py312h06a4308_0", + "filelock 3.17.0 py312h06a4308_0", + "jmespath 1.0.1 py312h06a4308_0", + "markupsafe 3.0.2 py312h5eee18b_0", + "more-itertools 10.3.0 py312h06a4308_0", + "pkginfo 1.12.0 py312h06a4308_0", + "psutil 7.0.0 py312hee96239_0", + "py-lief 0.12.3 py312h6a678d5_0", + "python-libarchive-c 5.1 pyhd3eb1b0_0", + "pytz 2025.2 py312h06a4308_0", + "pyyaml 6.0.2 py312h5eee18b_0", + "rpds-py 0.22.3 py312h4aa5aa6_0", + "six 1.17.0 py312h06a4308_0", + "soupsieve 2.5 py312h06a4308_0", + "tomlkit 0.13.2 py312h06a4308_0", + "xmltodict 0.14.2 py312h06a4308_0", + "jinja2 3.1.6 py312h06a4308_0", + "python-dateutil 2.9.0post0 py312h06a4308_2", + "referencing 0.30.2 py312h06a4308_0", + "yq 3.4.3 py312h06a4308_0", + "beautifulsoup4 4.13.5 py312h06a4308_0", + "botocore 1.37.10 py312h06a4308_0", + "jsonschema-specifications 2023.7.1 py312h06a4308_0", + "pynacl 1.5.0 py312h2630517_2", + "jsonschema 4.25.0 py312h06a4308_0", + "s3transfer 0.11.2 py312h06a4308_0", + "boto3 1.37.10 py312h06a4308_0", + "conda-anaconda-telemetry 0.3.0 pyhd3eb1b0_1", + "conda-index 0.5.0 py312h06a4308_0", + "conda-build 25.1.2 py312h06a4308_0" + ], + "summary": "The GCC low-level runtime library", + "tags": [] +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/files b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/files new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/git b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/git new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/hash_input.json b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..9231b75e2e766ff88697fd23fbcbc924a27dceda --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/hash_input.json @@ -0,0 +1,5 @@ +{ + "cross_target_platform": "linux-64", + "target_platform": "linux-64", + "channel_targets": "defaults" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/index.json b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..3e4ba74119e6f3e0a6fd46e8d3c750f8adb6dba3 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/index.json @@ -0,0 +1,14 @@ +{ + "arch": "x86_64", + "build": "h166f726_7", + "build_number": 7, + "depends": [ + "libgcc 15.2.0 h69a1729_7" + ], + "license": "GPL-3.0-only WITH GCC-exception-3.1", + "name": "libgcc-ng", + "platform": "linux", + "subdir": "linux-64", + "timestamp": 1762772577850, + "version": "15.2.0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/paths.json b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..03d81a3201aeefb71167ac453cd6d8c33bec10b9 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/paths.json @@ -0,0 +1,4 @@ +{ + "paths": [], + "paths_version": 1 +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/conda_build_config.yaml b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6de73da57e6bc8ce414772f2c7a838d2e377b584 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/conda_build_config.yaml @@ -0,0 +1,42 @@ +binutils_version: '2.44' +c_compiler: gcc +c_stdlib: sysroot +c_stdlib_version: '2.28' +channel_sources: conda-forge/label/sysroot-with-crypt,conda-forge +channel_targets: defaults +cpu_optimization_target: nocona +cran_mirror: https://cran.r-project.org +cross_target_platform: linux-64 +cross_target_stdlib: sysroot +cross_target_stdlib_version: '2.28' +cxx_compiler: gxx +extend_keys: +- extend_keys +- ignore_version +- pin_run_as_build +- ignore_build_only_deps +fortran_compiler: gfortran +gcc_maj_ver: '15' +gcc_version: 15.2.0 +ignore_build_only_deps: +- python +- numpy +libgfortran_soname: '5' +libgomp_ver: 1.0.0 +lua: '5' +numpy: '1.26' +openmp_ver: '4.5' +perl: 5.26.2 +pin_run_as_build: + python: + max_pin: x.x + min_pin: x.x + r-base: + max_pin: x.x + min_pin: x.x +platform: linux-64 +python: '3.12' +r_base: '3.5' +target_platform: linux-64 +triplet: x86_64-conda-linux-gnu +with_conda_specs: 'true' diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/meta.yaml b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2fd2b6c7ec5c7636f67b52a3e846e47b7017df73 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/meta.yaml @@ -0,0 +1,43 @@ +# This file created by conda-build 25.1.2 +# ------------------------------------------------ + +package: + name: libgcc-ng + version: 15.2.0 +source: + - patches: + - patches/0001-allow-commands-in-main-specfile.patch + - patches/0002-patch-zoneinfo_dir_override-to-point-to-our-tzdata.patch + - patches/0003-add-ldl-to-libstdc___la_LDFLAGS.patch + - patches/0004-Hardcode-HAVE_ALIGNED_ALLOC-1-in-libstdc-v3-configur.patch + sha256: 7294d65cc1a0558cb815af0ca8c7763d86f7a31199794ede3f630c0d1b0a5723 + url: + - https://ftp.gnu.org/gnu/gcc/gcc-15.2.0/gcc-15.2.0.tar.gz + - https://mirrors.ocf.berkeley.edu/gnu/gcc/gcc-15.2.0/gcc-15.2.0.tar.gz +build: + number: 7 + run_exports: + strong: + - libgcc + string: h166f726_7 +requirements: + host: + - libgcc 15.2.0 h69a1729_7 + run: + - libgcc 15.2.0 h69a1729_7 +test: + commands: + - echo "empty wrapper for compatibility with previous naming" +about: + home: https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html + license: GPL-3.0-only WITH GCC-exception-3.1 + summary: The GCC low-level runtime library +extra: + copy_test_source_files: true + feedstock-name: ctng-compilers-feedstock + final: true + recipe-maintainers: + - beckermr + - isuruf + - timsnyder + - xhochy diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/LICENSE b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..cba42cffc2901212c539e558950c6f6ed985d628 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/LICENSE @@ -0,0 +1,13 @@ +BSD 3-clause license +Copyright (c) 2015-2019, conda-forge +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/build.sh b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..68e45267b8eceabd79595abe9d20ddbc89939d23 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/build.sh @@ -0,0 +1,120 @@ +#!/bin/bash + +set -ex + +source ${RECIPE_DIR}/setup_compiler.sh + +# ensure patch is applied +grep 'conda-forge:: allow' gcc/gcc.c* + +GCC_CONFIGURE_OPTIONS=() + +if [[ "$channel_targets" == *conda-forge* ]]; then + GCC_CONFIGURE_OPTIONS+=(--with-pkgversion="conda-forge gcc ${gcc_version}-${PKG_BUILDNUM}") + GCC_CONFIGURE_OPTIONS+=(--with-bugurl="https://github.com/conda-forge/ctng-compilers-feedstock/issues/new/choose") +fi + +for tool in addr2line ar as c++filt cc c++ fc gcc g++ gfortran ld nm objcopy objdump ranlib readelf size strings strip; do + tool_upper=$(echo $tool | tr a-z-+ A-Z_X) + if [[ "$tool" == "cc" ]]; then + tool=gcc + elif [[ "$tool" == "fc" ]]; then + tool=gfortran + elif [[ "$tool" == "c++" ]]; then + tool=g++ + elif [[ "$target_platform" != "$build_platform" && "$tool" =~ ^(ar|nm|ranlib)$ ]]; then + tool="gcc-${tool}" + fi + eval "export ${tool_upper}_FOR_BUILD=\$BUILD_PREFIX/bin/\$BUILD-\$tool" + eval "export ${tool_upper}=\$BUILD_PREFIX/bin/\$HOST-\$tool" + eval "export ${tool_upper}_FOR_TARGET=\$BUILD_PREFIX/bin/\$TARGET-\$tool" +done + +if [[ "$cross_target_platform" == "win-64" ]]; then + # do not expect ${prefix}/mingw symlink - this should be superceded by + # 0005-Windows-Don-t-ignore-native-system-header-dir.patch .. but isn't! + sed -i 's#${prefix}/mingw/#${prefix}/${target}/sysroot/usr/#g' configure + if [[ "$gcc_maj_ver" == "13" || "$gcc_maj_ver" == "14" ]]; then + sed -i "s#/mingw/#/usr/#g" gcc/config/i386/mingw32.h + else + sed -i "s#/mingw/#/usr/#g" gcc/config/mingw/mingw32.h + fi +else + # prevent mingw patches from being archived in linux conda packages + rm -rf ${RECIPE_DIR}/patches/mingw +fi + +NATIVE_SYSTEM_HEADER_DIR=/usr/include +SYSROOT_DIR=${PREFIX}/${TARGET}/sysroot + +# workaround a bug in gcc build files when using external binutils +# and build != host == target +export gcc_cv_objdump=$OBJDUMP_FOR_TARGET + +ls $BUILD_PREFIX/bin/ + +./contrib/download_prerequisites + +# We want CONDA_PREFIX/usr/lib not CONDA_PREFIX/usr/lib64 and this +# is the only way. It is incompatible with multilib (obviously). +TINFO_FILES=$(find . -path "*/config/*/t-*") +for TINFO_FILE in ${TINFO_FILES}; do + echo TINFO_FILE ${TINFO_FILE} + sed -i.bak 's#^\(MULTILIB_OSDIRNAMES.*\)\(lib64\)#\1lib#g' ${TINFO_FILE} + rm -f ${TINFO_FILE}.bak + sed -i.bak 's#^\(MULTILIB_OSDIRNAMES.*\)\(libx32\)#\1lib#g' ${TINFO_FILE} + rm -f ${TINFO_FILE}.bak +done + +# workaround for https://gcc.gnu.org/bugzilla//show_bug.cgi?id=80196 +if [[ "$gcc_version" == "11."* && "$build_platform" != "$target_platform" ]]; then + sed -i.bak 's@-I$glibcxx_srcdir/libsupc++@-I$glibcxx_srcdir/libsupc++ -nostdinc++@g' libstdc++-v3/configure +fi + +mkdir -p build +cd build + +# We need to explicitly set the gxx include dir because previously +# with ct-ng, native build was not considered native because +# BUILD=HOST=x86_64-build_unknown-linux-gnu and TARGET=x86_64-conda-linux-gnu +# Depending on native or not, the include dir changes. Setting it explictly +# goes back to the original way. +# See https://github.com/gcc-mirror/gcc/blob/16e2427f50c208dfe07d07f18009969502c25dc8/gcc/configure.ac#L218 + +if [[ "$TARGET" == *linux* ]]; then + GCC_CONFIGURE_OPTIONS+=(--enable-libsanitizer) + GCC_CONFIGURE_OPTIONS+=(--enable-default-pie) + GCC_CONFIGURE_OPTIONS+=(--enable-threads=posix) +fi + +../configure \ + --prefix="$PREFIX" \ + --with-slibdir="$PREFIX/lib" \ + --libdir="$PREFIX/lib" \ + --mandir="$PREFIX/man" \ + --build=$BUILD \ + --host=$HOST \ + --target=$TARGET \ + --enable-languages=c,c++,fortran,objc,obj-c++ \ + --enable-__cxa_atexit \ + --disable-libmudflap \ + --enable-libgomp \ + --disable-libssp \ + --enable-libquadmath \ + --enable-libquadmath-support \ + --enable-lto \ + --enable-target-optspace \ + --enable-plugin \ + --enable-gold \ + --disable-nls \ + --disable-multilib \ + --enable-long-long \ + --with-sysroot=${SYSROOT_DIR} \ + --with-build-sysroot=${BUILD_PREFIX}/${TARGET}/sysroot \ + --with-native-system-header-dir=${NATIVE_SYSTEM_HEADER_DIR} \ + --with-gxx-include-dir="${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/include/c++" \ + "${GCC_CONFIGURE_OPTIONS[@]}" + +# Setting the CPU_COUNT=1 lets you see which job failed! +#CPU_COUNT=1 +make -j${CPU_COUNT} diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/c11threads.c b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/c11threads.c new file mode 100644 index 0000000000000000000000000000000000000000..1d0b34c8662f7eca07c573c32eadbdf35a8427e3 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/c11threads.c @@ -0,0 +1,6 @@ +#include +int main() { + mtx_t mutex; + mtx_init(&mutex, mtx_plain); +} + diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/conda_build_config.yaml b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2066b6abe52a8e832f676e8c49dd5a847678ae63 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/conda_build_config.yaml @@ -0,0 +1,49 @@ +triplet: + - x86_64-conda-linux-gnu # [linux and x86_64] + - powerpc64le-conda-linux-gnu # [ppc64le] + - aarch64-conda-linux-gnu # [linux and aarch64] + - x86_64-w64-mingw32 # [win] +gcc_version: + - 15.2.0 # [not ANACONDA_ROCKET_ENABLE_GCC13 and not ANACONDA_ROCKET_ENABLE_GCC14] + - 14.3.0 # [ANACONDA_ROCKET_ENABLE_GCC14] + - 13.4.0 # [ANACONDA_ROCKET_ENABLE_GCC13] +gcc_maj_ver: + - 15 # [not ANACONDA_ROCKET_ENABLE_GCC13 and not ANACONDA_ROCKET_ENABLE_GCC14] + - 14 # [ANACONDA_ROCKET_ENABLE_GCC14] + - 13 # [ANACONDA_ROCKET_ENABLE_GCC13] +libgfortran_soname: + - 5 # [not ANACONDA_ROCKET_ENABLE_GCC13 and not ANACONDA_ROCKET_ENABLE_GCC14] + - 5 # [ANACONDA_ROCKET_ENABLE_GCC14] + - 5 # [ANACONDA_ROCKET_ENABLE_GCC13] +binutils_version: + - 2.44 +cross_target_platform: + - linux-64 # [linux and x86_64] + - linux-ppc64le # [ppc64le] + - linux-aarch64 # [linux and aarch64] + - win-64 # [win] +cross_target_stdlib_version: + - 2.28 # [linux and x86_64] + - 2.28 # [ppc64le] + - 2.28 # [linux and aarch64] + - 12 # [win] +cross_target_stdlib: + - sysroot # [linux and x86_64] + - sysroot # [ppc64le] + - sysroot # [linux and aarch64] + - m2w64-sysroot # [win] +# openmp versions +openmp_ver: + - 4.5 +libgomp_ver: + - 1.0.0 +channel_sources: + - conda-forge/label/sysroot-with-crypt,conda-forge +# we could use stdlib("m2w64_c"), but this allows uniform use in setup_compiler.sh +c_stdlib: # [win] + - m2w64-sysroot # [win] +c_stdlib_version: # [win] + - 12 # [win] +with_conda_specs: + - true + - false diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/config.old b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/config.old new file mode 100644 index 0000000000000000000000000000000000000000..90a390a60b40932a63278c29c1f013e7d5254a2d --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/config.old @@ -0,0 +1,530 @@ +# +# Automatically generated file; DO NOT EDIT. +# Crosstool-NG Configuration +# +CT_CONFIGURE_has_static_link=y +CT_CONFIGURE_has_xz=y +CT_CONFIGURE_has_svn=y +CT_MODULES=y + +# +# Paths and misc options +# + +# +# crosstool-NG behavior +# +CT_OBSOLETE=y +CT_EXPERIMENTAL=y +CT_ALLOW_BUILD_AS_ROOT=y +CT_ALLOW_BUILD_AS_ROOT_SURE=y +# CT_DEBUG_CT is not set + +# +# Paths +# +CT_LOCAL_TARBALLS_DIR="${HOME}/src" +CT_SAVE_TARBALLS=y +CT_WORK_DIR="${CT_TOP_DIR}/.build" +CT_PREFIX_DIR="${CT_TOP_DIR}/gcc_built" +CT_BUILD_TOP_DIR="@BUILD_TOP@" +CT_INSTALL_DIR="${CT_PREFIX_DIR}" +CT_RM_RF_PREFIX_DIR=n +CT_REMOVE_DOCS=y +CT_INSTALL_DIR_RO=n +CT_STRIP_HOST_TOOLCHAIN_EXECUTABLES=y +# CT_STRIP_TARGET_TOOLCHAIN_EXECUTABLES is not set + +# +# Downloading +# +# CT_FORBID_DOWNLOAD is not set +# CT_FORCE_DOWNLOAD is not set +CT_CONNECT_TIMEOUT=10 +# CT_ONLY_DOWNLOAD is not set +# CT_USE_MIRROR is not set + +# +# Extracting +# +# CT_FORCE_EXTRACT is not set +CT_OVERIDE_CONFIG_GUESS_SUB=y +# CT_ONLY_EXTRACT is not set +CT_PATCH_BUNDLED=y +# CT_PATCH_LOCAL is not set +# CT_PATCH_BUNDLED_LOCAL is not set +# CT_PATCH_LOCAL_BUNDLED is not set +# CT_PATCH_BUNDLED_FALLBACK_LOCAL is not set +# CT_PATCH_LOCAL_FALLBACK_BUNDLED is not set +# CT_PATCH_NONE is not set +CT_PATCH_ORDER="bundled" + +# +# Build behavior +# +CT_PARALLEL_JOBS=4 +CT_LOAD="" +CT_USE_PIPES=y +CT_EXTRA_CFLAGS_FOR_BUILD="" +CT_EXTRA_LDFLAGS_FOR_BUILD="" +CT_EXTRA_CFLAGS_FOR_HOST="" +CT_EXTRA_LDFLAGS_FOR_HOST="" +# CT_CONFIG_SHELL_SH is not set +# CT_CONFIG_SHELL_ASH is not set +CT_CONFIG_SHELL_BASH=y +# CT_CONFIG_SHELL_CUSTOM is not set +CT_CONFIG_SHELL="${bash}" + +# +# Logging +# +# CT_LOG_ERROR is not set +# CT_LOG_WARN is not set +CT_LOG_INFO=y +# CT_LOG_EXTRA is not set +# CT_LOG_ALL is not set +# CT_LOG_DEBUG is not set +CT_LOG_LEVEL_MAX="INFO" +# CT_LOG_SEE_TOOLS_WARN is not set +CT_LOG_PROGRESS_BAR=y +CT_LOG_TO_FILE=y +CT_LOG_FILE_COMPRESS=y + +# +# Target options +# +CT_ARCH="arm" +CT_ARCH_SUPPORTS_BOTH_MMU=y +CT_ARCH_SUPPORTS_BOTH_ENDIAN=y +CT_ARCH_SUPPORTS_32=y +CT_ARCH_SUPPORTS_64=y +CT_ARCH_SUPPORTS_WITH_ARCH=y +CT_ARCH_SUPPORTS_WITH_CPU=y +CT_ARCH_SUPPORTS_WITH_TUNE=y +CT_ARCH_SUPPORTS_WITH_FLOAT=y +CT_ARCH_SUPPORTS_WITH_FPU=y +CT_ARCH_SUPPORTS_SOFTFP=y +CT_ARCH_DEFAULT_HAS_MMU=y +CT_ARCH_DEFAULT_LE=y +CT_ARCH_DEFAULT_32=y +CT_ARCH_CPU="arm1136jf-s" +CT_ARCH_FPU="vfp" +# CT_ARCH_BE is not set +CT_ARCH_LE=y +CT_ARCH_32=y +# CT_ARCH_64 is not set +CT_ARCH_BITNESS=32 +# CT_ARCH_FLOAT_HW is not set +CT_ARCH_FLOAT_SW=y +CT_TARGET_CFLAGS="" +CT_TARGET_LDFLAGS="" +# CT_ARCH_alpha is not set +CT_ARCH_arm=y +# CT_ARCH_avr is not set +# CT_ARCH_m68k is not set +# CT_ARCH_microblaze is not set +# CT_ARCH_mips is not set +# CT_ARCH_nios2 is not set +# CT_ARCH_powerpc is not set +# CT_ARCH_s390 is not set +# CT_ARCH_sh is not set +# CT_ARCH_sparc is not set +# CT_ARCH_x86 is not set +# CT_ARCH_xtensa is not set +CT_ARCH_alpha_AVAILABLE=y +CT_ARCH_arm_AVAILABLE=y +CT_ARCH_avr_AVAILABLE=y +CT_ARCH_m68k_AVAILABLE=y +CT_ARCH_microblaze_AVAILABLE=y +CT_ARCH_mips_AVAILABLE=y +CT_ARCH_nios2_AVAILABLE=y +CT_ARCH_powerpc_AVAILABLE=y +CT_ARCH_s390_AVAILABLE=y +CT_ARCH_sh_AVAILABLE=y +CT_ARCH_sparc_AVAILABLE=y +CT_ARCH_x86_AVAILABLE=y +CT_ARCH_xtensa_AVAILABLE=y +CT_ARCH_SUFFIX="" + +# +# Generic target options +# +# CT_MULTILIB is not set +# CT_DISABLE_MULTILIB_LIB_OSDIRNAMES is not set +CT_ARCH_USE_MMU=y +CT_ARCH_ENDIAN="little" +CT_ARCH_32=y + +# +# Target optimisations +# +CT_ARCH_EXCLUSIVE_WITH_CPU=y +# CT_ARCH_FLOAT_AUTO is not set +# CT_ARCH_FLOAT_SOFTFP is not set +CT_ARCH_FLOAT="soft" + +# +# arm other options +# +CT_ARCH_ARM_MODE="arm" +CT_ARCH_ARM_MODE_ARM=y +# CT_ARCH_ARM_MODE_THUMB is not set +# CT_ARCH_ARM_INTERWORKING is not set +CT_ARCH_ARM_EABI_FORCE=y +CT_ARCH_ARM_EABI=y + +# +# Toolchain options +# + +# +# General toolchain options +# +CT_FORCE_SYSROOT=y +CT_USE_SYSROOT=y +CT_SYSROOT_NAME="sysroot" +CT_SYSROOT_DIR_PREFIX="" +CT_WANTS_STATIC_LINK=y +CT_STATIC_TOOLCHAIN=y +CT_TOOLCHAIN_PKGVERSION="" +CT_TOOLCHAIN_BUGURL="" + +# +# Tuple completion and aliasing +# +CT_TARGET_VENDOR="unknown" +CT_TARGET_ALIAS_SED_EXPR="" +CT_TARGET_ALIAS="" + +# +# Toolchain type +# +# CT_NATIVE is not set +CT_CROSS=y +# CT_CROSS_NATIVE is not set +# CT_CANADIAN is not set +CT_TOOLCHAIN_TYPE="cross" + +# +# Build system +# +CT_BUILD="x86_64-pc-linux-gnu" +CT_BUILD_PREFIX="" +CT_BUILD_SUFFIX="" + +# +# Misc options +# +# CT_TOOLCHAIN_ENABLE_NLS is not set + +# +# Operating System +# +CT_KERNEL_SUPPORTS_SHARED_LIBS=y +CT_KERNEL="linux" +CT_KERNEL_VERSION="3.2.43" +# CT_KERNEL_bare_metal is not set +CT_KERNEL_linux=y +CT_KERNEL_bare_metal_AVAILABLE=y +CT_KERNEL_linux_AVAILABLE=y +# CT_KERNEL_LINUX_CUSTOM is not set +# CT_KERNEL_V_4_4 is not set +# CT_KERNEL_V_4_3 is not set +# CT_KERNEL_V_4_1 is not set +# CT_KERNEL_V_3_18 is not set +# CT_KERNEL_V_3_14 is not set +# CT_KERNEL_V_3_12 is not set +# CT_KERNEL_V_3_10 is not set +# CT_KERNEL_V_3_7 is not set +# CT_KERNEL_V_3_4 is not set +# CT_KERNEL_V_3_2 is not set +CT_KERNEL_V_3_2_43=y +# CT_KERNEL_V_2_6_32 is not set +# CT_KERNEL_V_2_6_18 is not set +CT_KERNEL_windows_AVAILABLE=y + +# +# Common kernel options +# +CT_SHARED_LIBS=y + +# +# linux other options +# +# CT_KERNEL_LINUX_VERBOSITY_0 is not set +CT_KERNEL_LINUX_VERBOSITY_1=y +# CT_KERNEL_LINUX_VERBOSITY_2 is not set +CT_KERNEL_LINUX_VERBOSE_LEVEL=1 +CT_KERNEL_LINUX_INSTALL_CHECK=y + +# +# Binary utilities +# +CT_ARCH_BINFMT_ELF=y +CT_BINUTILS="binutils" +CT_BINUTILS_binutils=y + +# +# GNU binutils +# +# CT_BINUTILS_CUSTOM is not set +CT_BINUTILS_VERSION="2.27" +# CT_CC_BINUTILS_SHOW_LINARO is not set +CT_BINUTILS_V_2_27=y +# CT_BINUTILS_V_2_25_1 is not set +# CT_BINUTILS_V_2_24 is not set +# CT_BINUTILS_V_2_23_2 is not set +CT_BINUTILS_2_26_or_later=y +CT_BINUTILS_2_25_1_or_later=y +CT_BINUTILS_2_25_or_later=y +CT_BINUTILS_2_24_or_later=y +CT_BINUTILS_2_23_2_or_later=y +CT_BINUTILS_HAS_HASH_STYLE=y +CT_BINUTILS_HAS_GOLD=y +CT_BINUTILS_GOLD_SUPPORTS_ARCH=y +CT_BINUTILS_HAS_PLUGINS=y +CT_BINUTILS_HAS_PKGVERSION_BUGURL=y +CT_BINUTILS_LINKER_LD=y +CT_BINUTILS_LINKERS_LIST="ld" +CT_BINUTILS_LINKER_DEFAULT="bfd" +CT_BINUTILS_EXTRA_CONFIG_ARRAY="" +CT_BINUTILS_FOR_TARGET=y +CT_BINUTILS_FOR_TARGET_IBERTY=y +CT_BINUTILS_FOR_TARGET_BFD=y +CT_BINUTILS_PLUGINS=y + +# +# binutils other options +# + +# +# C-library +# +CT_LIBC="uClibc" +CT_LIBC_VERSION="0.9.33.2" +# CT_LIBC_glibc is not set +# CT_LIBC_musl is not set +CT_LIBC_uClibc=y +CT_LIBC_avr_libc_AVAILABLE=y +CT_LIBC_glibc_AVAILABLE=y +CT_THREADS="nptl" +CT_LIBC_mingw_AVAILABLE=y +CT_LIBC_musl_AVAILABLE=y +CT_LIBC_newlib_AVAILABLE=y +CT_LIBC_none_AVAILABLE=y +CT_LIBC_uClibc_AVAILABLE=y + +CT_LIBC_UCLIBC_CUSTOM=n +CT_LIBC_UCLIBC_NG=n +CT_LIBC_UCLIBC_NG_V_1_0_22=n +CT_LIBC_UCLIBC_NG_V_1_0_21=n +CT_LIBC_UCLIBC_NG_V_1_0_20=n +CT_LIBC_UCLIBC_V_0_9_33_2=y + +CT_LIBC_UCLIBC_PARALLEL=y +# CT_LIBC_UCLIBC_VERBOSITY_0 is not set +# CT_LIBC_UCLIBC_VERBOSITY_1 is not set +CT_LIBC_UCLIBC_VERBOSITY_2=y +CT_LIBC_UCLIBC_VERBOSITY="V=2" +CT_LIBC_UCLIBC_DEBUG_LEVEL_0=y +# CT_LIBC_UCLIBC_DEBUG_LEVEL_1 is not set +# CT_LIBC_UCLIBC_DEBUG_LEVEL_2 is not set +# CT_LIBC_UCLIBC_DEBUG_LEVEL_3 is not set +CT_LIBC_UCLIBC_DEBUG_LEVEL=0 +CT_LIBC_UCLIBC_CONFIG_FILE="" +CT_LIBC_SUPPORT_THREADS_ANY=y +CT_LIBC_SUPPORT_THREADS_NATIVE=y +CT_LIBC_SUPPORT_THREADS_LT=y +CT_LIBC_SUPPORT_THREADS_NONE=y + +# +# Common C library options +# +CT_THREADS_NATIVE=y +# CT_THREADS_LT is not set +# CT_THREADS_NONE is not set +CT_LIBC_XLDD=y + +# +# uClibc other options +# +CT_LIBC_UCLIBC_LNXTHRD="" +# CT_LIBC_UCLIBC_LOCALES is not set +CT_LIBC_UCLIBC_IPV6=y +CT_LIBC_UCLIBC_WCHAR=y +# CT_LIBC_UCLIBC_FENV is not set + +# +# C compiler +# +CT_CC="gcc" +CT_CC_CORE_PASSES_NEEDED=y +CT_CC_CORE_PASS_1_NEEDED=y +CT_CC_CORE_PASS_2_NEEDED=y +CT_CC_gcc=y +# CT_CC_GCC_CUSTOM is not set +CT_CC_GCC_VERSION="6.3.0" +# CT_CC_GCC_SHOW_LINARO is not set +CT_CC_GCC_V_6_3_0=y +# CT_CC_GCC_V_6_1_0 is not set +# CT_CC_GCC_V_5_4_0 is not set +# CT_CC_GCC_V_4_9_3 is not set +# CT_CC_GCC_V_4_8_5 is not set +CT_CC_GCC_4_8_or_later=y +CT_CC_GCC_4_9_or_later=y +CT_CC_GCC_5_or_later=y +CT_CC_GCC_6=y +CT_CC_GCC_6_or_later=y +CT_CC_GCC_HAS_GRAPHITE=y +CT_CC_GCC_USE_GRAPHITE=y +CT_CC_GCC_HAS_LTO=y +CT_CC_GCC_USE_LTO=y +CT_CC_GCC_HAS_PKGVERSION_BUGURL=y +CT_CC_GCC_HAS_BUILD_ID=y +CT_CC_GCC_HAS_LNK_HASH_STYLE=y +CT_CC_GCC_USE_GMP_MPFR=y +CT_CC_GCC_USE_MPC=y +CT_CC_GCC_HAS_LIBQUADMATH=y +CT_CC_GCC_HAS_LIBSANITIZER=y +CT_CC_LANG_FORTRAN=y +CT_CC_GCC_ENABLE_CXX_FLAGS="" +CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY="" +CT_CC_GCC_EXTRA_CONFIG_ARRAY="" +CT_CC_GCC_STATIC_LIBSTDCXX=y +# CT_CC_GCC_SYSTEM_ZLIB is not set +# This does not work but it seems currently possible +# to hack it and use the stage2 liblto.so as long as +# you manually copy it to the right place. For conda +# compiler packages, we add it to binutils, since it +# is executed by programs in that package. +# Really, needs a CT_MOSTLY_STATIC_TOOLCHAIN config +# option that uses -fPIC for all companion libs and +# builds them statically and then the exes are just +# dynamic exes that happen to link only to glibc in +# a dynamic way. +CT_CC_GCC_ENABLE_PLUGINS=n + +# +# Optimisation features +# + +# +# Settings for libraries running on target +# +CT_CC_GCC_ENABLE_TARGET_OPTSPACE=y +# CT_CC_GCC_LIBMUDFLAP is not set +# CT_CC_GCC_LIBGOMP is not set +# CT_CC_GCC_LIBSSP is not set +# CT_CC_GCC_LIBQUADMATH is not set + +# +# Misc. obscure options. +# +CT_CC_CXA_ATEXIT=y +# CT_CC_GCC_DISABLE_PCH is not set +CT_CC_GCC_SJLJ_EXCEPTIONS=m +CT_CC_GCC_LDBL_128=m +# CT_CC_GCC_BUILD_ID is not set +CT_CC_GCC_LNK_HASH_STYLE_DEFAULT=y +# CT_CC_GCC_LNK_HASH_STYLE_SYSV is not set +# CT_CC_GCC_LNK_HASH_STYLE_GNU is not set +# CT_CC_GCC_LNK_HASH_STYLE_BOTH is not set +CT_CC_GCC_LNK_HASH_STYLE="" +CT_CC_GCC_DEC_FLOAT_AUTO=y +# CT_CC_GCC_DEC_FLOAT_BID is not set +# CT_CC_GCC_DEC_FLOAT_DPD is not set +# CT_CC_GCC_DEC_FLOATS_NO is not set +CT_CC_SUPPORT_CXX=y +CT_CC_SUPPORT_FORTRAN=y +CT_CC_SUPPORT_JAVA=y +CT_CC_SUPPORT_ADA=y +CT_CC_SUPPORT_OBJC=y +CT_CC_SUPPORT_OBJCXX=y +CT_CC_SUPPORT_GOLANG=y + +# +# Additional supported languages: +# +CT_CC_LANG_CXX=y +# CT_CC_LANG_JAVA is not set +# CT_CC_LANG_ADA is not set +CT_CC_LANG_OBJC=y +CT_CC_LANG_OBJCXX=y +# CT_CC_LANG_GOLANG is not set +CT_CC_LANG_OTHERS="" + +# +# Debug facilities +# +# CT_DEBUG_dmalloc is not set +# CT_DEBUG_duma is not set +# CT_DEBUG_gdb is not set +# CT_DEBUG_ltrace is not set +# CT_DEBUG_strace is not set + +# +# Companion libraries +# +CT_COMPLIBS_NEEDED=y +CT_GMP_NEEDED=y +CT_MPFR_NEEDED=y +CT_ISL_NEEDED=y +CT_MPC_NEEDED=y +CT_COMPLIBS=y +CT_GMP=y +CT_MPFR=y +CT_ISL=y +CT_MPC=y +CT_GMP_V_6_1_2=y +# CT_GMP_V_6_0_0 is not set +# CT_GMP_V_5_1_3 is not set +# CT_GMP_V_5_1_1 is not set +# CT_GMP_V_5_0_2 is not set +# CT_GMP_V_5_0_1 is not set +# CT_GMP_V_4_3_2 is not set +# CT_GMP_V_4_3_1 is not set +# CT_GMP_V_4_3_0 is not set +CT_GMP_5_0_2_or_later=y +CT_GMP_VERSION="6.1.2" +CT_MPFR_V_3_1_5=y +# CT_MPFR_V_3_1_2 is not set +# CT_MPFR_V_3_1_0 is not set +# CT_MPFR_V_3_0_1 is not set +# CT_MPFR_V_3_0_0 is not set +# CT_MPFR_V_2_4_2 is not set +# CT_MPFR_V_2_4_1 is not set +# CT_MPFR_V_2_4_0 is not set +CT_MPFR_VERSION="3.1.5" +CT_ISL_V_0_18=y +# CT_ISL_V_0_12_2 is not set +CT_ISL_V_0_14_or_later=y +CT_ISL_V_0_12_or_later=y +CT_ISL_VERSION="0.18" +CT_MPC_V_1_0_3=y +# CT_MPC_V_1_0_2 is not set +# CT_MPC_V_1_0_1 is not set +# CT_MPC_V_1_0 is not set +# CT_MPC_V_0_9 is not set +# CT_MPC_V_0_8_2 is not set +# CT_MPC_V_0_8_1 is not set +# CT_MPC_V_0_7 is not set +CT_MPC_VERSION="1.0.3" + +# +# Companion libraries common options +# +# CT_COMPLIBS_CHECK is not set + +# +# Companion tools +# + +# +# READ HELP before you say 'Y' below !!! +# +# CT_COMP_TOOLS is not set + +# +# Test suite +# +# CT_TEST_SUITE_GCC is not set diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/get_cpu_arch.sh b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/get_cpu_arch.sh new file mode 100644 index 0000000000000000000000000000000000000000..b7ec10f51bb3d6f9d3709715366948dd28dd0a4c --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/get_cpu_arch.sh @@ -0,0 +1,35 @@ +get_cpu_arch() { + local CPU_ARCH + if [[ "$1" == *"-64" ]]; then + CPU_ARCH="x86_64" + elif [[ "$1" == *"-ppc64le" ]]; then + CPU_ARCH="powerpc64le" + elif [[ "$1" == *"-aarch64" ]]; then + CPU_ARCH="aarch64" + elif [[ "$1" == *"-s390x" ]]; then + CPU_ARCH="s390x" + else + echo "Unknown architecture" + exit 1 + fi + echo $CPU_ARCH +} + +get_triplet() { + if [[ "$1" == linux-* ]]; then + echo "$(get_cpu_arch $1)-conda-linux-gnu" + elif [[ "$1" == osx-64 ]]; then + echo "x86_64-apple-darwin13.4.0" + elif [[ "$1" == osx-arm64 ]]; then + echo "arm64-apple-darwin20.0.0" + elif [[ "$1" == win-64 ]]; then + echo "x86_64-w64-mingw32" + else + echo "unknown platform" + exit 1 + fi +} + +export BUILD="$(get_triplet $build_platform)" +export HOST="$(get_triplet $target_platform)" +export TARGET="$(get_triplet $cross_target_platform)" diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/hello-world.cpp b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/hello-world.cpp new file mode 100644 index 0000000000000000000000000000000000000000..abdfa651565e60579d61d05bc45afd98be1d3457 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/hello-world.cpp @@ -0,0 +1,7 @@ +#include + +int main(int argc, char * argv[]) +{ + std::cout << "Hello World!\n" << std::endl; + return 0; +} diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-conda-specs.sh b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-conda-specs.sh new file mode 100644 index 0000000000000000000000000000000000000000..01a4d1c950f9d00380efc5a2df4efb96753b87d3 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-conda-specs.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh + +set -ex +export CHOST="${triplet}" +specdir=$PREFIX/lib/gcc/$CHOST/${gcc_version} +if [[ "$cross_target_platform" == "$target_platform" ]]; then + install -Dm644 -T ${SRC_DIR}/build/gcc/specs $specdir/conda.specs + + # Add specs when we're not cross compiling so that the toolchain works more like a system + # toolchain (i.e. conda installed libs can be #include <>'d and linked without adding any + # cmdline args or FLAGS and likewise the assumptions we have about rpath are built in) + # + # THIS IS INTENDED as a safety net for casual users who just want the native toolchain to work. + # It is not to be relied on by conda-forge package recipes and best practice is still to set the + # appropriate FLAGS vars (either via compiler activation scripts or explicitly in the recipe) + # + # We use double quotes here because we want $PREFIX and $CHOST to be expanded at build time + # and recorded in the specs file. It will undergo a prefix replacement when our compiler + # package is installed. + sed -i -e "/\*link_command:/,+1 s+%.*+& %{\!static:-rpath ${PREFIX}/lib -rpath-link ${PREFIX}/lib} -L ${PREFIX}/lib/stubs -L ${PREFIX}/lib+" $specdir/conda.specs + if [[ "$cross_target_platform" != "win-"* ]]; then + # put -disable-new-dtags at the front of the cmdline so that user provided -enable-new-dtags (in %l) can override it + sed -i -e "/\*link_command:/,+1 s+%(linker)+& -disable-new-dtags +" $specdir/conda.specs + fi + # use -idirafter to put the conda "system" includes where /usr/local/include would typically go + # in a system-packaged non-cross compiler + sed -i -e "/\*cpp_options:/,+1 s+%.*+& -idirafter ${PREFIX}/include+" $specdir/conda.specs + # cc1_options also get used for cc1plus... at least in 11.2.0 + sed -i -e "/\*cc1_options:/,+1 s+%.*+& -idirafter ${PREFIX}/include+" $specdir/conda.specs + +else + # does it even make sense to do anything here? Could do something with %:getenv(BUILD_PREFIX /include) + # but in the case that we aren't inside conda-build, it will cause gcc to fatal + # because it won't be set. Just explicitly making this fail for now so that the meta.yaml + # is consitent with when it creates the conda-gcc-specs package + false +fi diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-g++.sh b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-g++.sh new file mode 100644 index 0000000000000000000000000000000000000000..f1cf84ba32fb914e5ef29ee9b11a6195049534f5 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-g++.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" +_libdir=libexec/gcc/${CHOST}/${PKG_VERSION} + +# libtool wants to use ranlib that is here, macOS install doesn't grok -t etc +# .. do we need this scoped over the whole file though? +#export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${CHOST}/buildtools/bin:${SRC_DIR}/.build/tools/bin:${PATH} + +pushd ${SRC_DIR}/build + +make -C gcc prefix=${PREFIX} c++.install-common + +# How it used to be: +# install -m755 -t ${PREFIX}/bin/ gcc/{cc1plus,lto1} +for file in cc1plus; do + if [[ -f gcc/${file}${EXEEXT} ]]; then + install -c gcc/${file}${EXEEXT} ${PREFIX}/${_libdir}/${file}${EXEEXT} + fi +done + +# Following 3 are in libstdcxx-devel +#make -C $CHOST/libstdc++-v3/src prefix=${PREFIX} install +#make -C $CHOST/libstdc++-v3/include prefix=${PREFIX} install +#make -C $CHOST/libstdc++-v3/libsupc++ prefix=${PREFIX} install +make -C $CHOST/libstdc++-v3/python prefix=${PREFIX} install + +# Probably don't want to do this for cross-compilers +# mkdir -p ${PREFIX}/share/gdb/auto-load/usr/lib/ +# cp ${SRC_DIR}/gcc_built/${CHOST}/sysroot/lib/libstdc++.so.6.*-gdb.py ${PREFIX}/share/gdb/auto-load/usr/lib/ + +make -C libcpp prefix=${PREFIX} install + +popd + +mkdir -p ${PREFIX}/lib/gcc/${CHOST}/${PKG_VERSION} + +set +x +# Strip executables, we may want to install to a different prefix +# and strip in there so that we do not change files that are not +# part of this package. +pushd ${PREFIX} + _files=$(find bin libexec -type f -not -name '*.dll') + for _file in ${_files}; do + _type="$( file "${_file}" | cut -d ' ' -f 2- )" + case "${_type}" in + *script*executable*) + ;; + *executable*) + ${BUILD_PREFIX}/bin/${CHOST}-strip --strip-all -v "${_file}" || : + ;; + esac + done +popd + +source ${RECIPE_DIR}/make_tool_links.sh diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-gcc.sh b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-gcc.sh new file mode 100644 index 0000000000000000000000000000000000000000..da5e0e54e5b5cfd10c4e0b3b0e70bf30a61baf23 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-gcc.sh @@ -0,0 +1,262 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +_libdir=libexec/gcc/${TARGET}/${PKG_VERSION} + +# libtool wants to use ranlib that is here, macOS install doesn't grok -t etc +# .. do we need this scoped over the whole file though? +#export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${TARGET}/buildtools/bin:${SRC_DIR}/.build/tools/bin:${PATH} + +pushd ${SRC_DIR}/build + # We may not have built with plugin support so failure here is not fatal: + make prefix=${PREFIX} install-lto-plugin || true + + sed -i.bak 's/install-collect2: collect2 /install-collect2: collect2$(exeext) /g' gcc/Makefile + make -C gcc prefix=${PREFIX} install-driver install-cpp install-gcc-ar install-headers install-plugin install-lto-wrapper install-collect2 + # not sure if this is the same as the line above. Run both, just in case + make -C lto-plugin prefix=${PREFIX} install + install -dm755 ${PREFIX}/lib/bfd-plugins/ + + # statically linked, so this so does not exist + # ln -s $PREFIX/lib/gcc/$TARGET/liblto_plugin.so ${PREFIX}/lib/bfd-plugins/ + + make -C libcpp prefix=${PREFIX} install + + # Include languages we do not have any other place for here (and also lto1) + for file in gnat1 brig1 cc1 go1 lto1 cc1obj cc1objplus; do + if [[ -f gcc/${file}${EXEEXT} ]]; then + install -c gcc/${file}${EXEEXT} ${PREFIX}/${_libdir}/${file}${EXEEXT} + fi + done + + # https://github.com/gcc-mirror/gcc/blob/gcc-7_3_0-release/gcc/Makefile.in#L3481-L3526 + # Could have used install-common, but it also installs cxx binaries, which we + # don't want in this package. We could patch it, or use the loop below: + for file in gcov{,-tool,-dump}; do + if [[ -f gcc/${file}${EXEEXT} ]]; then + install -c gcc/${file}${EXEEXT} ${PREFIX}/bin/${TARGET}-${file}${EXEEXT} + fi + done + + make prefix=${PREFIX}/lib/gcc/${TARGET}/${gcc_version} install-libcc1 + install -d ${PREFIX}/share/gdb/auto-load/usr/lib + + make prefix=${PREFIX} install-fixincludes + make -C gcc prefix=${PREFIX} install-mkheaders + + if [[ -d ${TARGET}/libatomic ]]; then + make -C ${TARGET}/libatomic prefix=${PREFIX} install + fi + + if [[ -d ${TARGET}/libgomp ]]; then + make -C ${TARGET}/libgomp prefix=${PREFIX} install + fi + + if [[ -d ${TARGET}/libitm ]]; then + make -C ${TARGET}/libitm prefix=${PREFIX} install + fi + + if [[ -d ${TARGET}/libquadmath ]]; then + make -C ${TARGET}/libquadmath prefix=${PREFIX} install + fi + + if [[ -d ${TARGET}/libsanitizer ]]; then + make -C ${TARGET}/libsanitizer prefix=${PREFIX} install + fi + + if [[ -d ${TARGET}/libsanitizer/asan ]]; then + make -C ${TARGET}/libsanitizer/asan prefix=${PREFIX} install + fi + + if [[ -d ${TARGET}/libsanitizer/tsan ]]; then + make -C ${TARGET}/libsanitizer/tsan prefix=${PREFIX} install + fi + + make -C libiberty prefix=${PREFIX} install + # install PIC version of libiberty + if [[ "${TARGET}" != *mingw* ]]; then + install -m644 libiberty/pic/libiberty.a ${PREFIX}/lib/gcc/${TARGET}/${gcc_version} + else + install -m644 libiberty/libiberty.a ${PREFIX}/lib/gcc/${TARGET}/${gcc_version} + fi + + make -C gcc prefix=${PREFIX} install-man install-info + + make -C gcc prefix=${PREFIX} install-po + + # many packages expect this symlink + [[ -f ${PREFIX}/bin/${TARGET}-cc${EXEEXT} ]] && rm ${PREFIX}/bin/${TARGET}-cc${EXEEXT} + pushd ${PREFIX}/bin + if [[ "${HOST}" != *mingw* ]]; then + ln -s ${TARGET}-gcc${EXEEXT} ${TARGET}-cc${EXEEXT} + else + cp ${TARGET}-gcc${EXEEXT} ${TARGET}-cc${EXEEXT} + fi + popd + + # POSIX conformance launcher scripts for c89 and c99 + cat > ${PREFIX}/bin/${TARGET}-c89${EXEEXT} <<"EOF" +#!/bin/sh +fl="-std=c89" +for opt; do + case "$opt" in + -ansi|-std=c89|-std=iso9899:1990) fl="";; + -std=*) echo "`basename $0` called with non ANSI/ISO C option $opt" >&2 + exit 1;; + esac +done +exec ${TARGET}-c89${EXEEXT} $fl ${1+"$@"} +EOF + + cat > ${PREFIX}/bin/${TARGET}-c99${EXEEXT} <<"EOF" +#!/bin/sh +fl="-std=c99" +for opt; do + case "$opt" in + -std=c99|-std=iso9899:1999) fl="";; + -std=*) echo "`basename $0` called with non ISO C99 option $opt" >&2 + exit 1;; + esac +done +exec ${TARGET}-c99${EXEEXT} $fl ${1+"$@"} +EOF + + chmod 755 ${PREFIX}/bin/${TARGET}-c{8,9}9${EXEEXT} + + rm ${PREFIX}/bin/${TARGET}-gcc-${PKG_VERSION}${EXEEXT} + +popd + +# generate specfile so that we can patch loader link path +# link_libgcc should have the gcc's own libraries by default (-R) +# so that LD_LIBRARY_PATH isn't required for basic libraries. +# +# GF method here to create specs file and edit it. The other methods +# tried had no effect on the result. including: +# setting LINK_LIBGCC_SPECS on configure +# setting LINK_LIBGCC_SPECS on make +# setting LINK_LIBGCC_SPECS in gcc/Makefile +specdir=$PREFIX/lib/gcc/$TARGET/${gcc_version} +if [[ "$build_platform" == "$target_platform" ]]; then + $PREFIX/bin/${TARGET}-gcc${EXEEXT} -dumpspecs > $specdir/specs + # validate assumption that specs in build/gcc/specs are exactly the + # same as dumped specs so that I don't need to depend on gcc_impl in conda-gcc-specs subpackage + diff -s ${SRC_DIR}/build/gcc/specs $specdir/specs +elif [[ "$target_platform" == "$cross_target_platform" && ${TARGET} != *mingw* ]]; then + # For support of of native specs, we need this + # This is the only place where we need QEMU. + # Remove this elif condition for local experimentation if you + # do not have QEMU setup + $PREFIX/bin/${TARGET}-gcc -dumpspecs > $specdir/specs +else + $BUILD_PREFIX/bin/${TARGET}-gcc -dumpspecs > $specdir/specs + # validate assumption that specs in build/gcc/specs are exactly the + # same as dumped specs so that I don't need to depend on gcc_impl in conda-gcc-specs subpackage + diff -s ${SRC_DIR}/build/gcc/specs $specdir/specs +fi + +# make a copy of the specs without our additions so that people can choose not to use them +# by passing -specs=builtin.specs +cp $specdir/specs $specdir/builtin.specs + +# modify the default specs to only have %include_noerr that includes an optional conda.specs +# package installable via the conda-gcc-specs package where conda.specs (for $cross_target_platform +# == $target_platform) will add the minimal set of flags for the 'native' toolchains to be useable +# without anything additional set in the enviornment or extra cmdline args. +echo "%include_noerr " >> $specdir/specs + +# We use double quotes here because we want $PREFIX and $TARGET to be expanded at build time +# and recorded in the specs file. It will undergo a prefix replacement when our compiler +# package is installed. +sed -i -e "/\*link_command:/,+1 s+%.*+& %{!static:-rpath ${PREFIX}/lib}+" $specdir/specs + + +# Install Runtime Library Exception +install -Dm644 $SRC_DIR/COPYING.RUNTIME \ + ${PREFIX}/share/licenses/gcc/RUNTIME.LIBRARY.EXCEPTION + +set +x +# Strip executables, we may want to install to a different prefix +# and strip in there so that we do not change files that are not +# part of this package. +pushd ${PREFIX} + _files=$(find bin libexec -type f -not -name '*.dll') + for _file in ${_files}; do + _type="$( file "${_file}" | cut -d ' ' -f 2- )" + case "${_type}" in + *script*executable*) + ;; + *executable*) + ${BUILD_PREFIX}/bin/${TARGET}-strip --strip-all -v "${_file}" || : + ;; + esac + done +popd + +set -x + +#${PREFIX}/bin/${TARGET}-gcc "${RECIPE_DIR}"/c11threads.c -std=c11 + +mkdir -p ${PREFIX}/${TARGET}/lib +mkdir -p ${PREFIX}/lib/gcc/${TARGET}/${gcc_version} + +if [[ "$target_platform" == "$cross_target_platform" ]]; then + # making these this way so conda build doesn't muck with them + pushd ${PREFIX}/${TARGET}/lib + if [[ "${TARGET}" != *mingw* ]]; then + ln -sf ../../lib/libgomp.so libgomp.so + for lib in libgfortran libatomic libquadmath libitm lib{a,hwa,l,ub,t}san; do + for f in ${PREFIX}/lib/${lib}.so*; do + ln -s ../../lib/$(basename $f) ${PREFIX}/${TARGET}/lib/$(basename $f) + done + done + fi + + for f in ${PREFIX}/lib/*.spec; do + mv $f ${PREFIX}/${TARGET}/lib/$(basename $f) + done + if [[ "${TARGET}" != *mingw* ]]; then + for f in ${PREFIX}/lib/*.o; do + mv $f ${PREFIX}/${TARGET}/lib/$(basename $f) + done + fi + popd + for lib in asan atomic gomp hwasan itm lsan quadmath tsan ubsan; do + if [[ -f "${PREFIX}/lib/lib${lib}.a" ]]; then + mv ${PREFIX}/lib/lib${lib}.*a ${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/ + fi + done + for lib in libasan.so libatomic.so libgomp.so libhwasan.so libitm.so liblsan.so libquadmath.so libtsan.so libubsan.so libstdc++.so libstdc++.so.6 libgcc_s.so; do + if [[ -f "${PREFIX}/lib/${lib}" ]]; then + # install a shared library here since the directory ${PREFIX}/lib/gcc/${TARGET}/${gcc_version} + # has the highest preference and we want shared libraries to have the highest preference + rm ${PREFIX}/lib/${lib} + ln -sf ${PREFIX}/lib/${lib} ${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/ + fi + done +else + source ${RECIPE_DIR}/install-libgcc.sh + for lib in libcc1; do + mv ${PREFIX}/lib/${lib}.so* ${PREFIX}/${TARGET}/lib/ || true + mv ${PREFIX}/lib/${lib}.so* ${PREFIX}/${TARGET}/lib/ || true + done + rm -f ${PREFIX}/share/info/*.info + for lib in asan atomic gomp hwasan itm lsan quadmath tsan ubsan; do + if [[ -f "${PREFIX}/${TARGET}/lib/lib${lib}.a" ]]; then + mv ${PREFIX}/${TARGET}/lib/lib${lib}.*a ${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/ + fi + if [[ -f "${PREFIX}/${TARGET}/lib/lib${lib}.so" ]]; then + ln -sf ${PREFIX}/${TARGET}/lib/lib${lib}.so ${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/ + fi + done +fi + +if [[ -f ${PREFIX}/lib/libgomp.spec ]]; then + mv ${PREFIX}/lib/libgomp.spec ${PREFIX}/${TARGET}/lib/libgomp.spec +fi + +rm -f ${PREFIX}/share/info/dir + +source ${RECIPE_DIR}/make_tool_links.sh diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-gdb-pretty-printer.sh b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-gdb-pretty-printer.sh new file mode 100644 index 0000000000000000000000000000000000000000..c73dfd015673e079a1d2df9e656fb2e20d7bca1a --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-gdb-pretty-printer.sh @@ -0,0 +1,10 @@ +set -e -x + +# install gcc's gdbhooks ... +mkdir -p "$SP_DIR"/gcc +cp $SRC_DIR/gcc/gcc/gdbhooks.py "$SP_DIR"/gcc/. + +# install libstdc++'s pretty printer support +cp -r $SRC_DIR/gcc/libstdc++-v3/python/libstdcxx "$SP_DIR"/. + +exit 0 diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-gfortran.sh b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-gfortran.sh new file mode 100644 index 0000000000000000000000000000000000000000..46d877def15e561206381f98e1db227944f02256 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-gfortran.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" +_libdir=libexec/gcc/${CHOST}/${PKG_VERSION} + +# libtool wants to use ranlib that is here, macOS install doesn't grok -t etc +# .. do we need this scoped over the whole file though? +#export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${CHOST}/buildtools/bin:${SRC_DIR}/.build/tools/bin:${PATH} + +pushd ${SRC_DIR}/build + +# adapted from Arch install script from https://github.com/archlinuxarm/PKGBUILDs/blob/master/core/gcc/PKGBUILD +# We cannot make install since .la files are not relocatable so libtool deliberately prevents it: +# libtool: install: error: cannot install `libgfortran.la' to a directory not ending in ${SRC_DIR}/work/gcc_built/${CHOST}/lib/../lib +make -C ${CHOST}/libgfortran prefix=${PREFIX} all-multi libgfortran.spec ieee_arithmetic.mod ieee_exceptions.mod ieee_features.mod config.h +make -C gcc prefix=${PREFIX} fortran.install-{common,man,info} + +# How it used to be: +# install -Dm755 gcc/f951 ${PREFIX}/${_libdir}/f951 +for file in f951; do + if [[ -f gcc/${file}${EXEEXT} ]]; then + install -c gcc/${file}${EXEEXT} ${PREFIX}/${_libdir}/${file}${EXEEXT} + fi +done + +mkdir -p ${PREFIX}/${CHOST}/lib +cp ${CHOST}/libgfortran/libgfortran.spec ${PREFIX}/${CHOST}/lib + +pushd ${PREFIX}/bin + if [[ "${target_platform}" != "win-64" ]]; then + ln -sf ${CHOST}-gfortran${EXEEXT} ${CHOST}-f95${EXEEXT} + else + cp ${CHOST}-gfortran${EXEEXT} ${CHOST}-f95${EXEEXT} + fi +popd + +make install DESTDIR=$SRC_DIR/build-finclude +mkdir -p $PREFIX/lib/gcc/${CHOST}/${gcc_version}/finclude +mkdir -p $PREFIX/lib/gcc/${CHOST}/${gcc_version}/include +install -Dm644 $SRC_DIR/build-finclude/$PREFIX/lib/gcc/${CHOST}/${gcc_version}/finclude/* $PREFIX/lib/gcc/${CHOST}/${gcc_version}/finclude/ +install -Dm644 $SRC_DIR/build-finclude/$PREFIX/lib/gcc/${CHOST}/${gcc_version}/include/*.h $PREFIX/lib/gcc/${CHOST}/${gcc_version}/include/ + +# Install Runtime Library Exception +install -Dm644 $SRC_DIR/COPYING.RUNTIME \ + ${PREFIX}/share/licenses/gcc-fortran/RUNTIME.LIBRARY.EXCEPTION + +if [[ "${target_platform}" != "${cross_target_platform}" ]]; then + if [[ ${triplet} == *linux* ]]; then + cp -f --no-dereference ${SRC_DIR}/build/${CHOST}/libgfortran/.libs/libgfortran*.so* ${PREFIX}/${CHOST}/lib/ + fi +fi +cp -f --no-dereference ${SRC_DIR}/build/${CHOST}/libgfortran/.libs/libgfortran.*a ${PREFIX}/${CHOST}/lib/ + +set +x +# Strip executables, we may want to install to a different prefix +# and strip in there so that we do not change files that are not +# part of this package. +pushd ${PREFIX} + _files=$(find bin libexec -type f -not -name '*.dll') + for _file in ${_files}; do + _type="$( file "${_file}" | cut -d ' ' -f 2- )" + case "${_type}" in + *script*executable*) + ;; + *executable*) + ${BUILD_PREFIX}/bin/${CHOST}-strip --strip-all -v "${_file}" || : + ;; + esac + done +popd + +if [[ -f ${PREFIX}/lib/libgomp.spec ]]; then + mv ${PREFIX}/lib/libgomp.spec ${PREFIX}/${CHOST}/lib/libgomp.spec +fi + +rm -f ${PREFIX}/share/info/dir + +source ${RECIPE_DIR}/make_tool_links.sh diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libgcc-devel.sh b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libgcc-devel.sh new file mode 100644 index 0000000000000000000000000000000000000000..6ba08fc16608017c3a0545c4d8984f9aa7586a25 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libgcc-devel.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" + +# libtool wants to use ranlib that is here, macOS install doesn't grok -t etc +# .. do we need this scoped over the whole file though? +#export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${CHOST}/buildtools/bin:${SRC_DIR}/.build/tools/bin:${PATH} + +pushd ${SRC_DIR}/build + +make -C ${CHOST}/libgcc prefix=${PREFIX} install + +# ${PREFIX}/lib/libgcc_s.so* goes into libgcc output, but +# avoid that the equivalents in ${PREFIX}/${CHOST}/lib end up +# in gcc_impl_{{ cross_target_platform }}, c.f. install-gcc.sh +mkdir -p ${PREFIX}/${CHOST}/lib +if [[ "${triplet}" == *linux* ]]; then + mv ${PREFIX}/lib/libgcc_s.so* ${PREFIX}/${CHOST}/lib +else + # import library, not static library + mv ${PREFIX}/lib/libgcc_s.a ${PREFIX}/${CHOST}/lib + rm ${PREFIX}/lib/libgcc_s*.dll || true +fi +# This is in gcc_impl as it is gcc specific and clang has the same header +rm -rf ${PREFIX}/lib/gcc/${CHOST}/${gcc_version}/include/unwind.h + +popd + diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libgcc-no-gomp.sh b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libgcc-no-gomp.sh new file mode 100644 index 0000000000000000000000000000000000000000..e792608072235cedbc2836ec05a7bc9326d53862 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libgcc-no-gomp.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" + +# we have to remove existing links/files so that the libgcc install works +rm -rf ${PREFIX}/lib/* +rm -rf ${PREFIX}/share/* +rm -f ${PREFIX}/${CHOST}/lib/libgomp* + +# now run install of libgcc +# this reinstalls the wrong symlinks for openmp +source ${RECIPE_DIR}/install-libgcc.sh + +# remove and relink things for openmp +rm -f ${PREFIX}/lib/libgomp.so +rm -f ${PREFIX}/${CHOST}/lib/libgomp.so +rm -f ${PREFIX}/lib/libgomp.so.${libgomp_ver:0:1} +rm -f ${PREFIX}/${CHOST}/lib/libgomp.so.${libgomp_ver:0:1} +rm -f ${PREFIX}/${CHOST}/lib/libgomp.so.${libgomp_ver} + +# (re)make the right links +# note that this code is remaking more links than the ones we want in this +# package but that is ok +pushd ${PREFIX}/lib + if [[ "${TARGET}" != *mingw* ]]; then + ln -s libgomp.so.${libgomp_ver} libgomp.so.${libgomp_ver:0:1} + fi +popd diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libgcc.sh b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libgcc.sh new file mode 100644 index 0000000000000000000000000000000000000000..34a2effaa2d99c20bf30004b03a5fed5ba1fdbdb --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libgcc.sh @@ -0,0 +1,82 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +# libtool wants to use ranlib that is here, macOS install doesn't grok -t etc +# .. do we need this scoped over the whole file though? +#export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${TARGET}/buildtools/bin:${SRC_DIR}/.build/tools/bin:${PATH} + +pushd ${SRC_DIR}/build + + if [[ "${PKG_NAME}" == "libgcc" ]]; then + make -C ${TARGET}/libgcc prefix=${PREFIX} install-shared + if [[ "${TARGET}" == *mingw* ]]; then + mv $PREFIX/lib/libgcc_s*.dll $PREFIX/bin + fi + elif [[ "${PKG_NAME}" != "gcc_impl"* ]]; then + # when building a cross compiler, above make line will clobber $PREFIX/lib/libgcc_s.so.1 + # and fail after some point for some architectures. To avoid that, we copy manually + pushd ${TARGET}/libgcc + mkdir -p ${PREFIX}/lib/gcc/${TARGET}/${gcc_version} + install -c -m 644 libgcc_eh.a ${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/libgcc_eh.a + chmod 644 ${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/libgcc_eh.a + ${TARGET}-ranlib ${PREFIX}/lib/gcc/${TARGET}/${gcc_version}/libgcc_eh.a + + mkdir -p ${PREFIX}/${TARGET}/lib + if [[ "${triplet}" == *linux* ]]; then + install -c -m 644 ./libgcc_s.so.1 ${PREFIX}/${TARGET}/lib/libgcc_s.so.1 + cp $RECIPE_DIR/libgcc_s.so.ldscript ${PREFIX}/${TARGET}/lib/libgcc_s.so + else + # import library, not static library + install -c -m 644 ./shlib/libgcc_s.a ${PREFIX}/${TARGET}/lib/libgcc_s.a + fi + popd + fi + + # TODO :: Also do this for libgfortran (and libstdc++ too probably?) + if [[ -f ${TARGET}/libsanitizer/libtool ]]; then + sed -i.bak 's/.*cannot install.*/func_warning "Ignoring libtool error about cannot install to a directory not ending in"/' \ + ${TARGET}/libsanitizer/libtool + fi + for lib in libatomic libgomp libquadmath libitm libvtv libsanitizer/{a,hwa,l,ub,t}san; do + # TODO :: Also do this for libgfortran (and libstdc++ too probably?) + if [[ -f ${TARGET}/${lib}/libtool ]]; then + sed -i.bak 's/.*cannot install.*/func_warning "Ignoring libtool error about cannot install to a directory not ending in"/' \ + ${TARGET}/${lib}/libtool + fi + if [[ -d ${TARGET}/${lib} ]]; then + make -C ${TARGET}/${lib} prefix=${PREFIX} install-toolexeclibLTLIBRARIES + make -C ${TARGET}/${lib} prefix=${PREFIX} install-nodist_fincludeHEADERS || true + fi + done + + for lib in libgomp libquadmath; do + if [[ -d ${TARGET}/${lib} ]]; then + make -C ${TARGET}/${lib} prefix=${PREFIX} install-info + fi + done + +popd + +mkdir -p ${PREFIX}/lib + +if [[ "${PKG_NAME}" != "gcc_impl"* ]]; then + # no static libs + find ${PREFIX}/lib -name "*\.a" -exec rm -rf {} \; +fi +# no libtool files +find ${PREFIX}/lib -name "*\.la" -exec rm -rf {} \; + +if [[ "${PKG_NAME}" != gcc_impl* ]]; then + # mv ${PREFIX}/${TARGET}/lib/* ${PREFIX}/lib + # clean up empty folder + rm -rf ${PREFIX}/lib/gcc + rm -rf ${PREFIX}/lib/lib{a,hwa,l,ub,t}san.so* + + # Install Runtime Library Exception + install -Dm644 ${SRC_DIR}/COPYING.RUNTIME \ + ${PREFIX}/share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION +fi + +rm -f ${PREFIX}/share/info/dir diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libgfortran.sh b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libgfortran.sh new file mode 100644 index 0000000000000000000000000000000000000000..031da5eca76ae9762aa193eb3310b7923fd844c6 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libgfortran.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +rm -f ${PREFIX}/lib/libgfortran* || true + +if [[ "${TARGET}" == *mingw* ]]; then + mkdir -p ${PREFIX}/bin/ + cp ${SRC_DIR}/build/${TARGET}/libgfortran/.libs/libgfortran*.dll ${PREFIX}/bin/ +else + mkdir -p ${PREFIX}/lib + cp -f --no-dereference ${SRC_DIR}/build/${TARGET}/libgfortran/.libs/libgfortran*.so* ${PREFIX}/lib/ +fi + +# Install Runtime Library Exception +install -Dm644 $SRC_DIR/COPYING.RUNTIME \ + ${PREFIX}/share/licenses/libgfortran/RUNTIME.LIBRARY.EXCEPTION diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libgomp.sh b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libgomp.sh new file mode 100644 index 0000000000000000000000000000000000000000..cdd189f59dd81af7df42846c40b9300bf64dcd1e --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libgomp.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh + +cd build + +make -C ${triplet}/libgomp prefix=${PREFIX} install-toolexeclibLTLIBRARIES +rm ${PREFIX}/lib/libgomp.a ${PREFIX}/lib/libgomp.la + +if [[ "$target_platform" == "linux-"* ]]; then + rm ${PREFIX}/lib/libgomp.so.1 + rm ${PREFIX}/lib/libgomp.so + ln -sf ${PREFIX}/lib/libgomp.so.${libgomp_ver} ${PREFIX}/lib/libgomp.so +else + rm ${PREFIX}/lib/libgomp.dll.a +fi + +# Install Runtime Library Exception +install -Dm644 ${SRC_DIR}/COPYING.RUNTIME \ + ${PREFIX}/share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION.gomp_copy diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libsanitizer.sh b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libsanitizer.sh new file mode 100644 index 0000000000000000000000000000000000000000..2ef36d3bb8c750e42929f231de9d22a6e0addd40 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libsanitizer.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" + +mkdir -p ${PREFIX}/lib + +pushd ${SRC_DIR}/build + + # TODO :: Also do this for libgfortran (and libstdc++ too probably?) + sed -i.bak 's/.*cannot install.*/func_warning "Ignoring libtool error about cannot install to a directory not ending in"/' \ + ${CHOST}/libsanitizer/libtool + for lib in libsanitizer/{a,hwa,l,ub,t}san; do + # TODO :: Also do this for libgfortran (and libstdc++ too probably?) + if [[ -f ${CHOST}/${lib}/libtool ]]; then + sed -i.bak 's/.*cannot install.*/func_warning "Ignoring libtool error about cannot install to a directory not ending in"/' \ + ${CHOST}/${lib}/libtool + fi + if [[ -d ${CHOST}/${lib} ]]; then + make -C ${CHOST}/${lib} prefix=${PREFIX} install-toolexeclibLTLIBRARIES + make -C ${CHOST}/${lib} prefix=${PREFIX} install-nodist_fincludeHEADERS || true + fi + done + +popd + +# no static libs +find ${PREFIX}/lib -name "*\.a" -exec rm -rf {} \; +# no libtool files +find ${PREFIX}/lib -name "*\.la" -exec rm -rf {} \; diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libstdc++-devel.sh b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libstdc++-devel.sh new file mode 100644 index 0000000000000000000000000000000000000000..63b0439991dbb35a966fa02069d04899b13420f2 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libstdc++-devel.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" + +# libtool wants to use ranlib that is here, macOS install doesn't grok -t etc +# .. do we need this scoped over the whole file though? +# export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${CHOST}/buildtools/bin:${SRC_DIR}/.build/tools/bin:${PATH} + +pushd ${SRC_DIR}/build + +make -C $CHOST/libstdc++-v3/src prefix=${PREFIX} install +make -C $CHOST/libstdc++-v3/include prefix=${PREFIX} install +make -C $CHOST/libstdc++-v3/libsupc++ prefix=${PREFIX} install + +mkdir -p ${PREFIX}/lib/gcc/${CHOST}/${gcc_version} +mkdir -p ${PREFIX}/${CHOST}/lib + +if [[ "$target_platform" == "$cross_target_platform" ]]; then + mv $PREFIX/lib/lib*.a ${PREFIX}/lib/gcc/${CHOST}/${gcc_version}/ + if [[ "$target_platform" == linux-* ]]; then + mv ${PREFIX}/lib/libstdc++.so* ${PREFIX}/${CHOST}/lib + else + rm ${PREFIX}/bin/libstdc++*.dll + fi +else + mv $PREFIX/${CHOST}/lib/lib*.a ${PREFIX}/lib/gcc/${CHOST}/${gcc_version}/ +fi + +popd + diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libstdc++.sh b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libstdc++.sh new file mode 100644 index 0000000000000000000000000000000000000000..3d878849ae7b3d9282a04a885cd29df782b7d038 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-libstdc++.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +export CHOST="${triplet}" + +# libtool wants to use ranlib that is here, macOS install doesn't grok -t etc +# .. do we need this scoped over the whole file though? +#export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${CHOST}/buildtools/bin:${SRC_DIR}/.build/tools/bin:${PATH} + +pushd ${SRC_DIR}/build + + make -C ${CHOST}/libstdc++-v3/src prefix=${PREFIX} install-toolexeclibLTLIBRARIES + make -C ${CHOST}/libstdc++-v3/po prefix=${PREFIX} install + +popd + +mkdir -p ${PREFIX}/lib +#mv ${PREFIX}/${CHOST}/lib/* ${PREFIX}/lib + +# no static libs +find ${PREFIX}/lib -name "*\.a" -exec rm -rf {} \; +# no libtool files +find ${PREFIX}/lib -name "*\.la" -exec rm -rf {} \; + +# Install Runtime Library Exception +install -Dm644 ${SRC_DIR}/COPYING.RUNTIME \ + ${PREFIX}/share/licenses/libstdc++/RUNTIME.LIBRARY.EXCEPTION diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-openmp_impl.sh b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-openmp_impl.sh new file mode 100644 index 0000000000000000000000000000000000000000..c4ebad09aa18a43830fe2e9be9be97c9e965c354 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-openmp_impl.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh +set -e -x + +mkdir -p ${PREFIX}/lib + +pushd ${PREFIX}/lib/ + +if [[ "${TARGET}" != *mingw* ]]; then + ln -s libgomp.so.${libgomp_ver} libgomp.so.${libgomp_ver:0:1} +fi +popd diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-symlinks.sh b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-symlinks.sh new file mode 100644 index 0000000000000000000000000000000000000000..fd4887286b42cf9e1effd5a1931b9dc3224a3d9a --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/install-symlinks.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +source ${RECIPE_DIR}/setup_compiler.sh + +if [[ "$target_platform" == "win-"* ]]; then + symlink_or_copy="cp" +else + symlink_or_copy="ln -sf" +fi + +if [[ "${PKG_NAME}" == "gcc" ]]; then + for tool in cc cpp gcc gcc-ar gcc-nm gcc-ranlib gcov gcov-dump gcov-tool; do + $symlink_or_copy ${PREFIX}/bin/${triplet}-${tool}${EXEEXT} ${PREFIX}/bin/${tool}${EXEEXT} + done +elif [[ "${PKG_NAME}" == "gxx" ]]; then + $symlink_or_copy ${PREFIX}/bin/${triplet}-g++${EXEEXT} ${PREFIX}/bin/g++${EXEEXT} + $symlink_or_copy ${PREFIX}/bin/${triplet}-c++${EXEEXT} ${PREFIX}/bin/c++${EXEEXT} +elif [[ "${PKG_NAME}" == "gfortran" ]]; then + $symlink_or_copy ${PREFIX}/bin/${triplet}-gfortran${EXEEXT} ${PREFIX}/bin/gfortran${EXEEXT} +fi diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/libgcc_s.so.ldscript b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/libgcc_s.so.ldscript new file mode 100644 index 0000000000000000000000000000000000000000..c8e92242fc5b32888222e279088df08e791bd52c --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/libgcc_s.so.ldscript @@ -0,0 +1,4 @@ +/* GNU ld script + Use the shared library, but some functions are only in + the static library. */ +GROUP ( libgcc_s.so.1 -lgcc ) diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/make_tool_links.sh b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/make_tool_links.sh new file mode 100644 index 0000000000000000000000000000000000000000..26ad874c355cef4faa81da40d32fd985742f6262 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/make_tool_links.sh @@ -0,0 +1,11 @@ +# When host=target, gcc installs un-prefixed tools together with prefixed-tools +# In the case of cpp, only un-prefixed cpp. Let's copy the un-prefixed tool +# to prefix-tool and delete the un-prefixed one to get back ct-ng behaviour +for tool in gcc g++ gfortran cpp gcc-ar gcc-nm gcc-ranlib c++; do + if [ -f ${PREFIX}/bin/${tool}${EXEEXT} ]; then + if [ ! -f ${PREFIX}/bin/${triplet}-${tool}${EXEEXT} ]; then + cp ${PREFIX}/bin/${tool}${EXEEXT} ${PREFIX}/bin/${triplet}-${tool}${EXEEXT} + fi + rm ${PREFIX}/bin/${tool}${EXEEXT} + fi +done diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/meta.yaml b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d03f46ee81c2daee15e45ed5cfec75271e09891e --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/meta.yaml @@ -0,0 +1,775 @@ +{% set version = gcc_version %} +{% set build_num = 7 %} + +{% if gcc_maj_ver is not defined %} +{% set gcc_maj_ver = 15 %} +{% endif %} + +# libgcc-devel is a noarch: generic package that is built for +# cross-compilers as well. Instead of skipping for cross-compilers, +# let's prioritize the native compilers package +{% if target_platform == cross_target_platform %} +{% set libgcc_devel_build_num = build_num + 100 %} +{% else %} +{% set libgcc_devel_build_num = build_num %} +{% endif %} + +{% if cross_target_platform is not defined %} +{% set cross_target_platform = "linux-64" %} +{% endif %} + +package: + name: gcc_compilers + version: {{ version }} + +source: + - url: + - https://ftp.gnu.org/gnu/gcc/gcc-{{ version }}/gcc-{{ version }}.tar.gz + - https://mirrors.ocf.berkeley.edu/gnu/gcc/gcc-{{ version }}/gcc-{{ version }}.tar.gz + sha256: 7294d65cc1a0558cb815af0ca8c7763d86f7a31199794ede3f630c0d1b0a5723 # [gcc_version == "15.2.0"] + sha256: ace8b8b0dbfe6abfc22f821cb093e195aa5498b7ccf7cd23e4424b9f14afed22 # [gcc_version == "14.3.0"] + sha256: bf0baf3e570c9c74c17c8201f0196c6924b4bd98c90e69d6b2ac0cd823f33bbc # [gcc_version == "13.4.0"] + patches: + - patches/0001-allow-commands-in-main-specfile.patch + - patches/0002-patch-zoneinfo_dir_override-to-point-to-our-tzdata.patch # [gcc_maj_ver != 13] + {% if cross_target_platform.startswith("linux-") %} + - patches/0003-add-ldl-to-libstdc___la_LDFLAGS.patch # [gcc_maj_ver != 13] + - patches/0004-Hardcode-HAVE_ALIGNED_ALLOC-1-in-libstdc-v3-configur.patch + {% else %} + # for GCC 15: https://github.com/msys2/MINGW-packages/tree/f59921184b35858d4ceb91679578de0d62475cbf/mingw-w64-gcc + # for GCC 14: https://github.com/msys2/MINGW-packages/tree/331bf945d21af562d228ed46bda21c8272d1e76e/mingw-w64-gcc + # for GCC 13: https://github.com/msys2/MINGW-packages/tree/4f1262b4e1072632eccf0958764f90d890b832ac/mingw-w64-gcc + - patches/mingw/{{ gcc_maj_ver }}/0002-Relocate-libintl.patch # [gcc_maj_ver == 13] + - patches/mingw/{{ gcc_maj_ver }}/0003-Windows-Follow-Posix-dir-exists-semantics-more-close.patch + - patches/mingw/{{ gcc_maj_ver }}/0005-Windows-Don-t-ignore-native-system-header-dir.patch + - patches/mingw/{{ gcc_maj_ver }}/0006-Windows-New-feature-to-allow-overriding.patch # [gcc_maj_ver == 13] + - patches/mingw/{{ gcc_maj_ver }}/0007-Build-EXTRA_GNATTOOLS-for-Ada.patch + - patches/mingw/{{ gcc_maj_ver }}/0008-Prettify-linking-no-undefined.patch + - patches/mingw/{{ gcc_maj_ver }}/0011-Enable-shared-gnat-implib.patch + - patches/mingw/{{ gcc_maj_ver }}/0012-Handle-spaces-in-path-for-default-manifest.patch + - patches/mingw/{{ gcc_maj_ver }}/0014-gcc-9-branch-clone_function_name_1-Retain-any-stdcall-suffix.patch + - patches/mingw/{{ gcc_maj_ver }}/0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch + - patches/mingw/{{ gcc_maj_ver }}/0021-PR14940-Allow-a-PCH-to-be-mapped-to-a-different-addr.patch # [gcc_maj_ver != 15] + - patches/mingw/{{ gcc_maj_ver }}/0140-gcc-diagnostic-color.patch + - patches/mingw/{{ gcc_maj_ver }}/0200-add-m-no-align-vector-insn-option-for-i386.patch + - patches/mingw/{{ gcc_maj_ver }}/0300-override-builtin-printf-format.patch # [gcc_maj_ver == 13] + - patches/mingw/{{ gcc_maj_ver }}/2000-enable-rust.patch # [gcc_maj_ver == 13] + - patches/mingw/{{ gcc_maj_ver }}/2001-fix-building-rust-on-mingw-w64.patch + - patches/mingw/{{ gcc_maj_ver }}/2f7e7bfa3c6327793cdcdcb5c770b93cecd49bd0.patch # [gcc_maj_ver == 13] + - patches/mingw/{{ gcc_maj_ver }}/3eeb4801d6f45f6250fc77a6d3ab4e0115f8cfdd.patch # [gcc_maj_ver == 13] + - patches/mingw/{{ gcc_maj_ver }}/9002-native-tls.patch # [gcc_maj_ver == 15] + {% endif %} + +build: + number: {{ build_num }} + skip: True # [win] + skip: true # [not (linux or win) or (win and cross_target_platform != "win-64")] + detect_binary_files_with_prefix: false + ignore_run_exports_from: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + +requirements: + build: + # Build dependencies are installed in setup_compilers.sh due to + # conda-build bugs + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + +outputs: + - name: libgcc-devel_{{ cross_target_platform }} + script: install-libgcc-devel.sh + build: + noarch: generic + number: {{ libgcc_devel_build_num }} + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + ignore_run_exports_from: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + overlinking_ignore_patterns: + - "*/lib/libgcc_s.so.*" + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run: + - __unix # [unix] + - __win # [win] + test: + commands: + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/crtbegin.o + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libgcc_eh.a + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libgcc.a + {% if cross_target_platform.startswith("linux-") %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgcc_s.so + {% else %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgcc_s.a + {% endif %} + about: + summary: The GNU C development libraries and object files + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: libstdcxx-devel_{{ cross_target_platform }} + script: install-libstdc++-devel.sh + build: + noarch: generic + number: {{ libgcc_devel_build_num }} + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + ignore_run_exports_from: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + overlinking_ignore_patterns: + - "*/lib/libstdc++.so.*" + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run: + - __unix # [unix] + - __win # [win] + test: + commands: + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libstdc++.a + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libstdc++fs.a + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libsupc++.a + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/include/c++/cstdio + {% if cross_target_platform.startswith("linux-") %} + - test -f ${PREFIX}/{{ triplet }}/lib/libstdc++.so + {% else %} + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libstdc++.dll.a + {% endif %} + about: + summary: The GNU C++ headers and development libraries + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: gcc_impl_{{ cross_target_platform }} + script: install-gcc.sh + build: + number: {{ build_num }} + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - '*' + ignore_run_exports_from: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + - {{ pin_subpackage("libgomp", exact=True) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libstdcxx", exact=True) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libgcc", exact=True) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libgfortran" ~ libgfortran_soname) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libsanitizer", exact=True) }} # [target_platform == cross_target_platform and not win] + run: + - binutils_impl_{{ cross_target_platform }} >={{ binutils_version }} + - {{ pin_subpackage("libgcc-devel_" ~ cross_target_platform, exact=True) }} + - {{ pin_subpackage("libsanitizer", exact=True) }} # [target_platform == cross_target_platform and not win] + # libstdcxx is a runtime dep of gcc because LTO requires it. + - {{ pin_subpackage("libstdcxx", max_pin=None) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libgcc", max_pin=None) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libgomp", max_pin=None) }} # [target_platform == cross_target_platform] + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + run_exports: + # impose this requirement across the build/host boundary + strong: + - libgcc >={{ gcc_version }} + test: + requires: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + files: + - tests + commands: + - echo {{ c_stdlib }} + - echo {{ c_stdlib_version }} + - test -f ${PREFIX}/{{ triplet }}/lib/libgomp.so # [target_platform == cross_target_platform] + - test `readlink ${PREFIX}/{{ triplet }}/lib/libgomp.so` == "../../lib/libgomp.so" # [target_platform == cross_target_platform] + - test -f ${PREFIX}/bin/{{ triplet }}-gcc + - test -f ${PREFIX}/bin/{{ triplet }}-cpp + - test ! -f ${PREFIX}/bin/gcc + - test ! -f ${PREFIX}/bin/cpp + - CC=$(${PREFIX}/bin/*-gcc -dumpmachine)-gcc + - ${CC} -Wall tests/aligned_alloc.c -c -o c_aligned.o -v -Wl,-v -march=native # [target_platform == cross_target_platform and (x86_64 or s390x)] + # This test does not work well with QEMU + - ${CC} -Wall tests/aligned_alloc.c -c -o c_aligned.o -v -Wl,-v -mcpu=native # [target_platform == cross_target_platform and (not x86_64 and not s390x and not ppc64le)] + - ${CC} -Wall tests/aligned_alloc.c -c -o c_aligned.o -v -fsanitize=address # [cross_target_platform != "win-64"] + - ${CC} -Wall tests/aligned_alloc.c -c -o c_aligned.o -v # [cross_target_platform != "win-64"] + - ${CC} -Wall c_aligned.o -o c_aligned -v && ./c_aligned # [cross_target_platform == target_platform and cross_target_platform != "win-64"] + - ${CC} -Wall c_aligned.o -o c_aligned -Wl,-rpath,/foo && {{ triplet }}-readelf -d c_aligned | grep RPATH | grep "/foo:${PREFIX}/lib" # [cross_target_platform == target_platform and cross_target_platform != "win-64"] + - ${CC} -Wall tests/hello_world.c -c -o hello_world.o -v + - ${CC} -Wall hello_world.o -o hello_world -v + {% if cross_target_platform.startswith("linux-") %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgcc_s.so + - test -f ${PREFIX}/{{ triplet }}/lib/libsanitizer.spec + - test -f ${PREFIX}/{{ triplet }}/lib/libasan_preinit.o + {% else %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgcc_s.a + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libquadmath.a + - test -f ${PREFIX}/lib/gcc/{{ triplet }}/{{ gcc_version }}/libgomp.a + {% endif %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgomp.spec + about: + summary: GNU C Compiler + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: gcc + script: install-symlinks.sh + build: + skip: true # [target_platform != cross_target_platform] + track_features: # [not with_conda_specs] + - gcc_no_conda_specs # [not with_conda_specs] + requirements: + host: + - gcc_impl_{{ target_platform }} {{ gcc_version }}.* + run: + - gcc_impl_{{ target_platform }} {{ gcc_version }}.* + - conda-gcc-specs # [with_conda_specs] + test: + commands: + - ${PREFIX}/bin/gcc -v + - ${PREFIX}/bin/gcov -v + about: + summary: GNU C native compiler (symlinks) + home: https://github.com/conda-forge/ctng-compilers-feedstock + license: BSD-3-Clause + license_file: LICENSE + + - name: gcc-no-conda-specs + build: + skip: true # [with_conda_specs] + requirements: + run: + - gcc + run_constrained: + - conda-gcc-specs <0.0a0 + test: + commands: + - gcc --version + + - name: conda-gcc-specs + script: install-conda-specs.sh + build: + number: {{ build_num }} + skip: true # [cross_target_platform != target_platform] + detect_binary_files_with_prefix: false + requirements: + build: + run: + - {{ pin_subpackage("gcc_impl_" ~ cross_target_platform, max_pin='x.x.x.x') }} + test: + files: + - tests + commands: + - specdir=$PREFIX/lib/gcc/{{ triplet }}/{{ gcc_version }} + - test -f $specdir/conda.specs + - CC=$(${PREFIX}/bin/*-gcc -dumpmachine)-gcc + - echo | ${CC} -E -v -x c - |& grep '^Reading specs from' | awk '{print $NF}' | xargs readlink -e | awk -v ORS= '{print $1":"}' | grep "${specdir}/specs:${specdir}/conda.specs:" + - cp tests/libhowdy.h $PREFIX/include/ + - ${CC} -shared -fpic -o $PREFIX/lib/libhowdy.so tests/libhowdy.c + - ${CC} -o howdy-dso tests/howdy-dso.c -lhowdy + - ./howdy-dso + - grep RPATH <({{ triplet }}-readelf -d howdy-dso) + - "! grep RUNPATH <({{ triplet }}-readelf -d howdy-dso)" + - ${CC} -Wl,-enable-new-dtags -o howdy-dso-runpath tests/howdy-dso.c -lhowdy + - ./howdy-dso-runpath + - "! grep RPATH <({{ triplet }}-readelf -d howdy-dso-runpath)" + - grep RUNPATH <({{ triplet }}-readelf -d howdy-dso-runpath) + - echo | ${CC} -E -Wp,-v -x c - |& awk '/include <\.\.\.> search starts/,/^End of search/ {print}' | tail -n2 | head -n1 | grep "$PREFIX/include" + - echo | ${CC} -isystem "$PREFIX/include" -E -Wp,-v -x c - |& awk '/include <\.\.\.> search starts/, /^End of search/ {print}' | head -n2 | tail -n1 | grep "$PREFIX/include" + + about: + summary: conda-specific specfile for GNU C/C++ Compiler + description: | + When installed, this optional package provides a specfile that + directs gcc (and g++ or gfortran) to automatically: + * search for includes in $PREFIX/include + * link libraries in $PREFIX/lib + * set RPATH to $PREFIX/lib + * use RPATH instead of the newer RUNPATH + This package is intended to aid usability of the compiler + toolchain as a replacement for system-installed compilers. + It should not be used in recipes. Use the 'compiler()' + jinja function as described on + https://conda-forge.org/docs/maintainer/knowledge_base.html#dep-compilers + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + doc_url: https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html + + - name: gxx_impl_{{ cross_target_platform }} + script: install-g++.sh + build: + number: {{ build_num }} + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + ignore_run_exports_from: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + # For cpp and crt{i,n}.o + - {{ pin_subpackage("gcc_impl_" ~ cross_target_platform, exact=True) }} + run: + # For cpp and crt{i,n}.o + - {{ pin_subpackage("gcc_impl_" ~ cross_target_platform, exact=True) }} + # not needed due to pinning above but marks this build as using the new sysroots + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + - {{ pin_subpackage("libstdcxx-devel_" ~ cross_target_platform, exact=True) }} + # for C++20 chrono support + - tzdata + run_exports: + # impose this requirement across the build/host boundary + strong: + - libstdcxx >={{ gcc_version }} + test: + requires: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + - strace_{{ cross_target_platform }} + files: + - tests + commands: + - test -f ${PREFIX}/bin/{{ triplet }}-g++ + - CXX=$(${PREFIX}/bin/*-gcc -dumpmachine)-g++ + - ${CXX} -Wall tests/aligned_alloc.cpp -c -o cpp_aligned.o --std=c++17 # [cross_target_platform != "win-64"] + - ${CXX} -Wall cpp_aligned.o -o cpp_aligned --std=c++17 && ./cpp_aligned # [cross_target_platform == target_platform and cross_target_platform != "win-64"] + - ${CXX} -Wall tests/hello_world.cpp -c -o hello_world.o --std=c++17 + - ${CXX} -Wall hello_world.o -o hello_world --std=c++17 + + # test tzdb integration + {% if gcc_maj_ver|int >= 14 %} + - ${CXX} -isystem ${PREFIX}/include --std=c++20 -Wall tests/tzdb-override.cpp -c -o tzdb-override.o + - ${CXX} -isystem ${PREFIX}/include --std=c++20 -Wall tests/tzdb.cpp -c -o tzdb.o + {% if target_platform == cross_target_platform %} + - ${CXX} tzdb-override.o -o tzdb-override && ./tzdb-override + - ${CXX} tzdb.o -o tzdb && ./tzdb + - $PREFIX/usr/bin/strace ./tzdb 2>&1 | grep ${CONDA_PREFIX}/lib/../share/zoneinfo/tzdata.zi + # also test without any environment activation + - unset PREFIX + - unset CONDA_PREFIX + - ./tzdb + {% endif %} + {% endif %} + about: + summary: GNU C++ Compiler + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: gxx + script: install-symlinks.sh + build: + skip: true # [target_platform != cross_target_platform] + requirements: + host: + - gxx_impl_{{ target_platform }} {{ gcc_version }}.* + - gcc {{ gcc_version }}.* + run: + - gxx_impl_{{ target_platform }} {{ gcc_version }}.* + - gcc {{ gcc_version }}.* + test: + commands: + - ${PREFIX}/bin/g++ -v + - ${PREFIX}/bin/gcc -v + about: + summary: GNU C++ native compiler (symlinks) + home: https://github.com/conda-forge/ctng-compilers-feedstock + license: BSD-3-Clause + license_file: LICENSE + + - name: gfortran_impl_{{ cross_target_platform }} + script: install-gfortran.sh + build: + number: {{ build_num }} + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + ignore_run_exports_from: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + requirements: + build: + host: + # For cpp and crt{i,n}.o + - {{ pin_subpackage("gcc_impl_" ~ cross_target_platform, exact=True) }} + # not needed due to pinning above but marks this build as using the new sysroots + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run: + # For cpp and crt{i,n}.o + - gcc_impl_{{ cross_target_platform }} >={{ gcc_version }} + - {{ pin_subpackage("libgfortran" ~ libgfortran_soname, max_pin=None) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libgcc", max_pin=None) }} # [target_platform == cross_target_platform] + - {{ pin_subpackage("libstdcxx", max_pin=None) }} # [target_platform == cross_target_platform] + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + run_exports: + # impose this requirement across the build/host boundary + strong: + - libgfortran{{ libgfortran_soname }} {{ gcc_version }}.* + - libgcc >={{ gcc_version }} + test: + requires: + - cmake >=3.11,<4 # [x86_64 or aarch64 or ppc64le] + - make + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + commands: + {% if cross_target_platform.startswith("linux-") %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgfortran.so + {% else %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgfortran.dll.a + {% endif %} + - test -f ${PREFIX}/{{ triplet }}/lib/libgfortran.a + - test -f ${PREFIX}/bin/{{ triplet }}-gfortran + - find $PREFIX/lib -iname omp_lib.mod | grep '.' + - find $PREFIX/lib -iname omp_lib.h | grep '.' + - find $PREFIX/lib -iname ISO_Fortran_binding.h | grep '.' + - echo {{ gcc_maj_ver }} + - pushd tests/fortomp + - sh test_fort.sh # [target_platform == cross_target_platform and (x86_64 or aarch64 or ppc64le)] + files: + - tests/fortomp/* + about: + summary: GNU Fortran Compiler + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: gfortran + script: install-symlinks.sh + build: + skip: true # [target_platform != cross_target_platform] + requirements: + host: + - gfortran_impl_{{ target_platform }} {{ gcc_version }}.* + - gcc_impl_{{ target_platform }} {{ gcc_version }}.* + - gcc {{ gcc_version }}.* + run: + - gfortran_impl_{{ target_platform }} {{ gcc_version }}.* + - gcc_impl_{{ target_platform }} {{ gcc_version }}.* + - gcc {{ gcc_version }}.* + test: + commands: + - ${PREFIX}/bin/gfortran -v + - ${PREFIX}/bin/gcc -v + about: + summary: GNU Fortran native compiler (symlinks) + home: https://github.com/conda-forge/ctng-compilers-feedstock + license: BSD-3-Clause + license_file: LICENSE + + - name: libstdcxx + target: {{ cross_target_platform }} + script: install-libstdc++.sh + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform] + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + overlinking_ignore_patterns: + - "lib/libstdc++.so.*" + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + - {{ pin_subpackage("libgcc", exact=True) }} + run: + - {{ pin_subpackage("libgcc", exact=True) }} + run_constrained: + # avoid installing incompatible version of old name for this output + - libstdcxx-ng =={{ version }}=*_{{ build_num }} + test: + commands: + - test -f ${PREFIX}/lib/libstdc++.so + about: + summary: The GNU C++ Runtime Library + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: libsanitizer + target: {{ cross_target_platform }} + script: install-libsanitizer.sh + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform or win] + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + run_exports: + - libsanitizer {{ gcc_version }} + overlinking_ignore_patterns: + - "lib/libtsan.so.*" + - "lib/libasan.so.*" + - "lib/liblsan.so.*" + - "lib/libhwasan.so.*" + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run: + - libgcc >={{ gcc_version }} + - libstdcxx >={{ gcc_version }} + test: + requires: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + - gcc_impl_{{ cross_target_platform }} + commands: + - test -f ${PREFIX}/lib/libasan.so + - test -f ${PREFIX}/lib/libhwasan.so # [x86_64 or aarch64] + - file ${PREFIX}/bin/{{ triplet }}-gcc + - echo 'void main(){}' | {{ triplet }}-gcc -fsanitize=address -Wl,--fatal-warnings -x c - + about: + summary: The GCC runtime libraries for sanitizers + home: https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: libgomp + target: {{ cross_target_platform }} + script: install-libgomp.sh + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform] + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + run_exports: + strong: + - {{ pin_subpackage("_openmp_mutex", max_pin=None) }} + {% if cross_target_platform.startswith("win-") %} + - {{ pin_subpackage("libgomp", max_pin=None) }} + {% endif %} + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run_constrained: + - msys2-conda-epoch <0.0a0 # [win] + test: + requires: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + commands: + - test -f ${PREFIX}/lib/libgomp.so.{{ libgomp_ver }} + - test ! -f ${PREFIX}/lib/libgomp.so.{{ libgomp_ver[0:1] }} + about: + summary: The GCC OpenMP implementation. + home: https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: libgcc + target: {{ cross_target_platform }} + script: install-libgcc-no-gomp.sh + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform] + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + rpaths_patcher: patchelf + overlinking_ignore_patterns: + - "lib/libgcc_s.so.*" + requirements: + build: + host: + - {{ pin_subpackage("libgomp", exact=True) }} + - {{ pin_subpackage('_openmp_mutex', exact=True) }} + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run: + - {{ pin_subpackage("_openmp_mutex", max_pin=None) }} + run_constrained: + - {{ pin_subpackage("libgomp", exact=True) }} + - msys2-conda-epoch <0.0a0 # [win] + # avoid installing incompatible version of old name for this output + - libgcc-ng =={{ version }}=*_{{ build_num }} + test: + requires: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} + commands: + - test -f ${PREFIX}/lib/libgcc_s.so + - test -f ${PREFIX}/lib/libgomp.so.{{ libgomp_ver[0:1] }} + - test `readlink ${PREFIX}/lib/libgomp.so.{{ libgomp_ver[0:1] }}` == "libgomp.so.{{ libgomp_ver }}" + about: + summary: The GCC low-level runtime library + home: https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: _openmp_mutex + script: install-openmp_impl.sh + version: {{ openmp_ver }} + build: + string: 3_gnu + skip: true # [target_platform != cross_target_platform] + run_exports: + strong: + - {{ pin_subpackage("_openmp_mutex", max_pin=None) }} + requirements: + build: + host: + - {{ pin_subpackage('libgomp', exact=True) }} + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run: + - libgomp >=7.5.0 + run_constrained: + # conflict with previous name + - openmp_impl <0.0a0 + - msys2-conda-epoch <0.0a0 # [win] + test: + commands: + - test -f ${PREFIX}/lib/libgomp.so.{{ libgomp_ver[0:1] }} + - test `readlink ${PREFIX}/lib/libgomp.so.{{ libgomp_ver[0:1] }}` == "libgomp.so.{{ libgomp_ver }}" + about: + summary: OpenMP Implementation Mutex + license: BSD-3-Clause + license_file: LICENSE + home: https://github.com/conda-forge/ctng-compilers-feedstock + + - name: libgfortran{{ libgfortran_soname }} + target: {{ cross_target_platform }} + script: install-libgfortran.sh + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform] + detect_binary_files_with_prefix: false + missing_dso_whitelist: + - "*" + overlinking_ignore_patterns: + - "lib/libgfortran.so.*" + requirements: + build: + host: + - {{ cross_target_stdlib }}_{{ cross_target_platform }} {{ cross_target_stdlib_version }} + run: + - libgcc >={{ gcc_version }} + run_constrained: + - libgfortran {{ gcc_version }} + test: + commands: + - test -f ${PREFIX}/lib/libgfortran.so + about: + summary: The GNU Fortran Runtime Library + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: libgfortran + target: {{ cross_target_platform }} + build: + skip: true # [target_platform != cross_target_platform] + number: {{ build_num }} + requirements: + run: + - {{ pin_subpackage('libgfortran' ~ libgfortran_soname, exact=True) }} + run_constrained: + # avoid installing incompatible version of old name for this output + - libgfortran-ng =={{ version }}=*_{{ build_num }} + test: + commands: + - test -f ${PREFIX}/lib/libgfortran.so + about: + summary: The GNU Fortran Runtime Library + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: gdb-pretty-printer + version: {{ gcc_version }} + script: install-gdb-pretty-printer.sh + build: + # skip until gdb 16.3 is on defaults (which is built against GCC 14.3.0) + skip: true + number: {{ build_num }} + ignore_run_exports: # [linux] + - libstdcxx # [linux] + requirements: + host: + - python + run: + - python + - gdb >= 16.3 + - libstdcxx >={{ gcc_version }} + about: + summary: GNU Compiler Collection Python Pretty Printers + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + # compatibility outputs for previous naming of the runtime libraries + # with "-ng" suffix; for windows the suffix had never been introduced + {% if not cross_target_platform.startswith("win-") %} + - name: libgcc-ng + target: {{ cross_target_platform }} + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform] + run_exports: + strong: + - libgcc + requirements: + host: + - {{ pin_subpackage("libgcc", exact=True) }} + run: + - {{ pin_subpackage("libgcc", exact=True) }} + test: + commands: + - echo "empty wrapper for compatibility with previous naming" + about: + summary: The GCC low-level runtime library + home: https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: libstdcxx-ng + target: {{ cross_target_platform }} + script: install-libstdc++.sh + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform] + run_exports: + strong: + - libstdcxx + requirements: + host: + - {{ pin_subpackage("libstdcxx", exact=True) }} + run: + - {{ pin_subpackage("libstdcxx", exact=True) }} + test: + commands: + - echo "empty wrapper for compatibility with previous naming" + about: + summary: The GNU C++ Runtime Library + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + + - name: libgfortran-ng + target: {{ cross_target_platform }} + build: + number: {{ build_num }} + skip: true # [target_platform != cross_target_platform] + run_exports: + strong: + - libgfortran + requirements: + host: + - {{ pin_subpackage('libgfortran', exact=True) }} + run: + - {{ pin_subpackage('libgfortran', exact=True) }} + test: + commands: + - echo "empty wrapper for compatibility with previous naming" + about: + summary: The GNU Fortran Runtime Library + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + {% endif %} + +about: + summary: GNU Compiler Collection + home: https://gcc.gnu.org/ + license: GPL-3.0-only WITH GCC-exception-3.1 + license_file: + - COPYING + - COPYING.LIB + - COPYING3 + - COPYING3.LIB + +extra: + feedstock-name: ctng-compilers-feedstock + recipe-maintainers: + - timsnyder + - xhochy + - isuruf + - beckermr diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/patches/0001-allow-commands-in-main-specfile.patch b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/patches/0001-allow-commands-in-main-specfile.patch new file mode 100644 index 0000000000000000000000000000000000000000..0e6ea6afa6429337186944117011253d9be4e64f --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/patches/0001-allow-commands-in-main-specfile.patch @@ -0,0 +1,23 @@ +From 10cf9f22dcb62db55cd2e9cbc587e2ab35a88889 Mon Sep 17 00:00:00 2001 +From: Tim Snyder +Date: Tue, 29 Mar 2022 22:33:27 +0000 +Subject: [PATCH 1/4] allow % commands in main specfile + +--- + gcc/gcc.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index fc9f1f545dc..28b947c7afd 100644 +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -2392,7 +2392,8 @@ read_specs (const char *filename, bool main_p, bool user_p) + /* Is this a special command that starts with '%'? */ + /* Don't allow this for the main specs file, since it would + encourage people to overwrite it. */ +- if (*p == '%' && !main_p) ++ /* ::conda-forge:: allow use of commands in main specs */ ++ if (*p == '%') + { + p1 = p; + while (*p && *p != '\n') diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/patches/0002-patch-zoneinfo_dir_override-to-point-to-our-tzdata.patch b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/patches/0002-patch-zoneinfo_dir_override-to-point-to-our-tzdata.patch new file mode 100644 index 0000000000000000000000000000000000000000..e63a7f8389e8f3c3e60994356076261b033c5fb8 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/patches/0002-patch-zoneinfo_dir_override-to-point-to-our-tzdata.patch @@ -0,0 +1,113 @@ +From 92dc5e74592f57dbc9c2b421e2e348d88d3439f6 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Fri, 21 Jun 2024 12:41:07 +1100 +Subject: [PATCH 2/4] patch zoneinfo_dir_override to point to our tzdata + +--- + libstdc++-v3/src/c++20/tzdb.cc | 78 ++++++++++++++++++++++++++++------ + 1 file changed, 65 insertions(+), 13 deletions(-) + +diff --git a/libstdc++-v3/src/c++20/tzdb.cc b/libstdc++-v3/src/c++20/tzdb.cc +index 72f20e7f828..8d4feb99902 100644 +--- a/libstdc++-v3/src/c++20/tzdb.cc ++++ b/libstdc++-v3/src/c++20/tzdb.cc +@@ -37,8 +37,12 @@ + #include // mutex + #include // filesystem::read_symlink + +-#ifndef _AIX +-# include // getenv ++#if defined(__linux__) ++# include // dladdr ++# include // free, malloc, realpath ++# include // memcpy, strlen ++#else defined(_WIN32) ++# include + #endif + + #if defined __GTHREADS && ATOMIC_POINTER_LOCK_FREE == 2 +@@ -64,25 +68,73 @@ + + namespace __gnu_cxx + { +-#ifdef _AIX +- // Cannot override weak symbols on AIX. +- const char* (*zoneinfo_dir_override)() = nullptr; +-#else +- [[gnu::weak]] const char* zoneinfo_dir_override(); +- +-#if defined(__APPLE__) || defined(__hpux__) \ +- || (defined(__VXWORKS__) && !defined(__RTP__)) +- // Need a weak definition for Mach-O et al. + [[gnu::weak]] const char* zoneinfo_dir_override() + { ++#ifdef _GLIBCXX_SHARED ++ // get path to library we're in, to determine our location relative to $PREFIX; ++ // with help from the MIT-licensed https://github.com/gpakosz/whereami ++ void* addr = __builtin_extract_return_addr(__builtin_return_address(0)); ++ char* this_lib; ++ int i; ++ // is included through ++ static std::string tz_dir; ++ if (!tz_dir.empty()) { ++ return tz_dir.c_str(); ++ } ++#ifdef _WIN32 ++ // we're in %PREFIX%\Library\bin\libstdc++-6.dll ++# define TO_PREFIX "/../.." ++ // needs single quotes for character (not string) literal ++# define PATH_SEP '\\' ++ wchar_t buffer[MAX_PATH]; ++ HMODULE hm = NULL; ++ // non-zero return means success ++ if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | ++ GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, ++ (LPCSTR) addr, &hm)) { ++ // returns length of string (not counting null byte), see ++ // https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulefilenamew#return-value ++ DWORD total_length = GetModuleFileNameW(hm, buffer, sizeof(buffer)); ++ if (total_length) { ++ this_lib = (char*)malloc(total_length + 1); ++ memcpy(this_lib, buffer, total_length); ++#else ++ // we're in $PREFIX/lib/libstdcxx.so ++# define TO_PREFIX "/.." ++# define PATH_SEP '/' ++ char buffer[PATH_MAX]; ++ Dl_info info; ++ ++ if (dladdr(addr, &info)) { ++ char* resolved = realpath(info.dli_fname, buffer); ++ if (resolved) { ++ int total_length = (int)strlen(resolved); ++ this_lib = (char*)malloc(total_length + 1); ++ memcpy(this_lib, resolved, total_length); ++#endif ++ ++ for (i = (int)total_length - 1; i >= 0; --i) { ++ if (this_lib[i] == PATH_SEP) { ++ // set to null byte so the string ends before the basename ++ this_lib[i] = '\0'; ++ break; ++ } ++ } ++ tz_dir = {this_lib}; ++ tz_dir += TO_PREFIX; ++ tz_dir += "/share/zoneinfo"; ++ // std::string constructor for tz_dir deep-copies ++ free(this_lib); ++ return tz_dir.c_str(); ++ } ++ } ++#endif // _GLIBCXX_SHARED + #ifdef _GLIBCXX_ZONEINFO_DIR + return _GLIBCXX_ZONEINFO_DIR; + #else + return nullptr; + #endif + } +-#endif +-#endif + } + + #if ! defined _GLIBCXX_ZONEINFO_DIR && ! defined _GLIBCXX_STATIC_TZDATA diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/patches/0003-add-ldl-to-libstdc___la_LDFLAGS.patch b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/patches/0003-add-ldl-to-libstdc___la_LDFLAGS.patch new file mode 100644 index 0000000000000000000000000000000000000000..a17bf01c996d5181529f52f35b2df040463adbe4 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/patches/0003-add-ldl-to-libstdc___la_LDFLAGS.patch @@ -0,0 +1,40 @@ +From c54fd2dea14134d3e51c17ca5442e0ae2dc16462 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Mon, 15 Jul 2024 19:16:05 +1100 +Subject: [PATCH 3/4] add `-ldl` to libstdc___la_LDFLAGS + +we want to link static-only here, to avoid having to add +`-ldl` everytime something links against libstdc++.so + +Co-Authored-By: Isuru Fernando +--- + libstdc++-v3/src/Makefile.am | 2 +- + libstdc++-v3/src/Makefile.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am +index 37ba1491dea..5b69f43ecd8 100644 +--- a/libstdc++-v3/src/Makefile.am ++++ b/libstdc++-v3/src/Makefile.am +@@ -161,7 +161,7 @@ libstdc___darwin_rpath += -Wl,-rpath,@loader_path + endif + + libstdc___la_LDFLAGS = \ +- -version-info $(libtool_VERSION) ${version_arg} -lm $(libstdc___darwin_rpath) ++ -version-info $(libtool_VERSION) ${version_arg} -lm -Bstatic -ldl -Bdynamic -Wl,--exclude-libs,libdl.a $(libstdc___darwin_rpath) + + libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS) $(lt_host_flags) + +diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in +index 1bdf0daa88f..ab28e14804e 100644 +--- a/libstdc++-v3/src/Makefile.in ++++ b/libstdc++-v3/src/Makefile.in +@@ -566,7 +566,7 @@ libstdc___la_DEPENDENCIES = \ + @ENABLE_DARWIN_AT_RPATH_TRUE@ -Wc,-nodefaultrpaths \ + @ENABLE_DARWIN_AT_RPATH_TRUE@ -Wl,-rpath,@loader_path + libstdc___la_LDFLAGS = \ +- -version-info $(libtool_VERSION) ${version_arg} -lm $(libstdc___darwin_rpath) ++ -version-info $(libtool_VERSION) ${version_arg} -lm -Bstatic -ldl -Bdynamic -Wl,--exclude-libs,libdl.a $(libstdc___darwin_rpath) + + libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS) $(lt_host_flags) + @GLIBCXX_LDBL_ALT128_COMPAT_FALSE@@GLIBCXX_LDBL_COMPAT_TRUE@LTCXXCOMPILE64 = $(LTCXXCOMPILE) diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/patches/0004-Hardcode-HAVE_ALIGNED_ALLOC-1-in-libstdc-v3-configur.patch b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/patches/0004-Hardcode-HAVE_ALIGNED_ALLOC-1-in-libstdc-v3-configur.patch new file mode 100644 index 0000000000000000000000000000000000000000..07a361cd6d709849c78bba0ece60ff63d8c2295e --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/patches/0004-Hardcode-HAVE_ALIGNED_ALLOC-1-in-libstdc-v3-configur.patch @@ -0,0 +1,57 @@ +From 86369ec6c37896394546f3b01f9c447c4f4188ae Mon Sep 17 00:00:00 2001 +From: Nehal J Wani +Date: Tue, 12 Jun 2018 05:26:24 +0000 +Subject: [PATCH 4/4] Hardcode HAVE_ALIGNED_ALLOC=1 in libstdc++-v3/configure + +--- + libstdc++-v3/configure | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure +index 18053ab7eae..44b6a72f775 100755 +--- a/libstdc++-v3/configure ++++ b/libstdc++-v3/configure +@@ -26405,6 +26405,11 @@ _ACEOF + fi + done + ++# The check above works only if aligned_alloc is present as a symbol in libc.so ++# Since we provide a header only implementation, override the value here ++cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_aligned_alloc" | $as_tr_cpp` 1 ++_ACEOF + + # For iconv support. + +@@ -38403,6 +38408,9 @@ _ACEOF + fi + done + ++cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_aligned_alloc" | $as_tr_cpp` 1 ++_ACEOF + ;; + + *-fuchsia*) +@@ -42318,6 +42326,10 @@ fi + done + + ++cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_aligned_alloc" | $as_tr_cpp` 1 ++_ACEOF ++ + ;; + *-mingw32*) + +@@ -45924,6 +45936,10 @@ _ACEOF + fi + done + ++cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_aligned_alloc" | $as_tr_cpp` 1 ++_ACEOF ++ + ;; + *-qnx6.1* | *-qnx6.2*) + SECTION_FLAGS='-ffunction-sections -fdata-sections' diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/setup_compiler.sh b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/setup_compiler.sh new file mode 100644 index 0000000000000000000000000000000000000000..dcdd387ae719e4341ae316205f920118cd4b1a45 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/setup_compiler.sh @@ -0,0 +1,48 @@ +#!/bin/bash +if [[ ! -d $SRC_DIR/cf-compilers ]]; then + extra_pkgs=() + if [[ "$build_platform" != "$target_platform" ]]; then + # we need a compiler to target cross_target_platform. + # when build_platform == target_platform, the compiler + # just built can be used. + # when build_platform != target_platform, the compiler + # just built cannot be used, hence we need one that + # can be used. + extra_pkgs+=( + "gcc_impl_${cross_target_platform}=${gcc_version}" + "gxx_impl_${cross_target_platform}=${gcc_version}" + "gfortran_impl_${cross_target_platform}=${gcc_version}" + ) + fi + # Remove conda-forge/label/sysroot-with-crypt when GCC < 14 is dropped + conda create -p $SRC_DIR/cf-compilers --yes --quiet \ + "binutils_impl_${build_platform}" \ + "gcc_impl_${build_platform}" \ + "gxx_impl_${build_platform}" \ + "gfortran_impl_${build_platform}" \ + "binutils_impl_${target_platform}=${binutils_version}" \ + "gcc_impl_${target_platform}" \ + "gxx_impl_${target_platform}" \ + "gfortran_impl_${target_platform}" \ + "${c_stdlib}_${target_platform}=${c_stdlib_version}" \ + "binutils_impl_${cross_target_platform}=${binutils_version}" \ + "${cross_target_stdlib}_${cross_target_platform}=${cross_target_stdlib_version}" \ + make \ + ${extra_pkgs[@]} +fi + +export PATH=$SRC_DIR/cf-compilers/bin:$PATH +export BUILD_PREFIX=$SRC_DIR/cf-compilers + +if [[ "$target_platform" == "win-"* && "${PREFIX}" != *Library ]]; then + export PREFIX=${PREFIX}/Library +fi + +source $RECIPE_DIR/get_cpu_arch.sh + +if [[ "$target_platform" == "win-64" ]]; then + EXEEXT=".exe" +else + EXEEXT="" +fi +SYSROOT_DIR=${PREFIX}/${TARGET}/sysroot diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/aligned_alloc.c b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/aligned_alloc.c new file mode 100644 index 0000000000000000000000000000000000000000..287be94c7340a134a5d9a56ddc0f6c20acc0af74 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/aligned_alloc.c @@ -0,0 +1,9 @@ +#include +#include + +int main(void) +{ + int *p2 = (int*)aligned_alloc(1024, 1024*sizeof *p2); + printf("1024-byte aligned addr: %p\n", (void*)p2); + free(p2); +} diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/aligned_alloc.cpp b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/aligned_alloc.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1379c7547ae63e12433db910d243f159657aa0b6 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/aligned_alloc.cpp @@ -0,0 +1,18 @@ +#include +#include +#include +//#include + +int main(void) +{ + /// int *p2 = (int*)memalign(1024, 1024 * sizeof *p2); + int *p2; + int err = posix_memalign((void**)&p2, 1024, sizeof *p2); + printf("1024-byte aligned addr: %p\n", (void*)p2); + free(p2); + p2 = (int*)std::aligned_alloc(1024, 1); + printf("1024-byte aligned addr: %p\n", (void*)p2); + std::free(p2); + p2 = (int*)aligned_alloc(1024, 1024); + printf("1024-byte aligned addr: %p\n", (void*)p2); +} diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/fortomp/CMakeLists.txt b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/fortomp/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..491a48b42cb3ddfef5f8541f8db848e0ba844f84 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/fortomp/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.3 FATAL_ERROR) +project(fortomp + LANGUAGES Fortran) + +find_package(OpenMP REQUIRED) diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/fortomp/test_fort.sh b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/fortomp/test_fort.sh new file mode 100644 index 0000000000000000000000000000000000000000..75731b653df023e75c4d2b73b2c345a3510faad9 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/fortomp/test_fort.sh @@ -0,0 +1,11 @@ +GFORTRAN=$(${PREFIX}/bin/*-gcc -dumpmachine)-gfortran +FFLAGS="-fopenmp -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe" + +cmake \ + -H${SRC_DIR} \ + -Bbuild \ + -DCMAKE_INSTALL_PREFIX=${PREFIX} \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_Fortran_COMPILER=${GFORTRAN} \ + -DCMAKE_Fortran_FLAGS="${FFLAGS}" \ + . diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/hello_world.c b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/hello_world.c new file mode 100644 index 0000000000000000000000000000000000000000..f6054fde81f8dfa4882cef918c408fa6b7255c3e --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/hello_world.c @@ -0,0 +1,5 @@ +#include + +int main() { + printf("hello world!\n"); +} diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/hello_world.cpp b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/hello_world.cpp new file mode 100644 index 0000000000000000000000000000000000000000..585eea4cee5b1176fd28267f3e27dbdb344fd31f --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/hello_world.cpp @@ -0,0 +1,6 @@ +#include + +int main(void) +{ + std::cout << "hello world!" << std::endl; +} diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/howdy-dso.c b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/howdy-dso.c new file mode 100644 index 0000000000000000000000000000000000000000..ea47ce0a03e061a965fc1e2cdaf310c038d4b44d --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/howdy-dso.c @@ -0,0 +1,6 @@ +#include + +int main(void) { + howdy(); + return 0; +} diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/libhowdy.c b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/libhowdy.c new file mode 100644 index 0000000000000000000000000000000000000000..6cd0dc522a8e4485f8173321a3dff2b21f079415 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/libhowdy.c @@ -0,0 +1,5 @@ +#include + +void howdy(void) { + printf("Howdy Y'all!\n"); +} diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/libhowdy.h b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/libhowdy.h new file mode 100644 index 0000000000000000000000000000000000000000..6234950e5a3ce9ff0209513f328d0ecfc71bac99 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/libhowdy.h @@ -0,0 +1,6 @@ +#ifndef _LIBHOWDY_H +#define _LIBHOWDY_H + +extern void howdy(void); + +#endif diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/tzdb-override.cpp b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/tzdb-override.cpp new file mode 100644 index 0000000000000000000000000000000000000000..73284e6245e5774322d67924db2f0907e5a6d668 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/tzdb-override.cpp @@ -0,0 +1,29 @@ +// We are using a weak symbol in linux and windows using a patch +// while upstream only has the definition and no implementation. +// Check that overriding works. + +// adapted from upstream tests +// https://github.com/gcc-mirror/gcc/blob/releases/gcc-14.1.0/libstdc%2B%2B-v3/testsuite/std/time/tzdb/1.cc +// https://github.com/gcc-mirror/gcc/blob/releases/gcc-14.1.0/libstdc%2B%2B-v3/testsuite/std/time/tzdb/leap_seconds.cc + +#include +#include +#include + +static bool override_used = false; + +namespace __gnu_cxx +{ + const char* zoneinfo_dir_override() { + override_used = true; + return "./"; + } +} + +using namespace std::chrono; + +int main() +{ + auto &a = get_tzdb(); + return !override_used; +} diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/tzdb.cpp b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/tzdb.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9ccf3f4d44cb32a75a7f9e0d4b8876e9d76693ca --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/tests/tzdb.cpp @@ -0,0 +1,95 @@ +// adapted from upstream tests +// https://github.com/gcc-mirror/gcc/blob/releases/gcc-14.1.0/libstdc%2B%2B-v3/testsuite/std/time/tzdb/1.cc +// https://github.com/gcc-mirror/gcc/blob/releases/gcc-14.1.0/libstdc%2B%2B-v3/testsuite/std/time/tzdb/leap_seconds.cc + +#include +#include +#include + +// https://github.com/gcc-mirror/gcc/blob/releases/gcc-14.1.0/libstdc%2B%2B-v3/testsuite/util/testsuite_hooks.h#L61-L70 +#define VERIFY(fn) \ + do \ + { \ + if (! (fn)) \ + { \ + __builtin_fprintf(stderr, \ + "%s:%d: %s: Assertion '%s' failed.\n", \ + __FILE__, __LINE__, __PRETTY_FUNCTION__, #fn); \ + __builtin_abort(); \ + } \ + } while (false) + + +using namespace std::chrono; + +void +test_version() +{ + const tzdb& db = get_tzdb(); + VERIFY( &db == &get_tzdb_list().front() ); + + const char* func; + try { + func = "remote_version"; + VERIFY( db.version == remote_version() ); + func = "reload_tzdb"; + const tzdb& reloaded = reload_tzdb(); + if (reloaded.version == db.version) + VERIFY( &reloaded == &db ); + } catch (const std::exception&) { + std::printf("std::chrono::%s() failed\n", func); + // on exception, we fail louder than the upstream reference test + exit(1); + } +} + +void +test_current() +{ + const tzdb& db = get_tzdb(); + const time_zone* tz = db.current_zone(); + VERIFY( tz == std::chrono::current_zone() ); +} + +void +test_locate() +{ + const tzdb& db = get_tzdb(); + const time_zone* tz = db.locate_zone("GMT"); + VERIFY( tz != nullptr ); + VERIFY( tz->name() == "Etc/GMT" ); + VERIFY( tz == std::chrono::locate_zone("GMT") ); + VERIFY( tz == db.locate_zone("Etc/GMT") ); + VERIFY( tz == db.locate_zone("Etc/GMT+0") ); + + VERIFY( db.locate_zone(db.current_zone()->name()) == db.current_zone() ); +} + +void +test_all_zones() +{ + const tzdb& db = get_tzdb(); + + for (const auto& zone : db.zones) + VERIFY( locate_zone(zone.name())->name() == zone.name() ); + + for (const auto& link : db.links) + VERIFY( locate_zone(link.name()) == locate_zone(link.target()) ); +} + +void +test_load_leapseconds() +{ + const auto& db = get_tzdb(); + + // this is correct as of tzdata 2024a + VERIFY( db.leap_seconds.size() == 27 ); +} + +int main() +{ + test_version(); + test_current(); + test_locate(); + test_load_leapseconds(); +} diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/uclibc.config b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/uclibc.config new file mode 100644 index 0000000000000000000000000000000000000000..1c51f52fd306d3a08ada254a04bb29b307ac7399 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/uclibc.config @@ -0,0 +1,295 @@ +# +# Automatically generated make config: don't edit +# Version: 0.9.32-git +# Fri Jul 9 22:31:59 2010 +# +# TARGET_alpha is not set +TARGET_arm=y +# TARGET_avr32 is not set +# TARGET_bfin is not set +# TARGET_cris is not set +# TARGET_e1 is not set +# TARGET_frv is not set +# TARGET_h8300 is not set +# TARGET_hppa is not set +# TARGET_i386 is not set +# TARGET_i960 is not set +# TARGET_ia64 is not set +# TARGET_m68k is not set +# TARGET_microblaze is not set +# TARGET_mips is not set +# TARGET_nios is not set +# TARGET_nios2 is not set +# TARGET_powerpc is not set +# TARGET_sh is not set +# TARGET_sh64 is not set +# TARGET_sparc is not set +# TARGET_v850 is not set +# TARGET_vax is not set +# TARGET_x86_64 is not set +# TARGET_xtensa is not set +# TARGET_c6x is not set + +# CONFIG_GENERIC_ARM is not set +# CONFIG_ARM610 is not set +# CONFIG_ARM710 is not set +# CONFIG_ARM7TDMI is not set +# CONFIG_ARM720T is not set +# CONFIG_ARM920T is not set +# CONFIG_ARM922T is not set +# CONFIG_ARM926T is not set +# CONFIG_ARM10T is not set +CONFIG_ARM1136JF_S=y +# CONFIG_ARM1176JZ_S is not set +# CONFIG_ARM1176JZF_S is not set +# CONFIG_ARM_CORTEX_M3 is not set +# CONFIG_ARM_CORTEX_M1 is not set +# CONFIG_ARM_SA110 is not set +# CONFIG_ARM_SA1100 is not set +# CONFIG_ARM_XSCALE is not set +# CONFIG_ARM_IWMMXT is not set + +# COMPILE_IN_THUMB_MODE is not set +USE_BX=y + +TARGET_SUBARCH="" +# +# Target Architecture Features and Options +# +TARGET_ARCH="arm" +FORCE_OPTIONS_FOR_ARCH=y +# +# Using ELF file format +# +ARCH_LITTLE_ENDIAN=y +# ARCH_BIG_ENDIAN is not set +ARCH_WANTS_LITTLE_ENDIAN=y +# ARCH_WANTS_BIG_ENDIAN is not set +ARCH_HAS_MMU=y +ARCH_USE_MMU=y +UCLIBC_HAS_FLOATS=y +UCLIBC_HAS_FPU=n +DO_C99_MATH=y +# DO_XSI_MATH is not set +# UCLIBC_HAS_FENV is not set +UCLIBC_HAS_LONG_DOUBLE_MATH=y +HAVE_DOT_CONFIG=y + +# +# General Library Settings +# +# HAVE_NO_PIC is not set +DOPIC=y +# ARCH_HAS_NO_SHARED is not set +# ARCH_HAS_NO_LDSO is not set +HAVE_SHARED=y +# FORCE_SHAREABLE_TEXT_SEGMENTS is not set +LDSO_LDD_SUPPORT=y +# LDSO_CACHE_SUPPORT is not set +LDSO_PRELOAD_ENV_SUPPORT=y +# LDSO_PRELOAD_FILE_SUPPORT is not set +# LDSO_STANDALONE_SUPPORT is not set +# LDSO_PRELINK_SUPPORT is not set +# UCLIBC_STATIC_LDCONFIG is not set +LDSO_RUNPATH=y +LDSO_SEARCH_INTERP_PATH=y +LDSO_LD_LIBRARY_PATH=y +# LDSO_NO_CLEANUP is not set +UCLIBC_CTOR_DTOR=y +# LDSO_GNU_HASH_SUPPORT is not set +# HAS_NO_THREADS is not set +UCLIBC_HAS_SYSLOG=y +UCLIBC_HAS_LFS=y +# MALLOC is not set +# MALLOC_SIMPLE is not set +MALLOC_STANDARD=y +MALLOC_GLIBC_COMPAT=y +UCLIBC_DYNAMIC_ATEXIT=y +# COMPAT_ATEXIT is not set +UCLIBC_SUSV3_LEGACY=y +# UCLIBC_SUSV3_LEGACY_MACROS is not set +UCLIBC_SUSV4_LEGACY=y +# UCLIBC_STRICT_HEADERS is not set +# UCLIBC_HAS_STUBS is not set +UCLIBC_HAS_SHADOW=y +UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y +UCLIBC_HAS___PROGNAME=y +UCLIBC_HAS_PTY=y +ASSUME_DEVPTS=y +UNIX98PTY_ONLY=y +UCLIBC_HAS_GETPT=y +UCLIBC_HAS_LIBUTIL=y +UCLIBC_HAS_TM_EXTENSIONS=y +UCLIBC_HAS_TZ_CACHING=y +UCLIBC_HAS_TZ_FILE=y +UCLIBC_HAS_TZ_FILE_READ_MANY=y +UCLIBC_TZ_FILE_PATH="/etc/TZ" +UCLIBC_FALLBACK_TO_ETC_LOCALTIME=y + +# +# Advanced Library Settings +# +UCLIBC_PWD_BUFFER_SIZE=256 +UCLIBC_GRP_BUFFER_SIZE=256 + +# +# Support various families of functions +# +UCLIBC_LINUX_MODULE_26=y +# UCLIBC_LINUX_MODULE_24 is not set +UCLIBC_LINUX_SPECIFIC=y +UCLIBC_HAS_GNU_ERROR=y +UCLIBC_BSD_SPECIFIC=y +UCLIBC_HAS_BSD_ERR=y +# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set +# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set +# UCLIBC_NTP_LEGACY is not set +# UCLIBC_SV4_DEPRECATED is not set +UCLIBC_HAS_REALTIME=y +UCLIBC_HAS_ADVANCED_REALTIME=y +UCLIBC_HAS_EPOLL=y +UCLIBC_HAS_XATTR=y +UCLIBC_HAS_PROFILING=y +UCLIBC_HAS_CRYPT_IMPL=y +# UCLIBC_HAS_SHA256_CRYPT_IMPL is not set +# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set +UCLIBC_HAS_CRYPT=y +UCLIBC_HAS_NETWORK_SUPPORT=y +UCLIBC_HAS_SOCKET=y +UCLIBC_HAS_IPV4=y +UCLIBC_HAS_IPV6=y +UCLIBC_HAS_RPC=n +UCLIBC_HAS_FULL_RPC=n +UCLIBC_HAS_REENTRANT_RPC=n +UCLIBC_USE_NETLINK=y +UCLIBC_SUPPORT_AI_ADDRCONFIG=y +# UCLIBC_HAS_BSD_RES_CLOSE is not set +UCLIBC_HAS_COMPAT_RES_STATE=y +# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set +UCLIBC_HAS_RESOLVER_SUPPORT=y +UCLIBC_HAS_LIBRESOLV_STUB=y +UCLIBC_HAS_LIBNSL_STUB=y + +# +# String and Stdio Support +# +# UCLIBC_HAS_STRING_GENERIC_OPT is not set +UCLIBC_HAS_STRING_ARCH_OPT=y +UCLIBC_HAS_CTYPE_TABLES=y +UCLIBC_HAS_CTYPE_SIGNED=y +# UCLIBC_HAS_CTYPE_UNSAFE is not set +UCLIBC_HAS_CTYPE_CHECKED=y +# UCLIBC_HAS_CTYPE_ENFORCED is not set +UCLIBC_HAS_WCHAR=y +UCLIBC_HAS_LOCALE=n +UCLIBC_HAS_HEXADECIMAL_FLOATS=y +# UCLIBC_HAS_GLIBC_DIGIT_GROUPING is not set +UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y +# USE_OLD_VFPRINTF is not set +UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9 +UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y +# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set +# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set +# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set +# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set +# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set +UCLIBC_HAS_STDIO_BUFSIZ_4096=y +# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set +UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y +# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set +# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set +# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set +# UCLIBC_HAS_STDIO_GETC_MACRO is not set +# UCLIBC_HAS_STDIO_PUTC_MACRO is not set +UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y +# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set +UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y +# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set +UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y +UCLIBC_HAS_PRINTF_M_SPEC=y +UCLIBC_HAS_ERRNO_MESSAGES=y +# UCLIBC_HAS_SYS_ERRLIST is not set +UCLIBC_HAS_SIGNUM_MESSAGES=y +# UCLIBC_HAS_SYS_SIGLIST is not set +UCLIBC_HAS_GNU_GETOPT=y +# UCLIBC_HAS_GNU_GETSUBOPT is not set + +# +# Big and Tall +# +UCLIBC_HAS_REGEX=y +# UCLIBC_HAS_REGEX_OLD is not set +UCLIBC_HAS_FNMATCH=y +# UCLIBC_HAS_FNMATCH_OLD is not set +# UCLIBC_HAS_WORDEXP is not set +UCLIBC_HAS_NFTW=y +UCLIBC_HAS_FTW=y +# UCLIBC_HAS_FTS is not set +UCLIBC_HAS_GLOB=y +UCLIBC_HAS_GNU_GLOB=y +UCLIBC_HAS_UTMPX=y + +# +# Library Installation Options +# +RUNTIME_PREFIX="/" +DEVEL_PREFIX="/usr/" +MULTILIB_DIR="lib" +HARDWIRED_ABSPATH=y + +# +# Security options +# +# UCLIBC_BUILD_PIE is not set +# UCLIBC_HAS_ARC4RANDOM is not set +# HAVE_NO_SSP is not set +UCLIBC_HAS_SSP=y +# UCLIBC_HAS_SSP_COMPAT is not set +# SSP_QUICK_CANARY is not set +PROPOLICE_BLOCK_ABRT=y +# PROPOLICE_BLOCK_SEGV is not set +# UCLIBC_BUILD_SSP is not set +UCLIBC_BUILD_RELRO=y +UCLIBC_BUILD_NOW=y +UCLIBC_BUILD_NOEXECSTACK=y + +# +# uClibc development/debugging options +# +UCLIBC_EXTRA_CFLAGS="" +# DODEBUG is not set +# DODEBUG_PT is not set +DOSTRIP=y +# DOASSERTS is not set +# SUPPORT_LD_DEBUG is not set +# SUPPORT_LD_DEBUG_EARLY is not set +# UCLIBC_MALLOC_DEBUGGING is not set +# UCLIBC_HAS_BACKTRACE is not set +WARNINGS="-Wall" +# EXTRA_WARNINGS is not set +# DOMULTI is not set +# UCLIBC_MJN3_ONLY is not set +# CONFIG_GENERIC_ARM is not set +# CONFIG_ARM610 is not set +# CONFIG_ARM710 is not set +# CONFIG_ARM7TDMI is not set +# CONFIG_ARM720T is not set +# CONFIG_ARM920T is not set +# CONFIG_ARM922T is not set +# CONFIG_ARM926T is not set +# CONFIG_ARM10T is not set +CONFIG_ARM1136JF_S=y +# CONFIG_ARM1176JZ_S is not set +# CONFIG_ARM1176JZF_S is not set +# CONFIG_ARM_SA110 is not set +# CONFIG_ARM_SA1100 is not set +# CONFIG_ARM_XSCALE is not set +# CONFIG_ARM_IWMMXT is not set +# CONFIG_ARM_OABI is not set +CONFIG_ARM_EABI=y +UCLIBC_HAS_THREADS=y +# LINUXTHREADS is not set +# LINUXTHREADS_NEW is not set +# LINUXTHREADS_OLD is not set +UCLIBC_HAS_THREADS_NATIVE=y +# PTHREADS_DEBUG_SUPPORT is not set diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/uclibc.config.minimal b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/uclibc.config.minimal new file mode 100644 index 0000000000000000000000000000000000000000..af041eabf04383938f4857a8ec85a6834b5c07b5 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/uclibc.config.minimal @@ -0,0 +1,2 @@ +UCLIBC_HAS_STDIO_GETC_MACRO=n +UCLIBC_HAS_STDIO_PUTC_MACRO=n diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/yum_requirements.txt b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/yum_requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..1017f133398ac40e5408f2f480b14d422da8b632 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/recipe/parent/yum_requirements.txt @@ -0,0 +1,12 @@ +wget +m4 +help2man +patch +gcc-gfortran +gcc-c++ +rsync +sed +findutils +make +file +strace diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/repodata_record.json b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..2e6ea40e1f9d6a1a01b1135762a02b8cb28a51e6 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/repodata_record.json @@ -0,0 +1,22 @@ +{ + "arch": "x86_64", + "build": "h166f726_7", + "build_number": 7, + "channel": "https://repo.anaconda.com/pkgs/main/linux-64/", + "constrains": [], + "depends": [ + "libgcc 15.2.0 h69a1729_7", + "_libgcc_mutex * main" + ], + "fn": "libgcc-ng-15.2.0-h166f726_7.conda", + "license": "GPL-3.0-only WITH GCC-exception-3.1", + "md5": "2783efb2502b9caa7f08e25fd54df899", + "name": "libgcc-ng", + "platform": "linux", + "sha256": "3a3678f17a8916777d03b83f19f673107b4a9bf55366234dcfa42edbd5173123", + "size": 28356, + "subdir": "linux-64", + "timestamp": 1762772577000, + "url": "https://repo.anaconda.com/pkgs/main/linux-64/libgcc-ng-15.2.0-h166f726_7.conda", + "version": "15.2.0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/run_exports.json b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/run_exports.json new file mode 100644 index 0000000000000000000000000000000000000000..efcbe41e81a5bf34ba2686bb595e674f9d0eed69 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/run_exports.json @@ -0,0 +1 @@ +{"strong": ["libgcc"]} \ No newline at end of file diff --git a/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/test/run_test.sh b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/test/run_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..4dd81228618db5d3ac73ba9bf5d4874d86ae2f16 --- /dev/null +++ b/miniconda3/pkgs/libgcc-ng-15.2.0-h166f726_7/info/test/run_test.sh @@ -0,0 +1,8 @@ + + +set -ex + + + +echo "empty wrapper for compatibility with previous naming" +exit 0 diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/about.json b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..b069dea825d3135e6de4dad0f12d547cec9a42f6 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/about.json @@ -0,0 +1,184 @@ +{ + "channels": [ + "https://repo.anaconda.com/pkgs/main", + "https://repo.anaconda.com/pkgs/main" + ], + "conda_build_version": "26.1.0", + "conda_version": "26.1.0", + "env_vars": { + "CIO_TEST": "" + }, + "extra": { + "copy_test_source_files": true, + "feedstock-name": "gettext", + "final": true, + "parent_recipe": { + "name": "gettext-split", + "path": "/home/task_177204486800161/gettext-feedstock/recipe", + "version": "0.25.1" + }, + "pbp_graph_uuid": "3e8405fd-0d33-4442-9c6e-741a46b5c97d", + "recipe-maintainers": [ + "scopatz", + "ocefpaf", + "pkgw", + "xhochy" + ], + "remote_url": "https://github.com/AnacondaRecipes/gettext-feedstock", + "sha": "4bf3d3ea276e8ac4d8833cf6edee3f440fe7f401", + "task_id": "AU3TsZcCRaK9jiaCosfOMQ", + "task_run_id": "0" + }, + "home": "https://www.gnu.org/software/gettext", + "identifiers": [], + "keywords": [], + "license": "GPL-3.0-or-later", + "license_file": "COPYING", + "root_pkgs": [ + "_libgcc_mutex 0.1 main", + "ca-certificates 2025.12.2 h06a4308_0", + "ld_impl_linux-64 2.40 h12ee557_0", + "libstdcxx-ng 11.2.0 h1234567_1", + "nlohmann_json 3.11.2 h6a678d5_0", + "pybind11-abi 5 hd3eb1b0_0", + "tzdata 2025b h04d1e81_0", + "libgomp 11.2.0 h1234567_1", + "_openmp_mutex 5.1 1_gnu", + "libgcc-ng 11.2.0 h1234567_1", + "bzip2 1.0.8 h5eee18b_6", + "c-ares 1.19.1 h5eee18b_0", + "cpp-expected 1.1.0 hdb19cb5_0", + "expat 2.7.1 h6a678d5_0", + "fmt 9.1.0 hdb19cb5_1", + "icu 73.1 h6a678d5_0", + "libev 4.33 h7f8727e_1", + "libffi 3.4.4 h6a678d5_1", + "libuuid 1.41.5 h5eee18b_0", + "lz4-c 1.9.4 h6a678d5_1", + "ncurses 6.4 h6a678d5_0", + "libiconv 1.16 h5eee18b_3", + "pthread-stubs 0.3 h0ce48e5_1", + "reproc 14.2.4 h6a678d5_2", + "simdjson 3.10.1 hdb19cb5_0", + "xorg-libxau 1.0.12 h9b100fa_0", + "xorg-libxdmcp 1.1.5 h9b100fa_0", + "xorg-xorgproto 2024.1 h5eee18b_1", + "xz 5.6.4 h5eee18b_1", + "yaml-cpp 0.8.0 h6a678d5_1", + "zlib 1.2.13 h5eee18b_1", + "libedit 3.1.20230828 h5eee18b_0", + "libnghttp2 1.57.0 h2d74bed_0", + "libssh2 1.11.1 h251f7ec_0", + "libxcb 1.17.0 h9b100fa_0", + "libxml2 2.13.8 hfdd30dd_0", + "pcre2 10.42 hebb0a14_1", + "readline 8.2 h5eee18b_0", + "reproc-cpp 14.2.4 h6a678d5_2", + "spdlog 1.11.0 hdb19cb5_0", + "zstd 1.5.6 hc292b87_0", + "krb5 1.21.3 h8a1dbc1_1", + "libarchive 3.7.7 hfab0078_0", + "libsolv 0.7.30 he621ea3_1", + "sqlite 3.50.2 hb25bd0a_1", + "xorg-libx11 1.8.12 h9b100fa_1", + "patch 2.8 hb25bd0a_0", + "libmamba 2.0.5 haf1ee3a_1", + "python 3.12.11 h22baa00_0", + "menuinst 2.3.0 py312h06a4308_0", + "anaconda-anon-usage 0.7.1 py312hfc0e8ea_100", + "annotated-types 0.6.0 py312h06a4308_0", + "archspec 0.2.3 pyhd3eb1b0_0", + "boltons 25.0.0 py312h06a4308_0", + "charset-normalizer 3.3.2 pyhd3eb1b0_0", + "distro 1.9.0 py312h06a4308_0", + "frozendict 2.4.2 py312h06a4308_0", + "idna 3.7 py312h06a4308_0", + "jsonpointer 2.1 pyhd3eb1b0_0", + "libmambapy 2.0.5 py312hdb19cb5_1", + "mdurl 0.1.0 py312h06a4308_0", + "packaging 24.2 py312h06a4308_0", + "platformdirs 4.3.7 py312h06a4308_0", + "pluggy 1.5.0 py312h06a4308_0", + "pycosat 0.6.6 py312h5eee18b_2", + "pycparser 2.21 pyhd3eb1b0_0", + "pygments 2.19.1 py312h06a4308_0", + "pysocks 1.7.1 py312h06a4308_0", + "ruamel.yaml.clib 0.2.12 py312h5eee18b_0", + "setuptools 78.1.1 py312h06a4308_0", + "tqdm 4.67.1 py312he106c6f_0", + "truststore 0.10.0 py312h06a4308_0", + "typing_extensions 4.12.2 py312h06a4308_0", + "wheel 0.45.1 py312h06a4308_0", + "cffi 1.17.1 py312h1fdaa30_1", + "jsonpatch 1.33 py312h06a4308_1", + "markdown-it-py 2.2.0 py312h06a4308_1", + "pip 25.1 pyhc872135_2", + "ruamel.yaml 0.18.10 py312h5eee18b_0", + "typing-extensions 4.12.2 py312h06a4308_0", + "typing-inspection 0.4.0 py312h06a4308_0", + "brotlicffi 1.0.9.2 py312h6a678d5_1", + "cryptography 45.0.3 py312h2ccb017_0", + "pydantic-core 2.33.2 py312hc6f7160_0", + "rich 13.9.4 py312h06a4308_0", + "zstandard 0.23.0 py312h2c38b39_1", + "conda-content-trust 0.2.0 py312h06a4308_1", + "pydantic 2.11.7 py312h06a4308_0", + "urllib3 2.5.0 py312h06a4308_0", + "requests 2.32.4 py312h06a4308_0", + "conda-package-streaming 0.12.0 py312h06a4308_0", + "conda-package-handling 2.4.0 py312h06a4308_0", + "conda-anaconda-tos 0.2.1 py312h06a4308_0", + "libsodium 1.0.20 heac8642_0", + "libunistring 1.3 hb25bd0a_0", + "mbedtls 3.5.1 h6a678d5_1", + "openssl 3.0.18 hd6dcaed_0", + "patchelf 0.17.2 h6a678d5_0", + "perl 5.40.2 0_h5eee18b_perl5", + "yaml 0.2.5 h7b6447c_0", + "liblief 0.16.4 h6a678d5_0", + "gettext 0.21.0 hedfda30_2", + "libidn2 2.3.8 hf80d704_0", + "tk 8.6.15 h54e0aa7_0", + "libcurl 8.16.0 heebcbe5_0", + "git 2.51.0 pl5382h000ed5b_0", + "argcomplete 3.6.2 py312h06a4308_0", + "attrs 25.4.0 py312h06a4308_2", + "certifi 2026.01.04 py312h06a4308_0", + "chardet 5.2.0 py312h06a4308_0", + "click 8.2.1 py312h06a4308_1", + "evalidate 2.0.3 py312h06a4308_0", + "filelock 3.20.3 py312h06a4308_0", + "jmespath 1.1.0 py312h06a4308_0", + "markupsafe 3.0.2 py312h5eee18b_0", + "msgpack-python 1.1.1 py312h6a678d5_0", + "pkginfo 1.12.1.2 py312h06a4308_0", + "psutil 7.0.0 py312hee96239_1", + "py-lief 0.16.4 py312h6a678d5_0", + "python-libarchive-c 5.3 py312h06a4308_0", + "pytz 2025.2 py312h06a4308_0", + "pyyaml 6.0.2 py312h5eee18b_0", + "rpds-py 0.28.0 py312h498d7c9_0", + "six 1.17.0 py312h06a4308_0", + "soupsieve 2.5 py312h06a4308_0", + "tomlkit 0.13.3 py312h06a4308_0", + "xmltodict 1.0.2 py312h06a4308_0", + "jinja2 3.1.6 py312h06a4308_0", + "python-dateutil 2.9.0post0 py312h06a4308_2", + "referencing 0.37.0 py312h06a4308_0", + "yq 3.4.3 py312h06a4308_0", + "beautifulsoup4 4.14.3 py312h06a4308_0", + "jsonschema-specifications 2025.9.1 py312h06a4308_0", + "pynacl 1.6.0 py312h2630517_0", + "jsonschema 4.25.1 py312h06a4308_0", + "botocore 1.42.34 py312h06a4308_0", + "s3transfer 0.16.0 py312h06a4308_0", + "boto3 1.42.34 py312h06a4308_0", + "conda 26.1.0 py312h06a4308_0", + "conda-anaconda-telemetry 0.3.0 pyhd3eb1b0_1", + "conda-index 0.7.0 py312h06a4308_1", + "conda-libmamba-solver 25.11.0 pyhdf14ebd_0", + "conda-build 26.1.0 py312h76456e7_0" + ], + "summary": "library for interfacing programmatically with GNU gettext .po files", + "tags": [] +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/files b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/files new file mode 100644 index 0000000000000000000000000000000000000000..4d47b81b8f7e1a8e1a84fee08b78d2ba5cc976b4 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/files @@ -0,0 +1,2 @@ +lib/libgettextpo.so.0 +lib/libgettextpo.so.0.5.14 diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/git b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/git new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/hash_input.json b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..068dbf7af3f21d8412b86d29b5849b608b49dee4 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/hash_input.json @@ -0,0 +1,12 @@ +{ + "c_stdlib_version": "2.28", + "cxx_compiler_version": "14.3.0", + "channel_targets": "defaults", + "cxx_compiler": "gxx", + "c_compiler_version": "14.3.0", + "libiconv": "1", + "c_stdlib": "sysroot", + "c_compiler": "gcc", + "target_platform": "linux-64", + "__glibc": "__glibc >=2.28,<3.0.a0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/index.json b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..557391365f21c44cf6a9759d40435e52eedcb7bd --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/index.json @@ -0,0 +1,16 @@ +{ + "arch": "x86_64", + "build": "hf2ab22a_0", + "build_number": 0, + "depends": [ + "__glibc >=2.28,<3.0.a0", + "libgcc >=14", + "libiconv >=1.18,<2.0a0" + ], + "license": "GPL-3.0-or-later", + "name": "libgettextpo", + "platform": "linux", + "subdir": "linux-64", + "timestamp": 1772045245717, + "version": "0.25.1" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/licenses/COPYING b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/licenses/COPYING new file mode 100644 index 0000000000000000000000000000000000000000..e60008693e017bec1b4eb49c84be3898e26fcf2a --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/licenses/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/paths.json b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..cc8e1e2e65ee5e03a384c8d3b83f0036b05ba721 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/paths.json @@ -0,0 +1,17 @@ +{ + "paths": [ + { + "_path": "lib/libgettextpo.so.0", + "path_type": "hardlink", + "sha256": "995efd5ce5775d2b12912aeb485d7c628a3aeb044101b5c3c54f59554cf4feaf", + "size_in_bytes": 466024 + }, + { + "_path": "lib/libgettextpo.so.0.5.14", + "path_type": "hardlink", + "sha256": "995efd5ce5775d2b12912aeb485d7c628a3aeb044101b5c3c54f59554cf4feaf", + "size_in_bytes": 466024 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/conda_build_config.yaml b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..866fa46f09fba8e319b30a24734242f16b15ff72 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/conda_build_config.yaml @@ -0,0 +1,35 @@ +c_compiler: gcc +c_compiler_version: 14.3.0 +c_stdlib: sysroot +c_stdlib_version: '2.28' +channel_targets: defaults +cpu_optimization_target: nocona +cran_mirror: https://cran.r-project.org +cxx_compiler: gxx +cxx_compiler_version: 14.3.0 +extend_keys: +- pin_run_as_build +- extend_keys +- ignore_version +- ignore_build_only_deps +fortran_compiler: gfortran +gettext: '0' +ignore_build_only_deps: +- numpy +- python +libiconv: '1' +lua: '5' +ncurses: '6' +numpy: '1.26' +perl: 5.26.2 +pin_run_as_build: + python: + max_pin: x.x + min_pin: x.x + r-base: + max_pin: x.x + min_pin: x.x +platform: linux-64 +python: '3.11' +r_base: '3.5' +target_platform: linux-64 diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/install-libgettextpo.sh b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/install-libgettextpo.sh new file mode 100644 index 0000000000000000000000000000000000000000..9e2afdc5569cbbad2164cd670fddfece1d370b9d --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/install-libgettextpo.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -euxo pipefail + +mkdir -p $PREFIX/lib + +if [[ "${target_platform}" == osx-* ]]; then + cp ./gettext-tools/libgettextpo/.libs/libgettextpo.*.dylib $PREFIX/lib +else + cp ./gettext-tools/libgettextpo/.libs/libgettextpo.so.* $PREFIX/lib +fi diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/meta.yaml b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9360aa9b3861fcdf14367c45988d4d4541f1f0fc --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/meta.yaml @@ -0,0 +1,74 @@ +# This file created by conda-build 26.1.0 +# ------------------------------------------------ + +package: + name: libgettextpo + version: 0.25.1 +source: + url: https://ftp.gnu.org/pub/gnu/gettext/gettext-0.25.1.tar.xz + sha256: 2c8294be238f03fb3fa65b8051057e5b68167f3e21f08008070cf40a7051ba22 + patches: null +build: + run_exports: + - libgettextpo >=0.25.1,<1.0a0 + ignore_run_exports_from: + - gxx_linux-64 14.3.0.* + number: 0 + string: hf2ab22a_0 +requirements: + build: + - _libgcc_mutex 0.1 main + - _openmp_mutex 5.1 1_gnu + - binutils_impl_linux-64 2.44 h4b9a079_2 + - binutils_linux-64 2.44 hc03a8fd_2 + - gcc_impl_linux-64 14.3.0 h4943218_4 + - gcc_linux-64 14.3.0 hda73cce_12 + - gxx_impl_linux-64 14.3.0 he634eba_4 + - gxx_linux-64 14.3.0 hca8765c_12 + - kernel-headers_linux-64 4.18.0 h3108a97_1 + - ld_impl_linux-64 2.44 h153f514_2 + - libgcc 15.2.0 h69a1729_7 + - libgcc-devel_linux-64 14.3.0 he7458c1_104 + - libgcc-ng 15.2.0 h166f726_7 + - libgomp 15.2.0 h4751f2c_7 + - libltdl 2.6.0 h47b2149_0 + - libsanitizer 14.3.0 hd4faa28_4 + - libstdcxx 15.2.0 h39759b7_7 + - libstdcxx-devel_linux-64 14.3.0 he7458c1_104 + - libtool 2.6.0 h7354ed3_0 + - make 4.2.1 h1bed415_1 + - sysroot_linux-64 2.28 h3108a97_1 + - tzdata 2025c he532380_0 + host: + - _libgcc_mutex 0.1 main + - _openmp_mutex 5.1 1_gnu + - libgcc 15.2.0 h69a1729_7 + - libgomp 15.2.0 h4751f2c_7 + - libiconv 1.18 h75a1612_0 + run: + - __glibc >=2.28,<3.0.a0 + - libgcc >=14 + - libiconv >=1.18,<2.0a0 +test: + commands: + - test -f ${PREFIX}/lib/libgettextpo.so.0 + - test ! -f ${PREFIX}/lib/libgettextpo$SHLIB_EXT +about: + home: https://www.gnu.org/software/gettext + license: GPL-3.0-or-later + license_file: COPYING + summary: library for interfacing programmatically with GNU gettext .po files +extra: + feedstock-name: gettext + recipe-maintainers: + - ocefpaf + - pkgw + - scopatz + - xhochy + final: true + copy_test_source_files: true + remote_url: https://github.com/AnacondaRecipes/gettext-feedstock + sha: 4bf3d3ea276e8ac4d8833cf6edee3f440fe7f401 + task_id: AU3TsZcCRaK9jiaCosfOMQ + task_run_id: '0' + pbp_graph_uuid: 3e8405fd-0d33-4442-9c6e-741a46b5c97d diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/.gitattributes b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..2126fa4a1d6ca54c25a9f0f1403e56d58c72a041 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/.gitattributes @@ -0,0 +1,2 @@ +ar-lib text eol=lf +compile text eol=lf diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/an.po b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/an.po new file mode 100644 index 0000000000000000000000000000000000000000..ea2051bf913a94d6b2839d2cf5bba8a6d9acce56 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/an.po @@ -0,0 +1,145 @@ +# Aragonese translation for glib-networking. +# Copyright (C) 2013 glib-networking's COPYRIGHT HOLDER +# This file is distributed under the same license as the glib-networking package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: glib-networking master\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=glib&keywords=I18N+L10N&component=network\n" +"POT-Creation-Date: 2013-02-19 13:01+0000\n" +"PO-Revision-Date: 2013-02-20 01:19+0100\n" +"Last-Translator: Daniel Martinez \n" +"Language-Team: Aragonese \n" +"Language: an\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../proxy/libproxy/glibproxyresolver.c:150 +msgid "Proxy resolver internal error." +msgstr "Error interna d'o proxy." + +#: ../tls/gnutls/gtlscertificate-gnutls.c:173 +#, c-format +msgid "Could not parse DER certificate: %s" +msgstr "No se podió analisar o certificau DER: %s" + +#: ../tls/gnutls/gtlscertificate-gnutls.c:194 +#, c-format +msgid "Could not parse PEM certificate: %s" +msgstr "No se podió analisar o certificau PEM: %s" + +#: ../tls/gnutls/gtlscertificate-gnutls.c:225 +#, c-format +msgid "Could not parse DER private key: %s" +msgstr "No se podió analisar a clau privada DER: %s" + +#: ../tls/gnutls/gtlscertificate-gnutls.c:256 +#, c-format +msgid "Could not parse PEM private key: %s" +msgstr "No se podió analisar a clau privada PEM: %s" + +#: ../tls/gnutls/gtlscertificate-gnutls.c:296 +msgid "No certificate data provided" +msgstr "No s'han proporcionau datos d'o certificau" + +#: ../tls/gnutls/gtlsclientconnection-gnutls.c:309 +msgid "Server required TLS certificate" +msgstr "O servidor requiere un certificau TLS" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:258 +#, c-format +msgid "Could not create TLS connection: %s" +msgstr "No se podió creyar a connexión TLS: %s" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:520 +msgid "Connection is closed" +msgstr "A connexión ye zarrada" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:582 +#: ../tls/gnutls/gtlsconnection-gnutls.c:1419 +msgid "Operation would block" +msgstr "A operación se blocará" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:712 +msgid "Peer failed to perform TLS handshake" +msgstr "O par falló en realizar a negociación TLS" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:729 +msgid "Peer requested illegal TLS rehandshake" +msgstr "O par solicitó una renegociación TLS ilegal" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:755 +msgid "TLS connection closed unexpectedly" +msgstr "A connexión TLS se zarró inasperadament" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:765 +msgid "TLS connection peer did not send a certificate" +msgstr "O par d'a connexión TLS no ninvió un certificau" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:1146 +#: ../tls/gnutls/gtlsconnection-gnutls.c:1165 +#, c-format +msgid "Error performing TLS handshake: %s" +msgstr "Error en realizar a negociación TLS: %s" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:1175 +msgid "Server did not return a valid TLS certificate" +msgstr "O servidor no devolvió un certificau TLS valido" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:1250 +msgid "Unacceptable TLS certificate" +msgstr "Certificau TLS inacceptable" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:1442 +#, c-format +msgid "Error reading data from TLS socket: %s" +msgstr "Error en leyer datos d'o socket TLS: %s" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:1471 +#, c-format +msgid "Error writing data to TLS socket: %s" +msgstr "Error en escribir datos en o socket TLS: %s" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:1515 +msgid "Connection is already closed" +msgstr "A connexión ya ye zarrada" + +#: ../tls/gnutls/gtlsconnection-gnutls.c:1525 +#, c-format +msgid "Error performing TLS close: %s" +msgstr "Error en zarrar o TLS: %s" + +#: ../tls/gnutls/gtlsserverconnection-gnutls.c:103 +msgid "Certificate has no private key" +msgstr "O certificau no tiene clau privada" + +#: ../tls/pkcs11/gpkcs11pin.c:108 +msgid "This is the last chance to enter the PIN correctly before the token is locked." +msgstr "Ista ye a zaguera oportunidat ta introducir o PIN correctament antes que se bloque o \"token\"." + +#: ../tls/pkcs11/gpkcs11pin.c:110 +msgid "Several PIN attempts have been incorrect, and the token will be locked after further failures." +msgstr "Quantos intentos d'introducir o PIN han estau incorrectos y o \"token\" se blocará dimpués de mas fallos." + +#: ../tls/pkcs11/gpkcs11pin.c:112 +msgid "The PIN entered is incorrect." +msgstr "O PIN introduciu ye incorrecto." + +#: ../tls/pkcs11/gpkcs11slot.c:446 +msgid "Module" +msgstr "Modulo" + +#: ../tls/pkcs11/gpkcs11slot.c:447 +msgid "PKCS#11 Module Pointer" +msgstr "Puntero d'o modulo PKCS#11" + +#: ../tls/pkcs11/gpkcs11slot.c:454 +msgid "Slot ID" +msgstr "ID d'a ranura" + +#: ../tls/pkcs11/gpkcs11slot.c:455 +msgid "PKCS#11 Slot Identifier" +msgstr "Identificador d'a ranura de PKCS#11" + diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/ar-lib b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/ar-lib new file mode 100644 index 0000000000000000000000000000000000000000..54c6bdbf7f1b314721a3af9996f6ed6dd7091619 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/ar-lib @@ -0,0 +1,275 @@ +#! /bin/sh +# Wrapper for Microsoft lib.exe + +me=ar-lib +scriptversion=2019-07-04.01; # UTC + +# Copyright (C) 2010-2022 Free Software Foundation, Inc. +# Written by Peter Rosin . +# +# 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 . + +# 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 or send patches to +# . + + +# func_error message +func_error () +{ + echo "$me: $1" 1>&2 + exit 1 +} + +file_conv= + +# func_file_conv build_file +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN* | MSYS*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv in + mingw) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin | msys) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_at_file at_file operation archive +# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE +# for each of them. +# When interpreting the content of the @FILE, do NOT use func_file_conv, +# since the user would need to supply preconverted file names to +# binutils ar, at least for MinGW. +func_at_file () +{ + operation=$2 + archive=$3 + at_file_contents=`cat "$1"` + eval set x "$at_file_contents" + shift + + for member + do + $AR -NOLOGO $operation:"$member" "$archive" || exit $? + done +} + +case $1 in + '') + func_error "no command. Try '$0 --help' for more information." + ;; + -h | --h*) + cat <. +# +# 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 . + +# 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 or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN* | MSYS*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/* | msys/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + clang-cl | *[/\\]clang-cl | clang-cl.exe | *[/\\]clang-cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf-devel.bat b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf-devel.bat new file mode 100644 index 0000000000000000000000000000000000000000..5c43f5c19c29354b2f3008a53e45dd8b67b49620 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf-devel.bat @@ -0,0 +1,17 @@ +@echo on + +if not exist %LIBRARY_PREFIX%\include md %LIBRARY_PREFIX%\include +if errorlevel 1 exit 1 + +copy gettext-runtime\libasprintf\autosprintf.h %LIBRARY_PREFIX%\include\autosprintf.h +if errorlevel 1 exit 1 + +if not exist %LIBRARY_PREFIX%\lib md %LIBRARY_PREFIX%\lib +if errorlevel 1 exit 1 + +copy gettext-runtime\libasprintf\.libs\asprintf.dll.lib %LIBRARY_PREFIX%\lib\asprintf.dll.lib +if errorlevel 1 exit 1 + +@rem Enforce dynamic linkage +copy gettext-runtime\libasprintf\.libs\asprintf.dll.lib %LIBRARY_PREFIX%\lib\asprintf.lib +if errorlevel 1 exit 1 diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf-devel.sh b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf-devel.sh new file mode 100644 index 0000000000000000000000000000000000000000..e790223a2fa1805856d95bcd9bcbb918a3738829 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf-devel.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -euxo pipefail + +mkdir -p ${PREFIX}/include +cp ./gettext-runtime/libasprintf/autosprintf.h ${PREFIX}/include/autosprintf.h + +pushd ${PREFIX}/lib +if [[ "${target_platform}" == osx-* ]]; then + ln -s libasprintf.*.dylib libasprintf.dylib +else + test -f libasprintf.so.0 + ln -s libasprintf.so.0 libasprintf.so +fi +popd + diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf.bat b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf.bat new file mode 100644 index 0000000000000000000000000000000000000000..e1a7182a201ae7a6fd580d15be4a359a540ad6fc --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf.bat @@ -0,0 +1,7 @@ +@echo on + +if not exist %LIBRARY_PREFIX%\bin md %LIBRARY_PREFIX%\bin +if errorlevel 1 exit 1 + +copy gettext-runtime\libasprintf\.libs\asprintf-0.dll %LIBRARY_PREFIX%\bin +if errorlevel 1 exit 1 diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf.sh b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf.sh new file mode 100644 index 0000000000000000000000000000000000000000..0a0defbb1601d5fdc7859cb3caa40cdfcd0d0623 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-asprintf.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -euxo pipefail + +mkdir -p $PREFIX/lib + +if [[ "${target_platform}" == osx-* ]]; then + cp ./gettext-runtime/libasprintf/.libs/libasprintf.*.dylib $PREFIX/lib +else + cp ./gettext-runtime/libasprintf/.libs/libasprintf.so.* $PREFIX/lib +fi diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-gettext.bat b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-gettext.bat new file mode 100644 index 0000000000000000000000000000000000000000..d52472e49b7b7fe580071b8d2a6f269f67118e63 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-gettext.bat @@ -0,0 +1,25 @@ +:: Delegate to the Unix script. We need to translate the key path variables +:: to be Unix-y rather than Windows-y, though. + +copy "%RECIPE_DIR%\build.sh" . + +set MSYSTEM=MINGW%ARCH% +set MSYS2_PATH_TYPE=inherit +set CHERE_INVOKING=1 + +set "saved_recipe_dir=%RECIPE_DIR%" +FOR /F "delims=" %%i IN ('cygpath.exe -u -p "%PATH%"') DO set "PATH_OVERRIDE=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%BUILD_PREFIX%"') DO set "BUILD_PREFIX=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -m "%LIBRARY_PREFIX%"') DO set "LIBRARY_PREFIX_M=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%LIBRARY_PREFIX%"') DO set "LIBRARY_PREFIX_U=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%PREFIX%"') DO set "PREFIX=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%PYTHON%"') DO set "PYTHON=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%RECIPE_DIR%"') DO set "RECIPE_DIR=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%SP_DIR%"') DO set "SP_DIR=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%SRC_DIR%"') DO set "SRC_DIR=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%STDLIB_DIR%"') DO set "STDLIB_DIR=%%i" + +bash -lxc "${RECIPE_DIR}/install-gettext.sh" +if errorlevel 1 exit 1 +exit 0 + diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-gettext.sh b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-gettext.sh new file mode 100644 index 0000000000000000000000000000000000000000..2e5aa8da882754b6dc65ad664b25031c80442991 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/recipe/parent/install-gettext.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -euxo pipefail + +make install + +if [[ "${PKG_NAME}" != "gettext" ]]; then + rm -rf ${PREFIX}/share/gettext/projects + rm -rf ${PREFIX}/share/doc/libtextstyle + rm -rf ${PREFIX}/share/doc/gettext/examples + rm -rf ${PREFIX}/share/doc/gettext/javadoc2 +fi + +# This overlaps with readline: +rm -rf ${PREFIX}/share/info/dir + +find $PREFIX -name '*.la' -delete diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/repodata_record.json b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..ce1465f7fc088f0e8a45a102461b8adeb3164d23 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/repodata_record.json @@ -0,0 +1,23 @@ +{ + "arch": "x86_64", + "build": "hf2ab22a_0", + "build_number": 0, + "channel": "https://repo.anaconda.com/pkgs/main/linux-64/", + "constrains": [], + "depends": [ + "__glibc >=2.28,<3.0.a0", + "libgcc >=14", + "libiconv >=1.18,<2.0a0" + ], + "fn": "libgettextpo-0.25.1-hf2ab22a_0.conda", + "license": "GPL-3.0-or-later", + "md5": "775a5698ec2a0aa6e2435b86418b563f", + "name": "libgettextpo", + "platform": "linux", + "sha256": "c1585ccdee3503c2e055014197f63b99ac47a7493c612beef2162cbdd9f5528c", + "size": 190134, + "subdir": "linux-64", + "timestamp": 1772045245000, + "url": "https://repo.anaconda.com/pkgs/main/linux-64/libgettextpo-0.25.1-hf2ab22a_0.conda", + "version": "0.25.1" +} \ No newline at end of file diff --git a/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/run_exports.json b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/run_exports.json new file mode 100644 index 0000000000000000000000000000000000000000..f4b5ce9701221dfa31b5f7bb10a5d400c68af6e8 --- /dev/null +++ b/miniconda3/pkgs/libgettextpo-0.25.1-hf2ab22a_0/info/run_exports.json @@ -0,0 +1 @@ +{"weak": ["libgettextpo >=0.25.1,<1.0a0"]} \ No newline at end of file