mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-22 19:31:03 +00:00
added a testcase for -Olocal-temps
This commit is contained in:
parent
57c3d48711
commit
3f3ed9b6f0
2 changed files with 27 additions and 0 deletions
21
tests/pointlife.qc
Normal file
21
tests/pointlife.qc
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
void print(...) = #1;
|
||||||
|
|
||||||
|
var float foo = 0;
|
||||||
|
|
||||||
|
void funcall() {}
|
||||||
|
void bar(string) {}
|
||||||
|
|
||||||
|
void main(string str) {
|
||||||
|
string pl;
|
||||||
|
|
||||||
|
if (foo)
|
||||||
|
return; // this is a block wher 'str' doesn't live
|
||||||
|
// so the point-life will not overlap with str
|
||||||
|
pl = "Got overwritten!\n"; // pl point-life
|
||||||
|
|
||||||
|
print(str);
|
||||||
|
|
||||||
|
pl = "Kill the lifrange here"; // pl life stops
|
||||||
|
funcall(); // Now lock pl in case we have -Oglobal-temps
|
||||||
|
bar(pl); // pl life starts here now
|
||||||
|
}
|
6
tests/pointlife.tmpl
Normal file
6
tests/pointlife.tmpl
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
I: pointlife.qc
|
||||||
|
D: local-temp liferange test
|
||||||
|
T: -execute
|
||||||
|
C: -std=fteqcc -Ono-global-temps -Olocal-temps
|
||||||
|
E: -string Okay
|
||||||
|
M: Okay
|
Loading…
Reference in a new issue