Mercurial > hg > CbC > CbC_gcc
changeset 129:002ebcbc1eb4
remove test_env
author | mir3636 |
---|---|
date | Tue, 15 May 2018 18:45:25 +0900 |
parents | 76fdfee14d03 |
children | e108057fa461 |
files | CbC-examples/test_env.c |
diffstat | 1 files changed, 0 insertions(+), 68 deletions(-) [+] |
line wrap: on
line diff
--- a/CbC-examples/test_env.c Sun Aug 05 21:36:28 2012 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ - -typedef void (*RET_FUNC)(int, void *); - -int main(int argc, char **argv) -{ - int r; - r = f(); - printf("%d\n", r); -} - -//void z(RET_FUNC ret, void *fp) -__code z(RET_FUNC ret, void *fp) -{ - printf("z: fp=0x%x\n", __builtin_frame_address(0)); - ret(5, fp); -} -__code i(RET_FUNC ret, void *fp) -{ - printf("i: fp=0x%x\n", __builtin_frame_address(0)); - goto z(ret, fp); -} -__code h(RET_FUNC ret, void *fp) -{ - printf("h: fp=0x%x\n", __builtin_frame_address(0)); - goto i(ret, fp); -} -__code g(RET_FUNC ret, void *fp) -{ - printf("g: fp=0x%x\n", __builtin_frame_address(0)); - goto h(ret, fp); -} - -int f() -{ - __label__ exit0; - int retval; - //void (*ret)(int retval_, void *fp); - - /* - ret = ({ - void __return_func(int retval_, void *fp){ - retval = retval_; - goto exit0; - } - __return_func; - }); - */ - printf("f0: fp = 0x%x\n", __builtin_frame_address(0)); - void __return_func(int retval_, void *fp){ - retval = retval_; - goto exit0; - } - //ret = __return_func; - - printf("f1: fp = 0x%x\n", __builtin_frame_address(0)); - - //g(__return_func, __builtin_frame_address(0)); - goto g(__return_func, __builtin_frame_address(0)); - - printf("bad\n"); - -exit0: - printf("f2: fp = 0x%x\n", __builtin_frame_address(0)); - return retval; -} - - -