]> pd.if.org Git - lice/blobdiff - tests/cast.c
autocommit for files dated 2014-11-17 20:13:34
[lice] / tests / cast.c
diff --git a/tests/cast.c b/tests/cast.c
new file mode 100644 (file)
index 0000000..0b7e8f5
--- /dev/null
@@ -0,0 +1,13 @@
+// casts
+
+int main(void) {
+    expecti((int)1,     1);
+    expectf((float)2,   2.0);
+    expectd((double)3,  3.0);
+
+    int a[3];
+    *(int *)(a + 2) = 1024;
+    expecti(a[2], 1024);
+
+    return 0;
+}