1# Test that calling clazz.__call__() with up to at least 3 arguments
2# doesn't require heap allocation.
3import micropython
4
5
6class Foo0:
7    def __call__(self):
8        print("__call__")
9
10
11class Foo1:
12    def __call__(self, a):
13        print("__call__", a)
14
15
16class Foo2:
17    def __call__(self, a, b):
18        print("__call__", a, b)
19
20
21class Foo3:
22    def __call__(self, a, b, c):
23        print("__call__", a, b, c)
24
25
26f0 = Foo0()
27f1 = Foo1()
28f2 = Foo2()
29f3 = Foo3()
30
31micropython.heap_lock()
32f0()
33f1(1)
34f2(1, 2)
35f3(1, 2, 3)
36micropython.heap_unlock()
37