Mercurial > hg > CbC > CbC_examples
view test_env.c @ 14:7d168c1829c9
modify makefile
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 17 Apr 2015 16:09:28 +0900 |
parents | 35d6eabeadb0 |
children |
line wrap: on
line source
typedef void (*RET_FUNC)(int, void *); int main(int argc, char **argv) { int r; r = f(); printf("%d\n", r); } __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; printf("f0: fp = 0x%x\n", __builtin_frame_address(0)); void __return_func(int retval_, void *fp){ retval = retval_; goto exit0; } printf("f1: fp = 0x%x\n", __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; }