diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2009-03-29 09:47:11 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2009-03-29 09:47:11 +0000 |
commit | a5f03d96eee482cd84861fc8cefff9eb451c0cad (patch) | |
tree | cbc66cbc183a7c5ef2c044ed9ed04b8011df9cd4 /cil/doc/examples | |
parent | a9621943087a5578c995d88b06f87c5158eb5d00 (diff) | |
download | compcert-a5f03d96eee482cd84861fc8cefff9eb451c0cad.tar.gz compcert-a5f03d96eee482cd84861fc8cefff9eb451c0cad.zip |
Cleaned up configure script.
Distribution of CIL as an expanded source tree with changes applied
(instead of original .tar.gz + patches to be applied at config time).
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1020 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cil/doc/examples')
47 files changed, 1226 insertions, 0 deletions
diff --git a/cil/doc/examples/ex1.txt b/cil/doc/examples/ex1.txt new file mode 100644 index 00000000..2fe6c210 --- /dev/null +++ b/cil/doc/examples/ex1.txt @@ -0,0 +1,16 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex1.c" +long x ; +#line 3 "cilcode.tmp/ex1.c" +static long long y ; +#line 6 "cilcode.tmp/ex1.c" +int main(void) +{ + + { +#line 6 + return ((int )((long long )x + y)); +} +} diff --git a/cil/doc/examples/ex10.txt b/cil/doc/examples/ex10.txt new file mode 100644 index 00000000..7213b4c3 --- /dev/null +++ b/cil/doc/examples/ex10.txt @@ -0,0 +1,10 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex10.c" +char foo[13] = +#line 1 + { (char )'f', (char )'o', (char )'o', (char )' ', + (char )'p', (char )'l', (char )'u', (char )'s', + (char )' ', (char )'b', (char )'a', (char )'r', + (char )'\000'}; diff --git a/cil/doc/examples/ex11.txt b/cil/doc/examples/ex11.txt new file mode 100644 index 00000000..683df519 --- /dev/null +++ b/cil/doc/examples/ex11.txt @@ -0,0 +1,5 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex11.c" +char *foo = (char *)"foo plus bar "; diff --git a/cil/doc/examples/ex12.txt b/cil/doc/examples/ex12.txt new file mode 100644 index 00000000..d04d83d8 --- /dev/null +++ b/cil/doc/examples/ex12.txt @@ -0,0 +1,32 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 2 "cilcode.tmp/ex12.c" +struct foo { + int f1 ; + int f2 ; +}; +#line 1 "cilcode.tmp/ex12.c" +int main(void) +{ int x ; + struct foo a[3] ; + + { +#line 1 + x = 5; +#line 2 + a[0].f1 = 1; +#line 2 + a[0].f2 = 2; +#line 2 + a[1].f1 = 3; +#line 2 + a[1].f2 = 4; +#line 2 + a[2].f1 = 5; +#line 2 + a[2].f2 = 0; +#line 3 + return (0); +} +} diff --git a/cil/doc/examples/ex13.txt b/cil/doc/examples/ex13.txt new file mode 100644 index 00000000..6486ad6e --- /dev/null +++ b/cil/doc/examples/ex13.txt @@ -0,0 +1,21 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex13.c" +int x = 5; +#line 2 "cilcode.tmp/ex13.c" +int main(void) +{ int x___0 ; + int x___1 ; + + { +#line 3 + x___0 = 6; +#line 5 + x___1 = 7; +#line 6 + return (x___1); +#line 8 + return (x___0); +} +} diff --git a/cil/doc/examples/ex14.txt b/cil/doc/examples/ex14.txt new file mode 100644 index 00000000..72fc719e --- /dev/null +++ b/cil/doc/examples/ex14.txt @@ -0,0 +1,22 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex14.c" +int x = 5; +#line 5 +int main(void) ; +#line 5 "cilcode.tmp/ex14.c" +static int x___1 = 7; +#line 2 "cilcode.tmp/ex14.c" +int main(void) +{ int x___0 ; + + { +#line 3 + x___0 = 6; +#line 6 + return (x___1); +#line 8 + return (x___0); +} +} diff --git a/cil/doc/examples/ex15.txt b/cil/doc/examples/ex15.txt new file mode 100644 index 00000000..4f64ae9b --- /dev/null +++ b/cil/doc/examples/ex15.txt @@ -0,0 +1,14 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex15.c" +int foo(void) +{ int x ; + + { +#line 2 + x = 5; +#line 3 + return (0); +} +} diff --git a/cil/doc/examples/ex16.txt b/cil/doc/examples/ex16.txt new file mode 100644 index 00000000..82290c28 --- /dev/null +++ b/cil/doc/examples/ex16.txt @@ -0,0 +1,22 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex16.c" +extern int f(int ) ; +#line 1 "cilcode.tmp/ex16.c" +int main(void) +{ int x ; + int tmp ; + int tmp___0 ; + + { +#line 2 + tmp = x; +#line 2 + x ++; +#line 2 + tmp___0 = f(x); +#line 2 + return (tmp + tmp___0); +} +} diff --git a/cil/doc/examples/ex17.txt b/cil/doc/examples/ex17.txt new file mode 100644 index 00000000..20bbaa7a --- /dev/null +++ b/cil/doc/examples/ex17.txt @@ -0,0 +1,81 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex17.c" +int main(void) +{ int x ; + int y ; + int tmp ; + int z ; + int tmp___0 ; + + { +#line 2 + if (x) { +#line 2 + tmp = 2; + } else { +#line 2 + tmp = 4; + } +#line 2 + y = tmp; +#line 3 + if (x) { +#line 3 + tmp___0 = 1; + } else { +#line 3 + if (y) { +#line 3 + tmp___0 = 1; + } else { +#line 3 + tmp___0 = 0; + } + } +#line 3 + z = tmp___0; +#line 5 + if (x) { +#line 5 + if (y) { +#line 5 + return (0); + } else { +#line 5 + return (1); + } + } else { +#line 5 + return (1); + } +#line 8 + if (x) { +#line 8 + if (y) { + goto _L; + } else { + goto _L___0; + } + } else { + _L___0: /* CIL Label */ +#line 8 + if (z) { + _L: /* CIL Label */ +#line 8 + x ++; +#line 8 + y ++; +#line 8 + z ++; +#line 8 + x ++; +#line 8 + y ++; +#line 8 + return (z); + } + } +} +} diff --git a/cil/doc/examples/ex18.txt b/cil/doc/examples/ex18.txt new file mode 100644 index 00000000..bcdb7ef2 --- /dev/null +++ b/cil/doc/examples/ex18.txt @@ -0,0 +1,20 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex18.c" +extern int f() ; +#line 1 "cilcode.tmp/ex18.c" +int main(void) +{ int tmp___0 ; + + { +#line 2 + tmp___0 = f(); + if (! tmp___0) { +#line 2 + tmp___0 = 4; + } +#line 2 + return (tmp___0); +} +} diff --git a/cil/doc/examples/ex19.txt b/cil/doc/examples/ex19.txt new file mode 100644 index 00000000..3b82868f --- /dev/null +++ b/cil/doc/examples/ex19.txt @@ -0,0 +1,42 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex19.c" +int main(void) +{ int x ; + int i ; + + { +#line 2 + i = 0; +#line 2 + while (i < 5) { +#line 3 + if (i == 5) { + goto __Cont; + } +#line 4 + if (i == 4) { +#line 4 + break; + } +#line 5 + i += 2; + __Cont: /* CIL Label */ +#line 2 + i ++; + } +#line 7 + while (x < 5) { +#line 8 + if (x == 3) { +#line 8 + continue; + } +#line 9 + x ++; + } +#line 11 + return (0); +} +} diff --git a/cil/doc/examples/ex2.txt b/cil/doc/examples/ex2.txt new file mode 100644 index 00000000..20313828 --- /dev/null +++ b/cil/doc/examples/ex2.txt @@ -0,0 +1,9 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex2.c" +struct __anonstruct_s_1 { + int x ; +}; +#line 1 "cilcode.tmp/ex2.c" +struct __anonstruct_s_1 s ; diff --git a/cil/doc/examples/ex20.txt b/cil/doc/examples/ex20.txt new file mode 100644 index 00000000..7a51db3b --- /dev/null +++ b/cil/doc/examples/ex20.txt @@ -0,0 +1,26 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex20.c" +int main(void) +{ int x ; + int y ; + int z ; + + { +#line 1 + x = 5; +#line 1 + y = x; +#line 2 + x ++; + L: +#line 2 + y -= x; +#line 2 + z = y; + goto L; +#line 3 + return (0); +} +} diff --git a/cil/doc/examples/ex21.txt b/cil/doc/examples/ex21.txt new file mode 100644 index 00000000..3f331e42 --- /dev/null +++ b/cil/doc/examples/ex21.txt @@ -0,0 +1,25 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex21.c" +int main(void) +{ int x ; + int y ; + int z ; + int *tmp ; + + { +#line 2 + if (x) { +#line 2 + tmp = & y; + } else { +#line 2 + tmp = & z; + } +#line 2 + x ++; +#line 2 + return (tmp - & x); +} +} diff --git a/cil/doc/examples/ex22.txt b/cil/doc/examples/ex22.txt new file mode 100644 index 00000000..2224e7c7 --- /dev/null +++ b/cil/doc/examples/ex22.txt @@ -0,0 +1,16 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 327 "/usr/include/stdio.h" +extern int printf(char const * __restrict __format , ...) ; +#line 7 "cilcode.tmp/ex22.c" +int main(void) +{ + + { +#line 9 + printf((char const * __restrict )"Hello world\n"); +#line 10 + return (0); +} +} diff --git a/cil/doc/examples/ex23.txt b/cil/doc/examples/ex23.txt new file mode 100644 index 00000000..d48a1358 --- /dev/null +++ b/cil/doc/examples/ex23.txt @@ -0,0 +1,56 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex23.c" +int foo(int predicate ) +{ int x ; + + { +#line 2 + x = 0; +#line 4 + if (predicate == 0) { + goto switch_0_0; + } else { +#line 5 + if (predicate == 1) { + goto switch_0_1; + } else { +#line 6 + if (predicate == 2) { + goto switch_0_2; + } else { +#line 7 + if (predicate == 3) { + goto switch_0_3; + } else { + { + goto switch_0_default; +#line 3 + if (0) { + switch_0_0: /* CIL Label */ +#line 4 + return (111); + switch_0_1: /* CIL Label */ +#line 5 + x ++; + switch_0_2: /* CIL Label */ +#line 6 + return (x + 3); + switch_0_3: /* CIL Label */ + goto switch_0_break; + switch_0_default: /* CIL Label */ ; +#line 8 + return (222); + } else { + switch_0_break: /* CIL Label */ ; + } + } + } + } + } + } +#line 10 + return (333); +} +} diff --git a/cil/doc/examples/ex24.txt b/cil/doc/examples/ex24.txt new file mode 100644 index 00000000..587ce674 --- /dev/null +++ b/cil/doc/examples/ex24.txt @@ -0,0 +1,59 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +extern void * stackguard_get_ra(); +extern void stackguard_set_ra(void *new_ra); +/* You must provide an implementation for functions that get and set the + * return address. Such code is unfortunately architecture specific. + */ +struct stackguard_stack { + void * data; + struct stackguard_stack * next; +} * stackguard_stack; + +void stackguard_push(void *ra) { + void * old = stackguard_stack; + stackguard_stack = (struct stackguard_stack *) + malloc(sizeof(stackguard_stack)); + stackguard_stack->data = ra; + stackguard_stack->next = old; +} + +void * stackguard_pop() { + void * ret = stackguard_stack->data; + void * next = stackguard_stack->next; + free(stackguard_stack); + stackguard_stack->next = next; + return ret; +} +#line 3 "cilcode.tmp/ex24.c" +extern int ( /* missing proto */ scanf)() ; +#line 1 "cilcode.tmp/ex24.c" +int dangerous(void) +{ char array[10] ; + void *return_address ; + + { + return_address = (void *)stackguard_get_ra(); + stackguard_push(return_address); +#line 3 + scanf("%s", array); + { + return_address = (void *)stackguard_pop(); + stackguard_set_ra(return_address); +#line 4 + return (0); + } +} +} +#line 6 "cilcode.tmp/ex24.c" +int main(void) +{ int tmp ; + + { +#line 7 + tmp = dangerous(); +#line 7 + return (tmp); +} +} diff --git a/cil/doc/examples/ex25.txt b/cil/doc/examples/ex25.txt new file mode 100644 index 00000000..88f6902e --- /dev/null +++ b/cil/doc/examples/ex25.txt @@ -0,0 +1,40 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 3 "cilcode.tmp/ex25.c" +extern int ( /* missing proto */ scanf)() ; +#line 1 "cilcode.tmp/ex25.c" +struct dangerous_heapify { + char array[10] ; +}; +#line 1 "cilcode.tmp/ex25.c" +int dangerous(void) +{ struct dangerous_heapify *dangerous_heapify ; + int __cil_tmp3 ; + + { +#line 1 + dangerous_heapify = (struct dangerous_heapify *)malloc(sizeof(struct dangerous_heapify )); +#line 3 + scanf("%s", dangerous_heapify->array); + { +#line 4 + __cil_tmp3 = 0; +#line 4 + free(dangerous_heapify); +#line 4 + return (__cil_tmp3); + } +} +} +#line 6 "cilcode.tmp/ex25.c" +int main(void) +{ int tmp ; + + { +#line 7 + tmp = dangerous(); +#line 7 + return (tmp); +} +} diff --git a/cil/doc/examples/ex26.txt b/cil/doc/examples/ex26.txt new file mode 100644 index 00000000..8f5b1718 --- /dev/null +++ b/cil/doc/examples/ex26.txt @@ -0,0 +1,29 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex26.c" +int foo(int predicate ) +{ int __retres ; + + { +#line 2 + if (predicate <= 0) { +#line 3 + __retres = 1; + goto return_label; + } else { +#line 5 + if (predicate > 5) { +#line 6 + __retres = 2; + goto return_label; + } +#line 7 + __retres = 3; + goto return_label; + } + return_label: /* CIL Label */ +#line 1 + return (__retres); +} +} diff --git a/cil/doc/examples/ex27.txt b/cil/doc/examples/ex27.txt new file mode 100644 index 00000000..60591132 --- /dev/null +++ b/cil/doc/examples/ex27.txt @@ -0,0 +1,51 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex27.c" +int foo(int x , int y ) +{ int unknown ; + + { +#line 3 + if (unknown) { +#line 4 + return (9); + } +#line 5 + return (x + 3); +} +} +#line 8 "cilcode.tmp/ex27.c" +int main(void) +{ int a ; + int b ; + int c ; + int tmp ; + int tmp___0 ; + + { + { +#line 10 + tmp = foo(5, 7); +#line 10 + tmp___0 = foo(6, 7); +#line 10 + a = tmp + tmp___0; +#line 11 + b = 4; +#line 12 + c = 16; + } + { + { +#line 16 + return (20); + } +#line 13 + if (0) { +#line 14 + return (b - c); + } + } +} +} diff --git a/cil/doc/examples/ex28.txt b/cil/doc/examples/ex28.txt new file mode 100644 index 00000000..098b144a --- /dev/null +++ b/cil/doc/examples/ex28.txt @@ -0,0 +1,24 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex28.c" +int main(void) +{ int ***three ; + int **two ; + int **mem_3 ; + int *mem_4 ; + int *mem_5 ; + + { +#line 4 + mem_3 = (*three); +#line 4 + mem_4 = (*mem_3); +#line 4 + mem_5 = (*two); +#line 4 + (*mem_4) = (*mem_5); +#line 5 + return (0); +} +} diff --git a/cil/doc/examples/ex29.txt b/cil/doc/examples/ex29.txt new file mode 100644 index 00000000..7df8f681 --- /dev/null +++ b/cil/doc/examples/ex29.txt @@ -0,0 +1,53 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 2 "cilcode.tmp/ex29.c" +struct mystruct { + int a ; + int b ; +}; +#line 1 "cilcode.tmp/ex29.c" +int main(void) +{ struct mystruct m ; + int local ; + int arr[3] ; + int *ptr ; + unsigned int __cil_tmp5 ; + unsigned int __cil_tmp6 ; + int __cil_tmp7 ; + unsigned int __cil_tmp8 ; + int *__cil_tmp9 ; + int __cil_tmp10 ; + unsigned int __cil_tmp11 ; + unsigned int __cil_tmp12 ; + unsigned int __cil_tmp13 ; + int m_b14 ; + int m_a15 ; + + { +#line 10 + ptr = & local; +#line 11 + __cil_tmp5 = 2 * 4U; +#line 11 + __cil_tmp6 = (unsigned int )(arr) + __cil_tmp5; +#line 11 + __cil_tmp7 = (*((int *)__cil_tmp6)); +#line 11 + __cil_tmp8 = (unsigned int )__cil_tmp7; +#line 11 + __cil_tmp9 = & local; +#line 11 + __cil_tmp10 = (*__cil_tmp9); +#line 11 + __cil_tmp11 = (unsigned int )__cil_tmp10; +#line 11 + __cil_tmp12 = __cil_tmp11 + 8U; +#line 11 + __cil_tmp13 = __cil_tmp12 + __cil_tmp8; +#line 11 + m_a15 = (int )__cil_tmp13; +#line 12 + return (m_a15); +} +} diff --git a/cil/doc/examples/ex3.txt b/cil/doc/examples/ex3.txt new file mode 100644 index 00000000..2ca8ac95 --- /dev/null +++ b/cil/doc/examples/ex3.txt @@ -0,0 +1,20 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex3.c" +union baz { + int x1 ; + double x2 ; +}; +#line 1 "cilcode.tmp/ex3.c" +struct bar { + union baz u1 ; + int y ; +}; +#line 1 "cilcode.tmp/ex3.c" +struct foo { + struct bar s1 ; + int z ; +}; +#line 1 "cilcode.tmp/ex3.c" +struct foo f ; diff --git a/cil/doc/examples/ex30.txt b/cil/doc/examples/ex30.txt new file mode 100644 index 00000000..729cfb06 --- /dev/null +++ b/cil/doc/examples/ex30.txt @@ -0,0 +1,12 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex30.c" +int main(void) +{ int x ; + + { +#line 2 + return (x == (x != 0)); +} +} diff --git a/cil/doc/examples/ex31.txt b/cil/doc/examples/ex31.txt new file mode 100644 index 00000000..ab7d4716 --- /dev/null +++ b/cil/doc/examples/ex31.txt @@ -0,0 +1,12 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex31.c" +int main(void) +{ + + { +#line 1 + return ((int )((1U - sizeof(int )) >> 32)); +} +} diff --git a/cil/doc/examples/ex32.txt b/cil/doc/examples/ex32.txt new file mode 100644 index 00000000..f2b6b5b1 --- /dev/null +++ b/cil/doc/examples/ex32.txt @@ -0,0 +1,16 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex32.c" +int x = 5; +#line 2 "cilcode.tmp/ex32.c" +int f(void) +{ int x___0 ; + + { +#line 3 + x___0 = 3; +#line 6 + return (x); +} +} diff --git a/cil/doc/examples/ex33.txt b/cil/doc/examples/ex33.txt new file mode 100644 index 00000000..f73178f9 --- /dev/null +++ b/cil/doc/examples/ex33.txt @@ -0,0 +1,24 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex33.c" +int (*pf)(void) ; +#line 2 "cilcode.tmp/ex33.c" +int f(void) +{ + + { +#line 4 + pf = & f; +#line 5 + pf = & f; +#line 6 + ((*pf))(); +#line 7 + ((*pf))(); +#line 8 + f(); +#line 9 + return (0); +} +} diff --git a/cil/doc/examples/ex34.txt b/cil/doc/examples/ex34.txt new file mode 100644 index 00000000..494ca916 --- /dev/null +++ b/cil/doc/examples/ex34.txt @@ -0,0 +1,15 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex34.c" +struct __anonstruct_nested_2 { + int y ; + int z ; +}; +#line 1 "cilcode.tmp/ex34.c" +struct __anonstruct_i_1 { + int x ; + struct __anonstruct_nested_2 nested ; +}; +#line 1 "cilcode.tmp/ex34.c" +struct __anonstruct_i_1 i = {1, {2, 6}}; diff --git a/cil/doc/examples/ex35.txt b/cil/doc/examples/ex35.txt new file mode 100644 index 00000000..1af7447c --- /dev/null +++ b/cil/doc/examples/ex35.txt @@ -0,0 +1,32 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex35.c" +struct __anonstruct_T1_1 { + char *key ; + char *value ; +}; +#line 1 "cilcode.tmp/ex35.c" +typedef struct __anonstruct_T1_1 T1; +#line 7 "cilcode.tmp/ex35.c" +struct __anonstruct_T3_2 { + long type ; + char *value ; +}; +#line 7 "cilcode.tmp/ex35.c" +typedef struct __anonstruct_T3_2 T3; +#line 13 "cilcode.tmp/ex35.c" +struct __anonstruct_T3_2 __constr_expr_0 = {1L, (char *)1}; +#line 13 "cilcode.tmp/ex35.c" +T1 a[1] = { {(char *)"", (char *)(& __constr_expr_0)}}; +#line 20 "cilcode.tmp/ex35.c" +int main(void) +{ T3 *pt3 ; + + { +#line 21 + pt3 = (T3 *)a[0].value; +#line 22 + return ((int )pt3->value); +} +} diff --git a/cil/doc/examples/ex36.txt b/cil/doc/examples/ex36.txt new file mode 100644 index 00000000..adbcdaaa --- /dev/null +++ b/cil/doc/examples/ex36.txt @@ -0,0 +1,20 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex36.c" +int main(void) +{ int __constr_expr_0[4] ; + + { +#line 1 + __constr_expr_0[0] = 1; +#line 1 + __constr_expr_0[1] = 2; +#line 1 + __constr_expr_0[2] = 3; +#line 1 + __constr_expr_0[3] = 4; +#line 1 + return (__constr_expr_0[1]); +} +} diff --git a/cil/doc/examples/ex37.txt b/cil/doc/examples/ex37.txt new file mode 100644 index 00000000..00d6ca44 --- /dev/null +++ b/cil/doc/examples/ex37.txt @@ -0,0 +1,14 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 3 "cilcode.tmp/ex37.c" +int foo(void) ; +#line 1 "cilcode.tmp/ex37.c" +int foo(void) +{ + + { +#line 5 + return (0); +} +} diff --git a/cil/doc/examples/ex38.txt b/cil/doc/examples/ex38.txt new file mode 100644 index 00000000..706e13d9 --- /dev/null +++ b/cil/doc/examples/ex38.txt @@ -0,0 +1,12 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex38.c" +unsigned long foo(void) +{ + + { +#line 2 + return (536870911UL); +} +} diff --git a/cil/doc/examples/ex39.txt b/cil/doc/examples/ex39.txt new file mode 100644 index 00000000..2c8c25f9 --- /dev/null +++ b/cil/doc/examples/ex39.txt @@ -0,0 +1,25 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex39.c" +int main(void) +{ int x ; + int y ; + int z ; + int *tmp ; + + { +#line 2 + if (x) { +#line 2 + tmp = & y; + } else { +#line 2 + tmp = & z; + } +#line 2 + x ++; +#line 2 + return (tmp - & x); +} +} diff --git a/cil/doc/examples/ex4.txt b/cil/doc/examples/ex4.txt new file mode 100644 index 00000000..00a22d31 --- /dev/null +++ b/cil/doc/examples/ex4.txt @@ -0,0 +1,16 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 2 "cilcode.tmp/ex4.c" +struct foo { + int x ; +}; +#line 1 "cilcode.tmp/ex4.c" +int main(void) +{ struct foo foo ; + + { +#line 8 + return (foo.x); +} +} diff --git a/cil/doc/examples/ex40.txt b/cil/doc/examples/ex40.txt new file mode 100644 index 00000000..c41496b3 --- /dev/null +++ b/cil/doc/examples/ex40.txt @@ -0,0 +1,20 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex40.c" +extern int f() ; +#line 1 "cilcode.tmp/ex40.c" +int main(void) +{ int tmp___0 ; + + { +#line 2 + tmp___0 = f(); + if (! tmp___0) { +#line 2 + tmp___0 = -1; + } +#line 2 + return (tmp___0); +} +} diff --git a/cil/doc/examples/ex41.txt b/cil/doc/examples/ex41.txt new file mode 100644 index 00000000..f1196f39 --- /dev/null +++ b/cil/doc/examples/ex41.txt @@ -0,0 +1,69 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex41.c" +static void *jtab[2] ; +#line 4 +static int doit(int x ) ; +#line 4 "cilcode.tmp/ex41.c" +static int jtab_init = 0; +#line 2 "cilcode.tmp/ex41.c" +static int doit(int x ) +{ unsigned int __compgoto ; + + { +#line 5 + if (! jtab_init) { +#line 6 + jtab[0] = (void *)0; +#line 7 + jtab[1] = (void *)1; +#line 8 + jtab_init = 1; + } +#line 10 + __compgoto = (unsigned int )jtab[x]; +#line 10 + switch (__compgoto) { + case 1: + goto lbl2; + case 0: + goto lbl1; + default: +#line 10 + (*((int *)0)) = 0; + } + lbl1: +#line 12 + return (0); + lbl2: +#line 14 + return (1); +} +} +#line 18 +extern int ( /* missing proto */ exit)() ; +#line 17 "cilcode.tmp/ex41.c" +int main(void) +{ int tmp ; + int tmp___0 ; + + { +#line 18 + tmp = doit(0); +#line 18 + if (tmp != 0) { +#line 18 + exit(1); + } +#line 19 + tmp___0 = doit(1); +#line 19 + if (tmp___0 != 1) { +#line 19 + exit(1); + } +#line 20 + exit(0); +} +} diff --git a/cil/doc/examples/ex42.txt b/cil/doc/examples/ex42.txt new file mode 100644 index 00000000..b0f40b88 --- /dev/null +++ b/cil/doc/examples/ex42.txt @@ -0,0 +1,22 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex42.c" +int main(void) +{ int tmp ; + + { + goto L; +#line 1 + if (0) { + L: +#line 1 + tmp = 1; + } else { +#line 1 + tmp = 0; + } +#line 1 + return (tmp); +} +} diff --git a/cil/doc/examples/ex43.txt b/cil/doc/examples/ex43.txt new file mode 100644 index 00000000..4104f797 --- /dev/null +++ b/cil/doc/examples/ex43.txt @@ -0,0 +1,46 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex43.c" +__inline static int foo__extinline(void) +{ + + { +#line 1 + return (1); +} +} +#line 2 "cilcode.tmp/ex43.c" +int firstuse(void) +{ int tmp ; + + { +#line 2 + tmp = foo__extinline(); +#line 2 + return (tmp); +} +} +#line 5 "cilcode.tmp/ex43.c" +int foo(void) +{ + + { +#line 5 + return (2); +} +} +#line 7 "cilcode.tmp/ex43.c" +int main(void) +{ int tmp ; + int tmp___0 ; + + { +#line 8 + tmp = foo(); +#line 8 + tmp___0 = firstuse(); +#line 8 + return (tmp + tmp___0); +} +} diff --git a/cil/doc/examples/ex44.txt b/cil/doc/examples/ex44.txt new file mode 100644 index 00000000..06f83ba3 --- /dev/null +++ b/cil/doc/examples/ex44.txt @@ -0,0 +1,31 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex44.c" +struct s { + int i1 ; + int i2 ; +}; +#line 1 "cilcode.tmp/ex44.c" +union u { + int i ; + struct s s ; +}; +#line 8 "cilcode.tmp/ex44.c" +union u x = {6}; +#line 10 "cilcode.tmp/ex44.c" +int main(void) +{ struct s y ; + union u z ; + + { +#line 11 + y.i1 = 1; +#line 11 + y.i2 = 2; +#line 12 + z.s = y; +#line 13 + return (0); +} +} diff --git a/cil/doc/examples/ex45.txt b/cil/doc/examples/ex45.txt new file mode 100644 index 00000000..aaafca3a --- /dev/null +++ b/cil/doc/examples/ex45.txt @@ -0,0 +1,11 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex45.c" +char i8 ; +#line 2 "cilcode.tmp/ex45.c" +short i16 ; +#line 3 "cilcode.tmp/ex45.c" +int i32 ; +#line 4 "cilcode.tmp/ex45.c" +long long i64 ; diff --git a/cil/doc/examples/ex46.txt b/cil/doc/examples/ex46.txt new file mode 100644 index 00000000..1f87ec2f --- /dev/null +++ b/cil/doc/examples/ex46.txt @@ -0,0 +1,23 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex46.c" +static int bar(int x , char y ) +{ + + { +#line 2 + return (x + (int )y); +} +} +#line 6 "cilcode.tmp/ex46.c" +int foo(int x , char y ) +{ int tmp ; + + { +#line 6 + tmp = bar(x, y); +#line 6 + return (tmp); +} +} diff --git a/cil/doc/examples/ex47.txt b/cil/doc/examples/ex47.txt new file mode 100644 index 00000000..cc5c3067 --- /dev/null +++ b/cil/doc/examples/ex47.txt @@ -0,0 +1,28 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex47.c" +struct __anonstruct____missing_field_name_3 { + int u ; + int v ; +}; +#line 1 "cilcode.tmp/ex47.c" +struct __anonstruct____missing_field_name_2 { + int y ; + int z ; + struct __anonstruct____missing_field_name_3 __annonCompField1 ; +}; +#line 1 "cilcode.tmp/ex47.c" +struct __anonstruct_a_1 { + int x ; + struct __anonstruct____missing_field_name_2 __annonCompField2 ; +}; +#line 1 "cilcode.tmp/ex47.c" +int main(void) +{ struct __anonstruct_a_1 a ; + + { +#line 10 + return ((((a.x + a.__annonCompField2.y) + a.__annonCompField2.z) + a.__annonCompField2.__annonCompField1.u) + a.__annonCompField2.__annonCompField1.v); +} +} diff --git a/cil/doc/examples/ex5.txt b/cil/doc/examples/ex5.txt new file mode 100644 index 00000000..d750bb59 --- /dev/null +++ b/cil/doc/examples/ex5.txt @@ -0,0 +1,27 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex5.c" +int f(double x ) ; +#line 3 +int g(double x ) ; +#line 2 "cilcode.tmp/ex5.c" +int f(double x ) +{ int tmp ; + + { +#line 3 + tmp = g(x); +#line 3 + return (tmp); +} +} +#line 5 "cilcode.tmp/ex5.c" +int g(double x ) +{ + + { +#line 6 + return ((int )x); +} +} diff --git a/cil/doc/examples/ex6.txt b/cil/doc/examples/ex6.txt new file mode 100644 index 00000000..c33eb9e3 --- /dev/null +++ b/cil/doc/examples/ex6.txt @@ -0,0 +1,7 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex6.c" +int a1[3] = { 1, 2, 3}; +#line 2 "cilcode.tmp/ex6.c" +int a2[8] ; diff --git a/cil/doc/examples/ex7.txt b/cil/doc/examples/ex7.txt new file mode 100644 index 00000000..55434c70 --- /dev/null +++ b/cil/doc/examples/ex7.txt @@ -0,0 +1,22 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 2 "cilcode.tmp/ex7.c" +enum __anonenum_x_1 { + FIVE = 5, + SIX = 6, + SEVEN = 7, + FOUR = 4, + EIGHT = 8 +} ; +#line 1 "cilcode.tmp/ex7.c" +int main(void) +{ enum __anonenum_x_1 x ; + + { +#line 2 + x = 5; +#line 8 + return ((int )x); +} +} diff --git a/cil/doc/examples/ex8.txt b/cil/doc/examples/ex8.txt new file mode 100644 index 00000000..323a41e9 --- /dev/null +++ b/cil/doc/examples/ex8.txt @@ -0,0 +1,13 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 2 "cilcode.tmp/ex8.c" +struct foo { + int x ; + int y ; +}; +#line 1 "cilcode.tmp/ex8.c" +int a1[5] = { 1, 2, 3, 0, + 0}; +#line 2 "cilcode.tmp/ex8.c" +struct foo s1 = {4, 0}; diff --git a/cil/doc/examples/ex9.txt b/cil/doc/examples/ex9.txt new file mode 100644 index 00000000..22e976ca --- /dev/null +++ b/cil/doc/examples/ex9.txt @@ -0,0 +1,16 @@ +/* Generated by CIL v. 1.3.5 */ +/* print_CIL_Input is true */ + +#line 1 "cilcode.tmp/ex9.c" +struct inner { + int z ; +}; +#line 1 "cilcode.tmp/ex9.c" +struct foo { + int x ; + int y ; + int a[5] ; + struct inner inner ; +}; +#line 1 "cilcode.tmp/ex9.c" +struct foo s = {0, 8, {0, 5, 5, 4, 0}, {3}}; |