From: Wolfgang (Blub) Bumiller Date: Fri, 9 Nov 2012 21:56:34 +0000 (+0100) Subject: Testcases for parameter shadowing X-Git-Tag: 0.1~19^2~58 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b17fe4db0b25afc86bffd988e659e4cecdea454e;p=xonotic%2Fgmqcc.git Testcases for parameter shadowing --- diff --git a/testsuite/Makefile b/testsuite/Makefile index e902e55..6eafd4c 100644 --- a/testsuite/Makefile +++ b/testsuite/Makefile @@ -17,7 +17,8 @@ TESTLIST = \ ngraphs \ invalid-assign \ field-parameters \ - functions-as-parameters + functions-as-parameters \ + shadow-qcc shadow-gmqcc .PHONY: clean test @@ -168,6 +169,16 @@ functions-as-parameters: @$(VM) $< > $@/output @diff $@/output $@/expected +$(eval $(call maketest,shadow-qcc,qcc)) +shadow-qcc: + @$(VM) -vector '33 44 55' $< > $@/output + @diff $@/output $@/expected + +$(eval $(call maketest,shadow-gmqcc,gm)) +shadow-gmqcc: + @$(VM) -vector '33 44 55' $< > $@/output + @diff $@/output $@/expected + ####################################################################### obj: mkdir obj diff --git a/testsuite/shadow-gmqcc/expected b/testsuite/shadow-gmqcc/expected new file mode 100644 index 0000000..89f4331 --- /dev/null +++ b/testsuite/shadow-gmqcc/expected @@ -0,0 +1 @@ +'0 0 0' diff --git a/testsuite/shadow-gmqcc/main.qc b/testsuite/shadow-gmqcc/main.qc new file mode 100644 index 0000000..08bc917 --- /dev/null +++ b/testsuite/shadow-gmqcc/main.qc @@ -0,0 +1,7 @@ +void(string, string) print = #1; +string(vector) vtos = #5; + +void(vector org) main = { + local vector org; + print(vtos(org), "\n"); +}; diff --git a/testsuite/shadow-qcc/expected b/testsuite/shadow-qcc/expected new file mode 100644 index 0000000..9ec2a0c --- /dev/null +++ b/testsuite/shadow-qcc/expected @@ -0,0 +1 @@ +'33 44 55' diff --git a/testsuite/shadow-qcc/main.qc b/testsuite/shadow-qcc/main.qc new file mode 100644 index 0000000..08bc917 --- /dev/null +++ b/testsuite/shadow-qcc/main.qc @@ -0,0 +1,7 @@ +void(string, string) print = #1; +string(vector) vtos = #5; + +void(vector org) main = { + local vector org; + print(vtos(org), "\n"); +};