1# tests for natively compiled functions
2
3# basic test
4@micropython.native
5def native_test(x):
6    print(1, [], x)
7
8
9native_test(2)
10
11# check that GC doesn't collect the native function
12import gc
13
14gc.collect()
15native_test(3)
16
17# native with 2 args
18@micropython.native
19def f(a, b):
20    print(a + b)
21
22
23f(1, 2)
24
25# native with 3 args
26@micropython.native
27def f(a, b, c):
28    print(a + b + c)
29
30
31f(1, 2, 3)
32
33# check not operator
34@micropython.native
35def f(a):
36    print(not a)
37
38
39f(False)
40f(True)
41