From 5f905865bed2080c49b29dd48decdd24c4702cc9 Mon Sep 17 00:00:00 2001 From: Vincent Burns Date: Mon, 13 Jan 2014 01:51:36 -0500 Subject: Fix for some comments during if statements added test files --- compiler/c2nim/tests/vincent.c | 21 +++++++++++++++++++++ compiler/c2nim/tests/vincent.h | 3 +++ 2 files changed, 24 insertions(+) create mode 100644 compiler/c2nim/tests/vincent.c create mode 100644 compiler/c2nim/tests/vincent.h (limited to 'compiler/c2nim/tests') diff --git a/compiler/c2nim/tests/vincent.c b/compiler/c2nim/tests/vincent.c new file mode 100644 index 000000000..b9436c39b --- /dev/null +++ b/compiler/c2nim/tests/vincent.c @@ -0,0 +1,21 @@ +#include +#include + +int rand(void); + +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; +}; -- cgit 1.4.1-2-gfad0