From b17fe4db0b25afc86bffd988e659e4cecdea454e Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Fri, 9 Nov 2012 22:56:34 +0100 Subject: [PATCH] Testcases for parameter shadowing --- testsuite/Makefile | 13 ++++++++++++- testsuite/shadow-gmqcc/expected | 1 + testsuite/shadow-gmqcc/main.qc | 7 +++++++ testsuite/shadow-qcc/expected | 1 + testsuite/shadow-qcc/main.qc | 7 +++++++ 5 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 testsuite/shadow-gmqcc/expected create mode 100644 testsuite/shadow-gmqcc/main.qc create mode 100644 testsuite/shadow-qcc/expected create mode 100644 testsuite/shadow-qcc/main.qc 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"); +}; -- 2.39.2