• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright Nicolas Lelong,  2010. Distributed under the Boost
2# Software License, Version 1.0 (See accompanying
3# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4"""
5>>> from calling_conventions_ext import *
6>>> f_0__cdecl()
717041
8>>> f_1__cdecl(1)
91
10>>> f_2__cdecl(1, 2)
1121
12>>> f_3__cdecl(1, 2, 3)
13321
14>>> f_4__cdecl(1, 2, 3, 4)
154321
16>>> f_5__cdecl(1, 2, 3, 4, 5)
1754321
18>>> f_6__cdecl(1, 2, 3, 4, 5, 6)
19654321
20>>> f_7__cdecl(1, 2, 3, 4, 5, 6, 7)
217654321
22>>> f_8__cdecl(1, 2, 3, 4, 5, 6, 7, 8)
2387654321
24>>> f_9__cdecl(1, 2, 3, 4, 5, 6, 7, 8, 9)
25987654321
26>>> f_0__stdcall()
2717041
28>>> f_1__stdcall(1)
291
30>>> f_2__stdcall(1, 2)
3121
32>>> f_3__stdcall(1, 2, 3)
33321
34>>> f_4__stdcall(1, 2, 3, 4)
354321
36>>> f_5__stdcall(1, 2, 3, 4, 5)
3754321
38>>> f_6__stdcall(1, 2, 3, 4, 5, 6)
39654321
40>>> f_7__stdcall(1, 2, 3, 4, 5, 6, 7)
417654321
42>>> f_8__stdcall(1, 2, 3, 4, 5, 6, 7, 8)
4387654321
44>>> f_9__stdcall(1, 2, 3, 4, 5, 6, 7, 8, 9)
45987654321
46>>> f_0__fastcall()
4717041
48>>> f_1__fastcall(1)
491
50>>> f_2__fastcall(1, 2)
5121
52>>> f_3__fastcall(1, 2, 3)
53321
54>>> f_4__fastcall(1, 2, 3, 4)
554321
56>>> f_5__fastcall(1, 2, 3, 4, 5)
5754321
58>>> f_6__fastcall(1, 2, 3, 4, 5, 6)
59654321
60>>> f_7__fastcall(1, 2, 3, 4, 5, 6, 7)
617654321
62>>> f_8__fastcall(1, 2, 3, 4, 5, 6, 7, 8)
6387654321
64>>> f_9__fastcall(1, 2, 3, 4, 5, 6, 7, 8, 9)
65987654321
66"""
67
68def run(args = None):
69    import sys
70    import doctest
71
72    if args is not None:
73        sys.argv = args
74    return doctest.testmod(sys.modules.get(__name__))
75
76if __name__ == '__main__':
77    print("running...")
78    import sys
79    status = run()[0]
80    if (status == 0): print("Done.")
81    sys.exit(status)
82