comparison test/callback_suite/README.txt @ 513:95f6f43178ed

test/callback_suite simplifications: - more generator code sharing - changing how explicit callconv is specified - fix to handle signatures with calling convention prefixes, correctly
author Tassilo Philipp
date Sun, 10 Apr 2022 16:10:10 +0200
parents f3d44195dbdf
children
comparison
equal deleted inserted replaced
512:4d0541bf9b38 513:95f6f43178ed
20 Example: 20 Example:
21 The body for a signature of type "dpdf)p" at case id 19 is: 21 The body for a signature of type "dpdf)p" at case id 19 is:
22 22
23 void f19(void* addr) 23 void f19(void* addr)
24 { 24 {
25 V_p[4] = ((CONFIG_API p(*)(d,p,d,f))addr)(K_d[0],K_p[1],K_d[2],K_f[3]); 25 V_p[4] = ((p(*)(d,p,d,f))addr)(K_d[0],K_p[1],K_d[2],K_f[3]);
26 } ^^^^^^^^^^- specific calling convention 26 } ^^^^- dyncallback object
27 ^^^^^^^^^^^^^- signature 27 ^^^^^^^^^^^^^- signature
28 ^- return type ^^^^- dyncallback object 28 ^- return type ^- args from reference values (to be retrieved in handler)
29 ^- args from reference values (to be retrieved in handler) 29
30 30
31 The K_? values are the reference values, which are supposed to be copied to 31 The K_? values are the reference values, which are supposed to be copied to
32 V_?, and are compared for identity after invocation. The arguments are copied 32 V_?, and are compared for identity after invocation. The arguments are copied
33 to V_? in the callback handler, called through "addr". 33 to V_? in the callback handler, called through "addr".
34 34
35 The reference values stored in K_? are generated once, randomly, at startup. 35 The reference values stored in K_? are generated once, randomly, at startup.
36 36
37 37
38 Testing for exotic calling conventions on Windows 38 Specific calling conventions:
39 39
40 Specify 'api' and 'ccprefix' accordingly: 40 Specify 'api' and 'ccprefix' accordingly to generate callbacks for a
41 41 specific/custom calling convention:
42 42
43 "__stdcall" "_s" 43 "__stdcall" "_s"
44 "__fastcall" "_f" for gcc compiler 44 "__fastcall" "_f" for gcc compiler
45 "_F" for microsoft compiler 45 "_F" for microsoft compiler
46 46