functions-as-parameters testcase

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-11-01 18:24:48 +01:00
parent 70f9be0f59
commit 9cf696e0fa
3 changed files with 21 additions and 1 deletions

View file

@ -16,7 +16,8 @@ TESTLIST = \
invalid-types \ invalid-types \
ngraphs \ ngraphs \
invalid-assign \ invalid-assign \
field-parameters field-parameters \
functions-as-parameters
.PHONY: clean test .PHONY: clean test
@ -162,6 +163,11 @@ field-parameters:
@$(VM) $< > $@/output @$(VM) $< > $@/output
@diff $@/output $@/expected @diff $@/output $@/expected
$(eval $(call maketest,functions-as-parameters,qcc))
functions-as-parameters:
@$(VM) $< > $@/output
@diff $@/output $@/expected
####################################################################### #######################################################################
obj: obj:
mkdir obj mkdir obj

View file

@ -0,0 +1 @@
correct

View file

@ -0,0 +1,13 @@
void(string, string) print = #1;
string() getter = {
return "correct";
};
void(string() f) printer = {
print(f(), "\n");
};
void() main = {
printer(getter);
};