]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - misc/source/gmqcc-src/tests/pointlife.qc
By fteqcc, hello gmqcc
[voretournament/voretournament.git] / misc / source / gmqcc-src / tests / pointlife.qc
diff --git a/misc/source/gmqcc-src/tests/pointlife.qc b/misc/source/gmqcc-src/tests/pointlife.qc
new file mode 100644 (file)
index 0000000..13bbde7
--- /dev/null
@@ -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
+}