* test/ptrtostruct.cb: test (*ptr).memb access.

git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3777 1b9489fe-b721-0410-924e-b54b9192deb8
This commit is contained in:
Minero Aoki 2008-01-03 11:31:57 +00:00
parent 9915a036dc
commit a368d3cc92
4 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,7 @@
Thu Jan 3 20:31:54 2008 Minero Aoki <aamine@loveruby.net>
* test/ptrtostruct.cb: test (*ptr).memb access.
Thu Jan 3 20:26:01 2008 Minero Aoki <aamine@loveruby.net>
* net/loveruby/cflat/compiler/TypeChecker.java: <<, >> does not

View File

@ -17,6 +17,7 @@ CBPROGS = zero one hello hello2 hello3 hello4 integer string \
charops shortops intops longops \
ucharops ushortops uintops ulongops \
block cast defvar mbc assoc \
ptrtostruct \
ANT = jant

14
test/ptrtostruct.cb Normal file
View File

@ -0,0 +1,14 @@
import stdio;
struct s { int x; };
int
main(int argc, char **argv)
{
struct s s;
struct s* ptr = &s;
(*ptr).x = 1;
printf("%d\n", (*ptr).x);
return 0;
}

View File

@ -139,6 +139,7 @@ assert_out "1;2;1;1;3;4;5;6;OK" ./usertype
assert_out "5;5" ./pointer
assert_out "1;2" ./ptrmemb
assert_out "1" ./ptrtostruct
assert_error $CBC deref-semcheck1.cb
assert_error $CBC deref-semcheck2.cb
assert_error $CBC deref-semcheck3.cb