]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
add variable search order test
authorWolfgang Bumiller <wry.git@bumiller.com>
Sun, 14 Jan 2018 08:10:29 +0000 (09:10 +0100)
committerWolfgang Bumiller <wry.git@bumiller.com>
Sun, 14 Jan 2018 08:33:05 +0000 (09:33 +0100)
Signed-off-by: Wolfgang Bumiller <wry.git@bumiller.com>
tests/var-search-order.qc [new file with mode: 0644]
tests/var-search-order.tmpl [new file with mode: 0644]

diff --git a/tests/var-search-order.qc b/tests/var-search-order.qc
new file mode 100644 (file)
index 0000000..50b6746
--- /dev/null
@@ -0,0 +1,18 @@
+float a = 1000;
+float b = 1001;
+float c = 1002;
+
+void test(float b) {
+       float c = 3002;
+       print(ftos(a), "\n");
+       print(ftos(b), "\n");
+       print(ftos(c), "\n");
+       {
+               float b = 4001;
+               print(ftos(b), "\n");
+       }
+}
+
+void main() {
+       test(2001);
+}
diff --git a/tests/var-search-order.tmpl b/tests/var-search-order.tmpl
new file mode 100644 (file)
index 0000000..db3a4bf
--- /dev/null
@@ -0,0 +1,8 @@
+I: var-search-order.qc
+D: test variable search order
+T: -execute
+C: -std=gmqcc
+M: 1000
+M: 2001
+M: 3002
+M: 4001