From: Wolfgang Bumiller Date: Mon, 7 Jan 2013 18:09:15 +0000 (+0100) Subject: added a testcase for -Olocal-temps X-Git-Tag: before-library~347 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3f3ed9b6f099a16455f128f606175af5ce23056b;p=xonotic%2Fgmqcc.git added a testcase for -Olocal-temps --- diff --git a/tests/pointlife.qc b/tests/pointlife.qc new file mode 100644 index 0000000..b37e62a --- /dev/null +++ b/tests/pointlife.qc @@ -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 +} diff --git a/tests/pointlife.tmpl b/tests/pointlife.tmpl new file mode 100644 index 0000000..a39c41d --- /dev/null +++ b/tests/pointlife.tmpl @@ -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