From 3ec7088578fcf5a0618bbdc59d6b80a7dcae4b30 Mon Sep 17 00:00:00 2001 From: Julien Signoles <julien.signoles@cea.fr> Date: Tue, 22 Mar 2011 14:38:05 +0000 Subject: [PATCH] [e-acsl] implement options for direct linking with GMP [e-acsl] Makefile's target 'install' [e-acsl] test GMP linkage in non-regression suite ('make tests' now requires GMP >= 4.3.2) [e-acsl] fixed bugs of GMP compatibility --- src/plugins/e-acsl/Makefile.in | 9 +- src/plugins/e-acsl/configure.ac | 25 +- src/plugins/e-acsl/local_config.mli | 1 - src/plugins/e-acsl/main.ml | 20 +- src/plugins/e-acsl/options.ml | 13 +- src/plugins/e-acsl/options.mli | 3 +- src/plugins/e-acsl/read_header.ml | 30 +- src/plugins/e-acsl/share/e-acsl/e_acsl.h | 27 + src/plugins/e-acsl/share/e-acsl/e_acsl_gmp.h | 75 ++ .../e-acsl/share/e-acsl/e_acsl_gmp_types.h | 12 + src/plugins/e-acsl/share/e_acsl.h | 114 --- .../e-acsl/tests/e-acsl-runtime/addrOf.i | 4 +- .../e-acsl/tests/e-acsl-runtime/arith.i | 4 +- .../e-acsl/tests/e-acsl-runtime/cast.i | 4 +- .../e-acsl/tests/e-acsl-runtime/comparison.i | 4 +- .../e-acsl/tests/e-acsl-runtime/empty.i | 2 +- .../e-acsl/tests/e-acsl-runtime/false.i | 4 +- .../tests/e-acsl-runtime/integer_constant.i | 4 +- src/plugins/e-acsl/tests/e-acsl-runtime/not.i | 4 +- .../e-acsl-runtime/oracle/addrOf.res.oracle | 4 +- .../e-acsl-runtime/oracle/arith.res.oracle | 753 +++++++------- .../e-acsl-runtime/oracle/cast.res.oracle | 6 +- .../oracle/comparison.res.oracle | 207 ++-- .../e-acsl-runtime/oracle/false.res.oracle | 2 +- .../tests/e-acsl-runtime/oracle/gen_addrOf.c | 570 +++++++++++ .../tests/e-acsl-runtime/oracle/gen_arith.c | 938 ++++++++++++++++++ .../tests/e-acsl-runtime/oracle/gen_cast.c | 574 +++++++++++ .../e-acsl-runtime/oracle/gen_comparison.c | 681 +++++++++++++ .../tests/e-acsl-runtime/oracle/gen_false.c | 569 +++++++++++ .../oracle/gen_integer_constant.c | 619 ++++++++++++ .../tests/e-acsl-runtime/oracle/gen_not.c | 574 +++++++++++ .../tests/e-acsl-runtime/oracle/gen_sizeof.c | 574 +++++++++++ .../oracle/gen_string_literal.c | 568 +++++++++++ .../tests/e-acsl-runtime/oracle/gen_true.c | 569 +++++++++++ .../oracle/integer_constant.res.oracle | 85 +- .../e-acsl-runtime/oracle/not.res.oracle | 4 +- .../e-acsl-runtime/oracle/sizeof.res.oracle | 6 +- .../oracle/string_literal.res.oracle | 4 +- .../e-acsl-runtime/oracle/true.res.oracle | 4 +- .../e-acsl/tests/e-acsl-runtime/sizeof.i | 4 +- .../tests/e-acsl-runtime/string_literal.i | 4 +- .../e-acsl/tests/e-acsl-runtime/true.i | 4 +- 42 files changed, 6972 insertions(+), 710 deletions(-) create mode 100644 src/plugins/e-acsl/share/e-acsl/e_acsl.h create mode 100644 src/plugins/e-acsl/share/e-acsl/e_acsl_gmp.h create mode 100644 src/plugins/e-acsl/share/e-acsl/e_acsl_gmp_types.h delete mode 100644 src/plugins/e-acsl/share/e_acsl.h create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_addrOf.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_arith.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_cast.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_comparison.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_false.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_integer_constant.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_not.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_sizeof.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_string_literal.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_true.c diff --git a/src/plugins/e-acsl/Makefile.in b/src/plugins/e-acsl/Makefile.in index 61ced853031..c59a252fc3b 100644 --- a/src/plugins/e-acsl/Makefile.in +++ b/src/plugins/e-acsl/Makefile.in @@ -44,7 +44,6 @@ $(PLUGIN_DIR)/local_config.ml: $(PLUGIN_DIR)/Makefile.in $(ECHO) "(* This file was automatically generated from $<. Don't edit it. *)" >> $@ $(ECHO) "let may_compile_with_cc = @MAY_COMPILE_WITH_CC@" >> $@ $(ECHO) "let may_use_assert = @MAY_USE_ASSERT@" >> $@ - $(ECHO) "let gmpsrc_dir = \"@GMPSRC_DIR@\"" >> $@ $(CHMOD_RO) $@ PLUGIN_GENERATED:= $(PLUGIN_DIR)/local_config.ml @@ -67,6 +66,14 @@ tests:: tests/test_config endif +########### +# Install # +########### + +install:: + $(PRINT_CP) E-ACSL share files + $(CP) -R share/e-acsl $(FRAMAC_SHARE) + ################ # Generic part # ################ diff --git a/src/plugins/e-acsl/configure.ac b/src/plugins/e-acsl/configure.ac index 1ac59bef787..ea103a9cf1e 100644 --- a/src/plugins/e-acsl/configure.ac +++ b/src/plugins/e-acsl/configure.ac @@ -60,7 +60,7 @@ fi if test -z $HAVE_STDIO_H; then MAY_COMPILE_WITH_CC=false MAY_RUN_TESTS=no - AC_MSG_WARN([stdio.h missing: cannot use option -e-acsl-link-headers.]) + AC_MSG_WARN([stdio.h missing: cannot use option -e-acsl-include-headers.]) AC_MSG_WARN([stdio.h missing: non-regression tests unavailable.]) fi @@ -84,31 +84,10 @@ AC_CHECK_LIB(gmp,__gmpz_init,HAVE_GMP=yes,) # also set LIBS if test -z $HAVE_GMP; then MAY_COMPILE_WITH_CC=false MAY_RUN_TESTS=no - AC_MSG_WARN([GMP library missing: cannot use E-ACSL option -e-acsl-link-headers.]) + AC_MSG_WARN([GMP library missing: cannot use E-ACSL option -e-acsl-include-headers.]) AC_MSG_WARN([GMP library missing: non-regression tests unavailable.]) fi -# GMP sources -############# - -GMPSRC_DIR= - -AC_ARG_WITH(gmp-src, - AC_HELP_STRING( - [--with-gmp-src], - [directory containing the source of the GMP library] - )) - -if test "$with_gmp_src" = "yes" -o "$with_gmp_src" = "no" -o "$with_gmp_src" = ""; \ -then - AC_MSG_WARN([GMP sources missing: cannot use E-ACSL option -e-acsl-link-gmpsrc. Set the directory containing these sources with --with-gmp-src=<dirname>. Sources are available from ftp://ftp.gmplib.org/pub/gmp-4.3.2/gmp-4.3.2.tar.bz2]) -else - GMPSRC_DIR=$with_gmp_src - AC_CHECK_FILE($GMPSRC_DIR/mpz/init.c, - AC_MSG_NOTICE([GMP sources got from $GMPSRC_DIR]), - AC_MSG_ERROR([Directory $GMPSRC_DIR does not contain GMP sources.])) -fi - ####################### # Generating Makefile # ####################### diff --git a/src/plugins/e-acsl/local_config.mli b/src/plugins/e-acsl/local_config.mli index d95ac1f9414..aacfa9bd0ba 100644 --- a/src/plugins/e-acsl/local_config.mli +++ b/src/plugins/e-acsl/local_config.mli @@ -21,7 +21,6 @@ val may_compile_with_cc: bool val may_use_assert: bool -val gmpsrc_dir: string (* Local Variables: diff --git a/src/plugins/e-acsl/main.ml b/src/plugins/e-acsl/main.ml index d1c26f9f8dc..b6b9cfbed1e 100644 --- a/src/plugins/e-acsl/main.ml +++ b/src/plugins/e-acsl/main.ml @@ -56,10 +56,7 @@ module Resulting_projects = let size = 7 let kind = `Correctness let dependencies = - [ Ast.self; - Options.H_link.self; - Options.Gmpsrc_link.self; - Options.Use_assert.self ] + [ Ast.self; Options.Include_headers.self; Options.Use_assert.self ] end) let generate_code = @@ -67,7 +64,20 @@ let generate_code = (fun name -> try let visit prj = Visit.do_visit ~prj true in - File.create_rebuilt_project_from_visitor name visit + let preprocess = + if Options.Include_headers.get () then + if Local_config.may_compile_with_cc then begin + if Local_config.may_use_assert then Options.Use_assert.on (); + true + end else begin + Options.warning "option `-e-acsl-include-headers' not available \ +(see configure warning) : ignoring it."; + false + end + else + false + in + File.create_rebuilt_project_from_visitor ~preprocess name visit with Visit.Typing_error s -> Options.abort ~current:true "%s" s) diff --git a/src/plugins/e-acsl/options.ml b/src/plugins/e-acsl/options.ml index f6cee292b62..5deef961919 100644 --- a/src/plugins/e-acsl/options.ml +++ b/src/plugins/e-acsl/options.ml @@ -46,24 +46,15 @@ module Project_name = let arg_name = "prj" end) -module H_link = +module Include_headers = False (struct - let option_name = "-e-acsl-link-headers" + let option_name = "-e-acsl-include-headers" let help = "include standard headers in the new project \ (unset by default)" let kind = `Correctness end) -module Gmpsrc_link = - False - (struct - let option_name = "-e-acsl-link-gmpsrc" - let help = "link against GMP source code in the new project \ -(unset by default)" - let kind = `Correctness - end) - module Use_assert = False (struct diff --git a/src/plugins/e-acsl/options.mli b/src/plugins/e-acsl/options.mli index c7bc7e22448..bb1d8ec29f3 100644 --- a/src/plugins/e-acsl/options.mli +++ b/src/plugins/e-acsl/options.mli @@ -26,8 +26,7 @@ include S (** implementation of Log.S for E-ACSL *) module Check: BOOL module Project_name: STRING -module H_link: BOOL -module Gmpsrc_link: BOOL +module Include_headers: BOOL module Use_assert: BOOL (* diff --git a/src/plugins/e-acsl/read_header.ml b/src/plugins/e-acsl/read_header.ml index 1dc6c24ecf1..2403767af59 100644 --- a/src/plugins/e-acsl/read_header.ml +++ b/src/plugins/e-acsl/read_header.ml @@ -19,13 +19,12 @@ (* *) (**************************************************************************) -let text = - let buf = Buffer.create 97 in - fun () -> - if Buffer.length buf = 0 then begin - let fname = Filename.concat Config.datadir "e_acsl.h" in +let put_file_in_buffer fname buf = try - let cin = open_in fname in + let cin = + open_in + (Filename.concat Config.datadir (Filename.concat "e-acsl" fname)) + in try while true do let l = input_line cin in @@ -36,6 +35,25 @@ let text = close_in cin with Sys_error s -> Options.abort "cannot read file `%s': %s" fname s + +(* TODO: must be project-compliant. The memoized buffer should be reset when we + have to redo the visitor in a different setting. *) + +let add_include buf hfile = + Buffer.add_string buf (Format.sprintf "#include %S\n" hfile) + +let text = + let buf = Buffer.create 97 in + fun () -> + if Buffer.length buf = 0 then begin + if Options.Include_headers.get () then begin + add_include buf "stdio.h"; + if Options.Use_assert.get () then add_include buf "assert.h"; + add_include buf "gmp.h"; + end else + put_file_in_buffer "e_acsl_gmp_types.h" buf; + put_file_in_buffer "e_acsl_gmp.h" buf; + put_file_in_buffer "e_acsl.h" buf end; Buffer.contents buf diff --git a/src/plugins/e-acsl/share/e-acsl/e_acsl.h b/src/plugins/e-acsl/share/e-acsl/e_acsl.h new file mode 100644 index 00000000000..69cf358945e --- /dev/null +++ b/src/plugins/e-acsl/share/e-acsl/e_acsl.h @@ -0,0 +1,27 @@ +// TODO: remplacer par un e_acsl.h.in +// faire générer par le makefile un e_acsl.h +// avec des #include "FRAMAC_SHARE/libc/stdio.h", etc + +// [TODO] ne pas générer les typedef si on veut linker avec GMP derrière + +// [TODO] utiliser un champ modèle de type integer pour modéliser +// l'entier exact correspondant à un mpz_t. +// Not yet implemented in ACSL. + +/************************/ +/* Standard C functions */ +/************************/ + +/*@ terminates \false; + @ assigns \nothing; + @ ensures \false; */ +extern void exit(int status); + +/*@ assigns \nothing; */ +extern int printf(const char *, ...); + +/*****************************/ +/* Dedicated E-ACSL function */ +/*****************************/ + +void e_acsl_fail(char *msg) { printf("%s\n", msg); exit(1); } diff --git a/src/plugins/e-acsl/share/e-acsl/e_acsl_gmp.h b/src/plugins/e-acsl/share/e-acsl/e_acsl_gmp.h new file mode 100644 index 00000000000..ece341eca97 --- /dev/null +++ b/src/plugins/e-acsl/share/e-acsl/e_acsl_gmp.h @@ -0,0 +1,75 @@ + +/*****************/ +/* GMP functions */ +/*****************/ + +// initilializers + +/*@ ensures \valid(x); + @ assigns *x; */ +extern void mpz_init(mpz_t x); + +/*@ ensures \valid(z); + @ assigns *z; */ +extern void mpz_init_set_ui(mpz_t z, unsigned long int n); + +/*@ ensures \valid(z); + @ assigns *z; */ +extern void mpz_init_set_si(mpz_t z, signed long int n); + +/*@ ensures \valid(z); + @ assigns *z; */ +extern int mpz_init_set_str(mpz_t z, const char *str, int base); + +// finalizer + +/*@ requires \valid(x); + @ assigns *x; */ +extern void mpz_clear(mpz_t x); + +// logical and arithmetic operators + +/*@ requires \valid(z1); + @ requires \valid(z2); + @ assigns \nothing; */ +extern int mpz_cmp(const mpz_t z1, const mpz_t z2); + +/*@ requires \valid(z1); + @ requires \valid(z2); + @ assigns *z1; */ +extern int mpz_comp(mpz_t z1, const mpz_t z2); + +/*@ requires \valid(z1); + @ requires \valid(z2); + @ assigns *z1; */ +extern void mpz_neg(mpz_t z1, const mpz_t z2); + +/*@ requires \valid(z1); + @ requires \valid(z2); + @ requires \valid(z3); + @ assigns *z1; */ +extern void mpz_add(mpz_t z1, const mpz_t z2, const mpz_t z3); + +/*@ requires \valid(z1); + @ requires \valid(z2); + @ requires \valid(z3); + @ assigns *z1; */ +extern void mpz_sub(mpz_t z1, const mpz_t z2, const mpz_t z3); + +/*@ requires \valid(z1); + @ requires \valid(z2); + @ requires \valid(z3); + @ assigns *z1; */ +extern void mpz_mul(mpz_t z1, const mpz_t z2, const mpz_t z3); + +/*@ requires \valid(z1); + @ requires \valid(z2); + @ requires \valid(z3); + @ assigns *z1; */ +extern void mpz_cdiv_q(mpz_t z1, const mpz_t z2, const mpz_t z3); + +/*@ requires \valid(z1); + @ requires \valid(z2); + @ requires \valid(z3); + @ assigns *z1; */ +extern void mpz_mod(mpz_t z1, const mpz_t z2, const mpz_t z3); diff --git a/src/plugins/e-acsl/share/e-acsl/e_acsl_gmp_types.h b/src/plugins/e-acsl/share/e-acsl/e_acsl_gmp_types.h new file mode 100644 index 00000000000..a995e3d5ba2 --- /dev/null +++ b/src/plugins/e-acsl/share/e-acsl/e_acsl_gmp_types.h @@ -0,0 +1,12 @@ + +/*************/ +/* GMP types */ +/*************/ + +typedef struct { + int _mp_alloc; + int _mp_size; + unsigned long int *_mp_d; +} __mpz_struct; + +typedef __mpz_struct mpz_t[1]; diff --git a/src/plugins/e-acsl/share/e_acsl.h b/src/plugins/e-acsl/share/e_acsl.h deleted file mode 100644 index 05a034dc102..00000000000 --- a/src/plugins/e-acsl/share/e_acsl.h +++ /dev/null @@ -1,114 +0,0 @@ -// TODO: remplacer par un e_acsl.h.in -// faire générer par le makefile un e_acsl.h -// avec des #include "FRAMAC_SHARE/libc/stdio.h", etc - -/*************/ -/* GMP types */ -/*************/ - -// [TODO] ne pas générer les typedef si on veut linker avec GMP derrière - -// [TODO] utiliser un champ modèle de type integer pour modéliser -// l'entier exact correspondant à un mpz_t. -// Not yet implemented in ACSL. - -typedef struct { - int _mp_alloc; - int _mp_size; - unsigned long int *_mp_d; -} __mpz_struct; - -typedef __mpz_struct mpz_t[1]; - -/*****************/ -/* GMP functions */ -/*****************/ - -// initilializers - -/*@ ensures \valid(x); - @ assigns *x; */ -extern void mpz_init(mpz_t x); - -/*@ ensures \valid(z); - @ assigns *z; */ -extern void mpz_init_set_ui(mpz_t z, unsigned long int n); - -/*@ ensures \valid(z); - @ assigns *z; */ -extern void mpz_init_set_si(mpz_t z, signed long int n); - -/*@ ensures \valid(z); - @ assigns *z; */ -extern void mpz_init_set_str(mpz_t z, const char *str, int base); - -// finalizer - -/*@ requires \valid(x); - @ assigns *x; */ -extern void mpz_clear(mpz_t x); - -// logical and arithmetic operators - -/*@ requires \valid(z1); - @ requires \valid(z2); - @ assigns \nothing; */ -extern int mpz_cmp(const mpz_t z1, const mpz_t z2); - -/*@ requires \valid(z1); - @ requires \valid(z2); - @ assigns *z1; */ -extern int mpz_comp(mpz_t z1, const mpz_t z2); - -/*@ requires \valid(z1); - @ requires \valid(z2); - @ assigns *z1; */ -extern int mpz_neg(mpz_t z1, const mpz_t z2); - -/*@ requires \valid(z1); - @ requires \valid(z2); - @ requires \valid(z3); - @ assigns *z1; */ -extern int mpz_add(mpz_t z1, const mpz_t z2, const mpz_t z3); - -/*@ requires \valid(z1); - @ requires \valid(z2); - @ requires \valid(z3); - @ assigns *z1; */ -extern int mpz_sub(mpz_t z1, const mpz_t z2, const mpz_t z3); - -/*@ requires \valid(z1); - @ requires \valid(z2); - @ requires \valid(z3); - @ assigns *z1; */ -extern int mpz_mul(mpz_t z1, const mpz_t z2, const mpz_t z3); - -/*@ requires \valid(z1); - @ requires \valid(z2); - @ requires \valid(z3); - @ assigns *z1; */ -extern int mpz_cdiv_q(mpz_t z1, const mpz_t z2, const mpz_t z3); - -/*@ requires \valid(z1); - @ requires \valid(z2); - @ requires \valid(z3); - @ assigns *z1; */ -extern int mpz_mod(mpz_t z1, const mpz_t z2, const mpz_t z3); - -/************************/ -/* Standard C functions */ -/************************/ - -/*@ terminates \false; - @ assigns \nothing; - @ ensures \false; */ -extern void exit(int status); - -/*@ assigns \nothing; */ -extern int printf(const char *, ...); - -/*****************************/ -/* Dedicated E-ACSL function */ -/*****************************/ - -void e_acsl_fail(char *msg) { printf(msg); exit(1); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/addrOf.i b/src/plugins/e-acsl/tests/e-acsl-runtime/addrOf.i index a777cc10d9f..bae1b1682f2 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/addrOf.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/addrOf.i @@ -1,5 +1,7 @@ /* run.config - COMMENT: addrOf */ + COMMENT: addrOf + EXECNOW: LOG gen_addrOf.c BIN gen_addrOf.out FRAMAC_SHARE=./share frama-c -load-module E_ACSL ./tests/e-acsl-runtime/addrOf.i -e-acsl-project p -e-acsl-include-headers -then-on p -print -ocode ./tests/e-acsl-runtime/result/gen_addrOf.c > /dev/null && gcc -o ./tests/e-acsl-runtime/result/gen_addrOf.out ./tests/e-acsl-runtime/result/gen_addrOf.c +*/ void main() { int x = 0; /*@ assert &x == &x; */ ; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/arith.i b/src/plugins/e-acsl/tests/e-acsl-runtime/arith.i index 628233868f1..3435f843a7e 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/arith.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/arith.i @@ -1,6 +1,8 @@ /* run.config COMMENT: arithmetic operations - COMMENT: add the last assertion when fixing BTS #751 */ + COMMENT: add the last assertion when fixing BTS #751 + EXECNOW: LOG gen_arith.c BIN gen_arith.out FRAMAC_SHARE=./share frama-c -load-module E_ACSL ./tests/e-acsl-runtime/arith.i -e-acsl-project p -e-acsl-include-headers -then-on p -print -ocode ./tests/e-acsl-runtime/result/gen_arith.c > /dev/null && gcc -o ./tests/e-acsl-runtime/result/gen_arith.out -lgmp ./tests/e-acsl-runtime/result/gen_arith.c +*/ void main() { int x = -3; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/cast.i b/src/plugins/e-acsl/tests/e-acsl-runtime/cast.i index dc5383dd4d7..24f7609b4a3 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/cast.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/cast.i @@ -1,5 +1,7 @@ /* run.config - COMMENT: cast */ + COMMENT: cast + EXECNOW: LOG gen_cast.c BIN gen_cast.out FRAMAC_SHARE=./share frama-c -load-module E_ACSL ./tests/e-acsl-runtime/cast.i -e-acsl-project p -e-acsl-include-headers -then-on p -print -ocode ./tests/e-acsl-runtime/result/gen_cast.c > /dev/null && gcc -o ./tests/e-acsl-runtime/result/gen_cast.out ./tests/e-acsl-runtime/result/gen_cast.c +*/ void main() { long x = 0; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/comparison.i b/src/plugins/e-acsl/tests/e-acsl-runtime/comparison.i index ac1dd5a3616..10252afb555 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/comparison.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/comparison.i @@ -1,5 +1,7 @@ /* run.config - COMMENT: comparison operators */ + COMMENT: comparison operators + EXECNOW: LOG gen_comparison.c BIN gen_comparison.out FRAMAC_SHARE=./share frama-c -load-module E_ACSL ./tests/e-acsl-runtime/comparison.i -e-acsl-project p -e-acsl-include-headers -then-on p -print -ocode ./tests/e-acsl-runtime/result/gen_comparison.c > /dev/null && gcc -o ./tests/e-acsl-runtime/result/gen_comparison.out -lgmp ./tests/e-acsl-runtime/result/gen_comparison.c +*/ void main() { int x = 0, y = 1; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/empty.i b/src/plugins/e-acsl/tests/e-acsl-runtime/empty.i index 7f71fcedc6f..8c765be191a 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/empty.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/empty.i @@ -1,3 +1,3 @@ /* run.config COMMENT: empty file - OPT: -e-acsl-project p -then-on p -print */ + OPT: -e-acsl-check -e-acsl-project p -then-on p -print */ diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/false.i b/src/plugins/e-acsl/tests/e-acsl-runtime/false.i index 8a7597fd11a..1a1a80bf026 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/false.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/false.i @@ -1,5 +1,7 @@ /* run.config - COMMENT: assert \false */ + COMMENT: assert \false + EXECNOW: LOG gen_false.c BIN gen_false.out FRAMAC_SHARE=./share frama-c -load-module E_ACSL ./tests/e-acsl-runtime/false.i -e-acsl-project p -e-acsl-include-headers -then-on p -print -ocode ./tests/e-acsl-runtime/result/gen_false.c > /dev/null && gcc -o ./tests/e-acsl-runtime/result/gen_false.out ./tests/e-acsl-runtime/result/gen_false.c +*/ void main() { int x = 0; if (x) /*@ assert \false; */ ; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/integer_constant.i b/src/plugins/e-acsl/tests/e-acsl-runtime/integer_constant.i index 6fdade65ef1..9e8e9105a9b 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/integer_constant.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/integer_constant.i @@ -1,6 +1,8 @@ /* run.config COMMENT: integer constant - COMMENT: waiting for fixing BTS #745 */ + COMMENT: waiting for fixing BTS #745 + EXECNOW: LOG gen_integer_constant.c BIN gen_integer_constant.out FRAMAC_SHARE=./share frama-c -load-module E_ACSL ./tests/e-acsl-runtime/integer_constant.i -e-acsl-project p -e-acsl-include-headers -then-on p -print -ocode ./tests/e-acsl-runtime/result/gen_integer_constant.c > /dev/null && gcc -o ./tests/e-acsl-runtime/result/gen_integer_constant.out -lgmp ./tests/e-acsl-runtime/result/gen_integer_constant.c +*/ void main() { /*@ assert 0 == 0; */ /*@ assert 0 != 1; */ diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/not.i b/src/plugins/e-acsl/tests/e-acsl-runtime/not.i index 5349de31bc4..54c44a75bc5 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/not.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/not.i @@ -1,5 +1,7 @@ /* run.config - COMMENT: predicate [!p] */ + COMMENT: predicate [!p] + EXECNOW: LOG gen_not.c BIN gen_not.out FRAMAC_SHARE=./share frama-c -load-module E_ACSL ./tests/e-acsl-runtime/not.i -e-acsl-project p -e-acsl-include-headers -then-on p -print -ocode ./tests/e-acsl-runtime/result/gen_not.c > /dev/null && gcc -o ./tests/e-acsl-runtime/result/gen_not.out ./tests/e-acsl-runtime/result/gen_not.c +*/ void main() { int x = 0; /*@ assert ! x; */ diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/addrOf.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/addrOf.res.oracle index 3744ded6d7d..a85244fafff 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/addrOf.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/addrOf.res.oracle @@ -2,7 +2,7 @@ [value] Computing initial state [value] Initial state computed [value] Values of globals at initialization -PROJECT_FILE:121:[value] Assertion got status valid. +PROJECT_FILE.i:121:[value] Assertion got status valid. [value] Recording results for main [value] done for function main [dominators] computing for function main @@ -19,7 +19,7 @@ extern void exit(int status ) ; extern int printf(char const * , ...) ; void e_acsl_fail(char *msg ) { - printf((char const *)msg); + printf("%s\n",msg); exit(1); return; } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/arith.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/arith.res.oracle index b38abb0d6fd..5353425ece9 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/arith.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/arith.res.oracle @@ -2,800 +2,800 @@ [value] Computing initial state [value] Initial state computed [value] Values of globals at initialization -PROJECT_FILE:123:[value] Assertion got status valid. +PROJECT_FILE.i:123:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:125. -PROJECT_FILE:125:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:125. +PROJECT_FILE.i:125:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:126. -PROJECT_FILE:126:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:126. +PROJECT_FILE.i:126:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_neg <-main. - Called from PROJECT_FILE:126. -PROJECT_FILE:126:[value] Function mpz_neg: precondition got status valid + Called from PROJECT_FILE.i:126. +PROJECT_FILE.i:126:[value] Function mpz_neg: precondition got status valid [value] Done for function mpz_neg [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:127. -PROJECT_FILE:127:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:127. +PROJECT_FILE.i:127:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:128. -PROJECT_FILE:128:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:128. +PROJECT_FILE.i:128:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:129. + Called from PROJECT_FILE.i:129. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. -PROJECT_FILE:115:[value] Function exit: postcondition got status invalid + Called from PROJECT_FILE.i:115. +PROJECT_FILE.i:115:[value] Function exit: postcondition got status invalid [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:130. -PROJECT_FILE:130:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:130. +PROJECT_FILE.i:130:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:130. + Called from PROJECT_FILE.i:130. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:131. -PROJECT_FILE:131:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:131. +PROJECT_FILE.i:131:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear -PROJECT_FILE:134:[value] Assertion got status valid. +PROJECT_FILE.i:134:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:136. -PROJECT_FILE:136:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:136. +PROJECT_FILE.i:136:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:137. -PROJECT_FILE:137:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:137. +PROJECT_FILE.i:137:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:137. -PROJECT_FILE:137:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:137. +PROJECT_FILE.i:137:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_neg <-main. - Called from PROJECT_FILE:138. -PROJECT_FILE:138:[value] Function mpz_neg: precondition got status valid + Called from PROJECT_FILE.i:138. +PROJECT_FILE.i:138:[value] Function mpz_neg: precondition got status valid [value] Done for function mpz_neg [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:139. -PROJECT_FILE:139:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:139. +PROJECT_FILE.i:139:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:140. + Called from PROJECT_FILE.i:140. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:141. -PROJECT_FILE:141:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:141. +PROJECT_FILE.i:141:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:141. + Called from PROJECT_FILE.i:141. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:142. -PROJECT_FILE:142:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:142. +PROJECT_FILE.i:142:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear -PROJECT_FILE:145:[value] Assertion got status valid. +PROJECT_FILE.i:145:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:147. -PROJECT_FILE:147:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:147. +PROJECT_FILE.i:147:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:148. -PROJECT_FILE:148:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:148. +PROJECT_FILE.i:148:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:148. -PROJECT_FILE:148:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:148. +PROJECT_FILE.i:148:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_com <-main. - Called from PROJECT_FILE:149. + Called from PROJECT_FILE.i:149. [kernel] No code for function mpz_com, default assigns generated [value] Done for function mpz_com [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:150. -PROJECT_FILE:150:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:150. +PROJECT_FILE.i:150:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:151. + Called from PROJECT_FILE.i:151. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:152. -PROJECT_FILE:152:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:152. +PROJECT_FILE.i:152:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:152. + Called from PROJECT_FILE.i:152. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:153. -PROJECT_FILE:153:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:153. +PROJECT_FILE.i:153:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear -PROJECT_FILE:156:[value] Assertion got status valid. +PROJECT_FILE.i:156:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:159. -PROJECT_FILE:159:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:159. +PROJECT_FILE.i:159:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:159. + Called from PROJECT_FILE.i:159. [value] Done for function mpz_init_set_si [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:160. -PROJECT_FILE:160:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:160. +PROJECT_FILE.i:160:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_add <-main. - Called from PROJECT_FILE:160. -PROJECT_FILE:160:[value] Function mpz_add: precondition got status valid + Called from PROJECT_FILE.i:160. +PROJECT_FILE.i:160:[value] Function mpz_add: precondition got status valid [value] Done for function mpz_add [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:161. -PROJECT_FILE:161:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:161. +PROJECT_FILE.i:161:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:161. -PROJECT_FILE:161:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:161. +PROJECT_FILE.i:161:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_neg <-main. - Called from PROJECT_FILE:162. -PROJECT_FILE:162:[value] Function mpz_neg: precondition got status valid + Called from PROJECT_FILE.i:162. +PROJECT_FILE.i:162:[value] Function mpz_neg: precondition got status valid [value] Done for function mpz_neg [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:163. -PROJECT_FILE:163:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:163. +PROJECT_FILE.i:163:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:164. + Called from PROJECT_FILE.i:164. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:165. -PROJECT_FILE:165:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:165. +PROJECT_FILE.i:165:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:165. + Called from PROJECT_FILE.i:165. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:166. -PROJECT_FILE:166:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:166. +PROJECT_FILE.i:166:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:166. + Called from PROJECT_FILE.i:166. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:167. -PROJECT_FILE:167:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:167. +PROJECT_FILE.i:167:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear -PROJECT_FILE:170:[value] Assertion got status valid. +PROJECT_FILE.i:170:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:173. -PROJECT_FILE:173:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:173. +PROJECT_FILE.i:173:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:173. + Called from PROJECT_FILE.i:173. [value] Done for function mpz_init_set_si [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:174. -PROJECT_FILE:174:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:174. +PROJECT_FILE.i:174:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_sub <-main. - Called from PROJECT_FILE:174. -PROJECT_FILE:174:[value] Function mpz_sub: precondition got status valid + Called from PROJECT_FILE.i:174. +PROJECT_FILE.i:174:[value] Function mpz_sub: precondition got status valid [value] Done for function mpz_sub [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:175. -PROJECT_FILE:175:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:175. +PROJECT_FILE.i:175:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:175. -PROJECT_FILE:175:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:175. +PROJECT_FILE.i:175:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_neg <-main. - Called from PROJECT_FILE:176. -PROJECT_FILE:176:[value] Function mpz_neg: precondition got status valid + Called from PROJECT_FILE.i:176. +PROJECT_FILE.i:176:[value] Function mpz_neg: precondition got status valid [value] Done for function mpz_neg [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:177. -PROJECT_FILE:177:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:177. +PROJECT_FILE.i:177:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:178. + Called from PROJECT_FILE.i:178. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:179. -PROJECT_FILE:179:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:179. +PROJECT_FILE.i:179:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:179. + Called from PROJECT_FILE.i:179. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:180. -PROJECT_FILE:180:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:180. +PROJECT_FILE.i:180:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:180. + Called from PROJECT_FILE.i:180. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:181. -PROJECT_FILE:181:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:181. +PROJECT_FILE.i:181:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear -PROJECT_FILE:184:[value] Assertion got status valid. +PROJECT_FILE.i:184:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:187. -PROJECT_FILE:187:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:187. +PROJECT_FILE.i:187:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:187. + Called from PROJECT_FILE.i:187. [value] Done for function mpz_init_set_si [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:188. -PROJECT_FILE:188:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:188. +PROJECT_FILE.i:188:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_mul <-main. - Called from PROJECT_FILE:188. -PROJECT_FILE:188:[value] Function mpz_mul: precondition got status valid + Called from PROJECT_FILE.i:188. +PROJECT_FILE.i:188:[value] Function mpz_mul: precondition got status valid [value] Done for function mpz_mul [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:189. -PROJECT_FILE:189:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:189. +PROJECT_FILE.i:189:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:189. -PROJECT_FILE:189:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:189. +PROJECT_FILE.i:189:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_neg <-main. - Called from PROJECT_FILE:190. -PROJECT_FILE:190:[value] Function mpz_neg: precondition got status valid + Called from PROJECT_FILE.i:190. +PROJECT_FILE.i:190:[value] Function mpz_neg: precondition got status valid [value] Done for function mpz_neg [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:191. -PROJECT_FILE:191:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:191. +PROJECT_FILE.i:191:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:192. + Called from PROJECT_FILE.i:192. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:193. -PROJECT_FILE:193:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:193. +PROJECT_FILE.i:193:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:193. + Called from PROJECT_FILE.i:193. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:194. -PROJECT_FILE:194:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:194. +PROJECT_FILE.i:194:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:194. + Called from PROJECT_FILE.i:194. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:195. -PROJECT_FILE:195:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:195. +PROJECT_FILE.i:195:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear -PROJECT_FILE:198:[value] Assertion got status valid. +PROJECT_FILE.i:198:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:201. -PROJECT_FILE:201:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:201. +PROJECT_FILE.i:201:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:201. + Called from PROJECT_FILE.i:201. [value] Done for function mpz_init_set_si [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:202. -PROJECT_FILE:202:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:202. +PROJECT_FILE.i:202:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_cdiv_q <-main. - Called from PROJECT_FILE:203. -PROJECT_FILE:203:[value] Function mpz_cdiv_q: precondition got status valid + Called from PROJECT_FILE.i:203. +PROJECT_FILE.i:203:[value] Function mpz_cdiv_q: precondition got status valid [value] Done for function mpz_cdiv_q [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:204. -PROJECT_FILE:204:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:204. +PROJECT_FILE.i:204:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:204. -PROJECT_FILE:204:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:204. +PROJECT_FILE.i:204:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_neg <-main. - Called from PROJECT_FILE:205. -PROJECT_FILE:205:[value] Function mpz_neg: precondition got status valid + Called from PROJECT_FILE.i:205. +PROJECT_FILE.i:205:[value] Function mpz_neg: precondition got status valid [value] Done for function mpz_neg [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:206. -PROJECT_FILE:206:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:206. +PROJECT_FILE.i:206:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:207. + Called from PROJECT_FILE.i:207. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:208. -PROJECT_FILE:208:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:208. +PROJECT_FILE.i:208:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:208. + Called from PROJECT_FILE.i:208. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:209. -PROJECT_FILE:209:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:209. +PROJECT_FILE.i:209:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:209. + Called from PROJECT_FILE.i:209. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:210. -PROJECT_FILE:210:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:210. +PROJECT_FILE.i:210:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear -PROJECT_FILE:213:[value] Assertion got status valid. +PROJECT_FILE.i:213:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:216. -PROJECT_FILE:216:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:216. +PROJECT_FILE.i:216:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:216. + Called from PROJECT_FILE.i:216. [value] Done for function mpz_init_set_si [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:217. -PROJECT_FILE:217:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:217. +PROJECT_FILE.i:217:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_mod <-main. - Called from PROJECT_FILE:217. -PROJECT_FILE:217:[value] Function mpz_mod: precondition got status valid + Called from PROJECT_FILE.i:217. +PROJECT_FILE.i:217:[value] Function mpz_mod: precondition got status valid [value] Done for function mpz_mod [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:218. -PROJECT_FILE:218:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:218. +PROJECT_FILE.i:218:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:218. -PROJECT_FILE:218:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:218. +PROJECT_FILE.i:218:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_neg <-main. - Called from PROJECT_FILE:219. -PROJECT_FILE:219:[value] Function mpz_neg: precondition got status valid + Called from PROJECT_FILE.i:219. +PROJECT_FILE.i:219:[value] Function mpz_neg: precondition got status valid [value] Done for function mpz_neg [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:220. -PROJECT_FILE:220:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:220. +PROJECT_FILE.i:220:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:221. + Called from PROJECT_FILE.i:221. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:222. -PROJECT_FILE:222:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:222. +PROJECT_FILE.i:222:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:222. + Called from PROJECT_FILE.i:222. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:223. -PROJECT_FILE:223:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:223. +PROJECT_FILE.i:223:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:223. + Called from PROJECT_FILE.i:223. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:224. -PROJECT_FILE:224:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:224. +PROJECT_FILE.i:224:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear -PROJECT_FILE:227:[value] Assertion got status valid. +PROJECT_FILE.i:227:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:233. -PROJECT_FILE:233:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:233. +PROJECT_FILE.i:233:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:234. -PROJECT_FILE:234:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:234. +PROJECT_FILE.i:234:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:234. -PROJECT_FILE:234:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:234. +PROJECT_FILE.i:234:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_mul <-main. - Called from PROJECT_FILE:235. -PROJECT_FILE:235:[value] Function mpz_mul: precondition got status valid + Called from PROJECT_FILE.i:235. +PROJECT_FILE.i:235:[value] Function mpz_mul: precondition got status valid [value] Done for function mpz_mul [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:236. -PROJECT_FILE:236:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:236. +PROJECT_FILE.i:236:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:236. + Called from PROJECT_FILE.i:236. [value] Done for function mpz_init_set_si [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:237. -PROJECT_FILE:237:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:237. +PROJECT_FILE.i:237:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_add <-main. - Called from PROJECT_FILE:237. -PROJECT_FILE:237:[value] Function mpz_add: precondition got status valid + Called from PROJECT_FILE.i:237. +PROJECT_FILE.i:237:[value] Function mpz_add: precondition got status valid [value] Done for function mpz_add [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:238. -PROJECT_FILE:238:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:238. +PROJECT_FILE.i:238:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_add <-main. - Called from PROJECT_FILE:238. -PROJECT_FILE:238:[value] Function mpz_add: precondition got status valid + Called from PROJECT_FILE.i:238. +PROJECT_FILE.i:238:[value] Function mpz_add: precondition got status valid [value] Done for function mpz_add [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:239. -PROJECT_FILE:239:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:239. +PROJECT_FILE.i:239:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:239. -PROJECT_FILE:239:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:239. +PROJECT_FILE.i:239:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_sub <-main. - Called from PROJECT_FILE:240. -PROJECT_FILE:240:[value] Function mpz_sub: precondition got status valid + Called from PROJECT_FILE.i:240. +PROJECT_FILE.i:240:[value] Function mpz_sub: precondition got status valid [value] Done for function mpz_sub [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:241. -PROJECT_FILE:241:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:241. +PROJECT_FILE.i:241:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:241. + Called from PROJECT_FILE.i:241. [value] Done for function mpz_init_set_si [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:242. -PROJECT_FILE:242:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:242. +PROJECT_FILE.i:242:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_sub <-main. - Called from PROJECT_FILE:243. -PROJECT_FILE:243:[value] Function mpz_sub: precondition got status valid + Called from PROJECT_FILE.i:243. +PROJECT_FILE.i:243:[value] Function mpz_sub: precondition got status valid [value] Done for function mpz_sub [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:244. -PROJECT_FILE:244:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:244. +PROJECT_FILE.i:244:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_add <-main. - Called from PROJECT_FILE:245. -PROJECT_FILE:245:[value] Function mpz_add: precondition got status valid + Called from PROJECT_FILE.i:245. +PROJECT_FILE.i:245:[value] Function mpz_add: precondition got status valid [value] Done for function mpz_add [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:246. -PROJECT_FILE:246:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:246. +PROJECT_FILE.i:246:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:246. -PROJECT_FILE:246:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:246. +PROJECT_FILE.i:246:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_neg <-main. - Called from PROJECT_FILE:247. -PROJECT_FILE:247:[value] Function mpz_neg: precondition got status valid + Called from PROJECT_FILE.i:247. +PROJECT_FILE.i:247:[value] Function mpz_neg: precondition got status valid [value] Done for function mpz_neg [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:248. -PROJECT_FILE:248:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:248. +PROJECT_FILE.i:248:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:249. + Called from PROJECT_FILE.i:249. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:250. -PROJECT_FILE:250:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:250. +PROJECT_FILE.i:250:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:250. + Called from PROJECT_FILE.i:250. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:251. -PROJECT_FILE:251:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:251. +PROJECT_FILE.i:251:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:251. + Called from PROJECT_FILE.i:251. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:252. -PROJECT_FILE:252:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:252. +PROJECT_FILE.i:252:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:252. + Called from PROJECT_FILE.i:252. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:253. -PROJECT_FILE:253:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:253. +PROJECT_FILE.i:253:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:253. + Called from PROJECT_FILE.i:253. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:254. -PROJECT_FILE:254:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:254. +PROJECT_FILE.i:254:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:254. + Called from PROJECT_FILE.i:254. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:255. -PROJECT_FILE:255:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:255. +PROJECT_FILE.i:255:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:255. + Called from PROJECT_FILE.i:255. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:256. -PROJECT_FILE:256:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:256. +PROJECT_FILE.i:256:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:256. + Called from PROJECT_FILE.i:256. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:257. -PROJECT_FILE:257:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:257. +PROJECT_FILE.i:257:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear -PROJECT_FILE:260:[value] Assertion got status valid. +PROJECT_FILE.i:260:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:263. -PROJECT_FILE:263:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:263. +PROJECT_FILE.i:263:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:263. + Called from PROJECT_FILE.i:263. [value] Done for function mpz_init_set_si [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:264. -PROJECT_FILE:264:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:264. +PROJECT_FILE.i:264:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:265. -PROJECT_FILE:265:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:265. +PROJECT_FILE.i:265:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:265. + Called from PROJECT_FILE.i:265. [value] Done for function mpz_init_set_si [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:266. -PROJECT_FILE:266:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:266. +PROJECT_FILE.i:266:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:268. + Called from PROJECT_FILE.i:268. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:269. -PROJECT_FILE:269:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:269. +PROJECT_FILE.i:269:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:269. + Called from PROJECT_FILE.i:269. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:270. -PROJECT_FILE:270:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:270. +PROJECT_FILE.i:270:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:270. + Called from PROJECT_FILE.i:270. [value] Done for function mpz_clear -PROJECT_FILE:273:[value] Assertion got status valid. +PROJECT_FILE.i:273:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:276. -PROJECT_FILE:276:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:276. +PROJECT_FILE.i:276:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:277. -PROJECT_FILE:277:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:277. +PROJECT_FILE.i:277:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:277. -PROJECT_FILE:277:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:277. +PROJECT_FILE.i:277:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_neg <-main. - Called from PROJECT_FILE:278. -PROJECT_FILE:278:[value] Function mpz_neg: precondition got status valid + Called from PROJECT_FILE.i:278. +PROJECT_FILE.i:278:[value] Function mpz_neg: precondition got status valid [value] Done for function mpz_neg [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:279. -PROJECT_FILE:279:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:279. +PROJECT_FILE.i:279:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:280. -PROJECT_FILE:280:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:280. +PROJECT_FILE.i:280:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:280. + Called from PROJECT_FILE.i:280. [value] Done for function mpz_init_set_si [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:281. -PROJECT_FILE:281:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:281. +PROJECT_FILE.i:281:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:283. + Called from PROJECT_FILE.i:283. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:284. -PROJECT_FILE:284:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:284. +PROJECT_FILE.i:284:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:284. + Called from PROJECT_FILE.i:284. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:285. -PROJECT_FILE:285:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:285. +PROJECT_FILE.i:285:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:285. + Called from PROJECT_FILE.i:285. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:286. -PROJECT_FILE:286:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:286. +PROJECT_FILE.i:286:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear -PROJECT_FILE:289:[value] Assertion got status valid. +PROJECT_FILE.i:289:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:292. -PROJECT_FILE:292:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:292. +PROJECT_FILE.i:292:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:293. -PROJECT_FILE:293:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:293. +PROJECT_FILE.i:293:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init <-main. - Called from PROJECT_FILE:293. -PROJECT_FILE:293:[value] Function mpz_init: postcondition got status unknown + Called from PROJECT_FILE.i:293. +PROJECT_FILE.i:293:[value] Function mpz_init: postcondition got status unknown [value] Done for function mpz_init [value] computing for function mpz_neg <-main. - Called from PROJECT_FILE:294. -PROJECT_FILE:294:[value] Function mpz_neg: precondition got status valid + Called from PROJECT_FILE.i:294. +PROJECT_FILE.i:294:[value] Function mpz_neg: precondition got status valid [value] Done for function mpz_neg [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:295. -PROJECT_FILE:295:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:295. +PROJECT_FILE.i:295:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:296. -PROJECT_FILE:296:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:296. +PROJECT_FILE.i:296:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:296. + Called from PROJECT_FILE.i:296. [value] Done for function mpz_init_set_si [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:297. -PROJECT_FILE:297:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:297. +PROJECT_FILE.i:297:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:299. + Called from PROJECT_FILE.i:299. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:300. -PROJECT_FILE:300:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:300. +PROJECT_FILE.i:300:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:300. + Called from PROJECT_FILE.i:300. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:301. -PROJECT_FILE:301:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:301. +PROJECT_FILE.i:301:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:301. + Called from PROJECT_FILE.i:301. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:302. -PROJECT_FILE:302:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:302. +PROJECT_FILE.i:302:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear -PROJECT_FILE:305:[value] Assertion got status valid. +PROJECT_FILE.i:305:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:308. -PROJECT_FILE:308:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:308. +PROJECT_FILE.i:308:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:308. + Called from PROJECT_FILE.i:308. [value] Done for function mpz_init_set_si [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:309. -PROJECT_FILE:309:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:309. +PROJECT_FILE.i:309:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:310. -PROJECT_FILE:310:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:310. +PROJECT_FILE.i:310:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:310. + Called from PROJECT_FILE.i:310. [value] Done for function mpz_init_set_si [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:311. -PROJECT_FILE:311:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:311. +PROJECT_FILE.i:311:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:313. + Called from PROJECT_FILE.i:313. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:314. -PROJECT_FILE:314:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:314. +PROJECT_FILE.i:314:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:314. + Called from PROJECT_FILE.i:314. [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:315. -PROJECT_FILE:315:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:315. +PROJECT_FILE.i:315:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:315. + Called from PROJECT_FILE.i:315. [value] Done for function mpz_clear [value] Recording results for main [value] done for function main @@ -810,9 +810,10 @@ PROJECT_FILE:315:[value] Function mpz_clear: precondition got status valid [from] Computing for function e_acsl_fail [from] Computing for function printf <-e_acsl_fail [from] Done for function printf +PROJECT_FILE.i:115:[from] warning: variadic call detected. Using only 1 argument(s). [from] Computing for function exit <-e_acsl_fail [from] Done for function exit -PROJECT_FILE:115:[from] Non terminating function (no dependencies) +PROJECT_FILE.i:115:[from] Non terminating function (no dependencies) [from] Done for function e_acsl_fail [from] Computing for function mpz_clear [from] Done for function mpz_clear @@ -861,48 +862,48 @@ extern int mpz_cmp(__mpz_struct const * /*[1]*/ z1 , /*@ requires \valid(z1); requires \valid(z2); assigns *z1; */ -extern int mpz_neg(__mpz_struct * /*[1]*/ z1 , - __mpz_struct const * /*[1]*/ z2 ) ; +extern void mpz_neg(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) ; /*@ requires \valid(z1); requires \valid(z2); requires \valid(z3); assigns *z1; */ -extern int mpz_add(__mpz_struct * /*[1]*/ z1 , - __mpz_struct const * /*[1]*/ z2 , - __mpz_struct const * /*[1]*/ z3 ) ; +extern void mpz_add(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 , + __mpz_struct const * /*[1]*/ z3 ) ; /*@ requires \valid(z1); requires \valid(z2); requires \valid(z3); assigns *z1; */ -extern int mpz_sub(__mpz_struct * /*[1]*/ z1 , - __mpz_struct const * /*[1]*/ z2 , - __mpz_struct const * /*[1]*/ z3 ) ; +extern void mpz_sub(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 , + __mpz_struct const * /*[1]*/ z3 ) ; /*@ requires \valid(z1); requires \valid(z2); requires \valid(z3); assigns *z1; */ -extern int mpz_mul(__mpz_struct * /*[1]*/ z1 , - __mpz_struct const * /*[1]*/ z2 , - __mpz_struct const * /*[1]*/ z3 ) ; +extern void mpz_mul(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 , + __mpz_struct const * /*[1]*/ z3 ) ; /*@ requires \valid(z1); requires \valid(z2); requires \valid(z3); assigns *z1; */ -extern int mpz_cdiv_q(__mpz_struct * /*[1]*/ z1 , - __mpz_struct const * /*[1]*/ z2 , - __mpz_struct const * /*[1]*/ z3 ) ; +extern void mpz_cdiv_q(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 , + __mpz_struct const * /*[1]*/ z3 ) ; /*@ requires \valid(z1); requires \valid(z2); requires \valid(z3); assigns *z1; */ -extern int mpz_mod(__mpz_struct * /*[1]*/ z1 , - __mpz_struct const * /*[1]*/ z2 , - __mpz_struct const * /*[1]*/ z3 ) ; +extern void mpz_mod(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 , + __mpz_struct const * /*[1]*/ z3 ) ; /*@ terminates \false; ensures \false; assigns \nothing; */ @@ -911,7 +912,7 @@ extern void exit(int status ) ; extern int printf(char const * , ...) ; void e_acsl_fail(char *msg ) { - printf((char const *)msg); + printf("%s\n",msg); exit(1); return; } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/cast.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/cast.res.oracle index ae279007efd..93f77877442 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/cast.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/cast.res.oracle @@ -2,8 +2,8 @@ [value] Computing initial state [value] Initial state computed [value] Values of globals at initialization -PROJECT_FILE:123:[value] Assertion got status valid. -PROJECT_FILE:126:[value] Assertion got status valid. +PROJECT_FILE.i:123:[value] Assertion got status valid. +PROJECT_FILE.i:126:[value] Assertion got status valid. [value] Recording results for main [value] done for function main [dominators] computing for function main @@ -21,7 +21,7 @@ extern void exit(int status ) ; extern int printf(char const * , ...) ; void e_acsl_fail(char *msg ) { - printf((char const *)msg); + printf("%s\n",msg); exit(1); return; } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/comparison.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/comparison.res.oracle index 4a490f3c192..b54bf42b8c7 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/comparison.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/comparison.res.oracle @@ -2,242 +2,242 @@ [value] Computing initial state [value] Initial state computed [value] Values of globals at initialization -PROJECT_FILE:124:[value] Assertion got status valid. -PROJECT_FILE:127:[value] Assertion got status valid. -PROJECT_FILE:130:[value] Assertion got status valid. +PROJECT_FILE.i:124:[value] Assertion got status valid. +PROJECT_FILE.i:127:[value] Assertion got status valid. +PROJECT_FILE.i:130:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:132. -PROJECT_FILE:132:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:132. +PROJECT_FILE.i:132:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:132. + Called from PROJECT_FILE.i:132. [value] Done for function mpz_init_set_si [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:133. -PROJECT_FILE:133:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:133. +PROJECT_FILE.i:133:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:134. + Called from PROJECT_FILE.i:134. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. -PROJECT_FILE:115:[value] Function exit: postcondition got status invalid + Called from PROJECT_FILE.i:115. +PROJECT_FILE.i:115:[value] Function exit: postcondition got status invalid [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:135. -PROJECT_FILE:135:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:135. +PROJECT_FILE.i:135:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:135. + Called from PROJECT_FILE.i:135. [value] Done for function mpz_clear -PROJECT_FILE:138:[value] Assertion got status valid. +PROJECT_FILE.i:138:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:140. -PROJECT_FILE:140:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:140. +PROJECT_FILE.i:140:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:140. + Called from PROJECT_FILE.i:140. [value] Done for function mpz_init_set_si [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:141. -PROJECT_FILE:141:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:141. +PROJECT_FILE.i:141:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:142. + Called from PROJECT_FILE.i:142. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:143. -PROJECT_FILE:143:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:143. +PROJECT_FILE.i:143:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:143. + Called from PROJECT_FILE.i:143. [value] Done for function mpz_clear -PROJECT_FILE:147:[value] Assertion got status valid. -PROJECT_FILE:150:[value] Assertion got status valid. -PROJECT_FILE:153:[value] Assertion got status valid. +PROJECT_FILE.i:147:[value] Assertion got status valid. +PROJECT_FILE.i:150:[value] Assertion got status valid. +PROJECT_FILE.i:153:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:155. -PROJECT_FILE:155:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:155. +PROJECT_FILE.i:155:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:155. + Called from PROJECT_FILE.i:155. [value] Done for function mpz_init_set_si [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:156. -PROJECT_FILE:156:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:156. +PROJECT_FILE.i:156:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:157. + Called from PROJECT_FILE.i:157. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:158. -PROJECT_FILE:158:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:158. +PROJECT_FILE.i:158:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:158. + Called from PROJECT_FILE.i:158. [value] Done for function mpz_clear -PROJECT_FILE:161:[value] Assertion got status valid. +PROJECT_FILE.i:161:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:163. -PROJECT_FILE:163:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:163. +PROJECT_FILE.i:163:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:163. + Called from PROJECT_FILE.i:163. [value] Done for function mpz_init_set_si [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:164. -PROJECT_FILE:164:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:164. +PROJECT_FILE.i:164:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:165. + Called from PROJECT_FILE.i:165. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:166. -PROJECT_FILE:166:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:166. +PROJECT_FILE.i:166:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:166. + Called from PROJECT_FILE.i:166. [value] Done for function mpz_clear -PROJECT_FILE:169:[value] Assertion got status valid. +PROJECT_FILE.i:169:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:171. -PROJECT_FILE:171:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:171. +PROJECT_FILE.i:171:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:171. + Called from PROJECT_FILE.i:171. [value] Done for function mpz_init_set_si [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:172. -PROJECT_FILE:172:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:172. +PROJECT_FILE.i:172:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:173. + Called from PROJECT_FILE.i:173. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:174. -PROJECT_FILE:174:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:174. +PROJECT_FILE.i:174:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:174. + Called from PROJECT_FILE.i:174. [value] Done for function mpz_clear -PROJECT_FILE:177:[value] Assertion got status valid. +PROJECT_FILE.i:177:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:179. -PROJECT_FILE:179:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:179. +PROJECT_FILE.i:179:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:179. + Called from PROJECT_FILE.i:179. [value] Done for function mpz_init_set_si [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:180. -PROJECT_FILE:180:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:180. +PROJECT_FILE.i:180:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:181. + Called from PROJECT_FILE.i:181. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:182. -PROJECT_FILE:182:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:182. +PROJECT_FILE.i:182:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:182. + Called from PROJECT_FILE.i:182. [value] Done for function mpz_clear -PROJECT_FILE:185:[value] Assertion got status valid. +PROJECT_FILE.i:185:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:187. -PROJECT_FILE:187:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:187. +PROJECT_FILE.i:187:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:187. + Called from PROJECT_FILE.i:187. [value] Done for function mpz_init_set_si [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:188. -PROJECT_FILE:188:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:188. +PROJECT_FILE.i:188:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:189. + Called from PROJECT_FILE.i:189. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:190. -PROJECT_FILE:190:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:190. +PROJECT_FILE.i:190:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:190. + Called from PROJECT_FILE.i:190. [value] Done for function mpz_clear -PROJECT_FILE:193:[value] Assertion got status valid. +PROJECT_FILE.i:193:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:195. -PROJECT_FILE:195:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:195. +PROJECT_FILE.i:195:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:195. + Called from PROJECT_FILE.i:195. [value] Done for function mpz_init_set_si [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:196. -PROJECT_FILE:196:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:196. +PROJECT_FILE.i:196:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:197. + Called from PROJECT_FILE.i:197. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:198. -PROJECT_FILE:198:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:198. +PROJECT_FILE.i:198:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:198. + Called from PROJECT_FILE.i:198. [value] Done for function mpz_clear [value] Recording results for main [value] done for function main @@ -248,9 +248,10 @@ PROJECT_FILE:198:[value] Function mpz_clear: precondition got status valid [from] Computing for function e_acsl_fail [from] Computing for function printf <-e_acsl_fail [from] Done for function printf +PROJECT_FILE.i:115:[from] warning: variadic call detected. Using only 1 argument(s). [from] Computing for function exit <-e_acsl_fail [from] Done for function exit -PROJECT_FILE:115:[from] Non terminating function (no dependencies) +PROJECT_FILE.i:115:[from] Non terminating function (no dependencies) [from] Done for function e_acsl_fail [from] Computing for function mpz_clear [from] Done for function mpz_clear @@ -290,7 +291,7 @@ extern void exit(int status ) ; extern int printf(char const * , ...) ; void e_acsl_fail(char *msg ) { - printf((char const *)msg); + printf("%s\n",msg); exit(1); return; } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/false.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/false.res.oracle index 552948cf4b1..17e581bbedf 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/false.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/false.res.oracle @@ -18,7 +18,7 @@ extern void exit(int status ) ; extern int printf(char const * , ...) ; void e_acsl_fail(char *msg ) { - printf((char const *)msg); + printf("%s\n",msg); exit(1); return; } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_addrOf.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_addrOf.c new file mode 100644 index 00000000000..cfd930dd4ab --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_addrOf.c @@ -0,0 +1,570 @@ +/* Generated by Frama-C */ +typedef unsigned long size_t; +typedef unsigned long mp_limb_t; +struct __anonstruct___mpz_struct_6 { + int _mp_alloc ; + int _mp_size ; + mp_limb_t *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_6 __mpz_struct; +typedef mp_limb_t *mp_ptr; +typedef mp_limb_t const *mp_srcptr; +typedef long mp_size_t; +struct __anonstruct___mpq_struct_7 { + __mpz_struct _mp_num ; + __mpz_struct _mp_den ; +}; +typedef struct __anonstruct___mpq_struct_7 __mpq_struct; +typedef __mpz_struct const *mpz_srcptr; +typedef __mpz_struct *mpz_ptr; +typedef __mpq_struct const *mpq_srcptr; +typedef __mpq_struct *mpq_ptr; +/* compiler builtin: + long __builtin_expect(long , long ) ; */ +/*@ assigns \nothing; */ +extern int printf(char const * __restrict __format , ...) ; +__inline static void __gmpz_abs(mpz_ptr __gmp_w , mpz_srcptr __gmp_u ) ; +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) __attribute__(( +__pure__)) ; +__inline static void __gmpz_neg(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) ; +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) __attribute__(( +__pure__)) ; +extern void __gmpz_set(mpz_ptr , mpz_srcptr ) ; +__inline static void __gmpz_set_q(mpz_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +extern void __gmpz_tdiv_q(mpz_ptr , mpz_srcptr , mpz_srcptr ) ; +__inline static void __gmpq_abs(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +__inline static void __gmpq_neg(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +extern void __gmpq_set(mpq_ptr , mpq_srcptr ) ; +__inline static mp_limb_t __gmpn_add(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) ; +__inline static mp_limb_t __gmpn_add_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) ; +extern mp_limb_t __gmpn_add_n(mp_ptr , mp_srcptr , mp_srcptr , mp_size_t ) ; +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpn_neg_n(mp_ptr __gmp_rp , mp_srcptr __gmp_up , + mp_size_t __gmp_n ) ; +extern int __gmpn_perfect_square_p(mp_srcptr , mp_size_t ) __attribute__(( +__pure__)) ; +extern unsigned long __gmpn_popcount(mp_srcptr , mp_size_t ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpn_sub(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) ; +__inline static mp_limb_t __gmpn_sub_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) ; +extern mp_limb_t __gmpn_sub_n(mp_ptr , mp_srcptr , mp_srcptr , mp_size_t ) ; +__inline static void __gmpz_abs(mpz_ptr __gmp_w , mpz_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpz_set(__gmp_w,__gmp_u); } + if (__gmp_w->_mp_size >= 0) { __gmp_w->_mp_size = __gmp_w->_mp_size; } + else { __gmp_w->_mp_size = - __gmp_w->_mp_size; } + return; +} + +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= (mp_limb_t )(~ ((unsigned int )0))) { tmp = 1; } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= ~ ((unsigned long )0)) { tmp = 1; } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= (mp_limb_t )((unsigned short )(~ 0))) { tmp = 1; + } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) +{ + mp_ptr __gmp_p ; + mp_size_t __gmp_n ; + mp_limb_t __gmp_l ; + mp_limb_t tmp ; + __gmp_p = __gmp_z->_mp_d; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_l = *(__gmp_p + 0); + if (__gmp_n != (mp_size_t )0) { tmp = __gmp_l; } + else { tmp = (unsigned long )0; } + return (tmp); +} + +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) +{ + mp_limb_t __gmp_result ; + long tmp_1 ; + int tmp_0 ; + __gmp_result = (mp_limb_t )0; + { /*undefined sequence*/ + if (__gmp_n >= (mp_size_t )0) { + int tmp ; + { /*undefined sequence*/ + if (__gmp_z->_mp_size >= 0) { tmp = __gmp_z->_mp_size; } + else { tmp = - __gmp_z->_mp_size; } + ; + } + if (__gmp_n < (mp_size_t )tmp) { tmp_0 = 1; } + else { tmp_0 = 0; } + } + else { tmp_0 = 0; } + tmp_1 = __builtin_expect((long )(tmp_0 != 0),(long )1); + } + if (tmp_1) { __gmp_result = *(__gmp_z->_mp_d + __gmp_n); } + return (__gmp_result); +} + +/*@ requires \valid(z1); + requires \valid(z2); + assigns *z1; */ +__inline static void __gmpz_neg(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) +{ + if (z1 != z2) { __gmpz_set(z1,z2); } + z1->_mp_size = - z1->_mp_size; + return; +} + +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) +{ + mp_size_t __gmp_asize ; + int __gmp_result ; + long tmp ; + __gmp_asize = (long )__gmp_a->_mp_size; + __gmp_result = __gmp_asize >= (mp_size_t )0; + tmp = __builtin_expect((long )((__gmp_asize > (mp_size_t )0) != 0), + (long )1); + if (tmp) { + __gmp_result = __gmpn_perfect_square_p((mp_limb_t const *)__gmp_a->_mp_d, + __gmp_asize); + } + return (__gmp_result); +} + +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) +{ + mp_size_t __gmp_usize ; + unsigned long __gmp_result ; + long tmp ; + __gmp_usize = (long )__gmp_u->_mp_size; + if (__gmp_usize < (mp_size_t )0) { __gmp_result = ~ ((unsigned long )0); } + else { __gmp_result = (unsigned long )0; } + tmp = __builtin_expect((long )((__gmp_usize > (mp_size_t )0) != 0), + (long )1); + if (tmp) { + __gmp_result = __gmpn_popcount((mp_limb_t const *)__gmp_u->_mp_d, + __gmp_usize); + } + return (__gmp_result); +} + +__inline static void __gmpz_set_q(mpz_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + __gmpz_tdiv_q(__gmp_w,& __gmp_u->_mp_num,& __gmp_u->_mp_den); + return; +} + +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) +{ + size_t __retres ; + int tmp ; + if (__gmp_z->_mp_size >= 0) { tmp = __gmp_z->_mp_size; } + else { tmp = - __gmp_z->_mp_size; } + __retres = (unsigned long )tmp; + return (__retres); +} + +__inline static void __gmpq_abs(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpq_set(__gmp_w,__gmp_u); } + if (__gmp_w->_mp_num._mp_size >= 0) { + __gmp_w->_mp_num._mp_size = __gmp_w->_mp_num._mp_size; + } + else { __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size; } + return; +} + +__inline static void __gmpq_neg(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpq_set(__gmp_w,__gmp_u); } + __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size; + return; +} + +__inline static mp_limb_t __gmpn_add(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; __gmp_i = __gmp_ysize; + if (__gmp_i != (mp_size_t )0) { + mp_limb_t tmp_1 ; + tmp_1 = __gmpn_add_n(__gmp_wp,__gmp_xp,__gmp_yp,__gmp_i); + if (tmp_1) { + while (1) { + mp_size_t tmp ; + mp_limb_t tmp_0 ; + if (__gmp_i >= __gmp_xsize) { + __gmp_c = (unsigned long )1; + goto __gmp_done; + } + __gmp_x = *(__gmp_xp + __gmp_i); + { /*undefined sequence*/ + tmp = __gmp_i; + __gmp_i += (mp_size_t )1; + tmp_0 = (__gmp_x + (mp_limb_t )1) & (~ ((unsigned long )0) >> 0); + *(__gmp_wp + tmp) = tmp_0; + } + if (! (tmp_0 == (mp_limb_t )0)) { break; } + } + } + } + if (__gmp_wp != __gmp_xp) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_xsize) { + *(__gmp_wp + __gmp_j) = *(__gmp_xp + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } __gmp_c = (unsigned long )0; __gmp_done: ; + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_add_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_r ; + __gmp_x = *(__gmp_src + 0); __gmp_r = __gmp_x + __gmp_n; + *(__gmp_dst + 0) = __gmp_r; + if (__gmp_r < __gmp_n) { + __gmp_c = (unsigned long )1; + __gmp_i = (long )1; + while (__gmp_i < __gmp_size) { + __gmp_x = *(__gmp_src + __gmp_i); + __gmp_r = __gmp_x + (mp_limb_t )1; + *(__gmp_dst + __gmp_i) = __gmp_r; + __gmp_i += (mp_size_t )1; + if (! (__gmp_r < (mp_limb_t )1)) { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_size) { + *(__gmp_dst + __gmp_j) = *(__gmp_src + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + break; + } + } + } + else { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j_0 ; __gmp_j_0 = (long )1; + while (__gmp_j_0 < __gmp_size) { + *(__gmp_dst + __gmp_j_0) = *(__gmp_src + __gmp_j_0); + __gmp_j_0 += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + } + } + + break; + } + return (__gmp_c); +} + +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) __attribute__(( +__pure__)) ; +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) +{ + int __gmp_result ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_y ; + __gmp_result = 0; __gmp_i = __gmp_size; + while (1) { + __gmp_i -= (mp_size_t )1; + if (! (__gmp_i >= (mp_size_t )0)) { break; } + __gmp_x = *(__gmp_xp + __gmp_i); + __gmp_y = *(__gmp_yp + __gmp_i); + if (__gmp_x != __gmp_y) { + if (__gmp_x > __gmp_y) { __gmp_result = 1; } + else { __gmp_result = -1; } + break; + } + } + } + + break; + } + return (__gmp_result); +} + +__inline static mp_limb_t __gmpn_sub(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; __gmp_i = __gmp_ysize; + if (__gmp_i != (mp_size_t )0) { + mp_limb_t tmp_0 ; + tmp_0 = __gmpn_sub_n(__gmp_wp,__gmp_xp,__gmp_yp,__gmp_i); + if (tmp_0) { + while (1) { + mp_size_t tmp ; + if (__gmp_i >= __gmp_xsize) { + __gmp_c = (unsigned long )1; + goto __gmp_done; + } + __gmp_x = *(__gmp_xp + __gmp_i); + { /*undefined sequence*/ + tmp = __gmp_i; + __gmp_i += (mp_size_t )1; + *(__gmp_wp + tmp) = (__gmp_x - (mp_limb_t )1) & (~ ((unsigned long )0) >> 0); + } + if (! (__gmp_x == (mp_limb_t )0)) { break; } + } + } + } + if (__gmp_wp != __gmp_xp) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_xsize) { + *(__gmp_wp + __gmp_j) = *(__gmp_xp + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } __gmp_c = (unsigned long )0; __gmp_done: ; + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_sub_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_r ; + __gmp_x = *(__gmp_src + 0); __gmp_r = __gmp_x - __gmp_n; + *(__gmp_dst + 0) = __gmp_r; + if (__gmp_x < __gmp_n) { + __gmp_c = (unsigned long )1; + __gmp_i = (long )1; + while (__gmp_i < __gmp_size) { + __gmp_x = *(__gmp_src + __gmp_i); + __gmp_r = __gmp_x - (mp_limb_t )1; + *(__gmp_dst + __gmp_i) = __gmp_r; + __gmp_i += (mp_size_t )1; + if (! (__gmp_x < (mp_limb_t )1)) { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_size) { + *(__gmp_dst + __gmp_j) = *(__gmp_src + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + break; + } + } + } + else { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j_0 ; __gmp_j_0 = (long )1; + while (__gmp_j_0 < __gmp_size) { + *(__gmp_dst + __gmp_j_0) = *(__gmp_src + __gmp_j_0); + __gmp_j_0 += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + } + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_neg_n(mp_ptr __gmp_rp , mp_srcptr __gmp_up , + mp_size_t __gmp_n ) +{ + mp_limb_t __gmp_ul ; + mp_limb_t __gmp_cy ; + __gmp_cy = (unsigned long )0; + while (1) { + { mp_srcptr tmp ; mp_ptr tmp_0 ; + { /*undefined sequence*/ tmp = __gmp_up; __gmp_up ++; __gmp_ul = *tmp; + } + { /*undefined sequence*/ + tmp_0 = __gmp_rp; + __gmp_rp ++; + *tmp_0 = - __gmp_ul - __gmp_cy; + } __gmp_cy |= (unsigned long )(__gmp_ul != (mp_limb_t )0); + } + + __gmp_n -= (mp_size_t )1; + if (! (__gmp_n != (mp_size_t )0)) { break; } + } + return (__gmp_cy); +} + +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status ) ; +void e_acsl_fail(char *msg ) +{ + printf((char const *)"%s\n",msg); + exit(1); + return; +} + +void main(void) +{ + int x ; + x = 0; + /*@ assert &x ≡ &x; */ ; + if (& x != & x) { e_acsl_fail((char *)"(&x == &x)"); } + return; +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_arith.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_arith.c new file mode 100644 index 00000000000..5873fe9fa5f --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_arith.c @@ -0,0 +1,938 @@ +/* Generated by Frama-C */ +typedef unsigned long size_t; +typedef unsigned long mp_limb_t; +struct __anonstruct___mpz_struct_6 { + int _mp_alloc ; + int _mp_size ; + mp_limb_t *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_6 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +typedef mp_limb_t *mp_ptr; +typedef mp_limb_t const *mp_srcptr; +typedef long mp_size_t; +struct __anonstruct___mpq_struct_7 { + __mpz_struct _mp_num ; + __mpz_struct _mp_den ; +}; +typedef struct __anonstruct___mpq_struct_7 __mpq_struct; +typedef __mpz_struct const *mpz_srcptr; +typedef __mpz_struct *mpz_ptr; +typedef __mpq_struct const *mpq_srcptr; +typedef __mpq_struct *mpq_ptr; +/* compiler builtin: + long __builtin_expect(long , long ) ; */ +/*@ assigns \nothing; */ +extern int printf(char const * __restrict __format , ...) ; +__inline static void __gmpz_abs(mpz_ptr __gmp_w , mpz_srcptr __gmp_u ) ; +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_add(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 , + __mpz_struct const * /*[1]*/ z3 ) ; +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_cdiv_q(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 , + __mpz_struct const * /*[1]*/ z3 ) ; +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x ) ; +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) __attribute__(( +__pure__)) ; +extern void __gmpz_com(mpz_ptr , mpz_srcptr ) ; +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) __attribute__(( +__pure__)) ; +/*@ ensures \valid(\at(x,Old)); + assigns *x; */ +extern void __gmpz_init(__mpz_struct * /*[1]*/ x ) ; +/*@ ensures \valid(\at(z,Old)); + assigns *z; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z , long n ) ; +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_mod(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 , + __mpz_struct const * /*[1]*/ z3 ) ; +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_mul(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 , + __mpz_struct const * /*[1]*/ z3 ) ; +__inline static void __gmpz_neg(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) ; +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) __attribute__(( +__pure__)) ; +extern void __gmpz_set(mpz_ptr , mpz_srcptr ) ; +__inline static void __gmpz_set_q(mpz_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_sub(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 , + __mpz_struct const * /*[1]*/ z3 ) ; +extern void __gmpz_tdiv_q(mpz_ptr , mpz_srcptr , mpz_srcptr ) ; +__inline static void __gmpq_abs(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +__inline static void __gmpq_neg(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +extern void __gmpq_set(mpq_ptr , mpq_srcptr ) ; +__inline static mp_limb_t __gmpn_add(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) ; +__inline static mp_limb_t __gmpn_add_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) ; +extern mp_limb_t __gmpn_add_n(mp_ptr , mp_srcptr , mp_srcptr , mp_size_t ) ; +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpn_neg_n(mp_ptr __gmp_rp , mp_srcptr __gmp_up , + mp_size_t __gmp_n ) ; +extern int __gmpn_perfect_square_p(mp_srcptr , mp_size_t ) __attribute__(( +__pure__)) ; +extern unsigned long __gmpn_popcount(mp_srcptr , mp_size_t ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpn_sub(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) ; +__inline static mp_limb_t __gmpn_sub_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) ; +extern mp_limb_t __gmpn_sub_n(mp_ptr , mp_srcptr , mp_srcptr , mp_size_t ) ; +__inline static void __gmpz_abs(mpz_ptr __gmp_w , mpz_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpz_set(__gmp_w,__gmp_u); } + if (__gmp_w->_mp_size >= 0) { __gmp_w->_mp_size = __gmp_w->_mp_size; } + else { __gmp_w->_mp_size = - __gmp_w->_mp_size; } + return; +} + +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= (mp_limb_t )(~ ((unsigned int )0))) { tmp = 1; } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= ~ ((unsigned long )0)) { tmp = 1; } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= (mp_limb_t )((unsigned short )(~ 0))) { tmp = 1; + } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) +{ + mp_ptr __gmp_p ; + mp_size_t __gmp_n ; + mp_limb_t __gmp_l ; + mp_limb_t tmp ; + __gmp_p = __gmp_z->_mp_d; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_l = *(__gmp_p + 0); + if (__gmp_n != (mp_size_t )0) { tmp = __gmp_l; } + else { tmp = (unsigned long )0; } + return (tmp); +} + +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) +{ + mp_limb_t __gmp_result ; + long tmp_1 ; + int tmp_0 ; + __gmp_result = (mp_limb_t )0; + { /*undefined sequence*/ + if (__gmp_n >= (mp_size_t )0) { + int tmp ; + { /*undefined sequence*/ + if (__gmp_z->_mp_size >= 0) { tmp = __gmp_z->_mp_size; } + else { tmp = - __gmp_z->_mp_size; } + ; + } + if (__gmp_n < (mp_size_t )tmp) { tmp_0 = 1; } + else { tmp_0 = 0; } + } + else { tmp_0 = 0; } + tmp_1 = __builtin_expect((long )(tmp_0 != 0),(long )1); + } + if (tmp_1) { __gmp_result = *(__gmp_z->_mp_d + __gmp_n); } + return (__gmp_result); +} + +/*@ requires \valid(z1); + requires \valid(z2); + assigns *z1; */ +__inline static void __gmpz_neg(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) +{ + if (z1 != z2) { __gmpz_set(z1,z2); } + z1->_mp_size = - z1->_mp_size; + return; +} + +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) +{ + mp_size_t __gmp_asize ; + int __gmp_result ; + long tmp ; + __gmp_asize = (long )__gmp_a->_mp_size; + __gmp_result = __gmp_asize >= (mp_size_t )0; + tmp = __builtin_expect((long )((__gmp_asize > (mp_size_t )0) != 0), + (long )1); + if (tmp) { + __gmp_result = __gmpn_perfect_square_p((mp_limb_t const *)__gmp_a->_mp_d, + __gmp_asize); + } + return (__gmp_result); +} + +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) +{ + mp_size_t __gmp_usize ; + unsigned long __gmp_result ; + long tmp ; + __gmp_usize = (long )__gmp_u->_mp_size; + if (__gmp_usize < (mp_size_t )0) { __gmp_result = ~ ((unsigned long )0); } + else { __gmp_result = (unsigned long )0; } + tmp = __builtin_expect((long )((__gmp_usize > (mp_size_t )0) != 0), + (long )1); + if (tmp) { + __gmp_result = __gmpn_popcount((mp_limb_t const *)__gmp_u->_mp_d, + __gmp_usize); + } + return (__gmp_result); +} + +__inline static void __gmpz_set_q(mpz_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + __gmpz_tdiv_q(__gmp_w,& __gmp_u->_mp_num,& __gmp_u->_mp_den); + return; +} + +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) +{ + size_t __retres ; + int tmp ; + if (__gmp_z->_mp_size >= 0) { tmp = __gmp_z->_mp_size; } + else { tmp = - __gmp_z->_mp_size; } + __retres = (unsigned long )tmp; + return (__retres); +} + +__inline static void __gmpq_abs(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpq_set(__gmp_w,__gmp_u); } + if (__gmp_w->_mp_num._mp_size >= 0) { + __gmp_w->_mp_num._mp_size = __gmp_w->_mp_num._mp_size; + } + else { __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size; } + return; +} + +__inline static void __gmpq_neg(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpq_set(__gmp_w,__gmp_u); } + __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size; + return; +} + +__inline static mp_limb_t __gmpn_add(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; __gmp_i = __gmp_ysize; + if (__gmp_i != (mp_size_t )0) { + mp_limb_t tmp_1 ; + tmp_1 = __gmpn_add_n(__gmp_wp,__gmp_xp,__gmp_yp,__gmp_i); + if (tmp_1) { + while (1) { + mp_size_t tmp ; + mp_limb_t tmp_0 ; + if (__gmp_i >= __gmp_xsize) { + __gmp_c = (unsigned long )1; + goto __gmp_done; + } + __gmp_x = *(__gmp_xp + __gmp_i); + { /*undefined sequence*/ + tmp = __gmp_i; + __gmp_i += (mp_size_t )1; + tmp_0 = (__gmp_x + (mp_limb_t )1) & (~ ((unsigned long )0) >> 0); + *(__gmp_wp + tmp) = tmp_0; + } + if (! (tmp_0 == (mp_limb_t )0)) { break; } + } + } + } + if (__gmp_wp != __gmp_xp) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_xsize) { + *(__gmp_wp + __gmp_j) = *(__gmp_xp + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } __gmp_c = (unsigned long )0; __gmp_done: ; + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_add_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_r ; + __gmp_x = *(__gmp_src + 0); __gmp_r = __gmp_x + __gmp_n; + *(__gmp_dst + 0) = __gmp_r; + if (__gmp_r < __gmp_n) { + __gmp_c = (unsigned long )1; + __gmp_i = (long )1; + while (__gmp_i < __gmp_size) { + __gmp_x = *(__gmp_src + __gmp_i); + __gmp_r = __gmp_x + (mp_limb_t )1; + *(__gmp_dst + __gmp_i) = __gmp_r; + __gmp_i += (mp_size_t )1; + if (! (__gmp_r < (mp_limb_t )1)) { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_size) { + *(__gmp_dst + __gmp_j) = *(__gmp_src + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + break; + } + } + } + else { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j_0 ; __gmp_j_0 = (long )1; + while (__gmp_j_0 < __gmp_size) { + *(__gmp_dst + __gmp_j_0) = *(__gmp_src + __gmp_j_0); + __gmp_j_0 += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + } + } + + break; + } + return (__gmp_c); +} + +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) __attribute__(( +__pure__)) ; +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) +{ + int __gmp_result ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_y ; + __gmp_result = 0; __gmp_i = __gmp_size; + while (1) { + __gmp_i -= (mp_size_t )1; + if (! (__gmp_i >= (mp_size_t )0)) { break; } + __gmp_x = *(__gmp_xp + __gmp_i); + __gmp_y = *(__gmp_yp + __gmp_i); + if (__gmp_x != __gmp_y) { + if (__gmp_x > __gmp_y) { __gmp_result = 1; } + else { __gmp_result = -1; } + break; + } + } + } + + break; + } + return (__gmp_result); +} + +__inline static mp_limb_t __gmpn_sub(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; __gmp_i = __gmp_ysize; + if (__gmp_i != (mp_size_t )0) { + mp_limb_t tmp_0 ; + tmp_0 = __gmpn_sub_n(__gmp_wp,__gmp_xp,__gmp_yp,__gmp_i); + if (tmp_0) { + while (1) { + mp_size_t tmp ; + if (__gmp_i >= __gmp_xsize) { + __gmp_c = (unsigned long )1; + goto __gmp_done; + } + __gmp_x = *(__gmp_xp + __gmp_i); + { /*undefined sequence*/ + tmp = __gmp_i; + __gmp_i += (mp_size_t )1; + *(__gmp_wp + tmp) = (__gmp_x - (mp_limb_t )1) & (~ ((unsigned long )0) >> 0); + } + if (! (__gmp_x == (mp_limb_t )0)) { break; } + } + } + } + if (__gmp_wp != __gmp_xp) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_xsize) { + *(__gmp_wp + __gmp_j) = *(__gmp_xp + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } __gmp_c = (unsigned long )0; __gmp_done: ; + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_sub_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_r ; + __gmp_x = *(__gmp_src + 0); __gmp_r = __gmp_x - __gmp_n; + *(__gmp_dst + 0) = __gmp_r; + if (__gmp_x < __gmp_n) { + __gmp_c = (unsigned long )1; + __gmp_i = (long )1; + while (__gmp_i < __gmp_size) { + __gmp_x = *(__gmp_src + __gmp_i); + __gmp_r = __gmp_x - (mp_limb_t )1; + *(__gmp_dst + __gmp_i) = __gmp_r; + __gmp_i += (mp_size_t )1; + if (! (__gmp_x < (mp_limb_t )1)) { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_size) { + *(__gmp_dst + __gmp_j) = *(__gmp_src + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + break; + } + } + } + else { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j_0 ; __gmp_j_0 = (long )1; + while (__gmp_j_0 < __gmp_size) { + *(__gmp_dst + __gmp_j_0) = *(__gmp_src + __gmp_j_0); + __gmp_j_0 += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + } + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_neg_n(mp_ptr __gmp_rp , mp_srcptr __gmp_up , + mp_size_t __gmp_n ) +{ + mp_limb_t __gmp_ul ; + mp_limb_t __gmp_cy ; + __gmp_cy = (unsigned long )0; + while (1) { + { mp_srcptr tmp ; mp_ptr tmp_0 ; + { /*undefined sequence*/ tmp = __gmp_up; __gmp_up ++; __gmp_ul = *tmp; + } + { /*undefined sequence*/ + tmp_0 = __gmp_rp; + __gmp_rp ++; + *tmp_0 = - __gmp_ul - __gmp_cy; + } __gmp_cy |= (unsigned long )(__gmp_ul != (mp_limb_t )0); + } + + __gmp_n -= (mp_size_t )1; + if (! (__gmp_n != (mp_size_t )0)) { break; } + } + return (__gmp_cy); +} + +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status ) ; +void e_acsl_fail(char *msg ) +{ + printf((char const *)"%s\n",msg); + exit(1); + return; +} + +void main(void) +{ + int x ; + int y ; + x = -3; + y = 2; + /*@ assert -3 ≡ x; */ ; + { mpz_t e_acsl_cst_1 ; mpz_t e_acsl_cst_2 ; mpz_t e_acsl_cst_3 ; + int e_acsl_cst_4 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_1),(long )3); + __gmpz_init((__mpz_struct *)(e_acsl_cst_2)); + __gmpz_neg((__mpz_struct *)(e_acsl_cst_2), + (__mpz_struct const *)(e_acsl_cst_1)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_3),(long )x); + e_acsl_cst_4 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_2), + (__mpz_struct const *)(e_acsl_cst_3)); + if (e_acsl_cst_4 != 0) { e_acsl_fail((char *)"(-3 == x)"); } + __gmpz_clear((__mpz_struct *)(e_acsl_cst_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_2)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_3)); + } + + /*@ assert x ≡ -3; */ ; + { mpz_t e_acsl_cst_5 ; mpz_t e_acsl_cst_6 ; mpz_t e_acsl_cst_7 ; + int e_acsl_cst_8 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_5),(long )x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_6),(long )3); + __gmpz_init((__mpz_struct *)(e_acsl_cst_7)); + __gmpz_neg((__mpz_struct *)(e_acsl_cst_7), + (__mpz_struct const *)(e_acsl_cst_6)); + e_acsl_cst_8 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_5), + (__mpz_struct const *)(e_acsl_cst_7)); + if (e_acsl_cst_8 != 0) { e_acsl_fail((char *)"(x == -3)"); } + __gmpz_clear((__mpz_struct *)(e_acsl_cst_5)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_6)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_7)); + } + + /*@ assert 0 ≢ ~0; */ ; + { mpz_t e_acsl_cst_9 ; mpz_t e_acsl_cst_10 ; mpz_t e_acsl_cst_11 ; + int e_acsl_cst_12 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_9),(long )0); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_10),(long )0); + __gmpz_init((__mpz_struct *)(e_acsl_cst_11)); + __gmpz_com(e_acsl_cst_11,(__mpz_struct const *)(e_acsl_cst_10)); + e_acsl_cst_12 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_9), + (__mpz_struct const *)(e_acsl_cst_11)); + if (e_acsl_cst_12 == 0) { e_acsl_fail((char *)"(0 != ~0)"); } + __gmpz_clear((__mpz_struct *)(e_acsl_cst_9)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_10)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_11)); + } + + /*@ assert x+1 ≡ -2; */ ; + { mpz_t e_acsl_cst_13 ; mpz_t e_acsl_cst_14 ; mpz_t e_acsl_cst_15 ; + mpz_t e_acsl_cst_16 ; mpz_t e_acsl_cst_17 ; int e_acsl_cst_18 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_13),(long )x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_14),(long )1); + __gmpz_init((__mpz_struct *)(e_acsl_cst_15)); + __gmpz_add((__mpz_struct *)(e_acsl_cst_15), + (__mpz_struct const *)(e_acsl_cst_13), + (__mpz_struct const *)(e_acsl_cst_14)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_16),(long )2); + __gmpz_init((__mpz_struct *)(e_acsl_cst_17)); + __gmpz_neg((__mpz_struct *)(e_acsl_cst_17), + (__mpz_struct const *)(e_acsl_cst_16)); + e_acsl_cst_18 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_15), + (__mpz_struct const *)(e_acsl_cst_17)); + if (e_acsl_cst_18 != 0) { e_acsl_fail((char *)"(x+1 == -2)"); } + __gmpz_clear((__mpz_struct *)(e_acsl_cst_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_14)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_15)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_16)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_17)); + } + + /*@ assert x-1 ≡ -4; */ ; + { mpz_t e_acsl_cst_19 ; mpz_t e_acsl_cst_20 ; mpz_t e_acsl_cst_21 ; + mpz_t e_acsl_cst_22 ; mpz_t e_acsl_cst_23 ; int e_acsl_cst_24 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_19),(long )x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_20),(long )1); + __gmpz_init((__mpz_struct *)(e_acsl_cst_21)); + __gmpz_sub((__mpz_struct *)(e_acsl_cst_21), + (__mpz_struct const *)(e_acsl_cst_19), + (__mpz_struct const *)(e_acsl_cst_20)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_22),(long )4); + __gmpz_init((__mpz_struct *)(e_acsl_cst_23)); + __gmpz_neg((__mpz_struct *)(e_acsl_cst_23), + (__mpz_struct const *)(e_acsl_cst_22)); + e_acsl_cst_24 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_21), + (__mpz_struct const *)(e_acsl_cst_23)); + if (e_acsl_cst_24 != 0) { e_acsl_fail((char *)"(x-1 == -4)"); } + __gmpz_clear((__mpz_struct *)(e_acsl_cst_19)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_20)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_21)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_22)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_23)); + } + + /*@ assert x*3 ≡ -9; */ ; + { mpz_t e_acsl_cst_25 ; mpz_t e_acsl_cst_26 ; mpz_t e_acsl_cst_27 ; + mpz_t e_acsl_cst_28 ; mpz_t e_acsl_cst_29 ; int e_acsl_cst_30 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_25),(long )x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_26),(long )3); + __gmpz_init((__mpz_struct *)(e_acsl_cst_27)); + __gmpz_mul((__mpz_struct *)(e_acsl_cst_27), + (__mpz_struct const *)(e_acsl_cst_25), + (__mpz_struct const *)(e_acsl_cst_26)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_28),(long )9); + __gmpz_init((__mpz_struct *)(e_acsl_cst_29)); + __gmpz_neg((__mpz_struct *)(e_acsl_cst_29), + (__mpz_struct const *)(e_acsl_cst_28)); + e_acsl_cst_30 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_27), + (__mpz_struct const *)(e_acsl_cst_29)); + if (e_acsl_cst_30 != 0) { e_acsl_fail((char *)"(x*3 == -9)"); } + __gmpz_clear((__mpz_struct *)(e_acsl_cst_25)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_26)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_27)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_28)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_29)); + } + + /*@ assert x/3 ≡ -1; */ ; + { mpz_t e_acsl_cst_31 ; mpz_t e_acsl_cst_32 ; mpz_t e_acsl_cst_33 ; + mpz_t e_acsl_cst_34 ; mpz_t e_acsl_cst_35 ; int e_acsl_cst_36 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_31),(long )x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_32),(long )3); + __gmpz_init((__mpz_struct *)(e_acsl_cst_33)); + __gmpz_cdiv_q((__mpz_struct *)(e_acsl_cst_33), + (__mpz_struct const *)(e_acsl_cst_31), + (__mpz_struct const *)(e_acsl_cst_32)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_34),(long )1); + __gmpz_init((__mpz_struct *)(e_acsl_cst_35)); + __gmpz_neg((__mpz_struct *)(e_acsl_cst_35), + (__mpz_struct const *)(e_acsl_cst_34)); + e_acsl_cst_36 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_33), + (__mpz_struct const *)(e_acsl_cst_35)); + if (e_acsl_cst_36 != 0) { e_acsl_fail((char *)"(x/3 == -1)"); } + __gmpz_clear((__mpz_struct *)(e_acsl_cst_31)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_32)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_33)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_34)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_35)); + } + + /*@ assert x%2 ≡ -1; */ ; + { mpz_t e_acsl_cst_37 ; mpz_t e_acsl_cst_38 ; mpz_t e_acsl_cst_39 ; + mpz_t e_acsl_cst_40 ; mpz_t e_acsl_cst_41 ; int e_acsl_cst_42 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_37),(long )x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_38),(long )2); + __gmpz_init((__mpz_struct *)(e_acsl_cst_39)); + __gmpz_mod((__mpz_struct *)(e_acsl_cst_39), + (__mpz_struct const *)(e_acsl_cst_37), + (__mpz_struct const *)(e_acsl_cst_38)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_40),(long )1); + __gmpz_init((__mpz_struct *)(e_acsl_cst_41)); + __gmpz_neg((__mpz_struct *)(e_acsl_cst_41), + (__mpz_struct const *)(e_acsl_cst_40)); + e_acsl_cst_42 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_39), + (__mpz_struct const *)(e_acsl_cst_41)); + if (e_acsl_cst_42 != 0) { e_acsl_fail((char *)"(x%2 == -1)"); } + __gmpz_clear((__mpz_struct *)(e_acsl_cst_37)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_38)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_39)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_40)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_41)); + } + + /*@ assert ((x*2+(3+y))-4)+(x-y) ≡ -10; */ ; + { mpz_t e_acsl_cst_43 ; mpz_t e_acsl_cst_44 ; mpz_t e_acsl_cst_45 ; + mpz_t e_acsl_cst_46 ; mpz_t e_acsl_cst_47 ; mpz_t e_acsl_cst_48 ; + mpz_t e_acsl_cst_49 ; mpz_t e_acsl_cst_50 ; mpz_t e_acsl_cst_51 ; + mpz_t e_acsl_cst_52 ; mpz_t e_acsl_cst_53 ; mpz_t e_acsl_cst_54 ; + mpz_t e_acsl_cst_55 ; mpz_t e_acsl_cst_56 ; mpz_t e_acsl_cst_57 ; + int e_acsl_cst_58 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_43),(long )x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_44),(long )2); + __gmpz_init((__mpz_struct *)(e_acsl_cst_45)); + __gmpz_mul((__mpz_struct *)(e_acsl_cst_45), + (__mpz_struct const *)(e_acsl_cst_43), + (__mpz_struct const *)(e_acsl_cst_44)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_46),(long )3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_47),(long )y); + __gmpz_init((__mpz_struct *)(e_acsl_cst_48)); + __gmpz_add((__mpz_struct *)(e_acsl_cst_48), + (__mpz_struct const *)(e_acsl_cst_46), + (__mpz_struct const *)(e_acsl_cst_47)); + __gmpz_init((__mpz_struct *)(e_acsl_cst_49)); + __gmpz_add((__mpz_struct *)(e_acsl_cst_49), + (__mpz_struct const *)(e_acsl_cst_45), + (__mpz_struct const *)(e_acsl_cst_48)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_50),(long )4); + __gmpz_init((__mpz_struct *)(e_acsl_cst_51)); + __gmpz_sub((__mpz_struct *)(e_acsl_cst_51), + (__mpz_struct const *)(e_acsl_cst_49), + (__mpz_struct const *)(e_acsl_cst_50)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_52),(long )x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_53),(long )y); + __gmpz_init((__mpz_struct *)(e_acsl_cst_54)); + __gmpz_sub((__mpz_struct *)(e_acsl_cst_54), + (__mpz_struct const *)(e_acsl_cst_52), + (__mpz_struct const *)(e_acsl_cst_53)); + __gmpz_init((__mpz_struct *)(e_acsl_cst_55)); + __gmpz_add((__mpz_struct *)(e_acsl_cst_55), + (__mpz_struct const *)(e_acsl_cst_51), + (__mpz_struct const *)(e_acsl_cst_54)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_56),(long )10); + __gmpz_init((__mpz_struct *)(e_acsl_cst_57)); + __gmpz_neg((__mpz_struct *)(e_acsl_cst_57), + (__mpz_struct const *)(e_acsl_cst_56)); + e_acsl_cst_58 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_55), + (__mpz_struct const *)(e_acsl_cst_57)); + if (e_acsl_cst_58 != 0) { + e_acsl_fail((char *)"(((x*2+(3+y))-4)+(x-y) == -10)"); + } __gmpz_clear((__mpz_struct *)(e_acsl_cst_43)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_44)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_45)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_46)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_47)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_48)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_49)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_50)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_51)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_52)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_53)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_54)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_55)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_56)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_57)); + } + + /*@ assert (0≡1) ≡ !(0≡0); */ ; + { mpz_t e_acsl_cst_59 ; mpz_t e_acsl_cst_60 ; int e_acsl_cst_61 ; + mpz_t e_acsl_cst_62 ; mpz_t e_acsl_cst_63 ; int e_acsl_cst_64 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_59),(long )0); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_60),(long )1); + e_acsl_cst_61 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_59), + (__mpz_struct const *)(e_acsl_cst_60)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_62),(long )0); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_63),(long )0); + e_acsl_cst_64 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_62), + (__mpz_struct const *)(e_acsl_cst_63)); + if ((e_acsl_cst_61 == 0) != ! (e_acsl_cst_64 == 0)) { + e_acsl_fail((char *)"((0==1) == !(0==0))"); + } __gmpz_clear((__mpz_struct *)(e_acsl_cst_59)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_60)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_62)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_63)); + } + + /*@ assert (0≤-1) ≡ (0>0); */ ; + { mpz_t e_acsl_cst_65 ; mpz_t e_acsl_cst_66 ; mpz_t e_acsl_cst_67 ; + int e_acsl_cst_68 ; mpz_t e_acsl_cst_69 ; mpz_t e_acsl_cst_70 ; + int e_acsl_cst_71 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_65),(long )0); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_66),(long )1); + __gmpz_init((__mpz_struct *)(e_acsl_cst_67)); + __gmpz_neg((__mpz_struct *)(e_acsl_cst_67), + (__mpz_struct const *)(e_acsl_cst_66)); + e_acsl_cst_68 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_65), + (__mpz_struct const *)(e_acsl_cst_67)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_69),(long )0); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_70),(long )0); + e_acsl_cst_71 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_69), + (__mpz_struct const *)(e_acsl_cst_70)); + if ((e_acsl_cst_68 <= 0) != (e_acsl_cst_71 > 0)) { + e_acsl_fail((char *)"((0<=-1) == (0>0))"); + } __gmpz_clear((__mpz_struct *)(e_acsl_cst_65)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_66)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_67)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_69)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_70)); + } + + /*@ assert (0≥-1) ≡ (0≤0); */ ; + { mpz_t e_acsl_cst_72 ; mpz_t e_acsl_cst_73 ; mpz_t e_acsl_cst_74 ; + int e_acsl_cst_75 ; mpz_t e_acsl_cst_76 ; mpz_t e_acsl_cst_77 ; + int e_acsl_cst_78 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_72),(long )0); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_73),(long )1); + __gmpz_init((__mpz_struct *)(e_acsl_cst_74)); + __gmpz_neg((__mpz_struct *)(e_acsl_cst_74), + (__mpz_struct const *)(e_acsl_cst_73)); + e_acsl_cst_75 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_72), + (__mpz_struct const *)(e_acsl_cst_74)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_76),(long )0); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_77),(long )0); + e_acsl_cst_78 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_76), + (__mpz_struct const *)(e_acsl_cst_77)); + if ((e_acsl_cst_75 >= 0) != (e_acsl_cst_78 <= 0)) { + e_acsl_fail((char *)"((0>=-1) == (0<=0))"); + } __gmpz_clear((__mpz_struct *)(e_acsl_cst_72)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_73)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_74)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_76)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_77)); + } + + /*@ assert (0≢1) ≡ !(0≢0); */ ; + { mpz_t e_acsl_cst_79 ; mpz_t e_acsl_cst_80 ; int e_acsl_cst_81 ; + mpz_t e_acsl_cst_82 ; mpz_t e_acsl_cst_83 ; int e_acsl_cst_84 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_79),(long )0); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_80),(long )1); + e_acsl_cst_81 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_79), + (__mpz_struct const *)(e_acsl_cst_80)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_82),(long )0); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_83),(long )0); + e_acsl_cst_84 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_82), + (__mpz_struct const *)(e_acsl_cst_83)); + if ((e_acsl_cst_81 != 0) != ! (e_acsl_cst_84 != 0)) { + e_acsl_fail((char *)"((0!=1) == !(0!=0))"); + } __gmpz_clear((__mpz_struct *)(e_acsl_cst_79)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_80)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_82)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_83)); + } + + return; +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_cast.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_cast.c new file mode 100644 index 00000000000..d8bc0ee504d --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_cast.c @@ -0,0 +1,574 @@ +/* Generated by Frama-C */ +typedef unsigned long size_t; +typedef unsigned long mp_limb_t; +struct __anonstruct___mpz_struct_6 { + int _mp_alloc ; + int _mp_size ; + mp_limb_t *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_6 __mpz_struct; +typedef mp_limb_t *mp_ptr; +typedef mp_limb_t const *mp_srcptr; +typedef long mp_size_t; +struct __anonstruct___mpq_struct_7 { + __mpz_struct _mp_num ; + __mpz_struct _mp_den ; +}; +typedef struct __anonstruct___mpq_struct_7 __mpq_struct; +typedef __mpz_struct const *mpz_srcptr; +typedef __mpz_struct *mpz_ptr; +typedef __mpq_struct const *mpq_srcptr; +typedef __mpq_struct *mpq_ptr; +/* compiler builtin: + long __builtin_expect(long , long ) ; */ +/*@ assigns \nothing; */ +extern int printf(char const * __restrict __format , ...) ; +__inline static void __gmpz_abs(mpz_ptr __gmp_w , mpz_srcptr __gmp_u ) ; +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) __attribute__(( +__pure__)) ; +__inline static void __gmpz_neg(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) ; +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) __attribute__(( +__pure__)) ; +extern void __gmpz_set(mpz_ptr , mpz_srcptr ) ; +__inline static void __gmpz_set_q(mpz_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +extern void __gmpz_tdiv_q(mpz_ptr , mpz_srcptr , mpz_srcptr ) ; +__inline static void __gmpq_abs(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +__inline static void __gmpq_neg(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +extern void __gmpq_set(mpq_ptr , mpq_srcptr ) ; +__inline static mp_limb_t __gmpn_add(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) ; +__inline static mp_limb_t __gmpn_add_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) ; +extern mp_limb_t __gmpn_add_n(mp_ptr , mp_srcptr , mp_srcptr , mp_size_t ) ; +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpn_neg_n(mp_ptr __gmp_rp , mp_srcptr __gmp_up , + mp_size_t __gmp_n ) ; +extern int __gmpn_perfect_square_p(mp_srcptr , mp_size_t ) __attribute__(( +__pure__)) ; +extern unsigned long __gmpn_popcount(mp_srcptr , mp_size_t ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpn_sub(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) ; +__inline static mp_limb_t __gmpn_sub_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) ; +extern mp_limb_t __gmpn_sub_n(mp_ptr , mp_srcptr , mp_srcptr , mp_size_t ) ; +__inline static void __gmpz_abs(mpz_ptr __gmp_w , mpz_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpz_set(__gmp_w,__gmp_u); } + if (__gmp_w->_mp_size >= 0) { __gmp_w->_mp_size = __gmp_w->_mp_size; } + else { __gmp_w->_mp_size = - __gmp_w->_mp_size; } + return; +} + +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= (mp_limb_t )(~ ((unsigned int )0))) { tmp = 1; } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= ~ ((unsigned long )0)) { tmp = 1; } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= (mp_limb_t )((unsigned short )(~ 0))) { tmp = 1; + } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) +{ + mp_ptr __gmp_p ; + mp_size_t __gmp_n ; + mp_limb_t __gmp_l ; + mp_limb_t tmp ; + __gmp_p = __gmp_z->_mp_d; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_l = *(__gmp_p + 0); + if (__gmp_n != (mp_size_t )0) { tmp = __gmp_l; } + else { tmp = (unsigned long )0; } + return (tmp); +} + +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) +{ + mp_limb_t __gmp_result ; + long tmp_1 ; + int tmp_0 ; + __gmp_result = (mp_limb_t )0; + { /*undefined sequence*/ + if (__gmp_n >= (mp_size_t )0) { + int tmp ; + { /*undefined sequence*/ + if (__gmp_z->_mp_size >= 0) { tmp = __gmp_z->_mp_size; } + else { tmp = - __gmp_z->_mp_size; } + ; + } + if (__gmp_n < (mp_size_t )tmp) { tmp_0 = 1; } + else { tmp_0 = 0; } + } + else { tmp_0 = 0; } + tmp_1 = __builtin_expect((long )(tmp_0 != 0),(long )1); + } + if (tmp_1) { __gmp_result = *(__gmp_z->_mp_d + __gmp_n); } + return (__gmp_result); +} + +/*@ requires \valid(z1); + requires \valid(z2); + assigns *z1; */ +__inline static void __gmpz_neg(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) +{ + if (z1 != z2) { __gmpz_set(z1,z2); } + z1->_mp_size = - z1->_mp_size; + return; +} + +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) +{ + mp_size_t __gmp_asize ; + int __gmp_result ; + long tmp ; + __gmp_asize = (long )__gmp_a->_mp_size; + __gmp_result = __gmp_asize >= (mp_size_t )0; + tmp = __builtin_expect((long )((__gmp_asize > (mp_size_t )0) != 0), + (long )1); + if (tmp) { + __gmp_result = __gmpn_perfect_square_p((mp_limb_t const *)__gmp_a->_mp_d, + __gmp_asize); + } + return (__gmp_result); +} + +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) +{ + mp_size_t __gmp_usize ; + unsigned long __gmp_result ; + long tmp ; + __gmp_usize = (long )__gmp_u->_mp_size; + if (__gmp_usize < (mp_size_t )0) { __gmp_result = ~ ((unsigned long )0); } + else { __gmp_result = (unsigned long )0; } + tmp = __builtin_expect((long )((__gmp_usize > (mp_size_t )0) != 0), + (long )1); + if (tmp) { + __gmp_result = __gmpn_popcount((mp_limb_t const *)__gmp_u->_mp_d, + __gmp_usize); + } + return (__gmp_result); +} + +__inline static void __gmpz_set_q(mpz_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + __gmpz_tdiv_q(__gmp_w,& __gmp_u->_mp_num,& __gmp_u->_mp_den); + return; +} + +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) +{ + size_t __retres ; + int tmp ; + if (__gmp_z->_mp_size >= 0) { tmp = __gmp_z->_mp_size; } + else { tmp = - __gmp_z->_mp_size; } + __retres = (unsigned long )tmp; + return (__retres); +} + +__inline static void __gmpq_abs(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpq_set(__gmp_w,__gmp_u); } + if (__gmp_w->_mp_num._mp_size >= 0) { + __gmp_w->_mp_num._mp_size = __gmp_w->_mp_num._mp_size; + } + else { __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size; } + return; +} + +__inline static void __gmpq_neg(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpq_set(__gmp_w,__gmp_u); } + __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size; + return; +} + +__inline static mp_limb_t __gmpn_add(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; __gmp_i = __gmp_ysize; + if (__gmp_i != (mp_size_t )0) { + mp_limb_t tmp_1 ; + tmp_1 = __gmpn_add_n(__gmp_wp,__gmp_xp,__gmp_yp,__gmp_i); + if (tmp_1) { + while (1) { + mp_size_t tmp ; + mp_limb_t tmp_0 ; + if (__gmp_i >= __gmp_xsize) { + __gmp_c = (unsigned long )1; + goto __gmp_done; + } + __gmp_x = *(__gmp_xp + __gmp_i); + { /*undefined sequence*/ + tmp = __gmp_i; + __gmp_i += (mp_size_t )1; + tmp_0 = (__gmp_x + (mp_limb_t )1) & (~ ((unsigned long )0) >> 0); + *(__gmp_wp + tmp) = tmp_0; + } + if (! (tmp_0 == (mp_limb_t )0)) { break; } + } + } + } + if (__gmp_wp != __gmp_xp) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_xsize) { + *(__gmp_wp + __gmp_j) = *(__gmp_xp + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } __gmp_c = (unsigned long )0; __gmp_done: ; + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_add_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_r ; + __gmp_x = *(__gmp_src + 0); __gmp_r = __gmp_x + __gmp_n; + *(__gmp_dst + 0) = __gmp_r; + if (__gmp_r < __gmp_n) { + __gmp_c = (unsigned long )1; + __gmp_i = (long )1; + while (__gmp_i < __gmp_size) { + __gmp_x = *(__gmp_src + __gmp_i); + __gmp_r = __gmp_x + (mp_limb_t )1; + *(__gmp_dst + __gmp_i) = __gmp_r; + __gmp_i += (mp_size_t )1; + if (! (__gmp_r < (mp_limb_t )1)) { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_size) { + *(__gmp_dst + __gmp_j) = *(__gmp_src + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + break; + } + } + } + else { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j_0 ; __gmp_j_0 = (long )1; + while (__gmp_j_0 < __gmp_size) { + *(__gmp_dst + __gmp_j_0) = *(__gmp_src + __gmp_j_0); + __gmp_j_0 += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + } + } + + break; + } + return (__gmp_c); +} + +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) __attribute__(( +__pure__)) ; +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) +{ + int __gmp_result ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_y ; + __gmp_result = 0; __gmp_i = __gmp_size; + while (1) { + __gmp_i -= (mp_size_t )1; + if (! (__gmp_i >= (mp_size_t )0)) { break; } + __gmp_x = *(__gmp_xp + __gmp_i); + __gmp_y = *(__gmp_yp + __gmp_i); + if (__gmp_x != __gmp_y) { + if (__gmp_x > __gmp_y) { __gmp_result = 1; } + else { __gmp_result = -1; } + break; + } + } + } + + break; + } + return (__gmp_result); +} + +__inline static mp_limb_t __gmpn_sub(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; __gmp_i = __gmp_ysize; + if (__gmp_i != (mp_size_t )0) { + mp_limb_t tmp_0 ; + tmp_0 = __gmpn_sub_n(__gmp_wp,__gmp_xp,__gmp_yp,__gmp_i); + if (tmp_0) { + while (1) { + mp_size_t tmp ; + if (__gmp_i >= __gmp_xsize) { + __gmp_c = (unsigned long )1; + goto __gmp_done; + } + __gmp_x = *(__gmp_xp + __gmp_i); + { /*undefined sequence*/ + tmp = __gmp_i; + __gmp_i += (mp_size_t )1; + *(__gmp_wp + tmp) = (__gmp_x - (mp_limb_t )1) & (~ ((unsigned long )0) >> 0); + } + if (! (__gmp_x == (mp_limb_t )0)) { break; } + } + } + } + if (__gmp_wp != __gmp_xp) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_xsize) { + *(__gmp_wp + __gmp_j) = *(__gmp_xp + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } __gmp_c = (unsigned long )0; __gmp_done: ; + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_sub_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_r ; + __gmp_x = *(__gmp_src + 0); __gmp_r = __gmp_x - __gmp_n; + *(__gmp_dst + 0) = __gmp_r; + if (__gmp_x < __gmp_n) { + __gmp_c = (unsigned long )1; + __gmp_i = (long )1; + while (__gmp_i < __gmp_size) { + __gmp_x = *(__gmp_src + __gmp_i); + __gmp_r = __gmp_x - (mp_limb_t )1; + *(__gmp_dst + __gmp_i) = __gmp_r; + __gmp_i += (mp_size_t )1; + if (! (__gmp_x < (mp_limb_t )1)) { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_size) { + *(__gmp_dst + __gmp_j) = *(__gmp_src + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + break; + } + } + } + else { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j_0 ; __gmp_j_0 = (long )1; + while (__gmp_j_0 < __gmp_size) { + *(__gmp_dst + __gmp_j_0) = *(__gmp_src + __gmp_j_0); + __gmp_j_0 += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + } + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_neg_n(mp_ptr __gmp_rp , mp_srcptr __gmp_up , + mp_size_t __gmp_n ) +{ + mp_limb_t __gmp_ul ; + mp_limb_t __gmp_cy ; + __gmp_cy = (unsigned long )0; + while (1) { + { mp_srcptr tmp ; mp_ptr tmp_0 ; + { /*undefined sequence*/ tmp = __gmp_up; __gmp_up ++; __gmp_ul = *tmp; + } + { /*undefined sequence*/ + tmp_0 = __gmp_rp; + __gmp_rp ++; + *tmp_0 = - __gmp_ul - __gmp_cy; + } __gmp_cy |= (unsigned long )(__gmp_ul != (mp_limb_t )0); + } + + __gmp_n -= (mp_size_t )1; + if (! (__gmp_n != (mp_size_t )0)) { break; } + } + return (__gmp_cy); +} + +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status ) ; +void e_acsl_fail(char *msg ) +{ + printf((char const *)"%s\n",msg); + exit(1); + return; +} + +void main(void) +{ + long x ; + int y ; + x = (long )0; + y = 0; + /*@ assert (int )x ≡ y; */ ; + if ((int )x != y) { e_acsl_fail((char *)"((int )x == y)"); } + /*@ assert x ≡ (long )y; */ ; + if (x != (long )y) { e_acsl_fail((char *)"(x == (long )y)"); } + return; +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_comparison.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_comparison.c new file mode 100644 index 00000000000..67cc8ed29d4 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_comparison.c @@ -0,0 +1,681 @@ +/* Generated by Frama-C */ +typedef unsigned long size_t; +typedef unsigned long mp_limb_t; +struct __anonstruct___mpz_struct_6 { + int _mp_alloc ; + int _mp_size ; + mp_limb_t *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_6 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +typedef mp_limb_t *mp_ptr; +typedef mp_limb_t const *mp_srcptr; +typedef long mp_size_t; +struct __anonstruct___mpq_struct_7 { + __mpz_struct _mp_num ; + __mpz_struct _mp_den ; +}; +typedef struct __anonstruct___mpq_struct_7 __mpq_struct; +typedef __mpz_struct const *mpz_srcptr; +typedef __mpz_struct *mpz_ptr; +typedef __mpq_struct const *mpq_srcptr; +typedef __mpq_struct *mpq_ptr; +/* compiler builtin: + long __builtin_expect(long , long ) ; */ +/*@ assigns \nothing; */ +extern int printf(char const * __restrict __format , ...) ; +__inline static void __gmpz_abs(mpz_ptr __gmp_w , mpz_srcptr __gmp_u ) ; +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x ) ; +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) __attribute__(( +__pure__)) ; +/*@ ensures \valid(\at(z,Old)); + assigns *z; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z , long n ) ; +__inline static void __gmpz_neg(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) ; +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) __attribute__(( +__pure__)) ; +extern void __gmpz_set(mpz_ptr , mpz_srcptr ) ; +__inline static void __gmpz_set_q(mpz_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +extern void __gmpz_tdiv_q(mpz_ptr , mpz_srcptr , mpz_srcptr ) ; +__inline static void __gmpq_abs(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +__inline static void __gmpq_neg(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +extern void __gmpq_set(mpq_ptr , mpq_srcptr ) ; +__inline static mp_limb_t __gmpn_add(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) ; +__inline static mp_limb_t __gmpn_add_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) ; +extern mp_limb_t __gmpn_add_n(mp_ptr , mp_srcptr , mp_srcptr , mp_size_t ) ; +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpn_neg_n(mp_ptr __gmp_rp , mp_srcptr __gmp_up , + mp_size_t __gmp_n ) ; +extern int __gmpn_perfect_square_p(mp_srcptr , mp_size_t ) __attribute__(( +__pure__)) ; +extern unsigned long __gmpn_popcount(mp_srcptr , mp_size_t ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpn_sub(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) ; +__inline static mp_limb_t __gmpn_sub_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) ; +extern mp_limb_t __gmpn_sub_n(mp_ptr , mp_srcptr , mp_srcptr , mp_size_t ) ; +__inline static void __gmpz_abs(mpz_ptr __gmp_w , mpz_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpz_set(__gmp_w,__gmp_u); } + if (__gmp_w->_mp_size >= 0) { __gmp_w->_mp_size = __gmp_w->_mp_size; } + else { __gmp_w->_mp_size = - __gmp_w->_mp_size; } + return; +} + +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= (mp_limb_t )(~ ((unsigned int )0))) { tmp = 1; } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= ~ ((unsigned long )0)) { tmp = 1; } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= (mp_limb_t )((unsigned short )(~ 0))) { tmp = 1; + } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) +{ + mp_ptr __gmp_p ; + mp_size_t __gmp_n ; + mp_limb_t __gmp_l ; + mp_limb_t tmp ; + __gmp_p = __gmp_z->_mp_d; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_l = *(__gmp_p + 0); + if (__gmp_n != (mp_size_t )0) { tmp = __gmp_l; } + else { tmp = (unsigned long )0; } + return (tmp); +} + +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) +{ + mp_limb_t __gmp_result ; + long tmp_1 ; + int tmp_0 ; + __gmp_result = (mp_limb_t )0; + { /*undefined sequence*/ + if (__gmp_n >= (mp_size_t )0) { + int tmp ; + { /*undefined sequence*/ + if (__gmp_z->_mp_size >= 0) { tmp = __gmp_z->_mp_size; } + else { tmp = - __gmp_z->_mp_size; } + ; + } + if (__gmp_n < (mp_size_t )tmp) { tmp_0 = 1; } + else { tmp_0 = 0; } + } + else { tmp_0 = 0; } + tmp_1 = __builtin_expect((long )(tmp_0 != 0),(long )1); + } + if (tmp_1) { __gmp_result = *(__gmp_z->_mp_d + __gmp_n); } + return (__gmp_result); +} + +/*@ requires \valid(z1); + requires \valid(z2); + assigns *z1; */ +__inline static void __gmpz_neg(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) +{ + if (z1 != z2) { __gmpz_set(z1,z2); } + z1->_mp_size = - z1->_mp_size; + return; +} + +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) +{ + mp_size_t __gmp_asize ; + int __gmp_result ; + long tmp ; + __gmp_asize = (long )__gmp_a->_mp_size; + __gmp_result = __gmp_asize >= (mp_size_t )0; + tmp = __builtin_expect((long )((__gmp_asize > (mp_size_t )0) != 0), + (long )1); + if (tmp) { + __gmp_result = __gmpn_perfect_square_p((mp_limb_t const *)__gmp_a->_mp_d, + __gmp_asize); + } + return (__gmp_result); +} + +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) +{ + mp_size_t __gmp_usize ; + unsigned long __gmp_result ; + long tmp ; + __gmp_usize = (long )__gmp_u->_mp_size; + if (__gmp_usize < (mp_size_t )0) { __gmp_result = ~ ((unsigned long )0); } + else { __gmp_result = (unsigned long )0; } + tmp = __builtin_expect((long )((__gmp_usize > (mp_size_t )0) != 0), + (long )1); + if (tmp) { + __gmp_result = __gmpn_popcount((mp_limb_t const *)__gmp_u->_mp_d, + __gmp_usize); + } + return (__gmp_result); +} + +__inline static void __gmpz_set_q(mpz_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + __gmpz_tdiv_q(__gmp_w,& __gmp_u->_mp_num,& __gmp_u->_mp_den); + return; +} + +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) +{ + size_t __retres ; + int tmp ; + if (__gmp_z->_mp_size >= 0) { tmp = __gmp_z->_mp_size; } + else { tmp = - __gmp_z->_mp_size; } + __retres = (unsigned long )tmp; + return (__retres); +} + +__inline static void __gmpq_abs(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpq_set(__gmp_w,__gmp_u); } + if (__gmp_w->_mp_num._mp_size >= 0) { + __gmp_w->_mp_num._mp_size = __gmp_w->_mp_num._mp_size; + } + else { __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size; } + return; +} + +__inline static void __gmpq_neg(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpq_set(__gmp_w,__gmp_u); } + __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size; + return; +} + +__inline static mp_limb_t __gmpn_add(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; __gmp_i = __gmp_ysize; + if (__gmp_i != (mp_size_t )0) { + mp_limb_t tmp_1 ; + tmp_1 = __gmpn_add_n(__gmp_wp,__gmp_xp,__gmp_yp,__gmp_i); + if (tmp_1) { + while (1) { + mp_size_t tmp ; + mp_limb_t tmp_0 ; + if (__gmp_i >= __gmp_xsize) { + __gmp_c = (unsigned long )1; + goto __gmp_done; + } + __gmp_x = *(__gmp_xp + __gmp_i); + { /*undefined sequence*/ + tmp = __gmp_i; + __gmp_i += (mp_size_t )1; + tmp_0 = (__gmp_x + (mp_limb_t )1) & (~ ((unsigned long )0) >> 0); + *(__gmp_wp + tmp) = tmp_0; + } + if (! (tmp_0 == (mp_limb_t )0)) { break; } + } + } + } + if (__gmp_wp != __gmp_xp) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_xsize) { + *(__gmp_wp + __gmp_j) = *(__gmp_xp + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } __gmp_c = (unsigned long )0; __gmp_done: ; + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_add_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_r ; + __gmp_x = *(__gmp_src + 0); __gmp_r = __gmp_x + __gmp_n; + *(__gmp_dst + 0) = __gmp_r; + if (__gmp_r < __gmp_n) { + __gmp_c = (unsigned long )1; + __gmp_i = (long )1; + while (__gmp_i < __gmp_size) { + __gmp_x = *(__gmp_src + __gmp_i); + __gmp_r = __gmp_x + (mp_limb_t )1; + *(__gmp_dst + __gmp_i) = __gmp_r; + __gmp_i += (mp_size_t )1; + if (! (__gmp_r < (mp_limb_t )1)) { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_size) { + *(__gmp_dst + __gmp_j) = *(__gmp_src + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + break; + } + } + } + else { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j_0 ; __gmp_j_0 = (long )1; + while (__gmp_j_0 < __gmp_size) { + *(__gmp_dst + __gmp_j_0) = *(__gmp_src + __gmp_j_0); + __gmp_j_0 += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + } + } + + break; + } + return (__gmp_c); +} + +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) __attribute__(( +__pure__)) ; +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) +{ + int __gmp_result ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_y ; + __gmp_result = 0; __gmp_i = __gmp_size; + while (1) { + __gmp_i -= (mp_size_t )1; + if (! (__gmp_i >= (mp_size_t )0)) { break; } + __gmp_x = *(__gmp_xp + __gmp_i); + __gmp_y = *(__gmp_yp + __gmp_i); + if (__gmp_x != __gmp_y) { + if (__gmp_x > __gmp_y) { __gmp_result = 1; } + else { __gmp_result = -1; } + break; + } + } + } + + break; + } + return (__gmp_result); +} + +__inline static mp_limb_t __gmpn_sub(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; __gmp_i = __gmp_ysize; + if (__gmp_i != (mp_size_t )0) { + mp_limb_t tmp_0 ; + tmp_0 = __gmpn_sub_n(__gmp_wp,__gmp_xp,__gmp_yp,__gmp_i); + if (tmp_0) { + while (1) { + mp_size_t tmp ; + if (__gmp_i >= __gmp_xsize) { + __gmp_c = (unsigned long )1; + goto __gmp_done; + } + __gmp_x = *(__gmp_xp + __gmp_i); + { /*undefined sequence*/ + tmp = __gmp_i; + __gmp_i += (mp_size_t )1; + *(__gmp_wp + tmp) = (__gmp_x - (mp_limb_t )1) & (~ ((unsigned long )0) >> 0); + } + if (! (__gmp_x == (mp_limb_t )0)) { break; } + } + } + } + if (__gmp_wp != __gmp_xp) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_xsize) { + *(__gmp_wp + __gmp_j) = *(__gmp_xp + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } __gmp_c = (unsigned long )0; __gmp_done: ; + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_sub_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_r ; + __gmp_x = *(__gmp_src + 0); __gmp_r = __gmp_x - __gmp_n; + *(__gmp_dst + 0) = __gmp_r; + if (__gmp_x < __gmp_n) { + __gmp_c = (unsigned long )1; + __gmp_i = (long )1; + while (__gmp_i < __gmp_size) { + __gmp_x = *(__gmp_src + __gmp_i); + __gmp_r = __gmp_x - (mp_limb_t )1; + *(__gmp_dst + __gmp_i) = __gmp_r; + __gmp_i += (mp_size_t )1; + if (! (__gmp_x < (mp_limb_t )1)) { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_size) { + *(__gmp_dst + __gmp_j) = *(__gmp_src + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + break; + } + } + } + else { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j_0 ; __gmp_j_0 = (long )1; + while (__gmp_j_0 < __gmp_size) { + *(__gmp_dst + __gmp_j_0) = *(__gmp_src + __gmp_j_0); + __gmp_j_0 += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + } + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_neg_n(mp_ptr __gmp_rp , mp_srcptr __gmp_up , + mp_size_t __gmp_n ) +{ + mp_limb_t __gmp_ul ; + mp_limb_t __gmp_cy ; + __gmp_cy = (unsigned long )0; + while (1) { + { mp_srcptr tmp ; mp_ptr tmp_0 ; + { /*undefined sequence*/ tmp = __gmp_up; __gmp_up ++; __gmp_ul = *tmp; + } + { /*undefined sequence*/ + tmp_0 = __gmp_rp; + __gmp_rp ++; + *tmp_0 = - __gmp_ul - __gmp_cy; + } __gmp_cy |= (unsigned long )(__gmp_ul != (mp_limb_t )0); + } + + __gmp_n -= (mp_size_t )1; + if (! (__gmp_n != (mp_size_t )0)) { break; } + } + return (__gmp_cy); +} + +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status ) ; +void e_acsl_fail(char *msg ) +{ + printf((char const *)"%s\n",msg); + exit(1); + return; +} + +void main(void) +{ + int x ; + int y ; + char *s ; + x = 0; + y = 1; + /*@ assert x < y; */ ; + if (x >= y) { e_acsl_fail((char *)"(x < y)"); } + /*@ assert y > x; */ ; + if (y <= x) { e_acsl_fail((char *)"(y > x)"); } + /*@ assert x ≤ 0; */ ; + { mpz_t e_acsl_cst_1 ; mpz_t e_acsl_cst_2 ; int e_acsl_cst_3 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_1),(long )x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_2),(long )0); + e_acsl_cst_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_1), + (__mpz_struct const *)(e_acsl_cst_2)); + if (e_acsl_cst_3 > 0) { e_acsl_fail((char *)"(x <= 0)"); } + __gmpz_clear((__mpz_struct *)(e_acsl_cst_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_2)); + } + + /*@ assert y ≥ 1; */ ; + { mpz_t e_acsl_cst_4 ; mpz_t e_acsl_cst_5 ; int e_acsl_cst_6 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_4),(long )y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_5),(long )1); + e_acsl_cst_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_4), + (__mpz_struct const *)(e_acsl_cst_5)); + if (e_acsl_cst_6 < 0) { e_acsl_fail((char *)"(y >= 1)"); } + __gmpz_clear((__mpz_struct *)(e_acsl_cst_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_5)); + } + + s = (char *)"toto"; + /*@ assert s ≡ s; */ ; + if (s != s) { e_acsl_fail((char *)"(s == s)"); } + /*@ assert "toto" ≢ "titi"; */ ; + if ("toto" == "titi") { e_acsl_fail((char *)"(\"toto\" != \"titi\")"); } + /*@ assert 5 < 18; */ ; + { mpz_t e_acsl_cst_7 ; mpz_t e_acsl_cst_8 ; int e_acsl_cst_9 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_7),(long )5); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_8),(long )18); + e_acsl_cst_9 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_7), + (__mpz_struct const *)(e_acsl_cst_8)); + if (e_acsl_cst_9 >= 0) { e_acsl_fail((char *)"(5 < 18)"); } + __gmpz_clear((__mpz_struct *)(e_acsl_cst_7)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_8)); + } + + /*@ assert 32 > 3; */ ; + { mpz_t e_acsl_cst_10 ; mpz_t e_acsl_cst_11 ; int e_acsl_cst_12 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_10),(long )32); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_11),(long )3); + e_acsl_cst_12 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_10), + (__mpz_struct const *)(e_acsl_cst_11)); + if (e_acsl_cst_12 <= 0) { e_acsl_fail((char *)"(32 > 3)"); } + __gmpz_clear((__mpz_struct *)(e_acsl_cst_10)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_11)); + } + + /*@ assert 12 ≤ 13; */ ; + { mpz_t e_acsl_cst_13 ; mpz_t e_acsl_cst_14 ; int e_acsl_cst_15 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_13),(long )12); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_14),(long )13); + e_acsl_cst_15 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_13), + (__mpz_struct const *)(e_acsl_cst_14)); + if (e_acsl_cst_15 > 0) { e_acsl_fail((char *)"(12 <= 13)"); } + __gmpz_clear((__mpz_struct *)(e_acsl_cst_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_14)); + } + + /*@ assert 123 ≥ 12; */ ; + { mpz_t e_acsl_cst_16 ; mpz_t e_acsl_cst_17 ; int e_acsl_cst_18 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_16),(long )123); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_17),(long )12); + e_acsl_cst_18 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_16), + (__mpz_struct const *)(e_acsl_cst_17)); + if (e_acsl_cst_18 < 0) { e_acsl_fail((char *)"(123 >= 12)"); } + __gmpz_clear((__mpz_struct *)(e_acsl_cst_16)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_17)); + } + + /*@ assert 0xff ≡ 0xff; */ ; + { mpz_t e_acsl_cst_19 ; mpz_t e_acsl_cst_20 ; int e_acsl_cst_21 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_19),(long )0xff); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_20),(long )0xff); + e_acsl_cst_21 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_19), + (__mpz_struct const *)(e_acsl_cst_20)); + if (e_acsl_cst_21 != 0) { e_acsl_fail((char *)"(0xff == 0xff)"); } + __gmpz_clear((__mpz_struct *)(e_acsl_cst_19)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_20)); + } + + /*@ assert 1 ≢ 2; */ ; + { mpz_t e_acsl_cst_22 ; mpz_t e_acsl_cst_23 ; int e_acsl_cst_24 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_22),(long )1); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_23),(long )2); + e_acsl_cst_24 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_22), + (__mpz_struct const *)(e_acsl_cst_23)); + if (e_acsl_cst_24 == 0) { e_acsl_fail((char *)"(1 != 2)"); } + __gmpz_clear((__mpz_struct *)(e_acsl_cst_22)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_23)); + } + + return; +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_false.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_false.c new file mode 100644 index 00000000000..cf65181f922 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_false.c @@ -0,0 +1,569 @@ +/* Generated by Frama-C */ +typedef unsigned long size_t; +typedef unsigned long mp_limb_t; +struct __anonstruct___mpz_struct_6 { + int _mp_alloc ; + int _mp_size ; + mp_limb_t *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_6 __mpz_struct; +typedef mp_limb_t *mp_ptr; +typedef mp_limb_t const *mp_srcptr; +typedef long mp_size_t; +struct __anonstruct___mpq_struct_7 { + __mpz_struct _mp_num ; + __mpz_struct _mp_den ; +}; +typedef struct __anonstruct___mpq_struct_7 __mpq_struct; +typedef __mpz_struct const *mpz_srcptr; +typedef __mpz_struct *mpz_ptr; +typedef __mpq_struct const *mpq_srcptr; +typedef __mpq_struct *mpq_ptr; +/* compiler builtin: + long __builtin_expect(long , long ) ; */ +/*@ assigns \nothing; */ +extern int printf(char const * __restrict __format , ...) ; +__inline static void __gmpz_abs(mpz_ptr __gmp_w , mpz_srcptr __gmp_u ) ; +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) __attribute__(( +__pure__)) ; +__inline static void __gmpz_neg(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) ; +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) __attribute__(( +__pure__)) ; +extern void __gmpz_set(mpz_ptr , mpz_srcptr ) ; +__inline static void __gmpz_set_q(mpz_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +extern void __gmpz_tdiv_q(mpz_ptr , mpz_srcptr , mpz_srcptr ) ; +__inline static void __gmpq_abs(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +__inline static void __gmpq_neg(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +extern void __gmpq_set(mpq_ptr , mpq_srcptr ) ; +__inline static mp_limb_t __gmpn_add(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) ; +__inline static mp_limb_t __gmpn_add_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) ; +extern mp_limb_t __gmpn_add_n(mp_ptr , mp_srcptr , mp_srcptr , mp_size_t ) ; +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpn_neg_n(mp_ptr __gmp_rp , mp_srcptr __gmp_up , + mp_size_t __gmp_n ) ; +extern int __gmpn_perfect_square_p(mp_srcptr , mp_size_t ) __attribute__(( +__pure__)) ; +extern unsigned long __gmpn_popcount(mp_srcptr , mp_size_t ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpn_sub(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) ; +__inline static mp_limb_t __gmpn_sub_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) ; +extern mp_limb_t __gmpn_sub_n(mp_ptr , mp_srcptr , mp_srcptr , mp_size_t ) ; +__inline static void __gmpz_abs(mpz_ptr __gmp_w , mpz_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpz_set(__gmp_w,__gmp_u); } + if (__gmp_w->_mp_size >= 0) { __gmp_w->_mp_size = __gmp_w->_mp_size; } + else { __gmp_w->_mp_size = - __gmp_w->_mp_size; } + return; +} + +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= (mp_limb_t )(~ ((unsigned int )0))) { tmp = 1; } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= ~ ((unsigned long )0)) { tmp = 1; } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= (mp_limb_t )((unsigned short )(~ 0))) { tmp = 1; + } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) +{ + mp_ptr __gmp_p ; + mp_size_t __gmp_n ; + mp_limb_t __gmp_l ; + mp_limb_t tmp ; + __gmp_p = __gmp_z->_mp_d; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_l = *(__gmp_p + 0); + if (__gmp_n != (mp_size_t )0) { tmp = __gmp_l; } + else { tmp = (unsigned long )0; } + return (tmp); +} + +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) +{ + mp_limb_t __gmp_result ; + long tmp_1 ; + int tmp_0 ; + __gmp_result = (mp_limb_t )0; + { /*undefined sequence*/ + if (__gmp_n >= (mp_size_t )0) { + int tmp ; + { /*undefined sequence*/ + if (__gmp_z->_mp_size >= 0) { tmp = __gmp_z->_mp_size; } + else { tmp = - __gmp_z->_mp_size; } + ; + } + if (__gmp_n < (mp_size_t )tmp) { tmp_0 = 1; } + else { tmp_0 = 0; } + } + else { tmp_0 = 0; } + tmp_1 = __builtin_expect((long )(tmp_0 != 0),(long )1); + } + if (tmp_1) { __gmp_result = *(__gmp_z->_mp_d + __gmp_n); } + return (__gmp_result); +} + +/*@ requires \valid(z1); + requires \valid(z2); + assigns *z1; */ +__inline static void __gmpz_neg(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) +{ + if (z1 != z2) { __gmpz_set(z1,z2); } + z1->_mp_size = - z1->_mp_size; + return; +} + +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) +{ + mp_size_t __gmp_asize ; + int __gmp_result ; + long tmp ; + __gmp_asize = (long )__gmp_a->_mp_size; + __gmp_result = __gmp_asize >= (mp_size_t )0; + tmp = __builtin_expect((long )((__gmp_asize > (mp_size_t )0) != 0), + (long )1); + if (tmp) { + __gmp_result = __gmpn_perfect_square_p((mp_limb_t const *)__gmp_a->_mp_d, + __gmp_asize); + } + return (__gmp_result); +} + +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) +{ + mp_size_t __gmp_usize ; + unsigned long __gmp_result ; + long tmp ; + __gmp_usize = (long )__gmp_u->_mp_size; + if (__gmp_usize < (mp_size_t )0) { __gmp_result = ~ ((unsigned long )0); } + else { __gmp_result = (unsigned long )0; } + tmp = __builtin_expect((long )((__gmp_usize > (mp_size_t )0) != 0), + (long )1); + if (tmp) { + __gmp_result = __gmpn_popcount((mp_limb_t const *)__gmp_u->_mp_d, + __gmp_usize); + } + return (__gmp_result); +} + +__inline static void __gmpz_set_q(mpz_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + __gmpz_tdiv_q(__gmp_w,& __gmp_u->_mp_num,& __gmp_u->_mp_den); + return; +} + +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) +{ + size_t __retres ; + int tmp ; + if (__gmp_z->_mp_size >= 0) { tmp = __gmp_z->_mp_size; } + else { tmp = - __gmp_z->_mp_size; } + __retres = (unsigned long )tmp; + return (__retres); +} + +__inline static void __gmpq_abs(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpq_set(__gmp_w,__gmp_u); } + if (__gmp_w->_mp_num._mp_size >= 0) { + __gmp_w->_mp_num._mp_size = __gmp_w->_mp_num._mp_size; + } + else { __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size; } + return; +} + +__inline static void __gmpq_neg(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpq_set(__gmp_w,__gmp_u); } + __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size; + return; +} + +__inline static mp_limb_t __gmpn_add(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; __gmp_i = __gmp_ysize; + if (__gmp_i != (mp_size_t )0) { + mp_limb_t tmp_1 ; + tmp_1 = __gmpn_add_n(__gmp_wp,__gmp_xp,__gmp_yp,__gmp_i); + if (tmp_1) { + while (1) { + mp_size_t tmp ; + mp_limb_t tmp_0 ; + if (__gmp_i >= __gmp_xsize) { + __gmp_c = (unsigned long )1; + goto __gmp_done; + } + __gmp_x = *(__gmp_xp + __gmp_i); + { /*undefined sequence*/ + tmp = __gmp_i; + __gmp_i += (mp_size_t )1; + tmp_0 = (__gmp_x + (mp_limb_t )1) & (~ ((unsigned long )0) >> 0); + *(__gmp_wp + tmp) = tmp_0; + } + if (! (tmp_0 == (mp_limb_t )0)) { break; } + } + } + } + if (__gmp_wp != __gmp_xp) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_xsize) { + *(__gmp_wp + __gmp_j) = *(__gmp_xp + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } __gmp_c = (unsigned long )0; __gmp_done: ; + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_add_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_r ; + __gmp_x = *(__gmp_src + 0); __gmp_r = __gmp_x + __gmp_n; + *(__gmp_dst + 0) = __gmp_r; + if (__gmp_r < __gmp_n) { + __gmp_c = (unsigned long )1; + __gmp_i = (long )1; + while (__gmp_i < __gmp_size) { + __gmp_x = *(__gmp_src + __gmp_i); + __gmp_r = __gmp_x + (mp_limb_t )1; + *(__gmp_dst + __gmp_i) = __gmp_r; + __gmp_i += (mp_size_t )1; + if (! (__gmp_r < (mp_limb_t )1)) { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_size) { + *(__gmp_dst + __gmp_j) = *(__gmp_src + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + break; + } + } + } + else { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j_0 ; __gmp_j_0 = (long )1; + while (__gmp_j_0 < __gmp_size) { + *(__gmp_dst + __gmp_j_0) = *(__gmp_src + __gmp_j_0); + __gmp_j_0 += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + } + } + + break; + } + return (__gmp_c); +} + +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) __attribute__(( +__pure__)) ; +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) +{ + int __gmp_result ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_y ; + __gmp_result = 0; __gmp_i = __gmp_size; + while (1) { + __gmp_i -= (mp_size_t )1; + if (! (__gmp_i >= (mp_size_t )0)) { break; } + __gmp_x = *(__gmp_xp + __gmp_i); + __gmp_y = *(__gmp_yp + __gmp_i); + if (__gmp_x != __gmp_y) { + if (__gmp_x > __gmp_y) { __gmp_result = 1; } + else { __gmp_result = -1; } + break; + } + } + } + + break; + } + return (__gmp_result); +} + +__inline static mp_limb_t __gmpn_sub(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; __gmp_i = __gmp_ysize; + if (__gmp_i != (mp_size_t )0) { + mp_limb_t tmp_0 ; + tmp_0 = __gmpn_sub_n(__gmp_wp,__gmp_xp,__gmp_yp,__gmp_i); + if (tmp_0) { + while (1) { + mp_size_t tmp ; + if (__gmp_i >= __gmp_xsize) { + __gmp_c = (unsigned long )1; + goto __gmp_done; + } + __gmp_x = *(__gmp_xp + __gmp_i); + { /*undefined sequence*/ + tmp = __gmp_i; + __gmp_i += (mp_size_t )1; + *(__gmp_wp + tmp) = (__gmp_x - (mp_limb_t )1) & (~ ((unsigned long )0) >> 0); + } + if (! (__gmp_x == (mp_limb_t )0)) { break; } + } + } + } + if (__gmp_wp != __gmp_xp) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_xsize) { + *(__gmp_wp + __gmp_j) = *(__gmp_xp + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } __gmp_c = (unsigned long )0; __gmp_done: ; + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_sub_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_r ; + __gmp_x = *(__gmp_src + 0); __gmp_r = __gmp_x - __gmp_n; + *(__gmp_dst + 0) = __gmp_r; + if (__gmp_x < __gmp_n) { + __gmp_c = (unsigned long )1; + __gmp_i = (long )1; + while (__gmp_i < __gmp_size) { + __gmp_x = *(__gmp_src + __gmp_i); + __gmp_r = __gmp_x - (mp_limb_t )1; + *(__gmp_dst + __gmp_i) = __gmp_r; + __gmp_i += (mp_size_t )1; + if (! (__gmp_x < (mp_limb_t )1)) { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_size) { + *(__gmp_dst + __gmp_j) = *(__gmp_src + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + break; + } + } + } + else { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j_0 ; __gmp_j_0 = (long )1; + while (__gmp_j_0 < __gmp_size) { + *(__gmp_dst + __gmp_j_0) = *(__gmp_src + __gmp_j_0); + __gmp_j_0 += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + } + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_neg_n(mp_ptr __gmp_rp , mp_srcptr __gmp_up , + mp_size_t __gmp_n ) +{ + mp_limb_t __gmp_ul ; + mp_limb_t __gmp_cy ; + __gmp_cy = (unsigned long )0; + while (1) { + { mp_srcptr tmp ; mp_ptr tmp_0 ; + { /*undefined sequence*/ tmp = __gmp_up; __gmp_up ++; __gmp_ul = *tmp; + } + { /*undefined sequence*/ + tmp_0 = __gmp_rp; + __gmp_rp ++; + *tmp_0 = - __gmp_ul - __gmp_cy; + } __gmp_cy |= (unsigned long )(__gmp_ul != (mp_limb_t )0); + } + + __gmp_n -= (mp_size_t )1; + if (! (__gmp_n != (mp_size_t )0)) { break; } + } + return (__gmp_cy); +} + +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status ) ; +void e_acsl_fail(char *msg ) +{ + printf((char const *)"%s\n",msg); + exit(1); + return; +} + +void main(void) +{ + int x ; + x = 0; + if (x) { /*@ assert \false; */ ; e_acsl_fail((char *)"(\\false)"); } + return; +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_integer_constant.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_integer_constant.c new file mode 100644 index 00000000000..88b4e2f8fd4 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_integer_constant.c @@ -0,0 +1,619 @@ +/* Generated by Frama-C */ +typedef unsigned long size_t; +typedef unsigned long mp_limb_t; +struct __anonstruct___mpz_struct_6 { + int _mp_alloc ; + int _mp_size ; + mp_limb_t *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_6 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +typedef mp_limb_t *mp_ptr; +typedef mp_limb_t const *mp_srcptr; +typedef long mp_size_t; +struct __anonstruct___mpq_struct_7 { + __mpz_struct _mp_num ; + __mpz_struct _mp_den ; +}; +typedef struct __anonstruct___mpq_struct_7 __mpq_struct; +typedef __mpz_struct const *mpz_srcptr; +typedef __mpz_struct *mpz_ptr; +typedef __mpq_struct const *mpq_srcptr; +typedef __mpq_struct *mpq_ptr; +/* compiler builtin: + long __builtin_expect(long , long ) ; */ +/*@ assigns \nothing; */ +extern int printf(char const * __restrict __format , ...) ; +__inline static void __gmpz_abs(mpz_ptr __gmp_w , mpz_srcptr __gmp_u ) ; +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x ) ; +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) __attribute__(( +__pure__)) ; +/*@ ensures \valid(\at(z,Old)); + assigns *z; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z , long n ) ; +/*@ ensures \valid(\at(z,Old)); + assigns *z; */ +extern int __gmpz_init_set_str(__mpz_struct * /*[1]*/ z , + char const *str , int base ) ; +__inline static void __gmpz_neg(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) ; +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) __attribute__(( +__pure__)) ; +extern void __gmpz_set(mpz_ptr , mpz_srcptr ) ; +__inline static void __gmpz_set_q(mpz_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +extern void __gmpz_tdiv_q(mpz_ptr , mpz_srcptr , mpz_srcptr ) ; +__inline static void __gmpq_abs(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +__inline static void __gmpq_neg(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +extern void __gmpq_set(mpq_ptr , mpq_srcptr ) ; +__inline static mp_limb_t __gmpn_add(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) ; +__inline static mp_limb_t __gmpn_add_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) ; +extern mp_limb_t __gmpn_add_n(mp_ptr , mp_srcptr , mp_srcptr , mp_size_t ) ; +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpn_neg_n(mp_ptr __gmp_rp , mp_srcptr __gmp_up , + mp_size_t __gmp_n ) ; +extern int __gmpn_perfect_square_p(mp_srcptr , mp_size_t ) __attribute__(( +__pure__)) ; +extern unsigned long __gmpn_popcount(mp_srcptr , mp_size_t ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpn_sub(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) ; +__inline static mp_limb_t __gmpn_sub_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) ; +extern mp_limb_t __gmpn_sub_n(mp_ptr , mp_srcptr , mp_srcptr , mp_size_t ) ; +__inline static void __gmpz_abs(mpz_ptr __gmp_w , mpz_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpz_set(__gmp_w,__gmp_u); } + if (__gmp_w->_mp_size >= 0) { __gmp_w->_mp_size = __gmp_w->_mp_size; } + else { __gmp_w->_mp_size = - __gmp_w->_mp_size; } + return; +} + +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= (mp_limb_t )(~ ((unsigned int )0))) { tmp = 1; } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= ~ ((unsigned long )0)) { tmp = 1; } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= (mp_limb_t )((unsigned short )(~ 0))) { tmp = 1; + } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) +{ + mp_ptr __gmp_p ; + mp_size_t __gmp_n ; + mp_limb_t __gmp_l ; + mp_limb_t tmp ; + __gmp_p = __gmp_z->_mp_d; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_l = *(__gmp_p + 0); + if (__gmp_n != (mp_size_t )0) { tmp = __gmp_l; } + else { tmp = (unsigned long )0; } + return (tmp); +} + +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) +{ + mp_limb_t __gmp_result ; + long tmp_1 ; + int tmp_0 ; + __gmp_result = (mp_limb_t )0; + { /*undefined sequence*/ + if (__gmp_n >= (mp_size_t )0) { + int tmp ; + { /*undefined sequence*/ + if (__gmp_z->_mp_size >= 0) { tmp = __gmp_z->_mp_size; } + else { tmp = - __gmp_z->_mp_size; } + ; + } + if (__gmp_n < (mp_size_t )tmp) { tmp_0 = 1; } + else { tmp_0 = 0; } + } + else { tmp_0 = 0; } + tmp_1 = __builtin_expect((long )(tmp_0 != 0),(long )1); + } + if (tmp_1) { __gmp_result = *(__gmp_z->_mp_d + __gmp_n); } + return (__gmp_result); +} + +/*@ requires \valid(z1); + requires \valid(z2); + assigns *z1; */ +__inline static void __gmpz_neg(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) +{ + if (z1 != z2) { __gmpz_set(z1,z2); } + z1->_mp_size = - z1->_mp_size; + return; +} + +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) +{ + mp_size_t __gmp_asize ; + int __gmp_result ; + long tmp ; + __gmp_asize = (long )__gmp_a->_mp_size; + __gmp_result = __gmp_asize >= (mp_size_t )0; + tmp = __builtin_expect((long )((__gmp_asize > (mp_size_t )0) != 0), + (long )1); + if (tmp) { + __gmp_result = __gmpn_perfect_square_p((mp_limb_t const *)__gmp_a->_mp_d, + __gmp_asize); + } + return (__gmp_result); +} + +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) +{ + mp_size_t __gmp_usize ; + unsigned long __gmp_result ; + long tmp ; + __gmp_usize = (long )__gmp_u->_mp_size; + if (__gmp_usize < (mp_size_t )0) { __gmp_result = ~ ((unsigned long )0); } + else { __gmp_result = (unsigned long )0; } + tmp = __builtin_expect((long )((__gmp_usize > (mp_size_t )0) != 0), + (long )1); + if (tmp) { + __gmp_result = __gmpn_popcount((mp_limb_t const *)__gmp_u->_mp_d, + __gmp_usize); + } + return (__gmp_result); +} + +__inline static void __gmpz_set_q(mpz_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + __gmpz_tdiv_q(__gmp_w,& __gmp_u->_mp_num,& __gmp_u->_mp_den); + return; +} + +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) +{ + size_t __retres ; + int tmp ; + if (__gmp_z->_mp_size >= 0) { tmp = __gmp_z->_mp_size; } + else { tmp = - __gmp_z->_mp_size; } + __retres = (unsigned long )tmp; + return (__retres); +} + +__inline static void __gmpq_abs(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpq_set(__gmp_w,__gmp_u); } + if (__gmp_w->_mp_num._mp_size >= 0) { + __gmp_w->_mp_num._mp_size = __gmp_w->_mp_num._mp_size; + } + else { __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size; } + return; +} + +__inline static void __gmpq_neg(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpq_set(__gmp_w,__gmp_u); } + __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size; + return; +} + +__inline static mp_limb_t __gmpn_add(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; __gmp_i = __gmp_ysize; + if (__gmp_i != (mp_size_t )0) { + mp_limb_t tmp_1 ; + tmp_1 = __gmpn_add_n(__gmp_wp,__gmp_xp,__gmp_yp,__gmp_i); + if (tmp_1) { + while (1) { + mp_size_t tmp ; + mp_limb_t tmp_0 ; + if (__gmp_i >= __gmp_xsize) { + __gmp_c = (unsigned long )1; + goto __gmp_done; + } + __gmp_x = *(__gmp_xp + __gmp_i); + { /*undefined sequence*/ + tmp = __gmp_i; + __gmp_i += (mp_size_t )1; + tmp_0 = (__gmp_x + (mp_limb_t )1) & (~ ((unsigned long )0) >> 0); + *(__gmp_wp + tmp) = tmp_0; + } + if (! (tmp_0 == (mp_limb_t )0)) { break; } + } + } + } + if (__gmp_wp != __gmp_xp) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_xsize) { + *(__gmp_wp + __gmp_j) = *(__gmp_xp + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } __gmp_c = (unsigned long )0; __gmp_done: ; + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_add_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_r ; + __gmp_x = *(__gmp_src + 0); __gmp_r = __gmp_x + __gmp_n; + *(__gmp_dst + 0) = __gmp_r; + if (__gmp_r < __gmp_n) { + __gmp_c = (unsigned long )1; + __gmp_i = (long )1; + while (__gmp_i < __gmp_size) { + __gmp_x = *(__gmp_src + __gmp_i); + __gmp_r = __gmp_x + (mp_limb_t )1; + *(__gmp_dst + __gmp_i) = __gmp_r; + __gmp_i += (mp_size_t )1; + if (! (__gmp_r < (mp_limb_t )1)) { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_size) { + *(__gmp_dst + __gmp_j) = *(__gmp_src + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + break; + } + } + } + else { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j_0 ; __gmp_j_0 = (long )1; + while (__gmp_j_0 < __gmp_size) { + *(__gmp_dst + __gmp_j_0) = *(__gmp_src + __gmp_j_0); + __gmp_j_0 += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + } + } + + break; + } + return (__gmp_c); +} + +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) __attribute__(( +__pure__)) ; +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) +{ + int __gmp_result ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_y ; + __gmp_result = 0; __gmp_i = __gmp_size; + while (1) { + __gmp_i -= (mp_size_t )1; + if (! (__gmp_i >= (mp_size_t )0)) { break; } + __gmp_x = *(__gmp_xp + __gmp_i); + __gmp_y = *(__gmp_yp + __gmp_i); + if (__gmp_x != __gmp_y) { + if (__gmp_x > __gmp_y) { __gmp_result = 1; } + else { __gmp_result = -1; } + break; + } + } + } + + break; + } + return (__gmp_result); +} + +__inline static mp_limb_t __gmpn_sub(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; __gmp_i = __gmp_ysize; + if (__gmp_i != (mp_size_t )0) { + mp_limb_t tmp_0 ; + tmp_0 = __gmpn_sub_n(__gmp_wp,__gmp_xp,__gmp_yp,__gmp_i); + if (tmp_0) { + while (1) { + mp_size_t tmp ; + if (__gmp_i >= __gmp_xsize) { + __gmp_c = (unsigned long )1; + goto __gmp_done; + } + __gmp_x = *(__gmp_xp + __gmp_i); + { /*undefined sequence*/ + tmp = __gmp_i; + __gmp_i += (mp_size_t )1; + *(__gmp_wp + tmp) = (__gmp_x - (mp_limb_t )1) & (~ ((unsigned long )0) >> 0); + } + if (! (__gmp_x == (mp_limb_t )0)) { break; } + } + } + } + if (__gmp_wp != __gmp_xp) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_xsize) { + *(__gmp_wp + __gmp_j) = *(__gmp_xp + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } __gmp_c = (unsigned long )0; __gmp_done: ; + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_sub_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_r ; + __gmp_x = *(__gmp_src + 0); __gmp_r = __gmp_x - __gmp_n; + *(__gmp_dst + 0) = __gmp_r; + if (__gmp_x < __gmp_n) { + __gmp_c = (unsigned long )1; + __gmp_i = (long )1; + while (__gmp_i < __gmp_size) { + __gmp_x = *(__gmp_src + __gmp_i); + __gmp_r = __gmp_x - (mp_limb_t )1; + *(__gmp_dst + __gmp_i) = __gmp_r; + __gmp_i += (mp_size_t )1; + if (! (__gmp_x < (mp_limb_t )1)) { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_size) { + *(__gmp_dst + __gmp_j) = *(__gmp_src + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + break; + } + } + } + else { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j_0 ; __gmp_j_0 = (long )1; + while (__gmp_j_0 < __gmp_size) { + *(__gmp_dst + __gmp_j_0) = *(__gmp_src + __gmp_j_0); + __gmp_j_0 += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + } + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_neg_n(mp_ptr __gmp_rp , mp_srcptr __gmp_up , + mp_size_t __gmp_n ) +{ + mp_limb_t __gmp_ul ; + mp_limb_t __gmp_cy ; + __gmp_cy = (unsigned long )0; + while (1) { + { mp_srcptr tmp ; mp_ptr tmp_0 ; + { /*undefined sequence*/ tmp = __gmp_up; __gmp_up ++; __gmp_ul = *tmp; + } + { /*undefined sequence*/ + tmp_0 = __gmp_rp; + __gmp_rp ++; + *tmp_0 = - __gmp_ul - __gmp_cy; + } __gmp_cy |= (unsigned long )(__gmp_ul != (mp_limb_t )0); + } + + __gmp_n -= (mp_size_t )1; + if (! (__gmp_n != (mp_size_t )0)) { break; } + } + return (__gmp_cy); +} + +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status ) ; +void e_acsl_fail(char *msg ) +{ + printf((char const *)"%s\n",msg); + exit(1); + return; +} + +void main(void) +{ + /*@ assert 0 ≡ 0; */ ; + { mpz_t e_acsl_cst_1 ; mpz_t e_acsl_cst_2 ; int e_acsl_cst_3 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_1),(long )0); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_2),(long )0); + e_acsl_cst_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_1), + (__mpz_struct const *)(e_acsl_cst_2)); + if (e_acsl_cst_3 != 0) { e_acsl_fail((char *)"(0 == 0)"); } + __gmpz_clear((__mpz_struct *)(e_acsl_cst_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_2)); + } + + /*@ assert 0 ≢ 1; */ ; + { mpz_t e_acsl_cst_4 ; mpz_t e_acsl_cst_5 ; int e_acsl_cst_6 ; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_4),(long )0); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_cst_5),(long )1); + e_acsl_cst_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_4), + (__mpz_struct const *)(e_acsl_cst_5)); + if (e_acsl_cst_6 == 0) { e_acsl_fail((char *)"(0 != 1)"); } + __gmpz_clear((__mpz_struct *)(e_acsl_cst_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_5)); + } + + /*@ assert 0xfffffffffffffff ≡ 0xfffffffffffffff; */ ; + { mpz_t e_acsl_cst_7 ; mpz_t e_acsl_cst_8 ; int e_acsl_cst_9 ; + __gmpz_init_set_str((__mpz_struct *)(e_acsl_cst_7),"1152921504606846975", + 10); + __gmpz_init_set_str((__mpz_struct *)(e_acsl_cst_8),"1152921504606846975", + 10); + e_acsl_cst_9 = __gmpz_cmp((__mpz_struct const *)(e_acsl_cst_7), + (__mpz_struct const *)(e_acsl_cst_8)); + if (e_acsl_cst_9 != 0) { + e_acsl_fail((char *)"(0xfffffffffffffff == 0xfffffffffffffff)"); + } __gmpz_clear((__mpz_struct *)(e_acsl_cst_7)); + __gmpz_clear((__mpz_struct *)(e_acsl_cst_8)); + } + + return; +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_not.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_not.c new file mode 100644 index 00000000000..59787cedc1e --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_not.c @@ -0,0 +1,574 @@ +/* Generated by Frama-C */ +typedef unsigned long size_t; +typedef unsigned long mp_limb_t; +struct __anonstruct___mpz_struct_6 { + int _mp_alloc ; + int _mp_size ; + mp_limb_t *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_6 __mpz_struct; +typedef mp_limb_t *mp_ptr; +typedef mp_limb_t const *mp_srcptr; +typedef long mp_size_t; +struct __anonstruct___mpq_struct_7 { + __mpz_struct _mp_num ; + __mpz_struct _mp_den ; +}; +typedef struct __anonstruct___mpq_struct_7 __mpq_struct; +typedef __mpz_struct const *mpz_srcptr; +typedef __mpz_struct *mpz_ptr; +typedef __mpq_struct const *mpq_srcptr; +typedef __mpq_struct *mpq_ptr; +/* compiler builtin: + long __builtin_expect(long , long ) ; */ +/*@ assigns \nothing; */ +extern int printf(char const * __restrict __format , ...) ; +__inline static void __gmpz_abs(mpz_ptr __gmp_w , mpz_srcptr __gmp_u ) ; +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) __attribute__(( +__pure__)) ; +__inline static void __gmpz_neg(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) ; +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) __attribute__(( +__pure__)) ; +extern void __gmpz_set(mpz_ptr , mpz_srcptr ) ; +__inline static void __gmpz_set_q(mpz_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +extern void __gmpz_tdiv_q(mpz_ptr , mpz_srcptr , mpz_srcptr ) ; +__inline static void __gmpq_abs(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +__inline static void __gmpq_neg(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +extern void __gmpq_set(mpq_ptr , mpq_srcptr ) ; +__inline static mp_limb_t __gmpn_add(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) ; +__inline static mp_limb_t __gmpn_add_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) ; +extern mp_limb_t __gmpn_add_n(mp_ptr , mp_srcptr , mp_srcptr , mp_size_t ) ; +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpn_neg_n(mp_ptr __gmp_rp , mp_srcptr __gmp_up , + mp_size_t __gmp_n ) ; +extern int __gmpn_perfect_square_p(mp_srcptr , mp_size_t ) __attribute__(( +__pure__)) ; +extern unsigned long __gmpn_popcount(mp_srcptr , mp_size_t ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpn_sub(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) ; +__inline static mp_limb_t __gmpn_sub_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) ; +extern mp_limb_t __gmpn_sub_n(mp_ptr , mp_srcptr , mp_srcptr , mp_size_t ) ; +__inline static void __gmpz_abs(mpz_ptr __gmp_w , mpz_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpz_set(__gmp_w,__gmp_u); } + if (__gmp_w->_mp_size >= 0) { __gmp_w->_mp_size = __gmp_w->_mp_size; } + else { __gmp_w->_mp_size = - __gmp_w->_mp_size; } + return; +} + +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= (mp_limb_t )(~ ((unsigned int )0))) { tmp = 1; } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= ~ ((unsigned long )0)) { tmp = 1; } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= (mp_limb_t )((unsigned short )(~ 0))) { tmp = 1; + } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) +{ + mp_ptr __gmp_p ; + mp_size_t __gmp_n ; + mp_limb_t __gmp_l ; + mp_limb_t tmp ; + __gmp_p = __gmp_z->_mp_d; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_l = *(__gmp_p + 0); + if (__gmp_n != (mp_size_t )0) { tmp = __gmp_l; } + else { tmp = (unsigned long )0; } + return (tmp); +} + +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) +{ + mp_limb_t __gmp_result ; + long tmp_1 ; + int tmp_0 ; + __gmp_result = (mp_limb_t )0; + { /*undefined sequence*/ + if (__gmp_n >= (mp_size_t )0) { + int tmp ; + { /*undefined sequence*/ + if (__gmp_z->_mp_size >= 0) { tmp = __gmp_z->_mp_size; } + else { tmp = - __gmp_z->_mp_size; } + ; + } + if (__gmp_n < (mp_size_t )tmp) { tmp_0 = 1; } + else { tmp_0 = 0; } + } + else { tmp_0 = 0; } + tmp_1 = __builtin_expect((long )(tmp_0 != 0),(long )1); + } + if (tmp_1) { __gmp_result = *(__gmp_z->_mp_d + __gmp_n); } + return (__gmp_result); +} + +/*@ requires \valid(z1); + requires \valid(z2); + assigns *z1; */ +__inline static void __gmpz_neg(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) +{ + if (z1 != z2) { __gmpz_set(z1,z2); } + z1->_mp_size = - z1->_mp_size; + return; +} + +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) +{ + mp_size_t __gmp_asize ; + int __gmp_result ; + long tmp ; + __gmp_asize = (long )__gmp_a->_mp_size; + __gmp_result = __gmp_asize >= (mp_size_t )0; + tmp = __builtin_expect((long )((__gmp_asize > (mp_size_t )0) != 0), + (long )1); + if (tmp) { + __gmp_result = __gmpn_perfect_square_p((mp_limb_t const *)__gmp_a->_mp_d, + __gmp_asize); + } + return (__gmp_result); +} + +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) +{ + mp_size_t __gmp_usize ; + unsigned long __gmp_result ; + long tmp ; + __gmp_usize = (long )__gmp_u->_mp_size; + if (__gmp_usize < (mp_size_t )0) { __gmp_result = ~ ((unsigned long )0); } + else { __gmp_result = (unsigned long )0; } + tmp = __builtin_expect((long )((__gmp_usize > (mp_size_t )0) != 0), + (long )1); + if (tmp) { + __gmp_result = __gmpn_popcount((mp_limb_t const *)__gmp_u->_mp_d, + __gmp_usize); + } + return (__gmp_result); +} + +__inline static void __gmpz_set_q(mpz_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + __gmpz_tdiv_q(__gmp_w,& __gmp_u->_mp_num,& __gmp_u->_mp_den); + return; +} + +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) +{ + size_t __retres ; + int tmp ; + if (__gmp_z->_mp_size >= 0) { tmp = __gmp_z->_mp_size; } + else { tmp = - __gmp_z->_mp_size; } + __retres = (unsigned long )tmp; + return (__retres); +} + +__inline static void __gmpq_abs(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpq_set(__gmp_w,__gmp_u); } + if (__gmp_w->_mp_num._mp_size >= 0) { + __gmp_w->_mp_num._mp_size = __gmp_w->_mp_num._mp_size; + } + else { __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size; } + return; +} + +__inline static void __gmpq_neg(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpq_set(__gmp_w,__gmp_u); } + __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size; + return; +} + +__inline static mp_limb_t __gmpn_add(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; __gmp_i = __gmp_ysize; + if (__gmp_i != (mp_size_t )0) { + mp_limb_t tmp_1 ; + tmp_1 = __gmpn_add_n(__gmp_wp,__gmp_xp,__gmp_yp,__gmp_i); + if (tmp_1) { + while (1) { + mp_size_t tmp ; + mp_limb_t tmp_0 ; + if (__gmp_i >= __gmp_xsize) { + __gmp_c = (unsigned long )1; + goto __gmp_done; + } + __gmp_x = *(__gmp_xp + __gmp_i); + { /*undefined sequence*/ + tmp = __gmp_i; + __gmp_i += (mp_size_t )1; + tmp_0 = (__gmp_x + (mp_limb_t )1) & (~ ((unsigned long )0) >> 0); + *(__gmp_wp + tmp) = tmp_0; + } + if (! (tmp_0 == (mp_limb_t )0)) { break; } + } + } + } + if (__gmp_wp != __gmp_xp) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_xsize) { + *(__gmp_wp + __gmp_j) = *(__gmp_xp + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } __gmp_c = (unsigned long )0; __gmp_done: ; + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_add_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_r ; + __gmp_x = *(__gmp_src + 0); __gmp_r = __gmp_x + __gmp_n; + *(__gmp_dst + 0) = __gmp_r; + if (__gmp_r < __gmp_n) { + __gmp_c = (unsigned long )1; + __gmp_i = (long )1; + while (__gmp_i < __gmp_size) { + __gmp_x = *(__gmp_src + __gmp_i); + __gmp_r = __gmp_x + (mp_limb_t )1; + *(__gmp_dst + __gmp_i) = __gmp_r; + __gmp_i += (mp_size_t )1; + if (! (__gmp_r < (mp_limb_t )1)) { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_size) { + *(__gmp_dst + __gmp_j) = *(__gmp_src + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + break; + } + } + } + else { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j_0 ; __gmp_j_0 = (long )1; + while (__gmp_j_0 < __gmp_size) { + *(__gmp_dst + __gmp_j_0) = *(__gmp_src + __gmp_j_0); + __gmp_j_0 += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + } + } + + break; + } + return (__gmp_c); +} + +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) __attribute__(( +__pure__)) ; +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) +{ + int __gmp_result ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_y ; + __gmp_result = 0; __gmp_i = __gmp_size; + while (1) { + __gmp_i -= (mp_size_t )1; + if (! (__gmp_i >= (mp_size_t )0)) { break; } + __gmp_x = *(__gmp_xp + __gmp_i); + __gmp_y = *(__gmp_yp + __gmp_i); + if (__gmp_x != __gmp_y) { + if (__gmp_x > __gmp_y) { __gmp_result = 1; } + else { __gmp_result = -1; } + break; + } + } + } + + break; + } + return (__gmp_result); +} + +__inline static mp_limb_t __gmpn_sub(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; __gmp_i = __gmp_ysize; + if (__gmp_i != (mp_size_t )0) { + mp_limb_t tmp_0 ; + tmp_0 = __gmpn_sub_n(__gmp_wp,__gmp_xp,__gmp_yp,__gmp_i); + if (tmp_0) { + while (1) { + mp_size_t tmp ; + if (__gmp_i >= __gmp_xsize) { + __gmp_c = (unsigned long )1; + goto __gmp_done; + } + __gmp_x = *(__gmp_xp + __gmp_i); + { /*undefined sequence*/ + tmp = __gmp_i; + __gmp_i += (mp_size_t )1; + *(__gmp_wp + tmp) = (__gmp_x - (mp_limb_t )1) & (~ ((unsigned long )0) >> 0); + } + if (! (__gmp_x == (mp_limb_t )0)) { break; } + } + } + } + if (__gmp_wp != __gmp_xp) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_xsize) { + *(__gmp_wp + __gmp_j) = *(__gmp_xp + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } __gmp_c = (unsigned long )0; __gmp_done: ; + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_sub_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_r ; + __gmp_x = *(__gmp_src + 0); __gmp_r = __gmp_x - __gmp_n; + *(__gmp_dst + 0) = __gmp_r; + if (__gmp_x < __gmp_n) { + __gmp_c = (unsigned long )1; + __gmp_i = (long )1; + while (__gmp_i < __gmp_size) { + __gmp_x = *(__gmp_src + __gmp_i); + __gmp_r = __gmp_x - (mp_limb_t )1; + *(__gmp_dst + __gmp_i) = __gmp_r; + __gmp_i += (mp_size_t )1; + if (! (__gmp_x < (mp_limb_t )1)) { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_size) { + *(__gmp_dst + __gmp_j) = *(__gmp_src + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + break; + } + } + } + else { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j_0 ; __gmp_j_0 = (long )1; + while (__gmp_j_0 < __gmp_size) { + *(__gmp_dst + __gmp_j_0) = *(__gmp_src + __gmp_j_0); + __gmp_j_0 += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + } + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_neg_n(mp_ptr __gmp_rp , mp_srcptr __gmp_up , + mp_size_t __gmp_n ) +{ + mp_limb_t __gmp_ul ; + mp_limb_t __gmp_cy ; + __gmp_cy = (unsigned long )0; + while (1) { + { mp_srcptr tmp ; mp_ptr tmp_0 ; + { /*undefined sequence*/ tmp = __gmp_up; __gmp_up ++; __gmp_ul = *tmp; + } + { /*undefined sequence*/ + tmp_0 = __gmp_rp; + __gmp_rp ++; + *tmp_0 = - __gmp_ul - __gmp_cy; + } __gmp_cy |= (unsigned long )(__gmp_ul != (mp_limb_t )0); + } + + __gmp_n -= (mp_size_t )1; + if (! (__gmp_n != (mp_size_t )0)) { break; } + } + return (__gmp_cy); +} + +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status ) ; +void e_acsl_fail(char *msg ) +{ + printf((char const *)"%s\n",msg); + exit(1); + return; +} + +void main(void) +{ + int x ; + x = 0; + /*@ assert x ≡ 0; */ ; + if (x != 0) { e_acsl_fail((char *)"(x == 0)"); } + if (x) { + /*@ assert x ≢ 0; */ ; + if (x == 0) { e_acsl_fail((char *)"(x != 0)"); } + } + return; +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_sizeof.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_sizeof.c new file mode 100644 index 00000000000..f8dfb7b844b --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_sizeof.c @@ -0,0 +1,574 @@ +/* Generated by Frama-C */ +typedef unsigned long size_t; +typedef unsigned long mp_limb_t; +struct __anonstruct___mpz_struct_6 { + int _mp_alloc ; + int _mp_size ; + mp_limb_t *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_6 __mpz_struct; +typedef mp_limb_t *mp_ptr; +typedef mp_limb_t const *mp_srcptr; +typedef long mp_size_t; +struct __anonstruct___mpq_struct_7 { + __mpz_struct _mp_num ; + __mpz_struct _mp_den ; +}; +typedef struct __anonstruct___mpq_struct_7 __mpq_struct; +typedef __mpz_struct const *mpz_srcptr; +typedef __mpz_struct *mpz_ptr; +typedef __mpq_struct const *mpq_srcptr; +typedef __mpq_struct *mpq_ptr; +/* compiler builtin: + long __builtin_expect(long , long ) ; */ +/*@ assigns \nothing; */ +extern int printf(char const * __restrict __format , ...) ; +__inline static void __gmpz_abs(mpz_ptr __gmp_w , mpz_srcptr __gmp_u ) ; +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) __attribute__(( +__pure__)) ; +__inline static void __gmpz_neg(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) ; +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) __attribute__(( +__pure__)) ; +extern void __gmpz_set(mpz_ptr , mpz_srcptr ) ; +__inline static void __gmpz_set_q(mpz_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +extern void __gmpz_tdiv_q(mpz_ptr , mpz_srcptr , mpz_srcptr ) ; +__inline static void __gmpq_abs(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +__inline static void __gmpq_neg(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +extern void __gmpq_set(mpq_ptr , mpq_srcptr ) ; +__inline static mp_limb_t __gmpn_add(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) ; +__inline static mp_limb_t __gmpn_add_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) ; +extern mp_limb_t __gmpn_add_n(mp_ptr , mp_srcptr , mp_srcptr , mp_size_t ) ; +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpn_neg_n(mp_ptr __gmp_rp , mp_srcptr __gmp_up , + mp_size_t __gmp_n ) ; +extern int __gmpn_perfect_square_p(mp_srcptr , mp_size_t ) __attribute__(( +__pure__)) ; +extern unsigned long __gmpn_popcount(mp_srcptr , mp_size_t ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpn_sub(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) ; +__inline static mp_limb_t __gmpn_sub_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) ; +extern mp_limb_t __gmpn_sub_n(mp_ptr , mp_srcptr , mp_srcptr , mp_size_t ) ; +__inline static void __gmpz_abs(mpz_ptr __gmp_w , mpz_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpz_set(__gmp_w,__gmp_u); } + if (__gmp_w->_mp_size >= 0) { __gmp_w->_mp_size = __gmp_w->_mp_size; } + else { __gmp_w->_mp_size = - __gmp_w->_mp_size; } + return; +} + +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= (mp_limb_t )(~ ((unsigned int )0))) { tmp = 1; } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= ~ ((unsigned long )0)) { tmp = 1; } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= (mp_limb_t )((unsigned short )(~ 0))) { tmp = 1; + } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) +{ + mp_ptr __gmp_p ; + mp_size_t __gmp_n ; + mp_limb_t __gmp_l ; + mp_limb_t tmp ; + __gmp_p = __gmp_z->_mp_d; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_l = *(__gmp_p + 0); + if (__gmp_n != (mp_size_t )0) { tmp = __gmp_l; } + else { tmp = (unsigned long )0; } + return (tmp); +} + +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) +{ + mp_limb_t __gmp_result ; + long tmp_1 ; + int tmp_0 ; + __gmp_result = (mp_limb_t )0; + { /*undefined sequence*/ + if (__gmp_n >= (mp_size_t )0) { + int tmp ; + { /*undefined sequence*/ + if (__gmp_z->_mp_size >= 0) { tmp = __gmp_z->_mp_size; } + else { tmp = - __gmp_z->_mp_size; } + ; + } + if (__gmp_n < (mp_size_t )tmp) { tmp_0 = 1; } + else { tmp_0 = 0; } + } + else { tmp_0 = 0; } + tmp_1 = __builtin_expect((long )(tmp_0 != 0),(long )1); + } + if (tmp_1) { __gmp_result = *(__gmp_z->_mp_d + __gmp_n); } + return (__gmp_result); +} + +/*@ requires \valid(z1); + requires \valid(z2); + assigns *z1; */ +__inline static void __gmpz_neg(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) +{ + if (z1 != z2) { __gmpz_set(z1,z2); } + z1->_mp_size = - z1->_mp_size; + return; +} + +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) +{ + mp_size_t __gmp_asize ; + int __gmp_result ; + long tmp ; + __gmp_asize = (long )__gmp_a->_mp_size; + __gmp_result = __gmp_asize >= (mp_size_t )0; + tmp = __builtin_expect((long )((__gmp_asize > (mp_size_t )0) != 0), + (long )1); + if (tmp) { + __gmp_result = __gmpn_perfect_square_p((mp_limb_t const *)__gmp_a->_mp_d, + __gmp_asize); + } + return (__gmp_result); +} + +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) +{ + mp_size_t __gmp_usize ; + unsigned long __gmp_result ; + long tmp ; + __gmp_usize = (long )__gmp_u->_mp_size; + if (__gmp_usize < (mp_size_t )0) { __gmp_result = ~ ((unsigned long )0); } + else { __gmp_result = (unsigned long )0; } + tmp = __builtin_expect((long )((__gmp_usize > (mp_size_t )0) != 0), + (long )1); + if (tmp) { + __gmp_result = __gmpn_popcount((mp_limb_t const *)__gmp_u->_mp_d, + __gmp_usize); + } + return (__gmp_result); +} + +__inline static void __gmpz_set_q(mpz_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + __gmpz_tdiv_q(__gmp_w,& __gmp_u->_mp_num,& __gmp_u->_mp_den); + return; +} + +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) +{ + size_t __retres ; + int tmp ; + if (__gmp_z->_mp_size >= 0) { tmp = __gmp_z->_mp_size; } + else { tmp = - __gmp_z->_mp_size; } + __retres = (unsigned long )tmp; + return (__retres); +} + +__inline static void __gmpq_abs(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpq_set(__gmp_w,__gmp_u); } + if (__gmp_w->_mp_num._mp_size >= 0) { + __gmp_w->_mp_num._mp_size = __gmp_w->_mp_num._mp_size; + } + else { __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size; } + return; +} + +__inline static void __gmpq_neg(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpq_set(__gmp_w,__gmp_u); } + __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size; + return; +} + +__inline static mp_limb_t __gmpn_add(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; __gmp_i = __gmp_ysize; + if (__gmp_i != (mp_size_t )0) { + mp_limb_t tmp_1 ; + tmp_1 = __gmpn_add_n(__gmp_wp,__gmp_xp,__gmp_yp,__gmp_i); + if (tmp_1) { + while (1) { + mp_size_t tmp ; + mp_limb_t tmp_0 ; + if (__gmp_i >= __gmp_xsize) { + __gmp_c = (unsigned long )1; + goto __gmp_done; + } + __gmp_x = *(__gmp_xp + __gmp_i); + { /*undefined sequence*/ + tmp = __gmp_i; + __gmp_i += (mp_size_t )1; + tmp_0 = (__gmp_x + (mp_limb_t )1) & (~ ((unsigned long )0) >> 0); + *(__gmp_wp + tmp) = tmp_0; + } + if (! (tmp_0 == (mp_limb_t )0)) { break; } + } + } + } + if (__gmp_wp != __gmp_xp) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_xsize) { + *(__gmp_wp + __gmp_j) = *(__gmp_xp + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } __gmp_c = (unsigned long )0; __gmp_done: ; + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_add_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_r ; + __gmp_x = *(__gmp_src + 0); __gmp_r = __gmp_x + __gmp_n; + *(__gmp_dst + 0) = __gmp_r; + if (__gmp_r < __gmp_n) { + __gmp_c = (unsigned long )1; + __gmp_i = (long )1; + while (__gmp_i < __gmp_size) { + __gmp_x = *(__gmp_src + __gmp_i); + __gmp_r = __gmp_x + (mp_limb_t )1; + *(__gmp_dst + __gmp_i) = __gmp_r; + __gmp_i += (mp_size_t )1; + if (! (__gmp_r < (mp_limb_t )1)) { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_size) { + *(__gmp_dst + __gmp_j) = *(__gmp_src + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + break; + } + } + } + else { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j_0 ; __gmp_j_0 = (long )1; + while (__gmp_j_0 < __gmp_size) { + *(__gmp_dst + __gmp_j_0) = *(__gmp_src + __gmp_j_0); + __gmp_j_0 += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + } + } + + break; + } + return (__gmp_c); +} + +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) __attribute__(( +__pure__)) ; +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) +{ + int __gmp_result ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_y ; + __gmp_result = 0; __gmp_i = __gmp_size; + while (1) { + __gmp_i -= (mp_size_t )1; + if (! (__gmp_i >= (mp_size_t )0)) { break; } + __gmp_x = *(__gmp_xp + __gmp_i); + __gmp_y = *(__gmp_yp + __gmp_i); + if (__gmp_x != __gmp_y) { + if (__gmp_x > __gmp_y) { __gmp_result = 1; } + else { __gmp_result = -1; } + break; + } + } + } + + break; + } + return (__gmp_result); +} + +__inline static mp_limb_t __gmpn_sub(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; __gmp_i = __gmp_ysize; + if (__gmp_i != (mp_size_t )0) { + mp_limb_t tmp_0 ; + tmp_0 = __gmpn_sub_n(__gmp_wp,__gmp_xp,__gmp_yp,__gmp_i); + if (tmp_0) { + while (1) { + mp_size_t tmp ; + if (__gmp_i >= __gmp_xsize) { + __gmp_c = (unsigned long )1; + goto __gmp_done; + } + __gmp_x = *(__gmp_xp + __gmp_i); + { /*undefined sequence*/ + tmp = __gmp_i; + __gmp_i += (mp_size_t )1; + *(__gmp_wp + tmp) = (__gmp_x - (mp_limb_t )1) & (~ ((unsigned long )0) >> 0); + } + if (! (__gmp_x == (mp_limb_t )0)) { break; } + } + } + } + if (__gmp_wp != __gmp_xp) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_xsize) { + *(__gmp_wp + __gmp_j) = *(__gmp_xp + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } __gmp_c = (unsigned long )0; __gmp_done: ; + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_sub_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_r ; + __gmp_x = *(__gmp_src + 0); __gmp_r = __gmp_x - __gmp_n; + *(__gmp_dst + 0) = __gmp_r; + if (__gmp_x < __gmp_n) { + __gmp_c = (unsigned long )1; + __gmp_i = (long )1; + while (__gmp_i < __gmp_size) { + __gmp_x = *(__gmp_src + __gmp_i); + __gmp_r = __gmp_x - (mp_limb_t )1; + *(__gmp_dst + __gmp_i) = __gmp_r; + __gmp_i += (mp_size_t )1; + if (! (__gmp_x < (mp_limb_t )1)) { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_size) { + *(__gmp_dst + __gmp_j) = *(__gmp_src + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + break; + } + } + } + else { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j_0 ; __gmp_j_0 = (long )1; + while (__gmp_j_0 < __gmp_size) { + *(__gmp_dst + __gmp_j_0) = *(__gmp_src + __gmp_j_0); + __gmp_j_0 += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + } + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_neg_n(mp_ptr __gmp_rp , mp_srcptr __gmp_up , + mp_size_t __gmp_n ) +{ + mp_limb_t __gmp_ul ; + mp_limb_t __gmp_cy ; + __gmp_cy = (unsigned long )0; + while (1) { + { mp_srcptr tmp ; mp_ptr tmp_0 ; + { /*undefined sequence*/ tmp = __gmp_up; __gmp_up ++; __gmp_ul = *tmp; + } + { /*undefined sequence*/ + tmp_0 = __gmp_rp; + __gmp_rp ++; + *tmp_0 = - __gmp_ul - __gmp_cy; + } __gmp_cy |= (unsigned long )(__gmp_ul != (mp_limb_t )0); + } + + __gmp_n -= (mp_size_t )1; + if (! (__gmp_n != (mp_size_t )0)) { break; } + } + return (__gmp_cy); +} + +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status ) ; +void e_acsl_fail(char *msg ) +{ + printf((char const *)"%s\n",msg); + exit(1); + return; +} + +void main(void) +{ + int x ; + x = 0; + /*@ assert sizeof(int ) ≡ sizeof(x); */ ; + if (4 != 4) { e_acsl_fail((char *)"(sizeof(int ) == sizeof(x))"); } + /*@ assert sizeof("totototototo") ≡ sizeof(char *); */ ; + if (4 != 4) { + e_acsl_fail((char *)"(sizeof(\"totototototo\") == sizeof(char *))"); + } + return; +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_string_literal.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_string_literal.c new file mode 100644 index 00000000000..89ee2e834c2 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_string_literal.c @@ -0,0 +1,568 @@ +/* Generated by Frama-C */ +typedef unsigned long size_t; +typedef unsigned long mp_limb_t; +struct __anonstruct___mpz_struct_6 { + int _mp_alloc ; + int _mp_size ; + mp_limb_t *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_6 __mpz_struct; +typedef mp_limb_t *mp_ptr; +typedef mp_limb_t const *mp_srcptr; +typedef long mp_size_t; +struct __anonstruct___mpq_struct_7 { + __mpz_struct _mp_num ; + __mpz_struct _mp_den ; +}; +typedef struct __anonstruct___mpq_struct_7 __mpq_struct; +typedef __mpz_struct const *mpz_srcptr; +typedef __mpz_struct *mpz_ptr; +typedef __mpq_struct const *mpq_srcptr; +typedef __mpq_struct *mpq_ptr; +/* compiler builtin: + long __builtin_expect(long , long ) ; */ +/*@ assigns \nothing; */ +extern int printf(char const * __restrict __format , ...) ; +__inline static void __gmpz_abs(mpz_ptr __gmp_w , mpz_srcptr __gmp_u ) ; +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) __attribute__(( +__pure__)) ; +__inline static void __gmpz_neg(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) ; +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) __attribute__(( +__pure__)) ; +extern void __gmpz_set(mpz_ptr , mpz_srcptr ) ; +__inline static void __gmpz_set_q(mpz_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +extern void __gmpz_tdiv_q(mpz_ptr , mpz_srcptr , mpz_srcptr ) ; +__inline static void __gmpq_abs(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +__inline static void __gmpq_neg(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +extern void __gmpq_set(mpq_ptr , mpq_srcptr ) ; +__inline static mp_limb_t __gmpn_add(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) ; +__inline static mp_limb_t __gmpn_add_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) ; +extern mp_limb_t __gmpn_add_n(mp_ptr , mp_srcptr , mp_srcptr , mp_size_t ) ; +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpn_neg_n(mp_ptr __gmp_rp , mp_srcptr __gmp_up , + mp_size_t __gmp_n ) ; +extern int __gmpn_perfect_square_p(mp_srcptr , mp_size_t ) __attribute__(( +__pure__)) ; +extern unsigned long __gmpn_popcount(mp_srcptr , mp_size_t ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpn_sub(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) ; +__inline static mp_limb_t __gmpn_sub_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) ; +extern mp_limb_t __gmpn_sub_n(mp_ptr , mp_srcptr , mp_srcptr , mp_size_t ) ; +__inline static void __gmpz_abs(mpz_ptr __gmp_w , mpz_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpz_set(__gmp_w,__gmp_u); } + if (__gmp_w->_mp_size >= 0) { __gmp_w->_mp_size = __gmp_w->_mp_size; } + else { __gmp_w->_mp_size = - __gmp_w->_mp_size; } + return; +} + +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= (mp_limb_t )(~ ((unsigned int )0))) { tmp = 1; } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= ~ ((unsigned long )0)) { tmp = 1; } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= (mp_limb_t )((unsigned short )(~ 0))) { tmp = 1; + } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) +{ + mp_ptr __gmp_p ; + mp_size_t __gmp_n ; + mp_limb_t __gmp_l ; + mp_limb_t tmp ; + __gmp_p = __gmp_z->_mp_d; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_l = *(__gmp_p + 0); + if (__gmp_n != (mp_size_t )0) { tmp = __gmp_l; } + else { tmp = (unsigned long )0; } + return (tmp); +} + +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) +{ + mp_limb_t __gmp_result ; + long tmp_1 ; + int tmp_0 ; + __gmp_result = (mp_limb_t )0; + { /*undefined sequence*/ + if (__gmp_n >= (mp_size_t )0) { + int tmp ; + { /*undefined sequence*/ + if (__gmp_z->_mp_size >= 0) { tmp = __gmp_z->_mp_size; } + else { tmp = - __gmp_z->_mp_size; } + ; + } + if (__gmp_n < (mp_size_t )tmp) { tmp_0 = 1; } + else { tmp_0 = 0; } + } + else { tmp_0 = 0; } + tmp_1 = __builtin_expect((long )(tmp_0 != 0),(long )1); + } + if (tmp_1) { __gmp_result = *(__gmp_z->_mp_d + __gmp_n); } + return (__gmp_result); +} + +/*@ requires \valid(z1); + requires \valid(z2); + assigns *z1; */ +__inline static void __gmpz_neg(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) +{ + if (z1 != z2) { __gmpz_set(z1,z2); } + z1->_mp_size = - z1->_mp_size; + return; +} + +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) +{ + mp_size_t __gmp_asize ; + int __gmp_result ; + long tmp ; + __gmp_asize = (long )__gmp_a->_mp_size; + __gmp_result = __gmp_asize >= (mp_size_t )0; + tmp = __builtin_expect((long )((__gmp_asize > (mp_size_t )0) != 0), + (long )1); + if (tmp) { + __gmp_result = __gmpn_perfect_square_p((mp_limb_t const *)__gmp_a->_mp_d, + __gmp_asize); + } + return (__gmp_result); +} + +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) +{ + mp_size_t __gmp_usize ; + unsigned long __gmp_result ; + long tmp ; + __gmp_usize = (long )__gmp_u->_mp_size; + if (__gmp_usize < (mp_size_t )0) { __gmp_result = ~ ((unsigned long )0); } + else { __gmp_result = (unsigned long )0; } + tmp = __builtin_expect((long )((__gmp_usize > (mp_size_t )0) != 0), + (long )1); + if (tmp) { + __gmp_result = __gmpn_popcount((mp_limb_t const *)__gmp_u->_mp_d, + __gmp_usize); + } + return (__gmp_result); +} + +__inline static void __gmpz_set_q(mpz_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + __gmpz_tdiv_q(__gmp_w,& __gmp_u->_mp_num,& __gmp_u->_mp_den); + return; +} + +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) +{ + size_t __retres ; + int tmp ; + if (__gmp_z->_mp_size >= 0) { tmp = __gmp_z->_mp_size; } + else { tmp = - __gmp_z->_mp_size; } + __retres = (unsigned long )tmp; + return (__retres); +} + +__inline static void __gmpq_abs(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpq_set(__gmp_w,__gmp_u); } + if (__gmp_w->_mp_num._mp_size >= 0) { + __gmp_w->_mp_num._mp_size = __gmp_w->_mp_num._mp_size; + } + else { __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size; } + return; +} + +__inline static void __gmpq_neg(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpq_set(__gmp_w,__gmp_u); } + __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size; + return; +} + +__inline static mp_limb_t __gmpn_add(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; __gmp_i = __gmp_ysize; + if (__gmp_i != (mp_size_t )0) { + mp_limb_t tmp_1 ; + tmp_1 = __gmpn_add_n(__gmp_wp,__gmp_xp,__gmp_yp,__gmp_i); + if (tmp_1) { + while (1) { + mp_size_t tmp ; + mp_limb_t tmp_0 ; + if (__gmp_i >= __gmp_xsize) { + __gmp_c = (unsigned long )1; + goto __gmp_done; + } + __gmp_x = *(__gmp_xp + __gmp_i); + { /*undefined sequence*/ + tmp = __gmp_i; + __gmp_i += (mp_size_t )1; + tmp_0 = (__gmp_x + (mp_limb_t )1) & (~ ((unsigned long )0) >> 0); + *(__gmp_wp + tmp) = tmp_0; + } + if (! (tmp_0 == (mp_limb_t )0)) { break; } + } + } + } + if (__gmp_wp != __gmp_xp) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_xsize) { + *(__gmp_wp + __gmp_j) = *(__gmp_xp + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } __gmp_c = (unsigned long )0; __gmp_done: ; + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_add_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_r ; + __gmp_x = *(__gmp_src + 0); __gmp_r = __gmp_x + __gmp_n; + *(__gmp_dst + 0) = __gmp_r; + if (__gmp_r < __gmp_n) { + __gmp_c = (unsigned long )1; + __gmp_i = (long )1; + while (__gmp_i < __gmp_size) { + __gmp_x = *(__gmp_src + __gmp_i); + __gmp_r = __gmp_x + (mp_limb_t )1; + *(__gmp_dst + __gmp_i) = __gmp_r; + __gmp_i += (mp_size_t )1; + if (! (__gmp_r < (mp_limb_t )1)) { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_size) { + *(__gmp_dst + __gmp_j) = *(__gmp_src + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + break; + } + } + } + else { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j_0 ; __gmp_j_0 = (long )1; + while (__gmp_j_0 < __gmp_size) { + *(__gmp_dst + __gmp_j_0) = *(__gmp_src + __gmp_j_0); + __gmp_j_0 += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + } + } + + break; + } + return (__gmp_c); +} + +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) __attribute__(( +__pure__)) ; +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) +{ + int __gmp_result ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_y ; + __gmp_result = 0; __gmp_i = __gmp_size; + while (1) { + __gmp_i -= (mp_size_t )1; + if (! (__gmp_i >= (mp_size_t )0)) { break; } + __gmp_x = *(__gmp_xp + __gmp_i); + __gmp_y = *(__gmp_yp + __gmp_i); + if (__gmp_x != __gmp_y) { + if (__gmp_x > __gmp_y) { __gmp_result = 1; } + else { __gmp_result = -1; } + break; + } + } + } + + break; + } + return (__gmp_result); +} + +__inline static mp_limb_t __gmpn_sub(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; __gmp_i = __gmp_ysize; + if (__gmp_i != (mp_size_t )0) { + mp_limb_t tmp_0 ; + tmp_0 = __gmpn_sub_n(__gmp_wp,__gmp_xp,__gmp_yp,__gmp_i); + if (tmp_0) { + while (1) { + mp_size_t tmp ; + if (__gmp_i >= __gmp_xsize) { + __gmp_c = (unsigned long )1; + goto __gmp_done; + } + __gmp_x = *(__gmp_xp + __gmp_i); + { /*undefined sequence*/ + tmp = __gmp_i; + __gmp_i += (mp_size_t )1; + *(__gmp_wp + tmp) = (__gmp_x - (mp_limb_t )1) & (~ ((unsigned long )0) >> 0); + } + if (! (__gmp_x == (mp_limb_t )0)) { break; } + } + } + } + if (__gmp_wp != __gmp_xp) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_xsize) { + *(__gmp_wp + __gmp_j) = *(__gmp_xp + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } __gmp_c = (unsigned long )0; __gmp_done: ; + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_sub_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_r ; + __gmp_x = *(__gmp_src + 0); __gmp_r = __gmp_x - __gmp_n; + *(__gmp_dst + 0) = __gmp_r; + if (__gmp_x < __gmp_n) { + __gmp_c = (unsigned long )1; + __gmp_i = (long )1; + while (__gmp_i < __gmp_size) { + __gmp_x = *(__gmp_src + __gmp_i); + __gmp_r = __gmp_x - (mp_limb_t )1; + *(__gmp_dst + __gmp_i) = __gmp_r; + __gmp_i += (mp_size_t )1; + if (! (__gmp_x < (mp_limb_t )1)) { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_size) { + *(__gmp_dst + __gmp_j) = *(__gmp_src + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + break; + } + } + } + else { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j_0 ; __gmp_j_0 = (long )1; + while (__gmp_j_0 < __gmp_size) { + *(__gmp_dst + __gmp_j_0) = *(__gmp_src + __gmp_j_0); + __gmp_j_0 += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + } + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_neg_n(mp_ptr __gmp_rp , mp_srcptr __gmp_up , + mp_size_t __gmp_n ) +{ + mp_limb_t __gmp_ul ; + mp_limb_t __gmp_cy ; + __gmp_cy = (unsigned long )0; + while (1) { + { mp_srcptr tmp ; mp_ptr tmp_0 ; + { /*undefined sequence*/ tmp = __gmp_up; __gmp_up ++; __gmp_ul = *tmp; + } + { /*undefined sequence*/ + tmp_0 = __gmp_rp; + __gmp_rp ++; + *tmp_0 = - __gmp_ul - __gmp_cy; + } __gmp_cy |= (unsigned long )(__gmp_ul != (mp_limb_t )0); + } + + __gmp_n -= (mp_size_t )1; + if (! (__gmp_n != (mp_size_t )0)) { break; } + } + return (__gmp_cy); +} + +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status ) ; +void e_acsl_fail(char *msg ) +{ + printf((char const *)"%s\n",msg); + exit(1); + return; +} + +void main(void) +{ + /*@ assert "toto" ≢ "titi"; */ ; + if ("toto" == "titi") { e_acsl_fail((char *)"(\"toto\" != \"titi\")"); } + return; +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_true.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_true.c new file mode 100644 index 00000000000..f490f2355b0 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_true.c @@ -0,0 +1,569 @@ +/* Generated by Frama-C */ +typedef unsigned long size_t; +typedef unsigned long mp_limb_t; +struct __anonstruct___mpz_struct_6 { + int _mp_alloc ; + int _mp_size ; + mp_limb_t *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_6 __mpz_struct; +typedef mp_limb_t *mp_ptr; +typedef mp_limb_t const *mp_srcptr; +typedef long mp_size_t; +struct __anonstruct___mpq_struct_7 { + __mpz_struct _mp_num ; + __mpz_struct _mp_den ; +}; +typedef struct __anonstruct___mpq_struct_7 __mpq_struct; +typedef __mpz_struct const *mpz_srcptr; +typedef __mpz_struct *mpz_ptr; +typedef __mpq_struct const *mpq_srcptr; +typedef __mpq_struct *mpq_ptr; +/* compiler builtin: + long __builtin_expect(long , long ) ; */ +/*@ assigns \nothing; */ +extern int printf(char const * __restrict __format , ...) ; +__inline static void __gmpz_abs(mpz_ptr __gmp_w , mpz_srcptr __gmp_u ) ; +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) __attribute__(( +__pure__)) ; +__inline static void __gmpz_neg(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) ; +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) __attribute__(( +__pure__)) ; +extern void __gmpz_set(mpz_ptr , mpz_srcptr ) ; +__inline static void __gmpz_set_q(mpz_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +extern void __gmpz_tdiv_q(mpz_ptr , mpz_srcptr , mpz_srcptr ) ; +__inline static void __gmpq_abs(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +__inline static void __gmpq_neg(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) ; +extern void __gmpq_set(mpq_ptr , mpq_srcptr ) ; +__inline static mp_limb_t __gmpn_add(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) ; +__inline static mp_limb_t __gmpn_add_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) ; +extern mp_limb_t __gmpn_add_n(mp_ptr , mp_srcptr , mp_srcptr , mp_size_t ) ; +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpn_neg_n(mp_ptr __gmp_rp , mp_srcptr __gmp_up , + mp_size_t __gmp_n ) ; +extern int __gmpn_perfect_square_p(mp_srcptr , mp_size_t ) __attribute__(( +__pure__)) ; +extern unsigned long __gmpn_popcount(mp_srcptr , mp_size_t ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpn_sub(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) ; +__inline static mp_limb_t __gmpn_sub_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) ; +extern mp_limb_t __gmpn_sub_n(mp_ptr , mp_srcptr , mp_srcptr , mp_size_t ) ; +__inline static void __gmpz_abs(mpz_ptr __gmp_w , mpz_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpz_set(__gmp_w,__gmp_u); } + if (__gmp_w->_mp_size >= 0) { __gmp_w->_mp_size = __gmp_w->_mp_size; } + else { __gmp_w->_mp_size = - __gmp_w->_mp_size; } + return; +} + +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_uint_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= (mp_limb_t )(~ ((unsigned int )0))) { tmp = 1; } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= ~ ((unsigned long )0)) { tmp = 1; } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z ) +{ + int __retres ; + mp_size_t __gmp_n ; + mp_ptr __gmp_p ; + int tmp ; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_p = __gmp_z->_mp_d; + if (__gmp_n == (mp_size_t )0) { tmp = 1; } + else { + if (__gmp_n == (mp_size_t )1) { + if (*(__gmp_p + 0) <= (mp_limb_t )((unsigned short )(~ 0))) { tmp = 1; + } + else { tmp = 0; } + } + else { tmp = 0; } + } + __retres = tmp; + goto return_label; + return_label: /* internal */ + return (__retres); +} + +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_get_ui(mpz_srcptr __gmp_z ) +{ + mp_ptr __gmp_p ; + mp_size_t __gmp_n ; + mp_limb_t __gmp_l ; + mp_limb_t tmp ; + __gmp_p = __gmp_z->_mp_d; + __gmp_n = (mp_size_t )__gmp_z->_mp_size; + __gmp_l = *(__gmp_p + 0); + if (__gmp_n != (mp_size_t )0) { tmp = __gmp_l; } + else { tmp = (unsigned long )0; } + return (tmp); +} + +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) __attribute__(( +__pure__)) ; +__inline static mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z , + mp_size_t __gmp_n ) +{ + mp_limb_t __gmp_result ; + long tmp_1 ; + int tmp_0 ; + __gmp_result = (mp_limb_t )0; + { /*undefined sequence*/ + if (__gmp_n >= (mp_size_t )0) { + int tmp ; + { /*undefined sequence*/ + if (__gmp_z->_mp_size >= 0) { tmp = __gmp_z->_mp_size; } + else { tmp = - __gmp_z->_mp_size; } + ; + } + if (__gmp_n < (mp_size_t )tmp) { tmp_0 = 1; } + else { tmp_0 = 0; } + } + else { tmp_0 = 0; } + tmp_1 = __builtin_expect((long )(tmp_0 != 0),(long )1); + } + if (tmp_1) { __gmp_result = *(__gmp_z->_mp_d + __gmp_n); } + return (__gmp_result); +} + +/*@ requires \valid(z1); + requires \valid(z2); + assigns *z1; */ +__inline static void __gmpz_neg(__mpz_struct * /*[1]*/ z1 , + __mpz_struct const * /*[1]*/ z2 ) +{ + if (z1 != z2) { __gmpz_set(z1,z2); } + z1->_mp_size = - z1->_mp_size; + return; +} + +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) __attribute__(( +__pure__)) ; +__inline static int __gmpz_perfect_square_p(mpz_srcptr __gmp_a ) +{ + mp_size_t __gmp_asize ; + int __gmp_result ; + long tmp ; + __gmp_asize = (long )__gmp_a->_mp_size; + __gmp_result = __gmp_asize >= (mp_size_t )0; + tmp = __builtin_expect((long )((__gmp_asize > (mp_size_t )0) != 0), + (long )1); + if (tmp) { + __gmp_result = __gmpn_perfect_square_p((mp_limb_t const *)__gmp_a->_mp_d, + __gmp_asize); + } + return (__gmp_result); +} + +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) __attribute__(( +__pure__)) ; +__inline static unsigned long __gmpz_popcount(mpz_srcptr __gmp_u ) +{ + mp_size_t __gmp_usize ; + unsigned long __gmp_result ; + long tmp ; + __gmp_usize = (long )__gmp_u->_mp_size; + if (__gmp_usize < (mp_size_t )0) { __gmp_result = ~ ((unsigned long )0); } + else { __gmp_result = (unsigned long )0; } + tmp = __builtin_expect((long )((__gmp_usize > (mp_size_t )0) != 0), + (long )1); + if (tmp) { + __gmp_result = __gmpn_popcount((mp_limb_t const *)__gmp_u->_mp_d, + __gmp_usize); + } + return (__gmp_result); +} + +__inline static void __gmpz_set_q(mpz_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + __gmpz_tdiv_q(__gmp_w,& __gmp_u->_mp_num,& __gmp_u->_mp_den); + return; +} + +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) __attribute__(( +__pure__)) ; +__inline static size_t __gmpz_size(mpz_srcptr __gmp_z ) +{ + size_t __retres ; + int tmp ; + if (__gmp_z->_mp_size >= 0) { tmp = __gmp_z->_mp_size; } + else { tmp = - __gmp_z->_mp_size; } + __retres = (unsigned long )tmp; + return (__retres); +} + +__inline static void __gmpq_abs(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpq_set(__gmp_w,__gmp_u); } + if (__gmp_w->_mp_num._mp_size >= 0) { + __gmp_w->_mp_num._mp_size = __gmp_w->_mp_num._mp_size; + } + else { __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size; } + return; +} + +__inline static void __gmpq_neg(mpq_ptr __gmp_w , mpq_srcptr __gmp_u ) +{ + if (__gmp_w != __gmp_u) { __gmpq_set(__gmp_w,__gmp_u); } + __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size; + return; +} + +__inline static mp_limb_t __gmpn_add(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; __gmp_i = __gmp_ysize; + if (__gmp_i != (mp_size_t )0) { + mp_limb_t tmp_1 ; + tmp_1 = __gmpn_add_n(__gmp_wp,__gmp_xp,__gmp_yp,__gmp_i); + if (tmp_1) { + while (1) { + mp_size_t tmp ; + mp_limb_t tmp_0 ; + if (__gmp_i >= __gmp_xsize) { + __gmp_c = (unsigned long )1; + goto __gmp_done; + } + __gmp_x = *(__gmp_xp + __gmp_i); + { /*undefined sequence*/ + tmp = __gmp_i; + __gmp_i += (mp_size_t )1; + tmp_0 = (__gmp_x + (mp_limb_t )1) & (~ ((unsigned long )0) >> 0); + *(__gmp_wp + tmp) = tmp_0; + } + if (! (tmp_0 == (mp_limb_t )0)) { break; } + } + } + } + if (__gmp_wp != __gmp_xp) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_xsize) { + *(__gmp_wp + __gmp_j) = *(__gmp_xp + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } __gmp_c = (unsigned long )0; __gmp_done: ; + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_add_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_r ; + __gmp_x = *(__gmp_src + 0); __gmp_r = __gmp_x + __gmp_n; + *(__gmp_dst + 0) = __gmp_r; + if (__gmp_r < __gmp_n) { + __gmp_c = (unsigned long )1; + __gmp_i = (long )1; + while (__gmp_i < __gmp_size) { + __gmp_x = *(__gmp_src + __gmp_i); + __gmp_r = __gmp_x + (mp_limb_t )1; + *(__gmp_dst + __gmp_i) = __gmp_r; + __gmp_i += (mp_size_t )1; + if (! (__gmp_r < (mp_limb_t )1)) { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_size) { + *(__gmp_dst + __gmp_j) = *(__gmp_src + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + break; + } + } + } + else { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j_0 ; __gmp_j_0 = (long )1; + while (__gmp_j_0 < __gmp_size) { + *(__gmp_dst + __gmp_j_0) = *(__gmp_src + __gmp_j_0); + __gmp_j_0 += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + } + } + + break; + } + return (__gmp_c); +} + +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) __attribute__(( +__pure__)) ; +__inline static int __gmpn_cmp(mp_srcptr __gmp_xp , mp_srcptr __gmp_yp , + mp_size_t __gmp_size ) +{ + int __gmp_result ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_y ; + __gmp_result = 0; __gmp_i = __gmp_size; + while (1) { + __gmp_i -= (mp_size_t )1; + if (! (__gmp_i >= (mp_size_t )0)) { break; } + __gmp_x = *(__gmp_xp + __gmp_i); + __gmp_y = *(__gmp_yp + __gmp_i); + if (__gmp_x != __gmp_y) { + if (__gmp_x > __gmp_y) { __gmp_result = 1; } + else { __gmp_result = -1; } + break; + } + } + } + + break; + } + return (__gmp_result); +} + +__inline static mp_limb_t __gmpn_sub(mp_ptr __gmp_wp , mp_srcptr __gmp_xp , + mp_size_t __gmp_xsize , + mp_srcptr __gmp_yp , + mp_size_t __gmp_ysize ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; __gmp_i = __gmp_ysize; + if (__gmp_i != (mp_size_t )0) { + mp_limb_t tmp_0 ; + tmp_0 = __gmpn_sub_n(__gmp_wp,__gmp_xp,__gmp_yp,__gmp_i); + if (tmp_0) { + while (1) { + mp_size_t tmp ; + if (__gmp_i >= __gmp_xsize) { + __gmp_c = (unsigned long )1; + goto __gmp_done; + } + __gmp_x = *(__gmp_xp + __gmp_i); + { /*undefined sequence*/ + tmp = __gmp_i; + __gmp_i += (mp_size_t )1; + *(__gmp_wp + tmp) = (__gmp_x - (mp_limb_t )1) & (~ ((unsigned long )0) >> 0); + } + if (! (__gmp_x == (mp_limb_t )0)) { break; } + } + } + } + if (__gmp_wp != __gmp_xp) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_xsize) { + *(__gmp_wp + __gmp_j) = *(__gmp_xp + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } __gmp_c = (unsigned long )0; __gmp_done: ; + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_sub_1(mp_ptr __gmp_dst , + mp_srcptr __gmp_src , + mp_size_t __gmp_size , + mp_limb_t __gmp_n ) +{ + mp_limb_t __gmp_c ; + while (1) { + { mp_size_t __gmp_i ; mp_limb_t __gmp_x ; mp_limb_t __gmp_r ; + __gmp_x = *(__gmp_src + 0); __gmp_r = __gmp_x - __gmp_n; + *(__gmp_dst + 0) = __gmp_r; + if (__gmp_x < __gmp_n) { + __gmp_c = (unsigned long )1; + __gmp_i = (long )1; + while (__gmp_i < __gmp_size) { + __gmp_x = *(__gmp_src + __gmp_i); + __gmp_r = __gmp_x - (mp_limb_t )1; + *(__gmp_dst + __gmp_i) = __gmp_r; + __gmp_i += (mp_size_t )1; + if (! (__gmp_x < (mp_limb_t )1)) { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j ; __gmp_j = __gmp_i; + while (__gmp_j < __gmp_size) { + *(__gmp_dst + __gmp_j) = *(__gmp_src + __gmp_j); + __gmp_j += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + break; + } + } + } + else { + if (__gmp_src != __gmp_dst) { + while (1) { + { mp_size_t __gmp_j_0 ; __gmp_j_0 = (long )1; + while (__gmp_j_0 < __gmp_size) { + *(__gmp_dst + __gmp_j_0) = *(__gmp_src + __gmp_j_0); + __gmp_j_0 += (mp_size_t )1; + } + } + + break; + } + } + __gmp_c = (unsigned long )0; + } + } + + break; + } + return (__gmp_c); +} + +__inline static mp_limb_t __gmpn_neg_n(mp_ptr __gmp_rp , mp_srcptr __gmp_up , + mp_size_t __gmp_n ) +{ + mp_limb_t __gmp_ul ; + mp_limb_t __gmp_cy ; + __gmp_cy = (unsigned long )0; + while (1) { + { mp_srcptr tmp ; mp_ptr tmp_0 ; + { /*undefined sequence*/ tmp = __gmp_up; __gmp_up ++; __gmp_ul = *tmp; + } + { /*undefined sequence*/ + tmp_0 = __gmp_rp; + __gmp_rp ++; + *tmp_0 = - __gmp_ul - __gmp_cy; + } __gmp_cy |= (unsigned long )(__gmp_ul != (mp_limb_t )0); + } + + __gmp_n -= (mp_size_t )1; + if (! (__gmp_n != (mp_size_t )0)) { break; } + } + return (__gmp_cy); +} + +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status ) ; +void e_acsl_fail(char *msg ) +{ + printf((char const *)"%s\n",msg); + exit(1); + return; +} + +void main(void) +{ + int x ; + x = 0; + /*@ assert \true; */ ; + return; +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/integer_constant.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/integer_constant.res.oracle index 4f64aa11060..504adf43ccc 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/integer_constant.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/integer_constant.res.oracle @@ -2,94 +2,94 @@ [value] Computing initial state [value] Initial state computed [value] Values of globals at initialization -PROJECT_FILE:119:[value] Assertion got status valid. +PROJECT_FILE.i:119:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:121. -PROJECT_FILE:121:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:121. +PROJECT_FILE.i:121:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:121. + Called from PROJECT_FILE.i:121. [value] Done for function mpz_init_set_si [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:122. -PROJECT_FILE:122:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:122. +PROJECT_FILE.i:122:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:123. + Called from PROJECT_FILE.i:123. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. -PROJECT_FILE:115:[value] Function exit: postcondition got status invalid + Called from PROJECT_FILE.i:115. +PROJECT_FILE.i:115:[value] Function exit: postcondition got status invalid [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:124. -PROJECT_FILE:124:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:124. +PROJECT_FILE.i:124:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:124. + Called from PROJECT_FILE.i:124. [value] Done for function mpz_clear -PROJECT_FILE:127:[value] Assertion got status valid. +PROJECT_FILE.i:127:[value] Assertion got status valid. [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:129. -PROJECT_FILE:129:[value] Function mpz_init_set_si: postcondition got status unknown + Called from PROJECT_FILE.i:129. +PROJECT_FILE.i:129:[value] Function mpz_init_set_si: postcondition got status unknown [value] Done for function mpz_init_set_si [value] computing for function mpz_init_set_si <-main. - Called from PROJECT_FILE:129. + Called from PROJECT_FILE.i:129. [value] Done for function mpz_init_set_si [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:130. -PROJECT_FILE:130:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:130. +PROJECT_FILE.i:130:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:131. + Called from PROJECT_FILE.i:131. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:132. -PROJECT_FILE:132:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:132. +PROJECT_FILE.i:132:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:132. + Called from PROJECT_FILE.i:132. [value] Done for function mpz_clear -PROJECT_FILE:135:[value] Assertion got status valid. +PROJECT_FILE.i:135:[value] Assertion got status valid. [value] computing for function mpz_init_set_str <-main. - Called from PROJECT_FILE:137. -PROJECT_FILE:137:[value] Function mpz_init_set_str: postcondition got status unknown + Called from PROJECT_FILE.i:137. +PROJECT_FILE.i:137:[value] Function mpz_init_set_str: postcondition got status unknown [value] Done for function mpz_init_set_str [value] computing for function mpz_init_set_str <-main. - Called from PROJECT_FILE:138. -PROJECT_FILE:138:[value] Function mpz_init_set_str: postcondition got status unknown + Called from PROJECT_FILE.i:138. +PROJECT_FILE.i:138:[value] Function mpz_init_set_str: postcondition got status unknown [value] Done for function mpz_init_set_str [value] computing for function mpz_cmp <-main. - Called from PROJECT_FILE:139. -PROJECT_FILE:139:[value] Function mpz_cmp: precondition got status valid + Called from PROJECT_FILE.i:139. +PROJECT_FILE.i:139:[value] Function mpz_cmp: precondition got status valid [value] Done for function mpz_cmp [value] computing for function e_acsl_fail <-main. - Called from PROJECT_FILE:141. + Called from PROJECT_FILE.i:141. [value] computing for function printf <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function printf [value] computing for function exit <-e_acsl_fail <-main. - Called from PROJECT_FILE:115. + Called from PROJECT_FILE.i:115. [value] Done for function exit [value] Recording results for e_acsl_fail [value] Done for function e_acsl_fail [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:142. -PROJECT_FILE:142:[value] Function mpz_clear: precondition got status valid + Called from PROJECT_FILE.i:142. +PROJECT_FILE.i:142:[value] Function mpz_clear: precondition got status valid [value] Done for function mpz_clear [value] computing for function mpz_clear <-main. - Called from PROJECT_FILE:142. + Called from PROJECT_FILE.i:142. [value] Done for function mpz_clear [value] Recording results for main [value] done for function main @@ -100,9 +100,10 @@ PROJECT_FILE:142:[value] Function mpz_clear: precondition got status valid [from] Computing for function e_acsl_fail [from] Computing for function printf <-e_acsl_fail [from] Done for function printf +PROJECT_FILE.i:115:[from] warning: variadic call detected. Using only 1 argument(s). [from] Computing for function exit <-e_acsl_fail [from] Done for function exit -PROJECT_FILE:115:[from] Non terminating function (no dependencies) +PROJECT_FILE.i:115:[from] Non terminating function (no dependencies) [from] Done for function e_acsl_fail [from] Computing for function mpz_clear [from] Done for function mpz_clear @@ -127,8 +128,8 @@ typedef __mpz_struct mpz_t[1]; extern void mpz_init_set_si(__mpz_struct * /*[1]*/ z , long n ) ; /*@ ensures \valid(\at(z,Old)); assigns *z; */ -extern void mpz_init_set_str(__mpz_struct * /*[1]*/ z , char const *str , - int base ) ; +extern int mpz_init_set_str(__mpz_struct * /*[1]*/ z , char const *str , + int base ) ; /*@ requires \valid(x); assigns *x; */ extern void mpz_clear(__mpz_struct * /*[1]*/ x ) ; @@ -145,7 +146,7 @@ extern void exit(int status ) ; extern int printf(char const * , ...) ; void e_acsl_fail(char *msg ) { - printf((char const *)msg); + printf("%s\n",msg); exit(1); return; } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/not.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/not.res.oracle index 8f9fa71977c..b0051ed27e0 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/not.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/not.res.oracle @@ -2,7 +2,7 @@ [value] Computing initial state [value] Initial state computed [value] Values of globals at initialization -PROJECT_FILE:121:[value] Assertion got status valid. +PROJECT_FILE.i:121:[value] Assertion got status valid. [value] Recording results for main [value] done for function main [dominators] computing for function main @@ -19,7 +19,7 @@ extern void exit(int status ) ; extern int printf(char const * , ...) ; void e_acsl_fail(char *msg ) { - printf((char const *)msg); + printf("%s\n",msg); exit(1); return; } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/sizeof.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/sizeof.res.oracle index 8ae45edcb90..a13fbe47e1c 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/sizeof.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/sizeof.res.oracle @@ -2,8 +2,8 @@ [value] Computing initial state [value] Initial state computed [value] Values of globals at initialization -PROJECT_FILE:121:[value] Assertion got status valid. -PROJECT_FILE:124:[value] Assertion got status valid. +PROJECT_FILE.i:121:[value] Assertion got status valid. +PROJECT_FILE.i:124:[value] Assertion got status valid. [value] Recording results for main [value] done for function main [dominators] computing for function main @@ -20,7 +20,7 @@ extern void exit(int status ) ; extern int printf(char const * , ...) ; void e_acsl_fail(char *msg ) { - printf((char const *)msg); + printf("%s\n",msg); exit(1); return; } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/string_literal.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/string_literal.res.oracle index d37cdba751d..5fb44e544a1 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/string_literal.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/string_literal.res.oracle @@ -2,7 +2,7 @@ [value] Computing initial state [value] Initial state computed [value] Values of globals at initialization -PROJECT_FILE:119:[value] Assertion got status valid. +PROJECT_FILE.i:119:[value] Assertion got status valid. [value] Recording results for main [value] done for function main [dominators] computing for function main @@ -18,7 +18,7 @@ extern void exit(int status ) ; extern int printf(char const * , ...) ; void e_acsl_fail(char *msg ) { - printf((char const *)msg); + printf("%s\n",msg); exit(1); return; } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/true.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/true.res.oracle index 1cb0a34c323..5633bb0393b 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/true.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/true.res.oracle @@ -2,7 +2,7 @@ [value] Computing initial state [value] Initial state computed [value] Values of globals at initialization -PROJECT_FILE:121:[value] Assertion got status valid. +PROJECT_FILE.i:121:[value] Assertion got status valid. [value] Recording results for main [value] done for function main [dominators] computing for function main @@ -19,7 +19,7 @@ extern void exit(int status ) ; extern int printf(char const * , ...) ; void e_acsl_fail(char *msg ) { - printf((char const *)msg); + printf("%s\n",msg); exit(1); return; } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/sizeof.i b/src/plugins/e-acsl/tests/e-acsl-runtime/sizeof.i index 793682aa5d3..aa0c1e7a7e1 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/sizeof.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/sizeof.i @@ -1,5 +1,7 @@ /* run.config - COMMENT: sizeof */ + COMMENT: sizeof + EXECNOW: LOG gen_sizeof.c BIN gen_sizeof.out FRAMAC_SHARE=./share frama-c -load-module E_ACSL ./tests/e-acsl-runtime/sizeof.i -e-acsl-project p -e-acsl-include-headers -then-on p -print -ocode ./tests/e-acsl-runtime/result/gen_sizeof.c > /dev/null && gcc -o ./tests/e-acsl-runtime/result/gen_sizeof.out ./tests/e-acsl-runtime/result/gen_sizeof.c +*/ void main() { int x = 0; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/string_literal.i b/src/plugins/e-acsl/tests/e-acsl-runtime/string_literal.i index 8320e9dc7e0..b99966e26aa 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/string_literal.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/string_literal.i @@ -1,5 +1,7 @@ /* run.config - COMMENT: string literal */ + COMMENT: string literal + EXECNOW: LOG gen_string_literal.c BIN gen_string_literal.out FRAMAC_SHARE=./share frama-c -load-module E_ACSL ./tests/e-acsl-runtime/string_literal.i -e-acsl-project p -e-acsl-include-headers -then-on p -print -ocode ./tests/e-acsl-runtime/result/gen_string_literal.c > /dev/null && gcc -o ./tests/e-acsl-runtime/result/gen_string_literal.out ./tests/e-acsl-runtime/result/gen_string_literal.c +*/ void main() { /*@ assert "toto" != "titi"; */ } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/true.i b/src/plugins/e-acsl/tests/e-acsl-runtime/true.i index 3eb6b45ebe8..46f5aad15b9 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/true.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/true.i @@ -1,5 +1,7 @@ /* run.config - COMMENT: assert \true */ + COMMENT: assert \true + EXECNOW: LOG gen_true.c BIN gen_true.out FRAMAC_SHARE=./share frama-c -load-module E_ACSL ./tests/e-acsl-runtime/true.i -e-acsl-project p -e-acsl-include-headers -then-on p -print -ocode ./tests/e-acsl-runtime/result/gen_true.c > /dev/null && gcc -o ./tests/e-acsl-runtime/result/gen_true.out ./tests/e-acsl-runtime/result/gen_true.c +*/ void main() { int x = 0; /*@ assert \true; */ -- GitLab