]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Tests for the previous vector-liferange change
authorWolfgang Bumiller <blub@speed.at>
Mon, 24 Dec 2012 11:43:16 +0000 (12:43 +0100)
committerWolfgang Bumiller <blub@speed.at>
Mon, 24 Dec 2012 11:43:16 +0000 (12:43 +0100)
tests/uninit.qc [new file with mode: 0644]
tests/uninit.tmpl [new file with mode: 0644]
tests/uninit2.tmpl [new file with mode: 0644]

diff --git a/tests/uninit.qc b/tests/uninit.qc
new file mode 100644 (file)
index 0000000..3d75f07
--- /dev/null
@@ -0,0 +1,25 @@
+void   print(...)    = #1;
+string ftos (float)  = #2;
+string vtos (vector) = #5;
+
+vector main(float a, vector vin) {
+    vector v;
+
+    if (a < 4) {
+        v = vin;
+        v_x += 1;
+        v_y += 1;
+        v_z += 1;
+        return v;
+    }
+    else if (a < 5) {
+        v_x = 3;
+        v_y = 3;
+#ifdef UNINIT
+        print(vtos(v), "\n");
+#endif
+        v_z = 3;
+        return v;
+    }
+    return '0 0 0';
+}
diff --git a/tests/uninit.tmpl b/tests/uninit.tmpl
new file mode 100644 (file)
index 0000000..040f1d0
--- /dev/null
@@ -0,0 +1,4 @@
+I: uninit.qc
+D: catch another case of unused vector accesses
+T: -compile
+C: -std=fteqcc -Wall -Werror
diff --git a/tests/uninit2.tmpl b/tests/uninit2.tmpl
new file mode 100644 (file)
index 0000000..2c4be19
--- /dev/null
@@ -0,0 +1,4 @@
+I: uninit.qc
+D: catch another case of unused vector accesses - should fail
+T: -fail
+C: -std=fteqcc -Wall -Werror -DUNINIT