diff options
author | Mikhail Borisov <borisov.mikhail@gmail.com> | 2022-02-10 16:45:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:39 +0300 |
commit | a6a92afe03e02795227d2641b49819b687f088f8 (patch) | |
tree | f6984a1d27d5a7ec88a6fdd6e20cd5b7693b6ece /contrib/restricted/libffi/testsuite/libffi.closures/cls_sint.c | |
parent | c6dc8b8bd530985bc4cce0137e9a5de32f1087cb (diff) | |
download | ydb-a6a92afe03e02795227d2641b49819b687f088f8.tar.gz |
Restoring authorship annotation for Mikhail Borisov <borisov.mikhail@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'contrib/restricted/libffi/testsuite/libffi.closures/cls_sint.c')
-rw-r--r-- | contrib/restricted/libffi/testsuite/libffi.closures/cls_sint.c | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/contrib/restricted/libffi/testsuite/libffi.closures/cls_sint.c b/contrib/restricted/libffi/testsuite/libffi.closures/cls_sint.c index c7e13b73a3..bf30e9492e 100644 --- a/contrib/restricted/libffi/testsuite/libffi.closures/cls_sint.c +++ b/contrib/restricted/libffi/testsuite/libffi.closures/cls_sint.c @@ -1,42 +1,42 @@ -/* Area: closure_call - Purpose: Check return value sint32. - Limitations: none. - PR: none. - Originator: <andreast@gcc.gnu.org> 20031108 */ - -/* { dg-do run } */ -#include "ffitest.h" - -static void cls_ret_sint_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, - void* userdata __UNUSED__) -{ - *(ffi_arg*)resp = *(signed int *)args[0]; - printf("%d: %d\n",*(signed int *)args[0], - (int)*(ffi_arg *)(resp)); -} -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); -} +/* Area: closure_call + Purpose: Check return value sint32. + Limitations: none. + PR: none. + Originator: <andreast@gcc.gnu.org> 20031108 */ + +/* { dg-do run } */ +#include "ffitest.h" + +static void cls_ret_sint_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + *(ffi_arg*)resp = *(signed int *)args[0]; + printf("%d: %d\n",*(signed int *)args[0], + (int)*(ffi_arg *)(resp)); +} +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); +} |