Mercurial > projects > dstress
changeset 228:a3cb1d622f37
updated sizeof tests
author | thomask |
---|---|
date | Mon, 03 Jan 2005 18:00:19 +0000 |
parents | e1af2a603ff4 |
children | 75e5c8df6e02 |
files | compile/sizeof_12.d nocompile/sizeof_05.d nocompile/sizeof_06.d nocompile/sizeof_07.d nocompile/sizeof_08.d nocompile/sizeof_09.d nocompile/sizeof_10.d run/sizeof_11.d |
diffstat | 8 files changed, 84 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/sizeof_12.d Mon Jan 03 18:00:19 2005 +0000 @@ -0,0 +1,8 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +module dstress.compile.sizeof_12; + +Object sizeof; +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nocompile/sizeof_05.d Mon Jan 03 18:00:19 2005 +0000 @@ -0,0 +1,11 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +module dstress.nocompile.sizeof_05; + +struct MyStruct{ + size_t sizeof(){ + return 6; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nocompile/sizeof_06.d Mon Jan 03 18:00:19 2005 +0000 @@ -0,0 +1,9 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +module dstress.nocompile.sizeof_06; + +struct MyStruct{ + size_t sizeof; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nocompile/sizeof_07.d Mon Jan 03 18:00:19 2005 +0000 @@ -0,0 +1,9 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +module dstress.nocompile.sizeof_07; + +class MyClass{ + size_t sizeof; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nocompile/sizeof_08.d Mon Jan 03 18:00:19 2005 +0000 @@ -0,0 +1,11 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +module dstress.nocompile.sizeof_08; + +class MyClass{ + size_t sizeof(){ + return 8; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nocompile/sizeof_09.d Mon Jan 03 18:00:19 2005 +0000 @@ -0,0 +1,12 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +module dstress.nocompile.sizeof_09; + +union MyUnion{ + int a; + size_t sizeof(){ + return 0; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nocompile/sizeof_10.d Mon Jan 03 18:00:19 2005 +0000 @@ -0,0 +1,10 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +module dstress.nocompile.sizeof_10; + +union MyUnion{ + int a; + size_t sizeof; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/sizeof_11.d Mon Jan 03 18:00:19 2005 +0000 @@ -0,0 +1,14 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +module dstress.run.sizeof_11; + +int main(){ + size_t sizeof; + sizeof++; + assert(sizeof==1); + sizeof-=9; + assert(sizeof==-8); + return 0; +}