added a testcase for -Olocal-temps

This commit is contained in:
Wolfgang Bumiller 2013-01-07 19:09:15 +01:00
parent 57c3d48711
commit 3f3ed9b6f0
2 changed files with 27 additions and 0 deletions

21
tests/pointlife.qc Normal file
View 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
View 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