From: Wolfgang Bumiller Date: Mon, 24 Dec 2012 11:43:16 +0000 (+0100) Subject: Tests for the previous vector-liferange change X-Git-Tag: before-library~502 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=fcdff3180a2bb7f65b9a5fb9485b6b2c4523e2f2;p=xonotic%2Fgmqcc.git Tests for the previous vector-liferange change --- diff --git a/tests/uninit.qc b/tests/uninit.qc new file mode 100644 index 0000000..3d75f07 --- /dev/null +++ b/tests/uninit.qc @@ -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 index 0000000..040f1d0 --- /dev/null +++ b/tests/uninit.tmpl @@ -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 index 0000000..2c4be19 --- /dev/null +++ b/tests/uninit2.tmpl @@ -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