X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=misc%2Fsource%2Fgmqcc-src%2Ftests%2Fpointlife.qc;fp=misc%2Fsource%2Fgmqcc-src%2Ftests%2Fpointlife.qc;h=13bbde71eab0b53623504b8a4ab6d1a4fb42ab56;hb=f345f0f6d2962633e2e3a560b044ab1b91a8f937;hp=0000000000000000000000000000000000000000;hpb=b2df32d96df3e954d54f6e4b9bbb6c98d77ef507;p=voretournament%2Fvoretournament.git diff --git a/misc/source/gmqcc-src/tests/pointlife.qc b/misc/source/gmqcc-src/tests/pointlife.qc new file mode 100644 index 00000000..13bbde71 --- /dev/null +++ b/misc/source/gmqcc-src/tests/pointlife.qc @@ -0,0 +1,19 @@ +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 +}