]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Testcases for parameter shadowing
authorWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 9 Nov 2012 21:56:34 +0000 (22:56 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 11 Nov 2012 09:13:00 +0000 (10:13 +0100)
testsuite/Makefile
testsuite/shadow-gmqcc/expected [new file with mode: 0644]
testsuite/shadow-gmqcc/main.qc [new file with mode: 0644]
testsuite/shadow-qcc/expected [new file with mode: 0644]
testsuite/shadow-qcc/main.qc [new file with mode: 0644]

index e902e55612af9bcf84edc96b597d56cdf33abc68..6eafd4c235a7a2de491c8a2d2699889091d78097 100644 (file)
@@ -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 (file)
index 0000000..89f4331
--- /dev/null
@@ -0,0 +1 @@
+'0 0 0'
diff --git a/testsuite/shadow-gmqcc/main.qc b/testsuite/shadow-gmqcc/main.qc
new file mode 100644 (file)
index 0000000..08bc917
--- /dev/null
@@ -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 (file)
index 0000000..9ec2a0c
--- /dev/null
@@ -0,0 +1 @@
+'33 44 55'
diff --git a/testsuite/shadow-qcc/main.qc b/testsuite/shadow-qcc/main.qc
new file mode 100644 (file)
index 0000000..08bc917
--- /dev/null
@@ -0,0 +1,7 @@
+void(string, string) print = #1;
+string(vector) vtos = #5;
+
+void(vector org) main = {
+    local vector org;
+    print(vtos(org), "\n");
+};