2 Purpose: Check multiple long long values passing.
3 Also, exceed the limit of gpr and fpr registers on PowerPC
7 Originator: <andreast@gcc.gnu.org> 20031026 */
14 closure_test_fn0(ffi_cif
* cif __UNUSED__
, void* resp
, void** args
,
18 (int)*(unsigned long long *)args
[0] + (int)*(unsigned long long *)args
[1] +
19 (int)*(unsigned long long *)args
[2] + (int)*(unsigned long long *)args
[3] +
20 (int)*(unsigned long long *)args
[4] + (int)*(unsigned long long *)args
[5] +
21 (int)*(unsigned long long *)args
[6] + (int)*(unsigned long long *)args
[7] +
22 (int)*(unsigned long long *)args
[8] + (int)*(unsigned long long *)args
[9] +
23 (int)*(unsigned long long *)args
[10] +
24 (int)*(unsigned long long *)args
[11] +
25 (int)*(unsigned long long *)args
[12] +
26 (int)*(unsigned long long *)args
[13] +
27 (int)*(unsigned long long *)args
[14] +
28 *(int *)args
[15] + (int)(long)userdata
;
30 printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
31 (int)*(unsigned long long *)args
[0],
32 (int)*(unsigned long long *)args
[1],
33 (int)*(unsigned long long *)args
[2],
34 (int)*(unsigned long long *)args
[3],
35 (int)*(unsigned long long *)args
[4],
36 (int)*(unsigned long long *)args
[5],
37 (int)*(unsigned long long *)args
[6],
38 (int)*(unsigned long long *)args
[7],
39 (int)*(unsigned long long *)args
[8],
40 (int)*(unsigned long long *)args
[9],
41 (int)*(unsigned long long *)args
[10],
42 (int)*(unsigned long long *)args
[11],
43 (int)*(unsigned long long *)args
[12],
44 (int)*(unsigned long long *)args
[13],
45 (int)*(unsigned long long *)args
[14],
47 (int)(long)userdata
, (int)*(ffi_arg
*)resp
);
51 typedef int (*closure_test_type0
)(unsigned long long, unsigned long long,
52 unsigned long long, unsigned long long,
53 unsigned long long, unsigned long long,
54 unsigned long long, unsigned long long,
55 unsigned long long, unsigned long long,
56 unsigned long long, unsigned long long,
57 unsigned long long, unsigned long long,
58 unsigned long long, int);
64 static ffi_closure cl
;
67 ffi_type
* cl_arg_types
[17];
71 pcl
= allocate_mmap (sizeof(ffi_closure
));
76 for (i
= 0; i
< 15; i
++) {
77 cl_arg_types
[i
] = &ffi_type_uint64
;
79 cl_arg_types
[15] = &ffi_type_sint
;
80 cl_arg_types
[16] = NULL
;
82 /* Initialize the cif */
83 CHECK(ffi_prep_cif(&cif
, FFI_DEFAULT_ABI
, 16,
84 &ffi_type_sint
, cl_arg_types
) == FFI_OK
);
86 CHECK(ffi_prep_closure(pcl
, &cif
, closure_test_fn0
,
87 (void *) 3 /* userdata */) == FFI_OK
);
89 res
= (*((closure_test_type0
)pcl
))
90 (1LL, 2LL, 3LL, 4LL, 127LL, 429LL, 7LL, 8LL, 9LL, 10LL, 11LL, 12LL,
92 /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
93 printf("res: %d\n",res
);
94 /* { dg-output "\nres: 680" } */