inter-procedural call test
This commit is contained in:
committed by
Vasily Levchenko
parent
390edc146d
commit
97e31820ae
@@ -1,4 +1,5 @@
|
|||||||
TESTS := sum
|
TESTS := sum \
|
||||||
|
sum_foo_bar
|
||||||
|
|
||||||
BIN_TESTS=$(foreach t, ${TESTS},${t}_test)
|
BIN_TESTS=$(foreach t, ${TESTS},${t}_test)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
extern void *resolve_symbol(const char*);
|
||||||
|
|
||||||
|
int
|
||||||
|
run_test() {
|
||||||
|
int (*sum)(int, int) = resolve_symbol("kfun:sumFooBar");
|
||||||
|
|
||||||
|
if (sum(2, 3) != 5) return 1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
fun foo(a:Int):Int = a
|
||||||
|
fun bar(a:Int):Int = a
|
||||||
|
|
||||||
|
fun sumFooBar(a:Int, b:Int):Int = foo(a) + bar(b)
|
||||||
Reference in New Issue
Block a user