mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-18 14:21:36 +00:00
Tests for the previous vector-liferange change
This commit is contained in:
parent
dc691c8a6e
commit
fcdff3180a
3 changed files with 33 additions and 0 deletions
25
tests/uninit.qc
Normal file
25
tests/uninit.qc
Normal file
|
@ -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';
|
||||
}
|
4
tests/uninit.tmpl
Normal file
4
tests/uninit.tmpl
Normal file
|
@ -0,0 +1,4 @@
|
|||
I: uninit.qc
|
||||
D: catch another case of unused vector accesses
|
||||
T: -compile
|
||||
C: -std=fteqcc -Wall -Werror
|
4
tests/uninit2.tmpl
Normal file
4
tests/uninit2.tmpl
Normal file
|
@ -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
|
Loading…
Reference in a new issue