]> pd.if.org Git - lice/blobdiff - tests/kandr.c
autocommit for files dated 2014-11-17 20:13:36
[lice] / tests / kandr.c
diff --git a/tests/kandr.c b/tests/kandr.c
new file mode 100644 (file)
index 0000000..3185d9c
--- /dev/null
@@ -0,0 +1,22 @@
+// K&R C
+
+#pragma warning_disable
+
+// implicit integer
+function() {
+    return 4;
+}
+
+int main(void) {
+    expecti(function(), 4);
+    expecti(defined_later(), 1337);
+}
+
+defined_later() {
+    // this is defined later, but main can call into it
+    // since K&R doesn't care about declarations
+
+    return 1337;
+}
+
+#pragma warning_enable