Mercurial > hg > CbC > CbC_examples
view test_cs.c @ 29:a94136a6edb2 default tip
fix for LLVM12
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 17 Jul 2021 14:38:29 +0900 |
parents | 51f8521bc5d1 |
children |
line wrap: on
line source
//#include<stdio.h> //#include<stdlib.h> extern int printf(const char*, ...); extern void exit(int status); __code cs_exit(int , double , char ); __code cs1(int, int, int, int); __code cs2(double, double, int, double); void test_goto(void); int main(int argc, char **argv){ printf("main start\n"); //goto cs2(2.22, 3.33, 4, 5.55); test_goto(); return 0; } void test_goto(){ goto cs1(10, 20, 30, 40); } __code cs1(int a, int b, int c, int d){ printf("%4d, %4d, %4d, %4d\n", a, b, c, d); a += 40, b += 40, c += 40, d += 40; goto cs2((double)a, (double)b, c, (double)d); } __code cs2(double a, double b, int c, double d){ printf("%4d, %4d, %4d, %4d\n", (int)a, (int)b, (int)c, (int)d); a += 40, b += 40, c += 40, d += 40; goto cs_exit((int)a, b, (char)c); } __code cs_exit(int a, double b, char c){ printf("%4d, %4d, %4d\n", (int)a, (int)b, (int)c); printf("cs_exit was called!\n"); exit(0); } void caller(int a, double b){ cs2(b,20.0,a, 40.4); cs1(10,20,30, 40); }