summary refs log tree commit diff stats
path: root/compiler/c2nim/tests
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/c2nim/tests')
-rw-r--r--compiler/c2nim/tests/vincent.c33
-rw-r--r--compiler/c2nim/tests/vincent.h3
2 files changed, 36 insertions, 0 deletions
diff --git a/compiler/c2nim/tests/vincent.c b/compiler/c2nim/tests/vincent.c
new file mode 100644
index 000000000..24c6d6425
--- /dev/null
+++ b/compiler/c2nim/tests/vincent.c
@@ -0,0 +1,33 @@
+#include <stdlib.h>
+#include <stdio.h>
+
+int rand(void);
+
+int id2(void) {
+    return (int *)1;
+}
+
+int id(void (*f)(void)) {
+    f();
+    ((void (*)(int))f)(10);
+    return 10;
+    return (20+1);
+    return (int *)id;
+}
+
+int main() {
+    float f = .2,
+          g = 2.,
+          h = 1.0+rand(),
+          i = 1.0e+3;
+    int j, a;
+    for(j = 0, a = 10; j < 0; j++, a++) ;
+    do {
+        printf("howdy");
+    } while(--i, 0);
+    if(1)
+        printf("1"); // error from this comment
+    else
+        printf("2");
+    return '\x00';
+}
diff --git a/compiler/c2nim/tests/vincent.h b/compiler/c2nim/tests/vincent.h
new file mode 100644
index 000000000..b4e761ee1
--- /dev/null
+++ b/compiler/c2nim/tests/vincent.h
@@ -0,0 +1,3 @@
+struct foo {
+    int x,y,z;
+};