1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# call-external
# === External function calls inside user-defined functions ===
# Basic function calling external function
def add_wrapper(a, b):
return add_ints(a, b)
result = add_wrapper(10, 20)
assert result == 30
# Function with multiple external calls (sequential)
def multi_ext():
x = add_ints(1, 2)
y = add_ints(3, 4)
return add_ints(x, y)
assert multi_ext() == 10
# External call in function with local variable usage
def with_locals():
x = 100
y = add_ints(x, 50)
z = y * 2
return z
assert with_locals() == 300
# Function returning external call result
def get_sum(a, b, c):
temp = add_ints(a, b)
return add_ints(temp, c)
assert get_sum(1, 2, 3) == 6