Fortran · 494 bytes Raw Blame History
1 program integer16_external_stack_call
2 implicit none
3
4 interface
5 integer(16) function add5_ext(a, b, c, d, e) bind(c, name='add5_ext')
6 integer(16), value :: a, b, c, d, e
7 end function add5_ext
8 end interface
9
10 integer(16) :: a, b, c, d, e, r
11 integer :: score
12
13 a = 1_16
14 b = 2_16
15 c = 3_16
16 d = 4_16
17 e = 5_16
18
19 r = add5_ext(a, b, c, d, e)
20
21 if (r == 15_16) then
22 score = 1
23 else
24 score = 0
25 end if
26
27 print *, score
28 end program integer16_external_stack_call
29