mirror of https://github.com/aamine/cbc
* 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:
parent
9915a036dc
commit
a368d3cc92
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue