From 67442a4801cc7739bcd4006a66060f7c6a4ea1ff Mon Sep 17 00:00:00 2001 From: Minero Aoki Date: Fri, 4 Jan 2008 22:36:45 +0000 Subject: [PATCH] * test/cast2.cb: test cast from long* to int*. * test/test.sh: change result. git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3798 1b9489fe-b721-0410-924e-b54b9192deb8 --- ChangeLog | 6 ++++++ test/cast2.cb | 9 +++++++-- test/test.sh | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 38def41..fc7c214 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sat Jan 5 07:36:43 2008 Minero Aoki + + * test/cast2.cb: test cast from long* to int*. + + * test/test.sh: change result. + Sat Jan 5 07:33:06 2008 Minero Aoki * net/loveruby/cflat/compiler/CodeGenerator.java diff --git a/test/cast2.cb b/test/cast2.cb index 741cc6b..28213a0 100644 --- a/test/cast2.cb +++ b/test/cast2.cb @@ -3,8 +3,13 @@ import stdio; int main(int argc, char **argv) { - int i = 0; + int i = 777; int* ptr = &i; - printf("%d\n", *(int*)ptr); + + long x = 666; + long* lp = &x; + + printf("%d;%d\n", *(int*)ptr, *(int*)lp); + return 0; } diff --git a/test/test.sh b/test/test.sh index 4d7799e..0a48676 100755 --- a/test/test.sh +++ b/test/test.sh @@ -185,7 +185,7 @@ assert_out "1;2;1073741824;-2147483648;0" ./longops # 32bit assert_out "1;2;1073741824;2147483648;0" ./ulongops # 32bit assert_out "25000000" ./cast -assert_out "0" ./cast2 +assert_out "777;666" ./cast2 assert_out "2" ./block assert_out "1;2;3" ./defvar