]> pd.if.org Git - lice/blobdiff - tests/es.c
autocommit for files dated 2014-11-17 20:13:34
[lice] / tests / es.c
diff --git a/tests/es.c b/tests/es.c
new file mode 100644 (file)
index 0000000..c27c281
--- /dev/null
@@ -0,0 +1,31 @@
+// expression statements
+
+#define maxint(A, B) \
+    ({ int a = (A), b = (B); a > b ? a : b; })
+
+int main(void) {
+
+    expecti(({ 'a'; 1; 64; }), 64);
+
+    expecti(
+        ({
+            int a = 10;
+            a;
+        }), 10
+    );
+
+    expecti(
+        ({
+            int i = 0;
+            for (; i < 10; i++)
+                ;
+            i;
+        }), 10
+    );
+
+    expecti(maxint(100, 5), 100);
+
+    expecti(({ (int){1}; }), 1);
+
+    return 0;
+}