Mercurial > projects > dstress
changeset 366:1e56e7d78703
debug info of function pointer
Regan Heath <regan@netwin.co.nz>
2005-03-25
news:opsn61vgpg23k2f5@nrage.netwin.co.nz
author | thomask |
---|---|
date | Fri, 25 Mar 2005 15:12:23 +0000 |
parents | 2c399b802ed9 |
children | 58ba24adbc52 |
files | run/debug_info_01.d run/debug_info_02.d |
diffstat | 2 files changed, 56 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/debug_info_01.d Fri Mar 25 15:12:23 2005 +0000 @@ -0,0 +1,27 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Regan Heath <regan@netwin.co.nz> +// @date@ 2005-03-25 +// @uri@ news:opsn61vgpg23k2f5@nrage.netwin.co.nz + +module dstress.run.debug_info_01; + +typedef fn function() fn; + +byte status; + +fn foo() { + status++; + return &foo; +} + +int main(){ + assert(status==0); + fn p = foo(); + assert(status==1); + p(); + assert(status==2); + return 0; +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/debug_info_02.d Fri Mar 25 15:12:23 2005 +0000 @@ -0,0 +1,29 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Regan Heath <regan@netwin.co.nz> +// @date@ 2005-03-25 +// @uri@ news:opsn61vgpg23k2f5@nrage.netwin.co.nz + +// __DSTRESS_DFLAGS__ -g + +module dstress.run.debug_info_02; + +typedef fn function() fn; + +byte status; + +fn foo() { + status++; + return &foo; +} + +int main(){ + assert(status==0); + fn p = foo(); + assert(status==1); + p(); + assert(status==2); + return 0; +} \ No newline at end of file