]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
enum testcase
authorWolfgang Bumiller <blub@speed.at>
Thu, 10 Jan 2013 20:38:17 +0000 (21:38 +0100)
committerWolfgang Bumiller <blub@speed.at>
Thu, 10 Jan 2013 20:38:32 +0000 (21:38 +0100)
tests/enum.qc [new file with mode: 0644]
tests/enum.tmpl [new file with mode: 0644]

diff --git a/tests/enum.qc b/tests/enum.qc
new file mode 100644 (file)
index 0000000..39b4196
--- /dev/null
@@ -0,0 +1,25 @@
+void(string, ...)   print  = #1;
+string(float)       ftos   = #2;
+
+enum {
+    FOO,
+    BAR,
+    BAZ,
+    OMG = BAR,
+    POO,
+    LAST = OMG + POO
+};
+
+enum {A};
+enum {B=A+1};
+enum {C=A};
+
+void main() {
+    print(ftos(FOO), "\n");
+    print(ftos(BAR), "\n");
+    print(ftos(BAZ), "\n");
+    print(ftos(OMG), "\n");
+    print(ftos(POO), "\n");
+    print(ftos(LAST), "\n");
+    print(ftos(C), "\n");
+}
diff --git a/tests/enum.tmpl b/tests/enum.tmpl
new file mode 100644 (file)
index 0000000..11ef9e8
--- /dev/null
@@ -0,0 +1,11 @@
+I: enum.qc
+D: enumerations
+T: -execute
+C: -std=fteqcc
+M: 0
+M: 1
+M: 2
+M: 1
+M: 2
+M: 3
+M: 0