From b40943cc6bf2e2724c7873b3cc9435fbb5e7484d Mon Sep 17 00:00:00 2001 From: Zvonimir Date: Wed, 14 Oct 2020 23:08:39 -0600 Subject: [PATCH 01/25] Moved assert macro into its assert header This is a more meaningful and consistent location for it. --- share/smack/include/assert.h | 19 +++++++++++++++++++ share/smack/include/smack.h | 15 --------------- share/smack/lib/pthread.c | 1 + share/smack/lib/smack.c | 2 -- share/smack/svcomp/utils.py | 2 -- test/c/basic/ase_example.c | 1 + test/c/basic/ase_example_fail.c | 1 + test/c/basic/big_numbers.c | 3 ++- test/c/basic/big_numbers_fail.c | 3 ++- test/c/basic/big_types.c | 3 ++- test/c/basic/checking.c | 3 ++- test/c/basic/checking_invert_bpl.c | 3 ++- test/c/basic/checking_invert_out.c | 1 + test/c/basic/extern_func.c | 1 + test/c/basic/extern_mem.c | 3 ++- test/c/basic/gcd.c | 1 + test/c/basic/gcd_fail.c | 1 + test/c/basic/globals.c | 1 + test/c/basic/globals_fail.c | 1 + test/c/basic/init_funcs_example.c | 1 + test/c/basic/init_funcs_example_fail.c | 1 + test/c/basic/init_funcs_global.c | 1 + test/c/basic/init_funcs_global_fail.c | 1 + test/c/basic/jain_1_true.c | 1 + test/c/basic/jain_2_true.c | 1 + test/c/basic/jain_4_true.c | 1 + test/c/basic/jain_5_true.c | 1 + test/c/basic/limits.c | 1 + test/c/basic/limits_fail.c | 1 + test/c/basic/list.c | 1 + test/c/basic/list_fail.c | 1 + test/c/basic/lock.c | 1 + test/c/basic/lock_fail.c | 1 + test/c/basic/loop.c | 1 + test/c/basic/loop1.c | 1 + test/c/basic/loop1_fail.c | 1 + test/c/basic/loop_fail.c | 1 + test/c/basic/malloc_collapsing.c | 1 + test/c/basic/negative_numbers.c | 1 + test/c/basic/negative_numbers_fail.c | 1 + test/c/basic/nondet.c | 1 + test/c/basic/printfs.c | 1 + test/c/basic/return_label.c | 1 + test/c/basic/select.c | 1 + test/c/basic/select_fail.c | 1 + test/c/basic/sext.c | 1 + test/c/basic/sext_fail.c | 1 + test/c/basic/sign_cast.c | 1 + test/c/basic/sign_cast_fail.c | 1 + test/c/basic/simple.c | 1 + test/c/basic/simple_fail.c | 1 + test/c/basic/simple_pre.c | 1 + test/c/basic/simple_pre1.c | 1 + test/c/basic/simple_pre1_fail.c | 1 + test/c/basic/simple_pre2.c | 1 + test/c/basic/simple_pre2_fail.c | 1 + test/c/basic/simple_pre3.c | 1 + test/c/basic/simple_pre3_fail.c | 1 + test/c/basic/simple_pre4.c | 1 + test/c/basic/simple_pre4_fail.c | 1 + test/c/basic/simple_pre_fail.c | 1 + test/c/basic/smack_code_call.c | 1 + test/c/basic/smack_code_call_fail.c | 1 + test/c/basic/split_aggregate_values.c | 1 + test/c/basic/split_aggregate_values_fail.c | 1 + test/c/basic/srem.c | 1 + test/c/basic/srem_fail.c | 1 + test/c/basic/strings.c | 3 ++- test/c/basic/strings1.c | 3 ++- test/c/basic/strings1_fail.c | 3 ++- test/c/basic/strings_fail.c | 3 ++- test/c/basic/test_memcpy.c | 1 + test/c/basic/test_memcpy_fail.c | 1 + test/c/basic/timing-annotations.c | 1 + test/c/basic/transform-bpl.c | 1 + test/c/basic/transform-out.c | 1 + test/c/basic/trunc.c | 1 + test/c/basic/trunc_fail.c | 1 + test/c/basic/uninterpreted.c | 3 ++- test/c/basic/uninterpreted_fail.c | 3 ++- test/c/basic/unsigned_max.c | 1 + test/c/basic/unsigned_max_fail.c | 1 + test/c/basic/unsigned_underflow.c | 3 ++- test/c/basic/unsigned_underflow_fail.c | 3 ++- test/c/basic/urem.c | 1 + test/c/basic/urem_fail.c | 1 + test/c/basic/vararg.c | 1 + test/c/basic/vararg_fail.c | 1 + test/c/basic/zext.c | 1 + test/c/basic/zext_fail.c | 1 + test/c/bits/absolute.c | 1 + test/c/bits/absolute_fail.c | 1 + test/c/bits/bit_field.c | 1 + test/c/bits/bit_field_fail.c | 1 + test/c/bits/bit_fields.c | 1 + test/c/bits/bit_fields_fail.c | 1 + test/c/bits/bitreverse.c | 1 + test/c/bits/bitreverse_fail.c | 1 + test/c/bits/byte_swap.c | 1 + test/c/bits/byte_swap_fail.c | 1 + test/c/bits/countlz.c | 1 + test/c/bits/countlz_fail.c | 1 + test/c/bits/countlz_fail2.c | 1 + test/c/bits/countlz_zero_fail.c | 1 + test/c/bits/countpop32.c | 1 + test/c/bits/countpop32_fail.c | 1 + test/c/bits/counttz.c | 1 + test/c/bits/counttz_fail.c | 1 + test/c/bits/counttz_fail2.c | 1 + test/c/bits/interleave_bits_fail.c | 1 + test/c/bits/interleave_bits_true.c | 1 + test/c/bits/left_shift_negative_fail.c | 1 + test/c/bits/left_shift_overflow.c | 1 + test/c/bits/left_shift_overflow_fail.c | 1 + test/c/bits/left_shift_unsigned.c | 1 + test/c/bits/left_shift_unsigned_fail.c | 1 + test/c/bits/malloc_non_alias.c | 1 + test/c/bits/mm.c | 1 + test/c/bits/mm_fail.c | 1 + test/c/bits/num_conversion_1_fail.c | 1 + test/c/bits/num_conversion_1_true.c | 1 + test/c/bits/num_conversion_2_fail.c | 1 + test/c/bits/num_conversion_2_true.c | 1 + test/c/bits/pack_struct.c | 1 + test/c/bits/pack_struct_fail.c | 1 + test/c/bits/pointers.c | 1 + test/c/bits/pointers1.c | 1 + test/c/bits/pointers1_fail.c | 1 + test/c/bits/pointers4.c | 1 + test/c/bits/pointers4_fail.c | 1 + test/c/bits/pointers6.c | 1 + test/c/bits/pointers7.c | 1 + test/c/bits/pointers7_fail.c | 1 + test/c/bits/pointers_fail.c | 1 + test/c/bits/smack_code_annot.c | 1 + test/c/bits/smack_code_annot_fail.c | 1 + test/c/bits/sync-fetch.c | 1 + test/c/bits/sync-fetch_fail.c | 1 + test/c/bits/test_memset.c | 1 + test/c/bits/test_memset_fail.c | 1 + test/c/bits/unaligned_struct.c | 1 + test/c/bits/unaligned_struct_fail.c | 1 + test/c/contracts/and.c | 4 ++-- test/c/contracts/and_fail.c | 4 ++-- test/c/contracts/array.c | 6 +++--- test/c/contracts/array_fail.c | 6 +++--- test/c/contracts/failing/array_forall.c | 4 ++-- test/c/contracts/failing/array_forall_fail.c | 4 ++-- test/c/contracts/failing/forall.c | 4 ++-- test/c/contracts/failing/forall_fail.c | 4 ++-- test/c/contracts/failing/old.c | 4 ++-- test/c/contracts/failing/old_fail.c | 4 ++-- test/c/contracts/failing/result.c | 4 ++-- test/c/contracts/failing/result_fail.c | 4 ++-- test/c/contracts/invariant.c | 6 +++--- test/c/contracts/invariant_fail.c | 6 +++--- test/c/contracts/requires_const.c | 4 ++-- test/c/contracts/simple.c | 7 ++++--- test/c/contracts/simple_fail.c | 7 ++++--- test/c/data/array.c | 1 + test/c/data/array1.c | 1 + test/c/data/array1_fail.c | 1 + test/c/data/array2.c | 1 + test/c/data/array2_fail.c | 1 + test/c/data/array3.c | 1 + test/c/data/array3_fail.c | 1 + test/c/data/array4.c | 1 + test/c/data/array4_fail.c | 1 + test/c/data/array_free.c | 1 + test/c/data/array_free2.c | 1 + test/c/data/array_free2_fail.c | 1 + test/c/data/array_free_fail.c | 1 + test/c/data/extern_func_ptr.c | 1 + test/c/data/extern_func_ptr_fail.c | 1 + test/c/data/extern_struct.c | 1 + test/c/data/free_as_func_ptr.c | 1 + test/c/data/func_ptr.c | 1 + test/c/data/func_ptr1.c | 1 + test/c/data/func_ptr1_fail.c | 1 + test/c/data/func_ptr2.c | 1 + test/c/data/func_ptr2_fail.c | 1 + test/c/data/func_ptr_alias.c | 1 + test/c/data/func_ptr_alias1.c | 1 + test/c/data/func_ptr_alias1_fail.c | 1 + test/c/data/func_ptr_alias_fail.c | 1 + test/c/data/func_ptr_array.c | 1 + test/c/data/func_ptr_array_fail.c | 1 + test/c/data/func_ptr_fail.c | 1 + test/c/data/func_ptr_vararg.c | 1 + test/c/data/func_ptr_vararg_fail.c | 1 + test/c/data/global_structs.c | 1 + test/c/data/global_structs_fail.c | 1 + test/c/data/globals_func_ptr.c | 1 + test/c/data/globals_func_ptr_fail.c | 1 + test/c/data/nested_struct.c | 1 + test/c/data/nested_struct1.c | 1 + test/c/data/nested_struct1_fail.c | 1 + test/c/data/nested_struct2.c | 1 + test/c/data/nested_struct2_fail.c | 1 + test/c/data/nested_struct_fail.c | 1 + test/c/data/nondet_pointer_fail.c | 1 + test/c/data/pointers.c | 1 + test/c/data/pointers1.c | 1 + test/c/data/pointers1_fail.c | 1 + test/c/data/pointers2.c | 1 + test/c/data/pointers2_fail.c | 1 + test/c/data/pointers3.c | 1 + test/c/data/pointers3_fail.c | 1 + test/c/data/pointers4.c | 1 + test/c/data/pointers4_fail.c | 1 + test/c/data/pointers5.c | 1 + test/c/data/pointers5_fail.c | 1 + test/c/data/pointers8.c | 1 + test/c/data/pointers_fail.c | 1 + test/c/data/struct_alias.c | 3 ++- test/c/data/struct_alias_fail.c | 3 ++- test/c/data/struct_array.c | 1 + test/c/data/struct_array_fail.c | 1 + test/c/data/struct_assign.c | 1 + test/c/data/struct_assign_fail.c | 1 + test/c/data/struct_cast.c | 1 + test/c/data/struct_cast1.c | 1 + test/c/data/struct_cast1_fail.c | 1 + test/c/data/struct_cast_fail.c | 1 + test/c/data/struct_const_return.c | 1 + test/c/data/struct_const_return_fail.c | 1 + test/c/data/struct_init.c | 3 ++- test/c/data/struct_init_fail.c | 3 ++- test/c/data/struct_return.c | 1 + test/c/data/struct_return_o1.c | 1 + test/c/data/struct_return_o1_fail.c | 1 + test/c/data/two_arrays.c | 1 + test/c/data/two_arrays1.c | 1 + test/c/data/two_arrays1_fail.c | 1 + test/c/data/two_arrays2.c | 1 + test/c/data/two_arrays3.c | 1 + test/c/data/two_arrays4.c | 1 + test/c/data/two_arrays5.c | 1 + test/c/data/two_arrays6.c | 1 + test/c/data/two_arrays6_fail.c | 1 + test/c/data/two_arrays_fail.c | 1 + test/c/failing/atomic_cas.c | 1 + test/c/failing/atomic_cas_fail.c | 1 + test/c/failing/exit.c | 6 +++--- test/c/failing/extern_mem2.c | 3 ++- test/c/failing/extern_mem_fail.c | 3 ++- test/c/failing/floppy_false.i.cil.c | 1 + test/c/failing/floppy_true.i.cil.c | 1 + test/c/failing/regression_525_calloc.c | 1 + test/c/failing/struct_by_value.c | 1 + test/c/float/bitcast.c | 1 + test/c/float/bitcast_fail.c | 1 + test/c/float/change_rm.c | 1 + test/c/float/change_rm_fail.c | 1 + test/c/float/double_op_fail.c | 1 + test/c/float/double_ops.c | 1 + test/c/float/double_to_int.c | 1 + test/c/float/double_to_int_fail.c | 1 + test/c/float/float_int_union.c | 1 + test/c/float/float_int_union_fail.c | 1 + test/c/float/float_op_fail.c | 1 + test/c/float/float_ops.c | 1 + test/c/float/float_ops_rm.c | 1 + test/c/float/float_ops_rm_fail.c | 1 + test/c/float/floats_in_memory.c | 3 ++- test/c/float/floats_in_memory_fail.c | 3 ++- test/c/float/floor.c | 1 + test/c/float/floor_fail.c | 1 + test/c/float/get_rm_invalid.c | 1 + test/c/float/get_rm_invalid_fail.c | 1 + test/c/float/half_intrinsics.c | 1 + test/c/float/half_intrinsics_fail.c | 1 + test/c/float/intrinsics.c | 1 + test/c/float/intrinsics_fail.c | 1 + test/c/float/llvm_intrinsic.c | 1 + test/c/float/llvm_intrinsic_fail.c | 1 + test/c/float/set_rm_invalid.c | 1 + test/c/float/set_rm_invalid_fail.c | 1 + test/c/float/simple_double.c | 1 + test/c/float/simple_double_fail.c | 1 + test/c/float/simple_float.c | 1 + test/c/float/simple_float_fail.c | 1 + test/c/float/smack_code_annot.c | 1 + test/c/float/smack_code_annot_fail.c | 1 + test/c/locks/test_locks_10_true.c | 1 + test/c/locks/test_locks_11_true.c | 1 + test/c/locks/test_locks_12_true.c | 1 + test/c/locks/test_locks_13_true.c | 1 + test/c/locks/test_locks_14_false.c | 1 + test/c/locks/test_locks_14_true.c | 1 + test/c/locks/test_locks_15_false.c | 1 + test/c/locks/test_locks_15_true.c | 1 + test/c/locks/test_locks_5_true.c | 1 + test/c/locks/test_locks_6_true.c | 1 + test/c/locks/test_locks_7_true.c | 1 + test/c/locks/test_locks_8_true.c | 1 + test/c/locks/test_locks_9_true.c | 1 + test/c/mathc/ceil.c | 1 + test/c/mathc/ceil_fail.c | 1 + test/c/mathc/ceilf.c | 1 + test/c/mathc/ceilf_fail.c | 1 + test/c/mathc/ceill.c | 1 + test/c/mathc/ceill_fail.c | 1 + test/c/mathc/copysign.c | 1 + test/c/mathc/copysign_fail.c | 1 + test/c/mathc/copysignf.c | 1 + test/c/mathc/copysignf_fail.c | 1 + test/c/mathc/copysignl.c | 1 + test/c/mathc/copysignl_fail.c | 1 + test/c/mathc/fabs.c | 1 + test/c/mathc/fabs_fail.c | 1 + test/c/mathc/fabsf.c | 1 + test/c/mathc/fabsf_fail.c | 1 + test/c/mathc/fabsl.c | 1 + test/c/mathc/fabsl_fail.c | 1 + test/c/mathc/fdim.c | 1 + test/c/mathc/fdim_fail.c | 1 + test/c/mathc/fdimf.c | 1 + test/c/mathc/fdimf_fail.c | 1 + test/c/mathc/fdiml.c | 1 + test/c/mathc/fdiml_fail.c | 1 + test/c/mathc/floor.c | 1 + test/c/mathc/floor_fail.c | 1 + test/c/mathc/floorf.c | 1 + test/c/mathc/floorf_fail.c | 1 + test/c/mathc/floorl.c | 1 + test/c/mathc/floorl_fail.c | 1 + test/c/mathc/fmax.c | 1 + test/c/mathc/fmax_fail.c | 1 + test/c/mathc/fmaxf.c | 1 + test/c/mathc/fmaxf_fail.c | 1 + test/c/mathc/fmaxl.c | 1 + test/c/mathc/fmaxl_fail.c | 1 + test/c/mathc/fmin.c | 1 + test/c/mathc/fmin_fail.c | 1 + test/c/mathc/fminf.c | 1 + test/c/mathc/fminf_fail.c | 1 + test/c/mathc/fminl.c | 1 + test/c/mathc/fminl_fail.c | 1 + test/c/mathc/fmod.c | 1 + test/c/mathc/fmod_fail.c | 1 + test/c/mathc/fmodf.c | 1 + test/c/mathc/fmodf_fail.c | 1 + test/c/mathc/fmodl.c | 1 + test/c/mathc/fmodl_fail.c | 1 + test/c/mathc/issue_244.c | 1 + test/c/mathc/issue_244_fail.c | 1 + test/c/mathc/lrint.c | 1 + test/c/mathc/lrint_fail.c | 1 + test/c/mathc/lrintf.c | 1 + test/c/mathc/lrintf_fail.c | 1 + test/c/mathc/lrintl.c | 1 + test/c/mathc/lrintl_fail.c | 1 + test/c/mathc/lround.c | 1 + test/c/mathc/lround_fail.c | 1 + test/c/mathc/lroundf.c | 1 + test/c/mathc/lroundf_fail.c | 1 + test/c/mathc/lroundl.c | 1 + test/c/mathc/lroundl_fail.c | 1 + test/c/mathc/modf.c | 1 + test/c/mathc/modf_fail.c | 1 + test/c/mathc/modff.c | 1 + test/c/mathc/modff_fail.c | 1 + test/c/mathc/modfl.c | 1 + test/c/mathc/modfl_fail.c | 1 + test/c/mathc/nearbyint.c | 1 + test/c/mathc/nearbyint_fail.c | 1 + test/c/mathc/nearbyintf.c | 1 + test/c/mathc/nearbyintf_fail.c | 1 + test/c/mathc/nearbyintl.c | 1 + test/c/mathc/nearbyintl_fail.c | 1 + test/c/mathc/remainder.c | 1 + test/c/mathc/remainder_fail.c | 1 + test/c/mathc/remainderf.c | 1 + test/c/mathc/remainderf_fail.c | 1 + test/c/mathc/remainderl.c | 1 + test/c/mathc/remainderl_fail.c | 1 + test/c/mathc/rint.c | 1 + test/c/mathc/rint_fail.c | 1 + test/c/mathc/rintf.c | 1 + test/c/mathc/rintf_fail.c | 1 + test/c/mathc/rintl.c | 1 + test/c/mathc/rintl_fail.c | 1 + test/c/mathc/round.c | 1 + test/c/mathc/round_fail.c | 1 + test/c/mathc/roundf.c | 1 + test/c/mathc/roundf_fail.c | 1 + test/c/mathc/roundl.c | 1 + test/c/mathc/roundl_fail.c | 1 + test/c/mathc/sqrt.c | 1 + test/c/mathc/sqrt_fail.c | 1 + test/c/mathc/sqrtf.c | 1 + test/c/mathc/sqrtf_fail.c | 1 + test/c/mathc/sqrtl.c | 1 + test/c/mathc/sqrtl_fail.c | 1 + test/c/mathc/trunc.c | 1 + test/c/mathc/trunc_fail.c | 1 + test/c/mathc/truncf.c | 1 + test/c/mathc/truncf_fail.c | 1 + test/c/mathc/truncl.c | 1 + test/c/mathc/truncl_fail.c | 1 + test/c/memory-safety/calloc.c | 1 + test/c/memory-safety/calloc_fail.c | 1 + test/c/memory-safety/global_alloc.c | 2 +- test/c/memory-safety/global_alloc_fail_free.c | 2 +- test/c/memory-safety/global_and_heap_alloc.c | 2 +- .../global_and_heap_alloc_fail_free.c | 2 +- .../global_and_heap_alloc_fail_no_free.c | 2 +- .../cdaudio_simpl1_false.cil.c | 1 + .../cdaudio_simpl1_true.cil.c | 1 + .../diskperf_simpl1_true.cil.c | 1 + .../floppy_simpl3_false.cil.c | 1 + .../floppy_simpl3_true.cil.c | 1 + .../floppy_simpl4_false.cil.c | 1 + .../floppy_simpl4_true.cil.c | 1 + .../kbfiltr_simpl1_true.cil.c | 1 + .../kbfiltr_simpl2_false.cil.c | 1 + .../kbfiltr_simpl2_true.cil.c | 1 + test/c/ntdrivers/cdaudio_true.i.cil.c | 1 + test/c/ntdrivers/diskperf_false.i.cil.c | 1 + test/c/ntdrivers/diskperf_true.i.cil.c | 1 + test/c/ntdrivers/floppy2_true.i.cil.c | 1 + test/c/ntdrivers/kbfiltr_false.i.cil.c | 1 + test/c/ntdrivers/parport_false.i.cil.c | 1 + test/c/ntdrivers/parport_true.i.cil.c | 1 + test/c/pthread/account.c | 1 + test/c/pthread/account_fail.c | 1 + test/c/pthread/cond.c | 3 ++- test/c/pthread/cond_fail.c | 3 ++- test/c/pthread/equal.c | 3 ++- test/c/pthread/equal2.c | 3 ++- test/c/pthread/join.c | 3 ++- test/c/pthread/join_fail.c | 3 ++- test/c/pthread/join_null_retval.c | 1 + test/c/pthread/join_return.c | 3 ++- test/c/pthread/join_return2.c | 3 ++- test/c/pthread/join_return2_fail.c | 3 ++- test/c/pthread/join_return_fail.c | 3 ++- test/c/pthread/join_self.c | 3 ++- test/c/pthread/join_self_fail.c | 3 ++- test/c/pthread/lock.c | 3 ++- test/c/pthread/lock2.c | 3 ++- test/c/pthread/lock2_fail.c | 3 ++- test/c/pthread/lock3.c | 3 ++- test/c/pthread/lock3_fail.c | 3 ++- test/c/pthread/lock4.c | 3 ++- test/c/pthread/lock4_fail.c | 3 ++- test/c/pthread/lock5.c | 3 ++- test/c/pthread/lock5_fail.c | 3 ++- test/c/pthread/lock_fail.c | 3 ++- test/c/pthread/lockattr.c | 3 ++- test/c/pthread/regression_525_malloc.c | 1 + test/c/pthread/regression_525_malloc_fail.c | 1 + test/c/pthread/regression_525_stackalloc.c | 1 + .../pthread/regression_525_stackalloc_fail.c | 1 + .../pthread_extras/dekker_true-unreach-call.c | 1 + .../lamport_true-unreach-call.c | 1 + .../lazy01_false-unreach-call.c | 1 + .../peterson_true-unreach-call.c | 1 + .../pthread_extras/queue_false-unreach-call.c | 1 + .../queue_ok_true-unreach-call.c | 1 + .../reorder_2_false-unreach-call.c | 1 + .../reorder_5_false-unreach-call.c | 1 + .../pthread_extras/scull_true-unreach-call.c | 1 + .../pthread_extras/sigma_false-unreach-call.c | 1 + .../sigma_false_GREAT-unreach-call.c | 1 + .../singleton_false-unreach-call.c | 1 + .../singleton_with-uninit-problems-true.c | 1 + .../pthread_extras/sssc12_true-unreach-call.c | 1 + .../pthread_extras/stack_false-unreach-call.c | 1 + .../pthread_extras/stack_true-unreach-call.c | 1 + .../stateful01_false-unreach-call.c | 1 + .../stateful01_true-unreach-call.c | 1 + .../pthread_extras/sync01_true-unreach-call.c | 1 + .../szymanski_true-unreach-call.c | 1 + .../time_var_mutex_true-unreach-call.c | 1 + .../twostage_3_false-unreach-call.c | 1 + test/c/simd/add.c | 3 ++- test/c/simd/add_fail.c | 3 ++- test/c/simd/cast.c | 3 ++- test/c/simd/cast_fail.c | 3 ++- test/c/simd/constant.c | 3 ++- test/c/simd/constant_fail.c | 3 ++- test/c/simd/shuffle.c | 3 ++- test/c/simd/shuffle_fail.c | 3 ++- test/c/special/assume.c | 1 + test/c/special/assume2.c | 1 + test/c/special/assume_check.c | 1 + test/c/special/assume_check2.c | 1 + test/c/special/assume_check_fail.c | 1 + test/c/special/assume_fail.c | 1 + test/c/strings/strcat.c | 1 + test/c/strings/strcat_fail.c | 1 + test/c/strings/strcat_overflow.c | 1 + test/c/strings/strchr.c | 1 + test/c/strings/strchr_fail.c | 1 + test/c/strings/strcmp.c | 1 + test/c/strings/strcmp_fail.c | 1 + test/c/strings/strcpy.c | 1 + test/c/strings/strcpy_fail.c | 1 + test/c/strings/strcpy_overflow.c | 1 + test/c/strings/strcspn.c | 1 + test/c/strings/strcspn_fail.c | 1 + test/c/strings/strlen.c | 1 + test/c/strings/strlen_fail.c | 1 + test/c/strings/strncat.c | 1 + test/c/strings/strncat_fail.c | 1 + test/c/strings/strncmp.c | 1 + test/c/strings/strncmp_fail.c | 1 + test/c/strings/strncmp_toolong.c | 1 + test/c/strings/strpbrk.c | 1 + test/c/strings/strpbrk_fail.c | 1 + test/c/strings/strrchr.c | 1 + test/c/strings/strrchr_fail.c | 1 + test/c/strings/strspn.c | 1 + test/c/strings/strspn_fail.c | 1 + test/c/strings/strstr.c | 1 + test/c/strings/strstr_fail.c | 1 + test/c/strings/strtok.c | 1 + test/c/strings/strtok_fail.c | 1 + 520 files changed, 615 insertions(+), 120 deletions(-) create mode 100644 share/smack/include/assert.h diff --git a/share/smack/include/assert.h b/share/smack/include/assert.h new file mode 100644 index 000000000..8499b4997 --- /dev/null +++ b/share/smack/include/assert.h @@ -0,0 +1,19 @@ +// +// This file is distributed under the MIT License. See LICENSE for details. +// +#ifndef ASSERT_H +#define ASSERT_H +#include + +#define assert(EX) \ + do { \ + if (!(EX)) \ + __VERIFIER_assert(0); \ + } while (0) +#define assume(EX) \ + do { \ + if (!(EX)) \ + __VERIFIER_assume(0); \ + } while (0) + +#endif diff --git a/share/smack/include/smack.h b/share/smack/include/smack.h index 19f755c50..bf81f2bd5 100644 --- a/share/smack/include/smack.h +++ b/share/smack/include/smack.h @@ -52,22 +52,7 @@ void __SMACK_check_memory_leak(void); __attribute__((always_inline)) void __SMACK_dummy(int v); void __VERIFIER_assume(int); -#ifndef CUSTOM_VERIFIER_ASSERT void __VERIFIER_assert(int); -#endif - -#ifndef AVOID_NAME_CONFLICTS -#define assert(EX) \ - do { \ - if (!(EX)) \ - __VERIFIER_assert(0); \ - } while (0) -#define assume(EX) \ - do { \ - if (!(EX)) \ - __VERIFIER_assume(0); \ - } while (0) -#endif #define S4(a, b, c, d) a b c d #define S3(a, b, c) a b c diff --git a/share/smack/lib/pthread.c b/share/smack/lib/pthread.c index 6cf987cfd..4c5406dd2 100644 --- a/share/smack/lib/pthread.c +++ b/share/smack/lib/pthread.c @@ -3,6 +3,7 @@ // #include "pthread.h" #include "smack.h" +#include void *__SMACK_PthreadReturn[SMACK_MAX_THREADS]; diff --git a/share/smack/lib/smack.c b/share/smack/lib/smack.c index 61c7651c0..87cdc6745 100644 --- a/share/smack/lib/smack.c +++ b/share/smack/lib/smack.c @@ -38,14 +38,12 @@ void __VERIFIER_assume(int x) { __SMACK_code("assume @ != $0;", x); } -#ifndef CUSTOM_VERIFIER_ASSERT void __VERIFIER_assert(int x) { #if !MEMORY_SAFETY && !SIGNED_INTEGER_OVERFLOW_CHECK __SMACK_dummy(x); __SMACK_code("assert @ != $0;", x); #endif } -#endif void __SMACK_check_overflow(int flag) { __SMACK_dummy(flag); diff --git a/share/smack/svcomp/utils.py b/share/smack/svcomp/utils.py index 968533765..ea991738e 100644 --- a/share/smack/svcomp/utils.py +++ b/share/smack/svcomp/utils.py @@ -55,8 +55,6 @@ def svcomp_frontend(input_file, args): args.clang_options += " -fbracket-depth=2048" args.clang_options += " -Wno-unknown-attributes" args.clang_options += " -DSVCOMP" - args.clang_options += " -DAVOID_NAME_CONFLICTS" - args.clang_options += " -DCUSTOM_VERIFIER_ASSERT" args.clang_options += " -DDISABLE_PTHREAD_ASSERTS" args.clang_options += " -include smack.h" diff --git a/test/c/basic/ase_example.c b/test/c/basic/ase_example.c index 4cc36d802..1a5c58915 100644 --- a/test/c/basic/ase_example.c +++ b/test/c/basic/ase_example.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/ase_example_fail.c b/test/c/basic/ase_example_fail.c index ddb59df68..d3884c94a 100644 --- a/test/c/basic/ase_example_fail.c +++ b/test/c/basic/ase_example_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/big_numbers.c b/test/c/basic/big_numbers.c index 6dde23c64..76c2c6acd 100644 --- a/test/c/basic/big_numbers.c +++ b/test/c/basic/big_numbers.c @@ -1,4 +1,5 @@ -#include +#include "smack.h" +#include // @expect verified diff --git a/test/c/basic/big_numbers_fail.c b/test/c/basic/big_numbers_fail.c index 492b2f70b..f54b08232 100644 --- a/test/c/basic/big_numbers_fail.c +++ b/test/c/basic/big_numbers_fail.c @@ -1,4 +1,5 @@ -#include +#include "smack.h" +#include // @expect error diff --git a/test/c/basic/big_types.c b/test/c/basic/big_types.c index 5ac9de22f..2956d490a 100644 --- a/test/c/basic/big_types.c +++ b/test/c/basic/big_types.c @@ -1,4 +1,5 @@ -#include +#include "smack.h" +#include #include #include diff --git a/test/c/basic/checking.c b/test/c/basic/checking.c index e9e236671..3931ee27f 100644 --- a/test/c/basic/checking.c +++ b/test/c/basic/checking.c @@ -1,10 +1,11 @@ #include "smack.h" +#include #include #include // @expect error // @checkbpl grep "call foo" -// @checkout grep "checking.c(12,3)" +// @checkout grep "checking.c(13,3)" void foo(void) {} diff --git a/test/c/basic/checking_invert_bpl.c b/test/c/basic/checking_invert_bpl.c index 6b75b4f97..ec85c13d2 100644 --- a/test/c/basic/checking_invert_bpl.c +++ b/test/c/basic/checking_invert_bpl.c @@ -1,10 +1,11 @@ #include "smack.h" +#include #include #include // @expect error // @checkbpl grep -v "call bar" -// @checkout grep "checking_invert_bpl.c(12,3)" +// @checkout grep "checking_invert_bpl.c(13,3)" void foo(void) {} diff --git a/test/c/basic/checking_invert_out.c b/test/c/basic/checking_invert_out.c index 15c58389c..6daf4bb00 100644 --- a/test/c/basic/checking_invert_out.c +++ b/test/c/basic/checking_invert_out.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/extern_func.c b/test/c/basic/extern_func.c index c10edf64c..e93f13ccd 100644 --- a/test/c/basic/extern_func.c +++ b/test/c/basic/extern_func.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/basic/extern_mem.c b/test/c/basic/extern_mem.c index 37e633dbf..06772cb2d 100644 --- a/test/c/basic/extern_mem.c +++ b/test/c/basic/extern_mem.c @@ -1,4 +1,5 @@ -#include +#include "smack.h" +#include #include // @expect verified diff --git a/test/c/basic/gcd.c b/test/c/basic/gcd.c index 6d0667f6b..7ba59ad41 100644 --- a/test/c/basic/gcd.c +++ b/test/c/basic/gcd.c @@ -1,5 +1,6 @@ // This test shows why we need parallel assignment when translating Phi nodes #include "smack.h" +#include // @expect verified diff --git a/test/c/basic/gcd_fail.c b/test/c/basic/gcd_fail.c index 0f15144a3..0b65ded9c 100644 --- a/test/c/basic/gcd_fail.c +++ b/test/c/basic/gcd_fail.c @@ -1,5 +1,6 @@ // This test shows why we need parallel assignment when translating Phi nodes #include "smack.h" +#include // @expect error diff --git a/test/c/basic/globals.c b/test/c/basic/globals.c index 3708022cd..a94b7012e 100644 --- a/test/c/basic/globals.c +++ b/test/c/basic/globals.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/basic/globals_fail.c b/test/c/basic/globals_fail.c index 9a36c34b9..eae808e60 100644 --- a/test/c/basic/globals_fail.c +++ b/test/c/basic/globals_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/basic/init_funcs_example.c b/test/c/basic/init_funcs_example.c index 5f33bf559..7da18c924 100644 --- a/test/c/basic/init_funcs_example.c +++ b/test/c/basic/init_funcs_example.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/basic/init_funcs_example_fail.c b/test/c/basic/init_funcs_example_fail.c index 1c7aaaad8..f2621cd98 100644 --- a/test/c/basic/init_funcs_example_fail.c +++ b/test/c/basic/init_funcs_example_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/basic/init_funcs_global.c b/test/c/basic/init_funcs_global.c index cd356b457..5cbdf0c13 100644 --- a/test/c/basic/init_funcs_global.c +++ b/test/c/basic/init_funcs_global.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/basic/init_funcs_global_fail.c b/test/c/basic/init_funcs_global_fail.c index 8b041e267..8c107a2f4 100644 --- a/test/c/basic/init_funcs_global_fail.c +++ b/test/c/basic/init_funcs_global_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/basic/jain_1_true.c b/test/c/basic/jain_1_true.c index 0a35821ae..23f3a1a88 100644 --- a/test/c/basic/jain_1_true.c +++ b/test/c/basic/jain_1_true.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/basic/jain_2_true.c b/test/c/basic/jain_2_true.c index 0df0d16b3..e39afd8ed 100644 --- a/test/c/basic/jain_2_true.c +++ b/test/c/basic/jain_2_true.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/basic/jain_4_true.c b/test/c/basic/jain_4_true.c index b89dac2e7..964deedd1 100644 --- a/test/c/basic/jain_4_true.c +++ b/test/c/basic/jain_4_true.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/basic/jain_5_true.c b/test/c/basic/jain_5_true.c index 020116099..aea08db9d 100644 --- a/test/c/basic/jain_5_true.c +++ b/test/c/basic/jain_5_true.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/basic/limits.c b/test/c/basic/limits.c index ccd12e39e..a534ffbdb 100644 --- a/test/c/basic/limits.c +++ b/test/c/basic/limits.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/basic/limits_fail.c b/test/c/basic/limits_fail.c index 290d27302..8a18ef63f 100644 --- a/test/c/basic/limits_fail.c +++ b/test/c/basic/limits_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/basic/list.c b/test/c/basic/list.c index a23dd14ec..8c7535502 100644 --- a/test/c/basic/list.c +++ b/test/c/basic/list.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @flag --unroll=4 diff --git a/test/c/basic/list_fail.c b/test/c/basic/list_fail.c index 000dd1548..dd5f14454 100644 --- a/test/c/basic/list_fail.c +++ b/test/c/basic/list_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @flag --unroll=4 diff --git a/test/c/basic/lock.c b/test/c/basic/lock.c index eba337142..5e05492b8 100644 --- a/test/c/basic/lock.c +++ b/test/c/basic/lock.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/lock_fail.c b/test/c/basic/lock_fail.c index 9ee483f1a..39fac55ce 100644 --- a/test/c/basic/lock_fail.c +++ b/test/c/basic/lock_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/loop.c b/test/c/basic/loop.c index 3cc7155a3..581a84adb 100644 --- a/test/c/basic/loop.c +++ b/test/c/basic/loop.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/loop1.c b/test/c/basic/loop1.c index 9a77c310e..915244415 100644 --- a/test/c/basic/loop1.c +++ b/test/c/basic/loop1.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/loop1_fail.c b/test/c/basic/loop1_fail.c index ade70f134..ed0533690 100644 --- a/test/c/basic/loop1_fail.c +++ b/test/c/basic/loop1_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/loop_fail.c b/test/c/basic/loop_fail.c index ac62df7e6..4e7e38a09 100644 --- a/test/c/basic/loop_fail.c +++ b/test/c/basic/loop_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/malloc_collapsing.c b/test/c/basic/malloc_collapsing.c index be5ac8729..d8aa45418 100644 --- a/test/c/basic/malloc_collapsing.c +++ b/test/c/basic/malloc_collapsing.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/basic/negative_numbers.c b/test/c/basic/negative_numbers.c index 4837204db..97eacee5c 100644 --- a/test/c/basic/negative_numbers.c +++ b/test/c/basic/negative_numbers.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/basic/negative_numbers_fail.c b/test/c/basic/negative_numbers_fail.c index edd48ed71..9ed79d101 100644 --- a/test/c/basic/negative_numbers_fail.c +++ b/test/c/basic/negative_numbers_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/basic/nondet.c b/test/c/basic/nondet.c index f7547a3cd..e86121bae 100644 --- a/test/c/basic/nondet.c +++ b/test/c/basic/nondet.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/basic/printfs.c b/test/c/basic/printfs.c index e1683ea44..3022a6fa6 100644 --- a/test/c/basic/printfs.c +++ b/test/c/basic/printfs.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/basic/return_label.c b/test/c/basic/return_label.c index a12d08672..79be652a7 100644 --- a/test/c/basic/return_label.c +++ b/test/c/basic/return_label.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/basic/select.c b/test/c/basic/select.c index 439fe3b9f..a28435af5 100644 --- a/test/c/basic/select.c +++ b/test/c/basic/select.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified // @checkbpl grep -E ":= \(if.+then.+else.+\)" diff --git a/test/c/basic/select_fail.c b/test/c/basic/select_fail.c index 61453a8fe..948363136 100644 --- a/test/c/basic/select_fail.c +++ b/test/c/basic/select_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error // @checkbpl grep -E ":= \(if.+then.+else.+\)" diff --git a/test/c/basic/sext.c b/test/c/basic/sext.c index 7da9d3b3f..ad0e00a5c 100644 --- a/test/c/basic/sext.c +++ b/test/c/basic/sext.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/basic/sext_fail.c b/test/c/basic/sext_fail.c index de1f79f8d..afc0ac9e5 100644 --- a/test/c/basic/sext_fail.c +++ b/test/c/basic/sext_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/basic/sign_cast.c b/test/c/basic/sign_cast.c index b4bcc168e..61f4ff4b5 100644 --- a/test/c/basic/sign_cast.c +++ b/test/c/basic/sign_cast.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/basic/sign_cast_fail.c b/test/c/basic/sign_cast_fail.c index bce1a8c40..b64aae4ec 100644 --- a/test/c/basic/sign_cast_fail.c +++ b/test/c/basic/sign_cast_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/basic/simple.c b/test/c/basic/simple.c index 3f1eff03f..1540668ff 100644 --- a/test/c/basic/simple.c +++ b/test/c/basic/simple.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/simple_fail.c b/test/c/basic/simple_fail.c index 7ca0e570f..9f986886d 100644 --- a/test/c/basic/simple_fail.c +++ b/test/c/basic/simple_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/simple_pre.c b/test/c/basic/simple_pre.c index 22ffcc231..b58470d0d 100644 --- a/test/c/basic/simple_pre.c +++ b/test/c/basic/simple_pre.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/simple_pre1.c b/test/c/basic/simple_pre1.c index 1356968c4..00d283f42 100644 --- a/test/c/basic/simple_pre1.c +++ b/test/c/basic/simple_pre1.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/simple_pre1_fail.c b/test/c/basic/simple_pre1_fail.c index 18067a1fa..b536682c1 100644 --- a/test/c/basic/simple_pre1_fail.c +++ b/test/c/basic/simple_pre1_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/simple_pre2.c b/test/c/basic/simple_pre2.c index cf1fa13f7..51da9a28d 100644 --- a/test/c/basic/simple_pre2.c +++ b/test/c/basic/simple_pre2.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/simple_pre2_fail.c b/test/c/basic/simple_pre2_fail.c index aaa56eed2..1a382ecc9 100644 --- a/test/c/basic/simple_pre2_fail.c +++ b/test/c/basic/simple_pre2_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/simple_pre3.c b/test/c/basic/simple_pre3.c index 0cfa734c1..798a622b5 100644 --- a/test/c/basic/simple_pre3.c +++ b/test/c/basic/simple_pre3.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/simple_pre3_fail.c b/test/c/basic/simple_pre3_fail.c index 4627f21e4..42868cd28 100644 --- a/test/c/basic/simple_pre3_fail.c +++ b/test/c/basic/simple_pre3_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/simple_pre4.c b/test/c/basic/simple_pre4.c index 527ecd1f7..807f3e99f 100644 --- a/test/c/basic/simple_pre4.c +++ b/test/c/basic/simple_pre4.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/simple_pre4_fail.c b/test/c/basic/simple_pre4_fail.c index b6da3eb93..286e27a46 100644 --- a/test/c/basic/simple_pre4_fail.c +++ b/test/c/basic/simple_pre4_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/simple_pre_fail.c b/test/c/basic/simple_pre_fail.c index c29563d7b..6d6f02bb6 100644 --- a/test/c/basic/simple_pre_fail.c +++ b/test/c/basic/simple_pre_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/smack_code_call.c b/test/c/basic/smack_code_call.c index 891ded045..28b6fd4af 100644 --- a/test/c/basic/smack_code_call.c +++ b/test/c/basic/smack_code_call.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/basic/smack_code_call_fail.c b/test/c/basic/smack_code_call_fail.c index d4c266e9a..4fc33ab69 100644 --- a/test/c/basic/smack_code_call_fail.c +++ b/test/c/basic/smack_code_call_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/basic/split_aggregate_values.c b/test/c/basic/split_aggregate_values.c index ae935312f..d1c2cdd5e 100644 --- a/test/c/basic/split_aggregate_values.c +++ b/test/c/basic/split_aggregate_values.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/basic/split_aggregate_values_fail.c b/test/c/basic/split_aggregate_values_fail.c index 9f18d511f..91c04e479 100644 --- a/test/c/basic/split_aggregate_values_fail.c +++ b/test/c/basic/split_aggregate_values_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/basic/srem.c b/test/c/basic/srem.c index 355c9baa3..83c33698d 100644 --- a/test/c/basic/srem.c +++ b/test/c/basic/srem.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified // @checkbpl grep ':= \$srem' diff --git a/test/c/basic/srem_fail.c b/test/c/basic/srem_fail.c index a6b160f97..a89f8e72d 100644 --- a/test/c/basic/srem_fail.c +++ b/test/c/basic/srem_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error // @checkbpl grep ':= \$srem' diff --git a/test/c/basic/strings.c b/test/c/basic/strings.c index e8dd3a792..d9b17170a 100644 --- a/test/c/basic/strings.c +++ b/test/c/basic/strings.c @@ -1,4 +1,5 @@ -#include +#include "smack.h" +#include // @expect verified diff --git a/test/c/basic/strings1.c b/test/c/basic/strings1.c index b5a5205eb..76ec18887 100644 --- a/test/c/basic/strings1.c +++ b/test/c/basic/strings1.c @@ -1,4 +1,5 @@ -#include +#include "smack.h" +#include // @expect verified diff --git a/test/c/basic/strings1_fail.c b/test/c/basic/strings1_fail.c index 966720a2e..c8c74e771 100644 --- a/test/c/basic/strings1_fail.c +++ b/test/c/basic/strings1_fail.c @@ -1,4 +1,5 @@ -#include +#include "smack.h" +#include // @expect error diff --git a/test/c/basic/strings_fail.c b/test/c/basic/strings_fail.c index cbd3e8ecb..20011a4b8 100644 --- a/test/c/basic/strings_fail.c +++ b/test/c/basic/strings_fail.c @@ -1,4 +1,5 @@ -#include +#include "smack.h" +#include // @expect error diff --git a/test/c/basic/test_memcpy.c b/test/c/basic/test_memcpy.c index e59bbf6ab..79a5022ef 100644 --- a/test/c/basic/test_memcpy.c +++ b/test/c/basic/test_memcpy.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/basic/test_memcpy_fail.c b/test/c/basic/test_memcpy_fail.c index b17269bff..81a40139b 100644 --- a/test/c/basic/test_memcpy_fail.c +++ b/test/c/basic/test_memcpy_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/basic/timing-annotations.c b/test/c/basic/timing-annotations.c index 6b3f50104..ef1e33583 100644 --- a/test/c/basic/timing-annotations.c +++ b/test/c/basic/timing-annotations.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/transform-bpl.c b/test/c/basic/transform-bpl.c index 18e2d146b..ccb5ac1d3 100644 --- a/test/c/basic/transform-bpl.c +++ b/test/c/basic/transform-bpl.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/transform-out.c b/test/c/basic/transform-out.c index dad17ff34..48b87320e 100644 --- a/test/c/basic/transform-out.c +++ b/test/c/basic/transform-out.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/trunc.c b/test/c/basic/trunc.c index fe625e15c..74d3a7480 100644 --- a/test/c/basic/trunc.c +++ b/test/c/basic/trunc.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/basic/trunc_fail.c b/test/c/basic/trunc_fail.c index 8e48f3fe9..f22b96cb3 100644 --- a/test/c/basic/trunc_fail.c +++ b/test/c/basic/trunc_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/basic/uninterpreted.c b/test/c/basic/uninterpreted.c index 5689f8fa0..c5082adc7 100644 --- a/test/c/basic/uninterpreted.c +++ b/test/c/basic/uninterpreted.c @@ -1,4 +1,5 @@ -#include +#include "smack.h" +#include // @expect verified diff --git a/test/c/basic/uninterpreted_fail.c b/test/c/basic/uninterpreted_fail.c index 4af2c8cd0..9332bbb58 100644 --- a/test/c/basic/uninterpreted_fail.c +++ b/test/c/basic/uninterpreted_fail.c @@ -1,4 +1,5 @@ -#include +#include "smack.h" +#include // @expect error diff --git a/test/c/basic/unsigned_max.c b/test/c/basic/unsigned_max.c index 819b31cd3..37facf32e 100644 --- a/test/c/basic/unsigned_max.c +++ b/test/c/basic/unsigned_max.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/basic/unsigned_max_fail.c b/test/c/basic/unsigned_max_fail.c index 229f99efd..fd8322d14 100644 --- a/test/c/basic/unsigned_max_fail.c +++ b/test/c/basic/unsigned_max_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/basic/unsigned_underflow.c b/test/c/basic/unsigned_underflow.c index d28b1cd83..c5ed4b200 100644 --- a/test/c/basic/unsigned_underflow.c +++ b/test/c/basic/unsigned_underflow.c @@ -1,4 +1,5 @@ -#include +#include "smack.h" +#include // @expect verified // @flag --integer-encoding=wrapped-integer diff --git a/test/c/basic/unsigned_underflow_fail.c b/test/c/basic/unsigned_underflow_fail.c index 360208df4..f62a1c643 100644 --- a/test/c/basic/unsigned_underflow_fail.c +++ b/test/c/basic/unsigned_underflow_fail.c @@ -1,4 +1,5 @@ -#include +#include "smack.h" +#include // @expect error // @flag --integer-encoding=wrapped-integer diff --git a/test/c/basic/urem.c b/test/c/basic/urem.c index 74e6256ed..8ea3ea273 100644 --- a/test/c/basic/urem.c +++ b/test/c/basic/urem.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified // @checkbpl grep ':= \$urem' diff --git a/test/c/basic/urem_fail.c b/test/c/basic/urem_fail.c index dd802a908..c781a6fe9 100644 --- a/test/c/basic/urem_fail.c +++ b/test/c/basic/urem_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error // @checkbpl grep ':= \$urem' diff --git a/test/c/basic/vararg.c b/test/c/basic/vararg.c index 88288889f..9480c3deb 100644 --- a/test/c/basic/vararg.c +++ b/test/c/basic/vararg.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/vararg_fail.c b/test/c/basic/vararg_fail.c index e476c156c..8548621d1 100644 --- a/test/c/basic/vararg_fail.c +++ b/test/c/basic/vararg_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/basic/zext.c b/test/c/basic/zext.c index ee8045637..47eaea963 100644 --- a/test/c/basic/zext.c +++ b/test/c/basic/zext.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/basic/zext_fail.c b/test/c/basic/zext_fail.c index c99980b55..b372edcb8 100644 --- a/test/c/basic/zext_fail.c +++ b/test/c/basic/zext_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/bits/absolute.c b/test/c/bits/absolute.c index b78086153..7e6612a6b 100644 --- a/test/c/bits/absolute.c +++ b/test/c/bits/absolute.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/bits/absolute_fail.c b/test/c/bits/absolute_fail.c index 28791d42d..d60ebc45d 100644 --- a/test/c/bits/absolute_fail.c +++ b/test/c/bits/absolute_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/bits/bit_field.c b/test/c/bits/bit_field.c index 964e4e209..f92f5e133 100644 --- a/test/c/bits/bit_field.c +++ b/test/c/bits/bit_field.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/bits/bit_field_fail.c b/test/c/bits/bit_field_fail.c index b2040a3ef..71026cf87 100644 --- a/test/c/bits/bit_field_fail.c +++ b/test/c/bits/bit_field_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/bits/bit_fields.c b/test/c/bits/bit_fields.c index 34f4488e4..58e7b3239 100644 --- a/test/c/bits/bit_fields.c +++ b/test/c/bits/bit_fields.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/bits/bit_fields_fail.c b/test/c/bits/bit_fields_fail.c index 16d3cc3e2..0abd6771a 100644 --- a/test/c/bits/bit_fields_fail.c +++ b/test/c/bits/bit_fields_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/bits/bitreverse.c b/test/c/bits/bitreverse.c index 9b425bd7c..9bf95e3ea 100644 --- a/test/c/bits/bitreverse.c +++ b/test/c/bits/bitreverse.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/bits/bitreverse_fail.c b/test/c/bits/bitreverse_fail.c index ac49d4766..d4b163554 100644 --- a/test/c/bits/bitreverse_fail.c +++ b/test/c/bits/bitreverse_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/bits/byte_swap.c b/test/c/bits/byte_swap.c index c1268c0d9..729bed840 100644 --- a/test/c/bits/byte_swap.c +++ b/test/c/bits/byte_swap.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/bits/byte_swap_fail.c b/test/c/bits/byte_swap_fail.c index d38969a20..d3b864dd6 100644 --- a/test/c/bits/byte_swap_fail.c +++ b/test/c/bits/byte_swap_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/bits/countlz.c b/test/c/bits/countlz.c index bc992c8f6..c66e76d37 100644 --- a/test/c/bits/countlz.c +++ b/test/c/bits/countlz.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/bits/countlz_fail.c b/test/c/bits/countlz_fail.c index 5b894115b..ee746ed71 100644 --- a/test/c/bits/countlz_fail.c +++ b/test/c/bits/countlz_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/bits/countlz_fail2.c b/test/c/bits/countlz_fail2.c index 1cd4bcf3c..dcd1ed017 100644 --- a/test/c/bits/countlz_fail2.c +++ b/test/c/bits/countlz_fail2.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/bits/countlz_zero_fail.c b/test/c/bits/countlz_zero_fail.c index c2aa36422..8def31509 100644 --- a/test/c/bits/countlz_zero_fail.c +++ b/test/c/bits/countlz_zero_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/bits/countpop32.c b/test/c/bits/countpop32.c index f150ae6e0..4814924a7 100644 --- a/test/c/bits/countpop32.c +++ b/test/c/bits/countpop32.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/bits/countpop32_fail.c b/test/c/bits/countpop32_fail.c index db823f566..ca349c209 100644 --- a/test/c/bits/countpop32_fail.c +++ b/test/c/bits/countpop32_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/bits/counttz.c b/test/c/bits/counttz.c index 69a31bb97..149b4d53e 100644 --- a/test/c/bits/counttz.c +++ b/test/c/bits/counttz.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/bits/counttz_fail.c b/test/c/bits/counttz_fail.c index 478e88afe..2e22b081a 100644 --- a/test/c/bits/counttz_fail.c +++ b/test/c/bits/counttz_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/bits/counttz_fail2.c b/test/c/bits/counttz_fail2.c index 974fe4574..97e9311ec 100644 --- a/test/c/bits/counttz_fail2.c +++ b/test/c/bits/counttz_fail2.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/bits/interleave_bits_fail.c b/test/c/bits/interleave_bits_fail.c index 6aaf2958a..66f4edc23 100644 --- a/test/c/bits/interleave_bits_fail.c +++ b/test/c/bits/interleave_bits_fail.c @@ -1,6 +1,7 @@ /* https://graphics.stanford.edu/~seander/bithacks.html#InterleaveTableObvious */ #include "smack.h" +#include // @flag --loop-limit=17 // @flag --unroll=17 diff --git a/test/c/bits/interleave_bits_true.c b/test/c/bits/interleave_bits_true.c index 43ab27f44..999efd5b9 100644 --- a/test/c/bits/interleave_bits_true.c +++ b/test/c/bits/interleave_bits_true.c @@ -1,6 +1,7 @@ /* https://graphics.stanford.edu/~seander/bithacks.html#InterleaveTableObvious */ #include "smack.h" +#include // @flag --loop-limit=17 // @flag --unroll=17 diff --git a/test/c/bits/left_shift_negative_fail.c b/test/c/bits/left_shift_negative_fail.c index 9095bcefb..47c59164b 100644 --- a/test/c/bits/left_shift_negative_fail.c +++ b/test/c/bits/left_shift_negative_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error // @flag --check=integer-overflow diff --git a/test/c/bits/left_shift_overflow.c b/test/c/bits/left_shift_overflow.c index b8b9bbd77..3bf80388b 100644 --- a/test/c/bits/left_shift_overflow.c +++ b/test/c/bits/left_shift_overflow.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified // @flag --check=integer-overflow diff --git a/test/c/bits/left_shift_overflow_fail.c b/test/c/bits/left_shift_overflow_fail.c index ee43fb381..bca39ab38 100644 --- a/test/c/bits/left_shift_overflow_fail.c +++ b/test/c/bits/left_shift_overflow_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error // @flag --check=integer-overflow diff --git a/test/c/bits/left_shift_unsigned.c b/test/c/bits/left_shift_unsigned.c index a7ead0a89..8175aece6 100644 --- a/test/c/bits/left_shift_unsigned.c +++ b/test/c/bits/left_shift_unsigned.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified // @flag --check=integer-overflow diff --git a/test/c/bits/left_shift_unsigned_fail.c b/test/c/bits/left_shift_unsigned_fail.c index 54f6d78e1..e4f036aae 100644 --- a/test/c/bits/left_shift_unsigned_fail.c +++ b/test/c/bits/left_shift_unsigned_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error // @flag --check=integer-overflow diff --git a/test/c/bits/malloc_non_alias.c b/test/c/bits/malloc_non_alias.c index f14d2289c..0c4aa3fda 100644 --- a/test/c/bits/malloc_non_alias.c +++ b/test/c/bits/malloc_non_alias.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @flag --pointer-encoding=bit-vector diff --git a/test/c/bits/mm.c b/test/c/bits/mm.c index e1a653186..0333279cd 100644 --- a/test/c/bits/mm.c +++ b/test/c/bits/mm.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/bits/mm_fail.c b/test/c/bits/mm_fail.c index 6c98a4470..11d1d637c 100644 --- a/test/c/bits/mm_fail.c +++ b/test/c/bits/mm_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/bits/num_conversion_1_fail.c b/test/c/bits/num_conversion_1_fail.c index d791e6859..e27aed28f 100644 --- a/test/c/bits/num_conversion_1_fail.c +++ b/test/c/bits/num_conversion_1_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @flag --loop-limit=11 // @flag --unroll=11 diff --git a/test/c/bits/num_conversion_1_true.c b/test/c/bits/num_conversion_1_true.c index 15ac747e4..f0f56c497 100644 --- a/test/c/bits/num_conversion_1_true.c +++ b/test/c/bits/num_conversion_1_true.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @flag --loop-limit=11 // @flag --unroll=11 diff --git a/test/c/bits/num_conversion_2_fail.c b/test/c/bits/num_conversion_2_fail.c index c8c9cdd9c..64f1c0b16 100644 --- a/test/c/bits/num_conversion_2_fail.c +++ b/test/c/bits/num_conversion_2_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @flag --loop-limit=11 // @flag --unroll=11 diff --git a/test/c/bits/num_conversion_2_true.c b/test/c/bits/num_conversion_2_true.c index ee83c4d98..f2a95ec6d 100644 --- a/test/c/bits/num_conversion_2_true.c +++ b/test/c/bits/num_conversion_2_true.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @flag --loop-limit=11 // @flag --unroll=11 diff --git a/test/c/bits/pack_struct.c b/test/c/bits/pack_struct.c index 6372d9c9a..bd66cbbed 100644 --- a/test/c/bits/pack_struct.c +++ b/test/c/bits/pack_struct.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/bits/pack_struct_fail.c b/test/c/bits/pack_struct_fail.c index d52627740..54e4c707d 100644 --- a/test/c/bits/pack_struct_fail.c +++ b/test/c/bits/pack_struct_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/bits/pointers.c b/test/c/bits/pointers.c index eaaf4c2ee..8e4b02ebd 100644 --- a/test/c/bits/pointers.c +++ b/test/c/bits/pointers.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/bits/pointers1.c b/test/c/bits/pointers1.c index b90e08024..0f4ac9854 100644 --- a/test/c/bits/pointers1.c +++ b/test/c/bits/pointers1.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/bits/pointers1_fail.c b/test/c/bits/pointers1_fail.c index c103ca865..dac745b18 100644 --- a/test/c/bits/pointers1_fail.c +++ b/test/c/bits/pointers1_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/bits/pointers4.c b/test/c/bits/pointers4.c index a605c8113..7697bcb76 100644 --- a/test/c/bits/pointers4.c +++ b/test/c/bits/pointers4.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/bits/pointers4_fail.c b/test/c/bits/pointers4_fail.c index 57fed0b51..80b1f2bf7 100644 --- a/test/c/bits/pointers4_fail.c +++ b/test/c/bits/pointers4_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/bits/pointers6.c b/test/c/bits/pointers6.c index 112946a9b..d71adb6b3 100644 --- a/test/c/bits/pointers6.c +++ b/test/c/bits/pointers6.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/bits/pointers7.c b/test/c/bits/pointers7.c index 5967f4308..f3855853f 100644 --- a/test/c/bits/pointers7.c +++ b/test/c/bits/pointers7.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/bits/pointers7_fail.c b/test/c/bits/pointers7_fail.c index 929561af4..d9ae25dfd 100644 --- a/test/c/bits/pointers7_fail.c +++ b/test/c/bits/pointers7_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/bits/pointers_fail.c b/test/c/bits/pointers_fail.c index a6eea69b1..29a70b705 100644 --- a/test/c/bits/pointers_fail.c +++ b/test/c/bits/pointers_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/bits/smack_code_annot.c b/test/c/bits/smack_code_annot.c index 043c9734a..1d9bd2c8b 100644 --- a/test/c/bits/smack_code_annot.c +++ b/test/c/bits/smack_code_annot.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/bits/smack_code_annot_fail.c b/test/c/bits/smack_code_annot_fail.c index ec4bbf232..b1cd8bc93 100644 --- a/test/c/bits/smack_code_annot_fail.c +++ b/test/c/bits/smack_code_annot_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/bits/sync-fetch.c b/test/c/bits/sync-fetch.c index 822befad9..e43de02c0 100644 --- a/test/c/bits/sync-fetch.c +++ b/test/c/bits/sync-fetch.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/bits/sync-fetch_fail.c b/test/c/bits/sync-fetch_fail.c index 1df3ad022..f4b224254 100644 --- a/test/c/bits/sync-fetch_fail.c +++ b/test/c/bits/sync-fetch_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/bits/test_memset.c b/test/c/bits/test_memset.c index e5ff2b137..a7b4b41e6 100644 --- a/test/c/bits/test_memset.c +++ b/test/c/bits/test_memset.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/bits/test_memset_fail.c b/test/c/bits/test_memset_fail.c index 6e1770f82..52d8bd4c3 100644 --- a/test/c/bits/test_memset_fail.c +++ b/test/c/bits/test_memset_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/bits/unaligned_struct.c b/test/c/bits/unaligned_struct.c index 72775349e..9467868bd 100644 --- a/test/c/bits/unaligned_struct.c +++ b/test/c/bits/unaligned_struct.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/bits/unaligned_struct_fail.c b/test/c/bits/unaligned_struct_fail.c index 7991de6d8..2ec65d956 100644 --- a/test/c/bits/unaligned_struct_fail.c +++ b/test/c/bits/unaligned_struct_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/contracts/and.c b/test/c/contracts/and.c index 55d697af1..993ccb8b8 100644 --- a/test/c/contracts/and.c +++ b/test/c/contracts/and.c @@ -1,5 +1,5 @@ -#include -#include +#include "smack-contracts.h" +#include "smack.h" #include #include diff --git a/test/c/contracts/and_fail.c b/test/c/contracts/and_fail.c index 823c3981c..fcaf3fe5b 100644 --- a/test/c/contracts/and_fail.c +++ b/test/c/contracts/and_fail.c @@ -1,5 +1,5 @@ -#include -#include +#include "smack-contracts.h" +#include "smack.h" #include #include diff --git a/test/c/contracts/array.c b/test/c/contracts/array.c index 0493bb65e..f5f6a40b7 100644 --- a/test/c/contracts/array.c +++ b/test/c/contracts/array.c @@ -1,5 +1,5 @@ -#include -#include +#include "smack-contracts.h" +#include "smack.h" #include #include @@ -10,4 +10,4 @@ int g[10]; int main(void) { ensures(g[0] == 0); return 0; -} \ No newline at end of file +} diff --git a/test/c/contracts/array_fail.c b/test/c/contracts/array_fail.c index fd80e9146..7b1ef0104 100644 --- a/test/c/contracts/array_fail.c +++ b/test/c/contracts/array_fail.c @@ -1,5 +1,5 @@ -#include -#include +#include "smack-contracts.h" +#include "smack.h" #include #include @@ -10,4 +10,4 @@ int g[10]; int main(void) { ensures(g[0] == 1); return 0; -} \ No newline at end of file +} diff --git a/test/c/contracts/failing/array_forall.c b/test/c/contracts/failing/array_forall.c index b57545e5a..b9e9f3d01 100644 --- a/test/c/contracts/failing/array_forall.c +++ b/test/c/contracts/failing/array_forall.c @@ -1,5 +1,5 @@ -#include -#include +#include "smack-contracts.h" +#include "smack.h" #include #include diff --git a/test/c/contracts/failing/array_forall_fail.c b/test/c/contracts/failing/array_forall_fail.c index 45a0f5e18..0f25235b3 100644 --- a/test/c/contracts/failing/array_forall_fail.c +++ b/test/c/contracts/failing/array_forall_fail.c @@ -1,5 +1,5 @@ -#include -#include +#include "smack-contracts.h" +#include "smack.h" #include #include diff --git a/test/c/contracts/failing/forall.c b/test/c/contracts/failing/forall.c index 5134e4803..14b492da0 100644 --- a/test/c/contracts/failing/forall.c +++ b/test/c/contracts/failing/forall.c @@ -1,5 +1,5 @@ -#include -#include +#include "smack-contracts.h" +#include "smack.h" #include #include diff --git a/test/c/contracts/failing/forall_fail.c b/test/c/contracts/failing/forall_fail.c index bf176b86f..d3879af4d 100644 --- a/test/c/contracts/failing/forall_fail.c +++ b/test/c/contracts/failing/forall_fail.c @@ -1,5 +1,5 @@ -#include -#include +#include "smack-contracts.h" +#include "smack.h" #include #include diff --git a/test/c/contracts/failing/old.c b/test/c/contracts/failing/old.c index f61bff197..aa169c2d6 100644 --- a/test/c/contracts/failing/old.c +++ b/test/c/contracts/failing/old.c @@ -1,5 +1,5 @@ -#include -#include +#include "smack-contracts.h" +#include "smack.h" #include #include diff --git a/test/c/contracts/failing/old_fail.c b/test/c/contracts/failing/old_fail.c index ec03b4859..ae01f909a 100644 --- a/test/c/contracts/failing/old_fail.c +++ b/test/c/contracts/failing/old_fail.c @@ -1,5 +1,5 @@ -#include -#include +#include "smack-contracts.h" +#include "smack.h" #include #include diff --git a/test/c/contracts/failing/result.c b/test/c/contracts/failing/result.c index 327fe9f4d..9faa05d01 100644 --- a/test/c/contracts/failing/result.c +++ b/test/c/contracts/failing/result.c @@ -1,5 +1,5 @@ -#include -#include +#include "smack-contracts.h" +#include "smack.h" #include #include diff --git a/test/c/contracts/failing/result_fail.c b/test/c/contracts/failing/result_fail.c index ccdc79d1c..d318f427a 100644 --- a/test/c/contracts/failing/result_fail.c +++ b/test/c/contracts/failing/result_fail.c @@ -1,5 +1,5 @@ -#include -#include +#include "smack-contracts.h" +#include "smack.h" #include #include diff --git a/test/c/contracts/invariant.c b/test/c/contracts/invariant.c index 83f5ff22a..38614c94a 100644 --- a/test/c/contracts/invariant.c +++ b/test/c/contracts/invariant.c @@ -1,5 +1,5 @@ -#include -#include +#include "smack-contracts.h" +#include "smack.h" #include #include @@ -15,4 +15,4 @@ int main(void) { } return 0; -} \ No newline at end of file +} diff --git a/test/c/contracts/invariant_fail.c b/test/c/contracts/invariant_fail.c index 087d95c0d..2b1d3f195 100644 --- a/test/c/contracts/invariant_fail.c +++ b/test/c/contracts/invariant_fail.c @@ -1,5 +1,5 @@ -#include -#include +#include "smack-contracts.h" +#include "smack.h" #include #include @@ -15,4 +15,4 @@ int main(void) { } return 0; -} \ No newline at end of file +} diff --git a/test/c/contracts/requires_const.c b/test/c/contracts/requires_const.c index 27ff41ac9..25be9249a 100644 --- a/test/c/contracts/requires_const.c +++ b/test/c/contracts/requires_const.c @@ -1,5 +1,5 @@ -#include -#include +#include "smack-contracts.h" +#include "smack.h" #include #include diff --git a/test/c/contracts/simple.c b/test/c/contracts/simple.c index 4ee875e3d..4e56ad89f 100644 --- a/test/c/contracts/simple.c +++ b/test/c/contracts/simple.c @@ -1,5 +1,6 @@ -#include -#include +#include "smack-contracts.h" +#include "smack.h" +#include #include #include @@ -25,4 +26,4 @@ int main(void) { } assert(g > 0); return 0; -} \ No newline at end of file +} diff --git a/test/c/contracts/simple_fail.c b/test/c/contracts/simple_fail.c index fc22ad865..ada6fb3f5 100644 --- a/test/c/contracts/simple_fail.c +++ b/test/c/contracts/simple_fail.c @@ -1,5 +1,6 @@ -#include -#include +#include "smack-contracts.h" +#include "smack.h" +#include #include #include @@ -25,4 +26,4 @@ int main(void) { } assert(g > 0); return 0; -} \ No newline at end of file +} diff --git a/test/c/data/array.c b/test/c/data/array.c index 8a0455ab9..ff789a801 100644 --- a/test/c/data/array.c +++ b/test/c/data/array.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/array1.c b/test/c/data/array1.c index 79f4c3f64..585c2ad7b 100644 --- a/test/c/data/array1.c +++ b/test/c/data/array1.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/array1_fail.c b/test/c/data/array1_fail.c index 00561d7f8..8723235be 100644 --- a/test/c/data/array1_fail.c +++ b/test/c/data/array1_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/array2.c b/test/c/data/array2.c index ad787e9a6..c200270c7 100644 --- a/test/c/data/array2.c +++ b/test/c/data/array2.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/array2_fail.c b/test/c/data/array2_fail.c index 8377dd8e1..18ac7b2f9 100644 --- a/test/c/data/array2_fail.c +++ b/test/c/data/array2_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/array3.c b/test/c/data/array3.c index 37298c8b4..40fc53987 100644 --- a/test/c/data/array3.c +++ b/test/c/data/array3.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/array3_fail.c b/test/c/data/array3_fail.c index 60f3d23de..fed416c7c 100644 --- a/test/c/data/array3_fail.c +++ b/test/c/data/array3_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/array4.c b/test/c/data/array4.c index eb64063aa..15fbb3758 100644 --- a/test/c/data/array4.c +++ b/test/c/data/array4.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/array4_fail.c b/test/c/data/array4_fail.c index 2e12c7c83..752b2183b 100644 --- a/test/c/data/array4_fail.c +++ b/test/c/data/array4_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/array_free.c b/test/c/data/array_free.c index aef33e244..c6ad91eb7 100644 --- a/test/c/data/array_free.c +++ b/test/c/data/array_free.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @flag --loop-limit=11 diff --git a/test/c/data/array_free2.c b/test/c/data/array_free2.c index d2545216d..c1b411dc2 100644 --- a/test/c/data/array_free2.c +++ b/test/c/data/array_free2.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @flag --loop-limit=11 diff --git a/test/c/data/array_free2_fail.c b/test/c/data/array_free2_fail.c index d5805fd3f..77bc0f35d 100644 --- a/test/c/data/array_free2_fail.c +++ b/test/c/data/array_free2_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @flag --loop-limit=11 diff --git a/test/c/data/array_free_fail.c b/test/c/data/array_free_fail.c index 0f38f5d98..28b4970fe 100644 --- a/test/c/data/array_free_fail.c +++ b/test/c/data/array_free_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @flag --loop-limit=11 diff --git a/test/c/data/extern_func_ptr.c b/test/c/data/extern_func_ptr.c index b83578507..f3aede194 100644 --- a/test/c/data/extern_func_ptr.c +++ b/test/c/data/extern_func_ptr.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/data/extern_func_ptr_fail.c b/test/c/data/extern_func_ptr_fail.c index 5e8c8ff0b..68ffe02b6 100644 --- a/test/c/data/extern_func_ptr_fail.c +++ b/test/c/data/extern_func_ptr_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/data/extern_struct.c b/test/c/data/extern_struct.c index 51bd31f5d..94e13cb1d 100644 --- a/test/c/data/extern_struct.c +++ b/test/c/data/extern_struct.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/data/free_as_func_ptr.c b/test/c/data/free_as_func_ptr.c index 5c630d557..cc9a26a41 100644 --- a/test/c/data/free_as_func_ptr.c +++ b/test/c/data/free_as_func_ptr.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/data/func_ptr.c b/test/c/data/func_ptr.c index 0a6add12d..a97cf94c4 100644 --- a/test/c/data/func_ptr.c +++ b/test/c/data/func_ptr.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/data/func_ptr1.c b/test/c/data/func_ptr1.c index a39cd641c..6baa13a7c 100644 --- a/test/c/data/func_ptr1.c +++ b/test/c/data/func_ptr1.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/data/func_ptr1_fail.c b/test/c/data/func_ptr1_fail.c index c6693587c..3945a9966 100644 --- a/test/c/data/func_ptr1_fail.c +++ b/test/c/data/func_ptr1_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/data/func_ptr2.c b/test/c/data/func_ptr2.c index 5dbcab424..e7dfb3276 100644 --- a/test/c/data/func_ptr2.c +++ b/test/c/data/func_ptr2.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/data/func_ptr2_fail.c b/test/c/data/func_ptr2_fail.c index 4149c2774..cb6f93f19 100644 --- a/test/c/data/func_ptr2_fail.c +++ b/test/c/data/func_ptr2_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/data/func_ptr_alias.c b/test/c/data/func_ptr_alias.c index cc2787c06..895a32298 100644 --- a/test/c/data/func_ptr_alias.c +++ b/test/c/data/func_ptr_alias.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/data/func_ptr_alias1.c b/test/c/data/func_ptr_alias1.c index 0ce8473a0..0b0b352b2 100644 --- a/test/c/data/func_ptr_alias1.c +++ b/test/c/data/func_ptr_alias1.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/data/func_ptr_alias1_fail.c b/test/c/data/func_ptr_alias1_fail.c index e39c3526b..298b65fe7 100644 --- a/test/c/data/func_ptr_alias1_fail.c +++ b/test/c/data/func_ptr_alias1_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/data/func_ptr_alias_fail.c b/test/c/data/func_ptr_alias_fail.c index 7ba6a88fa..2dbd023c1 100644 --- a/test/c/data/func_ptr_alias_fail.c +++ b/test/c/data/func_ptr_alias_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/data/func_ptr_array.c b/test/c/data/func_ptr_array.c index 80b65a389..229ddd400 100644 --- a/test/c/data/func_ptr_array.c +++ b/test/c/data/func_ptr_array.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/data/func_ptr_array_fail.c b/test/c/data/func_ptr_array_fail.c index 0f7fe4d37..cca2b9d8f 100644 --- a/test/c/data/func_ptr_array_fail.c +++ b/test/c/data/func_ptr_array_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/data/func_ptr_fail.c b/test/c/data/func_ptr_fail.c index 7ab49bbe4..47223797b 100644 --- a/test/c/data/func_ptr_fail.c +++ b/test/c/data/func_ptr_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/data/func_ptr_vararg.c b/test/c/data/func_ptr_vararg.c index e28ca5c5b..81b866ae4 100644 --- a/test/c/data/func_ptr_vararg.c +++ b/test/c/data/func_ptr_vararg.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/data/func_ptr_vararg_fail.c b/test/c/data/func_ptr_vararg_fail.c index d609ee099..4adec3cc9 100644 --- a/test/c/data/func_ptr_vararg_fail.c +++ b/test/c/data/func_ptr_vararg_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/data/global_structs.c b/test/c/data/global_structs.c index 11530d04a..06674aa1e 100644 --- a/test/c/data/global_structs.c +++ b/test/c/data/global_structs.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/data/global_structs_fail.c b/test/c/data/global_structs_fail.c index 02acd6286..846edfabb 100644 --- a/test/c/data/global_structs_fail.c +++ b/test/c/data/global_structs_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/data/globals_func_ptr.c b/test/c/data/globals_func_ptr.c index b5e301a25..f1c22e731 100644 --- a/test/c/data/globals_func_ptr.c +++ b/test/c/data/globals_func_ptr.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/globals_func_ptr_fail.c b/test/c/data/globals_func_ptr_fail.c index 06edc6225..d12efe648 100644 --- a/test/c/data/globals_func_ptr_fail.c +++ b/test/c/data/globals_func_ptr_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/nested_struct.c b/test/c/data/nested_struct.c index 37f0fb2fd..b26cf01af 100644 --- a/test/c/data/nested_struct.c +++ b/test/c/data/nested_struct.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/nested_struct1.c b/test/c/data/nested_struct1.c index aa5504ab4..0a7b2f59d 100644 --- a/test/c/data/nested_struct1.c +++ b/test/c/data/nested_struct1.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/nested_struct1_fail.c b/test/c/data/nested_struct1_fail.c index 49f349289..3094d77ba 100644 --- a/test/c/data/nested_struct1_fail.c +++ b/test/c/data/nested_struct1_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/nested_struct2.c b/test/c/data/nested_struct2.c index 924ea5045..64af2e76d 100644 --- a/test/c/data/nested_struct2.c +++ b/test/c/data/nested_struct2.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/nested_struct2_fail.c b/test/c/data/nested_struct2_fail.c index 97413b5ec..927f35c28 100644 --- a/test/c/data/nested_struct2_fail.c +++ b/test/c/data/nested_struct2_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/nested_struct_fail.c b/test/c/data/nested_struct_fail.c index e3cbc2b57..db80aeb86 100644 --- a/test/c/data/nested_struct_fail.c +++ b/test/c/data/nested_struct_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/nondet_pointer_fail.c b/test/c/data/nondet_pointer_fail.c index b768e0a33..521be4c46 100644 --- a/test/c/data/nondet_pointer_fail.c +++ b/test/c/data/nondet_pointer_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/data/pointers.c b/test/c/data/pointers.c index 465419a42..0f6cc740a 100644 --- a/test/c/data/pointers.c +++ b/test/c/data/pointers.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/pointers1.c b/test/c/data/pointers1.c index d016af845..87cf72fc4 100644 --- a/test/c/data/pointers1.c +++ b/test/c/data/pointers1.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/pointers1_fail.c b/test/c/data/pointers1_fail.c index a1945a56a..c0d0b4fbe 100644 --- a/test/c/data/pointers1_fail.c +++ b/test/c/data/pointers1_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/pointers2.c b/test/c/data/pointers2.c index 6c6f7be7e..a2acf0a1d 100644 --- a/test/c/data/pointers2.c +++ b/test/c/data/pointers2.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/pointers2_fail.c b/test/c/data/pointers2_fail.c index 96d3c1c43..465964c62 100644 --- a/test/c/data/pointers2_fail.c +++ b/test/c/data/pointers2_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/pointers3.c b/test/c/data/pointers3.c index 6fda80645..a83993fc4 100644 --- a/test/c/data/pointers3.c +++ b/test/c/data/pointers3.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/pointers3_fail.c b/test/c/data/pointers3_fail.c index 8cb2043e7..b81c3a84e 100644 --- a/test/c/data/pointers3_fail.c +++ b/test/c/data/pointers3_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/pointers4.c b/test/c/data/pointers4.c index b8a4188c6..9891ee897 100644 --- a/test/c/data/pointers4.c +++ b/test/c/data/pointers4.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/data/pointers4_fail.c b/test/c/data/pointers4_fail.c index 9366aa469..5329e13a9 100644 --- a/test/c/data/pointers4_fail.c +++ b/test/c/data/pointers4_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/data/pointers5.c b/test/c/data/pointers5.c index 5c29ae121..8d170e257 100644 --- a/test/c/data/pointers5.c +++ b/test/c/data/pointers5.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include #include diff --git a/test/c/data/pointers5_fail.c b/test/c/data/pointers5_fail.c index 01ed12e9c..45e3d36fb 100644 --- a/test/c/data/pointers5_fail.c +++ b/test/c/data/pointers5_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/pointers8.c b/test/c/data/pointers8.c index 6124756a9..e075dbb94 100644 --- a/test/c/data/pointers8.c +++ b/test/c/data/pointers8.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/data/pointers_fail.c b/test/c/data/pointers_fail.c index 4109b0aaf..ba249850c 100644 --- a/test/c/data/pointers_fail.c +++ b/test/c/data/pointers_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/struct_alias.c b/test/c/data/struct_alias.c index d1a0e9f68..46b840dad 100644 --- a/test/c/data/struct_alias.c +++ b/test/c/data/struct_alias.c @@ -1,4 +1,5 @@ -#include +#include "smack.h" +#include // @expect verified diff --git a/test/c/data/struct_alias_fail.c b/test/c/data/struct_alias_fail.c index 047891200..4b2d86477 100644 --- a/test/c/data/struct_alias_fail.c +++ b/test/c/data/struct_alias_fail.c @@ -1,4 +1,5 @@ -#include +#include "smack.h" +#include // @expect error diff --git a/test/c/data/struct_array.c b/test/c/data/struct_array.c index 1c5b76778..c56b889fc 100644 --- a/test/c/data/struct_array.c +++ b/test/c/data/struct_array.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/data/struct_array_fail.c b/test/c/data/struct_array_fail.c index 6c65a8663..4bbc817e6 100644 --- a/test/c/data/struct_array_fail.c +++ b/test/c/data/struct_array_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/data/struct_assign.c b/test/c/data/struct_assign.c index 6fb95b14b..ceef6b868 100644 --- a/test/c/data/struct_assign.c +++ b/test/c/data/struct_assign.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/data/struct_assign_fail.c b/test/c/data/struct_assign_fail.c index aad154a0a..ad41991e2 100644 --- a/test/c/data/struct_assign_fail.c +++ b/test/c/data/struct_assign_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/data/struct_cast.c b/test/c/data/struct_cast.c index dd1493b89..cbdad44a2 100644 --- a/test/c/data/struct_cast.c +++ b/test/c/data/struct_cast.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/struct_cast1.c b/test/c/data/struct_cast1.c index d1e85cd21..e2582b85d 100644 --- a/test/c/data/struct_cast1.c +++ b/test/c/data/struct_cast1.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/struct_cast1_fail.c b/test/c/data/struct_cast1_fail.c index 91f0bb018..b6056873a 100644 --- a/test/c/data/struct_cast1_fail.c +++ b/test/c/data/struct_cast1_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/struct_cast_fail.c b/test/c/data/struct_cast_fail.c index 68f0cfb5a..f908cce92 100644 --- a/test/c/data/struct_cast_fail.c +++ b/test/c/data/struct_cast_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/struct_const_return.c b/test/c/data/struct_const_return.c index f70ad49a6..05ad8485b 100644 --- a/test/c/data/struct_const_return.c +++ b/test/c/data/struct_const_return.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @flag --clang-options=-O1 // @expect verified diff --git a/test/c/data/struct_const_return_fail.c b/test/c/data/struct_const_return_fail.c index 8ea6a5a2b..73b8b34e1 100644 --- a/test/c/data/struct_const_return_fail.c +++ b/test/c/data/struct_const_return_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @flag --clang-options=-O1 // @expect error diff --git a/test/c/data/struct_init.c b/test/c/data/struct_init.c index b70a293b4..af4caaec8 100644 --- a/test/c/data/struct_init.c +++ b/test/c/data/struct_init.c @@ -1,4 +1,5 @@ -#include +#include "smack.h" +#include // @expect verified diff --git a/test/c/data/struct_init_fail.c b/test/c/data/struct_init_fail.c index ba74d0348..a0d31c20a 100644 --- a/test/c/data/struct_init_fail.c +++ b/test/c/data/struct_init_fail.c @@ -1,4 +1,5 @@ -#include +#include "smack.h" +#include // @expect error diff --git a/test/c/data/struct_return.c b/test/c/data/struct_return.c index dcde67cd6..819ca83e2 100644 --- a/test/c/data/struct_return.c +++ b/test/c/data/struct_return.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/data/struct_return_o1.c b/test/c/data/struct_return_o1.c index cf7da2c09..4b977f693 100644 --- a/test/c/data/struct_return_o1.c +++ b/test/c/data/struct_return_o1.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified // @flag --clang-options=-O1 diff --git a/test/c/data/struct_return_o1_fail.c b/test/c/data/struct_return_o1_fail.c index 65c0e39e0..8de10e6f5 100644 --- a/test/c/data/struct_return_o1_fail.c +++ b/test/c/data/struct_return_o1_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error // @flag --clang-options=-O1 diff --git a/test/c/data/two_arrays.c b/test/c/data/two_arrays.c index 0a42d7f32..75b410e77 100644 --- a/test/c/data/two_arrays.c +++ b/test/c/data/two_arrays.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/two_arrays1.c b/test/c/data/two_arrays1.c index 3b1723306..d1e118af1 100644 --- a/test/c/data/two_arrays1.c +++ b/test/c/data/two_arrays1.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/two_arrays1_fail.c b/test/c/data/two_arrays1_fail.c index 801e1ab4d..b749b94c5 100644 --- a/test/c/data/two_arrays1_fail.c +++ b/test/c/data/two_arrays1_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/two_arrays2.c b/test/c/data/two_arrays2.c index 2f8935db9..57622c00b 100644 --- a/test/c/data/two_arrays2.c +++ b/test/c/data/two_arrays2.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/two_arrays3.c b/test/c/data/two_arrays3.c index 2f8935db9..57622c00b 100644 --- a/test/c/data/two_arrays3.c +++ b/test/c/data/two_arrays3.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/two_arrays4.c b/test/c/data/two_arrays4.c index 2f8935db9..57622c00b 100644 --- a/test/c/data/two_arrays4.c +++ b/test/c/data/two_arrays4.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/two_arrays5.c b/test/c/data/two_arrays5.c index 8198d4e96..c92429944 100644 --- a/test/c/data/two_arrays5.c +++ b/test/c/data/two_arrays5.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/two_arrays6.c b/test/c/data/two_arrays6.c index b7d6c81d6..f532d6d30 100644 --- a/test/c/data/two_arrays6.c +++ b/test/c/data/two_arrays6.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/two_arrays6_fail.c b/test/c/data/two_arrays6_fail.c index 11ee48184..1ee5811cd 100644 --- a/test/c/data/two_arrays6_fail.c +++ b/test/c/data/two_arrays6_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/data/two_arrays_fail.c b/test/c/data/two_arrays_fail.c index e116fee7f..035b05547 100644 --- a/test/c/data/two_arrays_fail.c +++ b/test/c/data/two_arrays_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/failing/atomic_cas.c b/test/c/failing/atomic_cas.c index 8def98678..3e1c3e717 100644 --- a/test/c/failing/atomic_cas.c +++ b/test/c/failing/atomic_cas.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/failing/atomic_cas_fail.c b/test/c/failing/atomic_cas_fail.c index bb1d2a5ef..63ee1b02d 100644 --- a/test/c/failing/atomic_cas_fail.c +++ b/test/c/failing/atomic_cas_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/failing/exit.c b/test/c/failing/exit.c index 69cb72b42..4b89549d3 100644 --- a/test/c/failing/exit.c +++ b/test/c/failing/exit.c @@ -1,9 +1,9 @@ +#include "smack.h" +#include +#include // @expect verified -#include -#include - int x = 1; void *t1(void *arg) { diff --git a/test/c/failing/extern_mem2.c b/test/c/failing/extern_mem2.c index e7088db82..41cb81dd0 100644 --- a/test/c/failing/extern_mem2.c +++ b/test/c/failing/extern_mem2.c @@ -1,4 +1,5 @@ -#include +#include "smack.h" +#include #include // @expect verified diff --git a/test/c/failing/extern_mem_fail.c b/test/c/failing/extern_mem_fail.c index d432dc7f2..9644c6226 100644 --- a/test/c/failing/extern_mem_fail.c +++ b/test/c/failing/extern_mem_fail.c @@ -1,4 +1,5 @@ -#include +#include "smack.h" +#include #include // @expect error diff --git a/test/c/failing/floppy_false.i.cil.c b/test/c/failing/floppy_false.i.cil.c index 9d57493ea..a40edc30c 100644 --- a/test/c/failing/floppy_false.i.cil.c +++ b/test/c/failing/floppy_false.i.cil.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/failing/floppy_true.i.cil.c b/test/c/failing/floppy_true.i.cil.c index 67388109c..e9f405128 100644 --- a/test/c/failing/floppy_true.i.cil.c +++ b/test/c/failing/floppy_true.i.cil.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/failing/regression_525_calloc.c b/test/c/failing/regression_525_calloc.c index aa9c294fb..152c73fd5 100644 --- a/test/c/failing/regression_525_calloc.c +++ b/test/c/failing/regression_525_calloc.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include #include diff --git a/test/c/failing/struct_by_value.c b/test/c/failing/struct_by_value.c index 6528d2119..36ef7fd53 100644 --- a/test/c/failing/struct_by_value.c +++ b/test/c/failing/struct_by_value.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/float/bitcast.c b/test/c/float/bitcast.c index 6df09d69c..c4b894806 100644 --- a/test/c/float/bitcast.c +++ b/test/c/float/bitcast.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @flag --integer-encoding=bit-vector --clang-options="-fno-strict-aliasing" // @expect verified diff --git a/test/c/float/bitcast_fail.c b/test/c/float/bitcast_fail.c index 6db6767f0..f3eb75a35 100644 --- a/test/c/float/bitcast_fail.c +++ b/test/c/float/bitcast_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @flag --integer-encoding=bit-vector --clang-options="-fno-strict-aliasing" // @expect error diff --git a/test/c/float/change_rm.c b/test/c/float/change_rm.c index 56217d53d..4a9a63a5b 100644 --- a/test/c/float/change_rm.c +++ b/test/c/float/change_rm.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/float/change_rm_fail.c b/test/c/float/change_rm_fail.c index 1626347f1..513a0d336 100644 --- a/test/c/float/change_rm_fail.c +++ b/test/c/float/change_rm_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/float/double_op_fail.c b/test/c/float/double_op_fail.c index 8454df824..0032ddcfe 100644 --- a/test/c/float/double_op_fail.c +++ b/test/c/float/double_op_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/float/double_ops.c b/test/c/float/double_ops.c index f6f00ddab..10ca5b935 100644 --- a/test/c/float/double_ops.c +++ b/test/c/float/double_ops.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/float/double_to_int.c b/test/c/float/double_to_int.c index 961308fec..15123e0f6 100644 --- a/test/c/float/double_to_int.c +++ b/test/c/float/double_to_int.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @flag --integer-encoding=bit-vector // @expect verified diff --git a/test/c/float/double_to_int_fail.c b/test/c/float/double_to_int_fail.c index 6103ed0a2..1df9a10b3 100644 --- a/test/c/float/double_to_int_fail.c +++ b/test/c/float/double_to_int_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @flag --integer-encoding=bit-vector // @expect error diff --git a/test/c/float/float_int_union.c b/test/c/float/float_int_union.c index b9f802364..1a24d1854 100644 --- a/test/c/float/float_int_union.c +++ b/test/c/float/float_int_union.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @flag --integer-encoding=bit-vector // @expect verified diff --git a/test/c/float/float_int_union_fail.c b/test/c/float/float_int_union_fail.c index 1bbd63de5..2e40212fd 100644 --- a/test/c/float/float_int_union_fail.c +++ b/test/c/float/float_int_union_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @flag --integer-encoding=bit-vector // @expect error diff --git a/test/c/float/float_op_fail.c b/test/c/float/float_op_fail.c index edb06f59e..24cb8e72d 100644 --- a/test/c/float/float_op_fail.c +++ b/test/c/float/float_op_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/float/float_ops.c b/test/c/float/float_ops.c index f4d3555dc..3acb13efe 100644 --- a/test/c/float/float_ops.c +++ b/test/c/float/float_ops.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/float/float_ops_rm.c b/test/c/float/float_ops_rm.c index eb8330ac1..2663777bf 100644 --- a/test/c/float/float_ops_rm.c +++ b/test/c/float/float_ops_rm.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/float/float_ops_rm_fail.c b/test/c/float/float_ops_rm_fail.c index 3c16c39d7..f19c72e93 100644 --- a/test/c/float/float_ops_rm_fail.c +++ b/test/c/float/float_ops_rm_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/float/floats_in_memory.c b/test/c/float/floats_in_memory.c index b5ddd173d..e84d0942b 100644 --- a/test/c/float/floats_in_memory.c +++ b/test/c/float/floats_in_memory.c @@ -1,4 +1,5 @@ -#include +#include "smack.h" +#include // @expect verified diff --git a/test/c/float/floats_in_memory_fail.c b/test/c/float/floats_in_memory_fail.c index 21ef21bdb..36a565017 100644 --- a/test/c/float/floats_in_memory_fail.c +++ b/test/c/float/floats_in_memory_fail.c @@ -1,4 +1,5 @@ -#include +#include "smack.h" +#include // @expect error diff --git a/test/c/float/floor.c b/test/c/float/floor.c index 17f6abefa..05ff557c7 100644 --- a/test/c/float/floor.c +++ b/test/c/float/floor.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/float/floor_fail.c b/test/c/float/floor_fail.c index d19a4ee40..536c703ff 100644 --- a/test/c/float/floor_fail.c +++ b/test/c/float/floor_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/float/get_rm_invalid.c b/test/c/float/get_rm_invalid.c index 860f65e5c..4b64b1310 100644 --- a/test/c/float/get_rm_invalid.c +++ b/test/c/float/get_rm_invalid.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/float/get_rm_invalid_fail.c b/test/c/float/get_rm_invalid_fail.c index 74898b316..4367df66c 100644 --- a/test/c/float/get_rm_invalid_fail.c +++ b/test/c/float/get_rm_invalid_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/float/half_intrinsics.c b/test/c/float/half_intrinsics.c index f023b570a..b7a34c55d 100644 --- a/test/c/float/half_intrinsics.c +++ b/test/c/float/half_intrinsics.c @@ -1,5 +1,6 @@ #include "math.h" #include "smack.h" +#include // @flag --integer-encoding=bit-vector // @expect verified diff --git a/test/c/float/half_intrinsics_fail.c b/test/c/float/half_intrinsics_fail.c index 257c5e6ce..7ce714bfa 100644 --- a/test/c/float/half_intrinsics_fail.c +++ b/test/c/float/half_intrinsics_fail.c @@ -1,5 +1,6 @@ #include "math.h" #include "smack.h" +#include // @flag --integer-encoding=bit-vector // @expect error diff --git a/test/c/float/intrinsics.c b/test/c/float/intrinsics.c index 8fecce55b..d65275b80 100644 --- a/test/c/float/intrinsics.c +++ b/test/c/float/intrinsics.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/float/intrinsics_fail.c b/test/c/float/intrinsics_fail.c index 2f6f7ed05..cd50a54aa 100644 --- a/test/c/float/intrinsics_fail.c +++ b/test/c/float/intrinsics_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/float/llvm_intrinsic.c b/test/c/float/llvm_intrinsic.c index 9c135ecd0..8e7c3b0f6 100644 --- a/test/c/float/llvm_intrinsic.c +++ b/test/c/float/llvm_intrinsic.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include //@expect verified diff --git a/test/c/float/llvm_intrinsic_fail.c b/test/c/float/llvm_intrinsic_fail.c index 9b7393640..53594c5e2 100644 --- a/test/c/float/llvm_intrinsic_fail.c +++ b/test/c/float/llvm_intrinsic_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include //@expect error diff --git a/test/c/float/set_rm_invalid.c b/test/c/float/set_rm_invalid.c index 74899d727..c80519629 100644 --- a/test/c/float/set_rm_invalid.c +++ b/test/c/float/set_rm_invalid.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/float/set_rm_invalid_fail.c b/test/c/float/set_rm_invalid_fail.c index de30ad9f5..d400585c2 100644 --- a/test/c/float/set_rm_invalid_fail.c +++ b/test/c/float/set_rm_invalid_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/float/simple_double.c b/test/c/float/simple_double.c index d547fe906..7fc33c146 100644 --- a/test/c/float/simple_double.c +++ b/test/c/float/simple_double.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/float/simple_double_fail.c b/test/c/float/simple_double_fail.c index 1251eafaa..9b124c5e2 100644 --- a/test/c/float/simple_double_fail.c +++ b/test/c/float/simple_double_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/float/simple_float.c b/test/c/float/simple_float.c index 2284a3f25..c9a7ba723 100644 --- a/test/c/float/simple_float.c +++ b/test/c/float/simple_float.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/float/simple_float_fail.c b/test/c/float/simple_float_fail.c index 1ce6d2e9e..75fc80513 100644 --- a/test/c/float/simple_float_fail.c +++ b/test/c/float/simple_float_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/float/smack_code_annot.c b/test/c/float/smack_code_annot.c index 799977145..21ba2bdb1 100644 --- a/test/c/float/smack_code_annot.c +++ b/test/c/float/smack_code_annot.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/float/smack_code_annot_fail.c b/test/c/float/smack_code_annot_fail.c index 451c1ba37..5baaad303 100644 --- a/test/c/float/smack_code_annot_fail.c +++ b/test/c/float/smack_code_annot_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/locks/test_locks_10_true.c b/test/c/locks/test_locks_10_true.c index 27586b720..29a4af9da 100644 --- a/test/c/locks/test_locks_10_true.c +++ b/test/c/locks/test_locks_10_true.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/locks/test_locks_11_true.c b/test/c/locks/test_locks_11_true.c index 6390b9c86..71b75b94d 100644 --- a/test/c/locks/test_locks_11_true.c +++ b/test/c/locks/test_locks_11_true.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/locks/test_locks_12_true.c b/test/c/locks/test_locks_12_true.c index 6823548a3..c9b9b59bf 100644 --- a/test/c/locks/test_locks_12_true.c +++ b/test/c/locks/test_locks_12_true.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/locks/test_locks_13_true.c b/test/c/locks/test_locks_13_true.c index 641905e20..265058d42 100644 --- a/test/c/locks/test_locks_13_true.c +++ b/test/c/locks/test_locks_13_true.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/locks/test_locks_14_false.c b/test/c/locks/test_locks_14_false.c index 1d4963d9d..a13211397 100644 --- a/test/c/locks/test_locks_14_false.c +++ b/test/c/locks/test_locks_14_false.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/locks/test_locks_14_true.c b/test/c/locks/test_locks_14_true.c index a4d600377..d4352a94d 100644 --- a/test/c/locks/test_locks_14_true.c +++ b/test/c/locks/test_locks_14_true.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/locks/test_locks_15_false.c b/test/c/locks/test_locks_15_false.c index ea5ff730e..eac7b7f5f 100644 --- a/test/c/locks/test_locks_15_false.c +++ b/test/c/locks/test_locks_15_false.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/locks/test_locks_15_true.c b/test/c/locks/test_locks_15_true.c index dbda3eec5..68745e150 100644 --- a/test/c/locks/test_locks_15_true.c +++ b/test/c/locks/test_locks_15_true.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/locks/test_locks_5_true.c b/test/c/locks/test_locks_5_true.c index 10a06a4e9..dea30addc 100644 --- a/test/c/locks/test_locks_5_true.c +++ b/test/c/locks/test_locks_5_true.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/locks/test_locks_6_true.c b/test/c/locks/test_locks_6_true.c index b4a11ea13..06cfbd0e2 100644 --- a/test/c/locks/test_locks_6_true.c +++ b/test/c/locks/test_locks_6_true.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/locks/test_locks_7_true.c b/test/c/locks/test_locks_7_true.c index da56aac93..a6dbc31c6 100644 --- a/test/c/locks/test_locks_7_true.c +++ b/test/c/locks/test_locks_7_true.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/locks/test_locks_8_true.c b/test/c/locks/test_locks_8_true.c index 4fba2615c..e16c9640e 100644 --- a/test/c/locks/test_locks_8_true.c +++ b/test/c/locks/test_locks_8_true.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/locks/test_locks_9_true.c b/test/c/locks/test_locks_9_true.c index 9704c2d93..51e04b460 100644 --- a/test/c/locks/test_locks_9_true.c +++ b/test/c/locks/test_locks_9_true.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/mathc/ceil.c b/test/c/mathc/ceil.c index 7934de5e7..806ce7a02 100644 --- a/test/c/mathc/ceil.c +++ b/test/c/mathc/ceil.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/ceil_fail.c b/test/c/mathc/ceil_fail.c index 2505a0c3a..b4b83bcdd 100644 --- a/test/c/mathc/ceil_fail.c +++ b/test/c/mathc/ceil_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/ceilf.c b/test/c/mathc/ceilf.c index 664f7af4c..ecc272b04 100644 --- a/test/c/mathc/ceilf.c +++ b/test/c/mathc/ceilf.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/ceilf_fail.c b/test/c/mathc/ceilf_fail.c index 609370673..e39815d9f 100644 --- a/test/c/mathc/ceilf_fail.c +++ b/test/c/mathc/ceilf_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/ceill.c b/test/c/mathc/ceill.c index b91831b91..830e92e88 100644 --- a/test/c/mathc/ceill.c +++ b/test/c/mathc/ceill.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/ceill_fail.c b/test/c/mathc/ceill_fail.c index f5b60c3a1..c25263ec8 100644 --- a/test/c/mathc/ceill_fail.c +++ b/test/c/mathc/ceill_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/copysign.c b/test/c/mathc/copysign.c index 5d61e9cdb..4719261e5 100644 --- a/test/c/mathc/copysign.c +++ b/test/c/mathc/copysign.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/copysign_fail.c b/test/c/mathc/copysign_fail.c index 8bec02f5a..df1eaffc5 100644 --- a/test/c/mathc/copysign_fail.c +++ b/test/c/mathc/copysign_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/copysignf.c b/test/c/mathc/copysignf.c index 2fbb2e77e..e73cc8d0b 100644 --- a/test/c/mathc/copysignf.c +++ b/test/c/mathc/copysignf.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/copysignf_fail.c b/test/c/mathc/copysignf_fail.c index 14e5ebe7c..103892288 100644 --- a/test/c/mathc/copysignf_fail.c +++ b/test/c/mathc/copysignf_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/copysignl.c b/test/c/mathc/copysignl.c index d62bc27dc..073d0ae1f 100644 --- a/test/c/mathc/copysignl.c +++ b/test/c/mathc/copysignl.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/copysignl_fail.c b/test/c/mathc/copysignl_fail.c index c0c060a30..f21169855 100644 --- a/test/c/mathc/copysignl_fail.c +++ b/test/c/mathc/copysignl_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/fabs.c b/test/c/mathc/fabs.c index 796cee5b7..82d498693 100644 --- a/test/c/mathc/fabs.c +++ b/test/c/mathc/fabs.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/fabs_fail.c b/test/c/mathc/fabs_fail.c index 5b28242eb..15d34cf8c 100644 --- a/test/c/mathc/fabs_fail.c +++ b/test/c/mathc/fabs_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/fabsf.c b/test/c/mathc/fabsf.c index b78812e8e..e99a3d687 100644 --- a/test/c/mathc/fabsf.c +++ b/test/c/mathc/fabsf.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/fabsf_fail.c b/test/c/mathc/fabsf_fail.c index 39e34b8fa..f34eff0cb 100644 --- a/test/c/mathc/fabsf_fail.c +++ b/test/c/mathc/fabsf_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/fabsl.c b/test/c/mathc/fabsl.c index 105f5cd76..6481a3e83 100644 --- a/test/c/mathc/fabsl.c +++ b/test/c/mathc/fabsl.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/fabsl_fail.c b/test/c/mathc/fabsl_fail.c index fea3d6fe1..11c883c76 100644 --- a/test/c/mathc/fabsl_fail.c +++ b/test/c/mathc/fabsl_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/fdim.c b/test/c/mathc/fdim.c index 7ab9824b8..703865645 100644 --- a/test/c/mathc/fdim.c +++ b/test/c/mathc/fdim.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/fdim_fail.c b/test/c/mathc/fdim_fail.c index aa33bc2eb..61a4b3b71 100644 --- a/test/c/mathc/fdim_fail.c +++ b/test/c/mathc/fdim_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/fdimf.c b/test/c/mathc/fdimf.c index 9041fd81a..547f6c0a2 100644 --- a/test/c/mathc/fdimf.c +++ b/test/c/mathc/fdimf.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/fdimf_fail.c b/test/c/mathc/fdimf_fail.c index cb9eb5577..c2d8c3c6f 100644 --- a/test/c/mathc/fdimf_fail.c +++ b/test/c/mathc/fdimf_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/fdiml.c b/test/c/mathc/fdiml.c index eda28e28a..5814ccef8 100644 --- a/test/c/mathc/fdiml.c +++ b/test/c/mathc/fdiml.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/fdiml_fail.c b/test/c/mathc/fdiml_fail.c index ec9ed636e..0c6b2c702 100644 --- a/test/c/mathc/fdiml_fail.c +++ b/test/c/mathc/fdiml_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/floor.c b/test/c/mathc/floor.c index d4a62f745..8abb658ac 100644 --- a/test/c/mathc/floor.c +++ b/test/c/mathc/floor.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/floor_fail.c b/test/c/mathc/floor_fail.c index 96265299a..46a9644bd 100644 --- a/test/c/mathc/floor_fail.c +++ b/test/c/mathc/floor_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/floorf.c b/test/c/mathc/floorf.c index 6eeca9e0c..eb3c13caf 100644 --- a/test/c/mathc/floorf.c +++ b/test/c/mathc/floorf.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/floorf_fail.c b/test/c/mathc/floorf_fail.c index a665df901..f5a910312 100644 --- a/test/c/mathc/floorf_fail.c +++ b/test/c/mathc/floorf_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/floorl.c b/test/c/mathc/floorl.c index a852e2e02..b9003dd4b 100644 --- a/test/c/mathc/floorl.c +++ b/test/c/mathc/floorl.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/floorl_fail.c b/test/c/mathc/floorl_fail.c index 5450c5d4c..3b65a3b71 100644 --- a/test/c/mathc/floorl_fail.c +++ b/test/c/mathc/floorl_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/fmax.c b/test/c/mathc/fmax.c index 613f179cc..387bcb4da 100644 --- a/test/c/mathc/fmax.c +++ b/test/c/mathc/fmax.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/fmax_fail.c b/test/c/mathc/fmax_fail.c index 55d434b41..8730ebda2 100644 --- a/test/c/mathc/fmax_fail.c +++ b/test/c/mathc/fmax_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/fmaxf.c b/test/c/mathc/fmaxf.c index 9aac65a9a..de8438d63 100644 --- a/test/c/mathc/fmaxf.c +++ b/test/c/mathc/fmaxf.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/fmaxf_fail.c b/test/c/mathc/fmaxf_fail.c index a10a2a80b..36e48b339 100644 --- a/test/c/mathc/fmaxf_fail.c +++ b/test/c/mathc/fmaxf_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/fmaxl.c b/test/c/mathc/fmaxl.c index 46332655d..aaa7be078 100644 --- a/test/c/mathc/fmaxl.c +++ b/test/c/mathc/fmaxl.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/fmaxl_fail.c b/test/c/mathc/fmaxl_fail.c index ed3807bce..7a1a93cb9 100644 --- a/test/c/mathc/fmaxl_fail.c +++ b/test/c/mathc/fmaxl_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/fmin.c b/test/c/mathc/fmin.c index 835dca030..76c96f9f6 100644 --- a/test/c/mathc/fmin.c +++ b/test/c/mathc/fmin.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/fmin_fail.c b/test/c/mathc/fmin_fail.c index 6f0c0b376..043e08e95 100644 --- a/test/c/mathc/fmin_fail.c +++ b/test/c/mathc/fmin_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/fminf.c b/test/c/mathc/fminf.c index ef8c38e5b..70bbcbeb6 100644 --- a/test/c/mathc/fminf.c +++ b/test/c/mathc/fminf.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/fminf_fail.c b/test/c/mathc/fminf_fail.c index 6ccd4d5f6..433466664 100644 --- a/test/c/mathc/fminf_fail.c +++ b/test/c/mathc/fminf_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/fminl.c b/test/c/mathc/fminl.c index a5f81f334..1d9b9ac6b 100644 --- a/test/c/mathc/fminl.c +++ b/test/c/mathc/fminl.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/fminl_fail.c b/test/c/mathc/fminl_fail.c index 733f0e5f1..74aeb6e9b 100644 --- a/test/c/mathc/fminl_fail.c +++ b/test/c/mathc/fminl_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/fmod.c b/test/c/mathc/fmod.c index c249f03d2..2c0e3fe1a 100644 --- a/test/c/mathc/fmod.c +++ b/test/c/mathc/fmod.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/fmod_fail.c b/test/c/mathc/fmod_fail.c index c81763568..ea760ffbe 100644 --- a/test/c/mathc/fmod_fail.c +++ b/test/c/mathc/fmod_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/fmodf.c b/test/c/mathc/fmodf.c index 399264ffc..623025083 100644 --- a/test/c/mathc/fmodf.c +++ b/test/c/mathc/fmodf.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/fmodf_fail.c b/test/c/mathc/fmodf_fail.c index c6c17ac9a..823124c6e 100644 --- a/test/c/mathc/fmodf_fail.c +++ b/test/c/mathc/fmodf_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/fmodl.c b/test/c/mathc/fmodl.c index 3fae0b0a9..20df165e4 100644 --- a/test/c/mathc/fmodl.c +++ b/test/c/mathc/fmodl.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/fmodl_fail.c b/test/c/mathc/fmodl_fail.c index 30574a6f2..983e73cb4 100644 --- a/test/c/mathc/fmodl_fail.c +++ b/test/c/mathc/fmodl_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/issue_244.c b/test/c/mathc/issue_244.c index e8f9ea6ad..ff1f4c3c9 100644 --- a/test/c/mathc/issue_244.c +++ b/test/c/mathc/issue_244.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/issue_244_fail.c b/test/c/mathc/issue_244_fail.c index b55a8b911..143da21e7 100644 --- a/test/c/mathc/issue_244_fail.c +++ b/test/c/mathc/issue_244_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/lrint.c b/test/c/mathc/lrint.c index b2441e0e2..54060b99b 100644 --- a/test/c/mathc/lrint.c +++ b/test/c/mathc/lrint.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/lrint_fail.c b/test/c/mathc/lrint_fail.c index 5e1b1e2cf..59180c838 100644 --- a/test/c/mathc/lrint_fail.c +++ b/test/c/mathc/lrint_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/lrintf.c b/test/c/mathc/lrintf.c index 9748e59b6..1d93e9f47 100644 --- a/test/c/mathc/lrintf.c +++ b/test/c/mathc/lrintf.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/lrintf_fail.c b/test/c/mathc/lrintf_fail.c index 17afa2e21..c76b6caea 100644 --- a/test/c/mathc/lrintf_fail.c +++ b/test/c/mathc/lrintf_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/lrintl.c b/test/c/mathc/lrintl.c index 863856f92..d16b2ca45 100644 --- a/test/c/mathc/lrintl.c +++ b/test/c/mathc/lrintl.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/lrintl_fail.c b/test/c/mathc/lrintl_fail.c index 268e6efcc..6518d4ada 100644 --- a/test/c/mathc/lrintl_fail.c +++ b/test/c/mathc/lrintl_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/lround.c b/test/c/mathc/lround.c index 5a2bd76d4..9f8dc05ea 100644 --- a/test/c/mathc/lround.c +++ b/test/c/mathc/lround.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/lround_fail.c b/test/c/mathc/lround_fail.c index 802ba10ea..73b51de17 100644 --- a/test/c/mathc/lround_fail.c +++ b/test/c/mathc/lround_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/lroundf.c b/test/c/mathc/lroundf.c index d34f1c978..73b6833d1 100644 --- a/test/c/mathc/lroundf.c +++ b/test/c/mathc/lroundf.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/lroundf_fail.c b/test/c/mathc/lroundf_fail.c index 1550ab77d..a995e4576 100644 --- a/test/c/mathc/lroundf_fail.c +++ b/test/c/mathc/lroundf_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/lroundl.c b/test/c/mathc/lroundl.c index 27a436670..cec6251e0 100644 --- a/test/c/mathc/lroundl.c +++ b/test/c/mathc/lroundl.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/lroundl_fail.c b/test/c/mathc/lroundl_fail.c index 700b80946..a7d2b4165 100644 --- a/test/c/mathc/lroundl_fail.c +++ b/test/c/mathc/lroundl_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/modf.c b/test/c/mathc/modf.c index ee8052a4e..ef10e25a2 100644 --- a/test/c/mathc/modf.c +++ b/test/c/mathc/modf.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/modf_fail.c b/test/c/mathc/modf_fail.c index 56d0b0018..2125c2f20 100644 --- a/test/c/mathc/modf_fail.c +++ b/test/c/mathc/modf_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/modff.c b/test/c/mathc/modff.c index a58a24e50..d009389f2 100644 --- a/test/c/mathc/modff.c +++ b/test/c/mathc/modff.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/modff_fail.c b/test/c/mathc/modff_fail.c index 4efda4774..e11263f8e 100644 --- a/test/c/mathc/modff_fail.c +++ b/test/c/mathc/modff_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/modfl.c b/test/c/mathc/modfl.c index 358fc6c4e..a31865a12 100644 --- a/test/c/mathc/modfl.c +++ b/test/c/mathc/modfl.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/modfl_fail.c b/test/c/mathc/modfl_fail.c index 72b489359..b2d49a83c 100644 --- a/test/c/mathc/modfl_fail.c +++ b/test/c/mathc/modfl_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/nearbyint.c b/test/c/mathc/nearbyint.c index b220a43b3..a62f1a76a 100644 --- a/test/c/mathc/nearbyint.c +++ b/test/c/mathc/nearbyint.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/nearbyint_fail.c b/test/c/mathc/nearbyint_fail.c index 692e34fb6..9d6de898b 100644 --- a/test/c/mathc/nearbyint_fail.c +++ b/test/c/mathc/nearbyint_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/nearbyintf.c b/test/c/mathc/nearbyintf.c index c3b048f62..23c565610 100644 --- a/test/c/mathc/nearbyintf.c +++ b/test/c/mathc/nearbyintf.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/nearbyintf_fail.c b/test/c/mathc/nearbyintf_fail.c index 614a05473..d32d7f021 100644 --- a/test/c/mathc/nearbyintf_fail.c +++ b/test/c/mathc/nearbyintf_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/nearbyintl.c b/test/c/mathc/nearbyintl.c index fec4c00a6..2038c0ba9 100644 --- a/test/c/mathc/nearbyintl.c +++ b/test/c/mathc/nearbyintl.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/nearbyintl_fail.c b/test/c/mathc/nearbyintl_fail.c index fd22afd7e..7b2eb3d87 100644 --- a/test/c/mathc/nearbyintl_fail.c +++ b/test/c/mathc/nearbyintl_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/remainder.c b/test/c/mathc/remainder.c index 1114f41b8..61bf1b725 100644 --- a/test/c/mathc/remainder.c +++ b/test/c/mathc/remainder.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/remainder_fail.c b/test/c/mathc/remainder_fail.c index 8cc96f277..11b5cab8c 100644 --- a/test/c/mathc/remainder_fail.c +++ b/test/c/mathc/remainder_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/remainderf.c b/test/c/mathc/remainderf.c index af44d2347..e7eac2991 100644 --- a/test/c/mathc/remainderf.c +++ b/test/c/mathc/remainderf.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/remainderf_fail.c b/test/c/mathc/remainderf_fail.c index ec9321795..790d967c2 100644 --- a/test/c/mathc/remainderf_fail.c +++ b/test/c/mathc/remainderf_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/remainderl.c b/test/c/mathc/remainderl.c index a8c7a1876..6262f737d 100644 --- a/test/c/mathc/remainderl.c +++ b/test/c/mathc/remainderl.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/remainderl_fail.c b/test/c/mathc/remainderl_fail.c index d5ac1e26c..2c0cfd269 100644 --- a/test/c/mathc/remainderl_fail.c +++ b/test/c/mathc/remainderl_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/rint.c b/test/c/mathc/rint.c index d41859253..a77fef3ea 100644 --- a/test/c/mathc/rint.c +++ b/test/c/mathc/rint.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/rint_fail.c b/test/c/mathc/rint_fail.c index a3c84e380..06e8d8c05 100644 --- a/test/c/mathc/rint_fail.c +++ b/test/c/mathc/rint_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/rintf.c b/test/c/mathc/rintf.c index d3cfdc7f8..78aad7cbf 100644 --- a/test/c/mathc/rintf.c +++ b/test/c/mathc/rintf.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/rintf_fail.c b/test/c/mathc/rintf_fail.c index 23b41fa7a..bbf7032b4 100644 --- a/test/c/mathc/rintf_fail.c +++ b/test/c/mathc/rintf_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/rintl.c b/test/c/mathc/rintl.c index 270e076d8..6514d66b2 100644 --- a/test/c/mathc/rintl.c +++ b/test/c/mathc/rintl.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/rintl_fail.c b/test/c/mathc/rintl_fail.c index 6ff5a32ba..2e47720d5 100644 --- a/test/c/mathc/rintl_fail.c +++ b/test/c/mathc/rintl_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/mathc/round.c b/test/c/mathc/round.c index 818a35138..bff1c1ea4 100644 --- a/test/c/mathc/round.c +++ b/test/c/mathc/round.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/round_fail.c b/test/c/mathc/round_fail.c index 15356c30f..afb76c7d1 100644 --- a/test/c/mathc/round_fail.c +++ b/test/c/mathc/round_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/roundf.c b/test/c/mathc/roundf.c index 63374b1ba..e9a93cb66 100644 --- a/test/c/mathc/roundf.c +++ b/test/c/mathc/roundf.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/roundf_fail.c b/test/c/mathc/roundf_fail.c index fe302f87a..29e5ca7b3 100644 --- a/test/c/mathc/roundf_fail.c +++ b/test/c/mathc/roundf_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/roundl.c b/test/c/mathc/roundl.c index 0de5f04ef..d875c409e 100644 --- a/test/c/mathc/roundl.c +++ b/test/c/mathc/roundl.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/roundl_fail.c b/test/c/mathc/roundl_fail.c index 9321c69be..e7a71fd04 100644 --- a/test/c/mathc/roundl_fail.c +++ b/test/c/mathc/roundl_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/sqrt.c b/test/c/mathc/sqrt.c index b4a15ae53..333b78fcf 100644 --- a/test/c/mathc/sqrt.c +++ b/test/c/mathc/sqrt.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/sqrt_fail.c b/test/c/mathc/sqrt_fail.c index c2edb4471..8d68c8193 100644 --- a/test/c/mathc/sqrt_fail.c +++ b/test/c/mathc/sqrt_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/sqrtf.c b/test/c/mathc/sqrtf.c index d474cb549..540e46d9d 100644 --- a/test/c/mathc/sqrtf.c +++ b/test/c/mathc/sqrtf.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/sqrtf_fail.c b/test/c/mathc/sqrtf_fail.c index 7a1c59f18..bfd5fba6b 100644 --- a/test/c/mathc/sqrtf_fail.c +++ b/test/c/mathc/sqrtf_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/sqrtl.c b/test/c/mathc/sqrtl.c index d90dd226d..73e1884a7 100644 --- a/test/c/mathc/sqrtl.c +++ b/test/c/mathc/sqrtl.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/sqrtl_fail.c b/test/c/mathc/sqrtl_fail.c index 444d331b3..14e1977c3 100644 --- a/test/c/mathc/sqrtl_fail.c +++ b/test/c/mathc/sqrtl_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/trunc.c b/test/c/mathc/trunc.c index 7353cd2e2..89a035d34 100644 --- a/test/c/mathc/trunc.c +++ b/test/c/mathc/trunc.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/trunc_fail.c b/test/c/mathc/trunc_fail.c index 6672d8ce5..5bc1daf5f 100644 --- a/test/c/mathc/trunc_fail.c +++ b/test/c/mathc/trunc_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/truncf.c b/test/c/mathc/truncf.c index d00f466a8..02ed3260a 100644 --- a/test/c/mathc/truncf.c +++ b/test/c/mathc/truncf.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/truncf_fail.c b/test/c/mathc/truncf_fail.c index 3df6543ce..52ac0cf93 100644 --- a/test/c/mathc/truncf_fail.c +++ b/test/c/mathc/truncf_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/mathc/truncl.c b/test/c/mathc/truncl.c index 500d6da1b..9b4e0bbcb 100644 --- a/test/c/mathc/truncl.c +++ b/test/c/mathc/truncl.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/mathc/truncl_fail.c b/test/c/mathc/truncl_fail.c index 02cd824f9..b925ebbf3 100644 --- a/test/c/mathc/truncl_fail.c +++ b/test/c/mathc/truncl_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/memory-safety/calloc.c b/test/c/memory-safety/calloc.c index 1758e4f08..cf4f4eb31 100644 --- a/test/c/memory-safety/calloc.c +++ b/test/c/memory-safety/calloc.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/memory-safety/calloc_fail.c b/test/c/memory-safety/calloc_fail.c index e6cdb6176..7952c9ae3 100644 --- a/test/c/memory-safety/calloc_fail.c +++ b/test/c/memory-safety/calloc_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/memory-safety/global_alloc.c b/test/c/memory-safety/global_alloc.c index 90d9e5708..f341670a5 100644 --- a/test/c/memory-safety/global_alloc.c +++ b/test/c/memory-safety/global_alloc.c @@ -1,4 +1,4 @@ -#include +#include "smack.h" #include #include diff --git a/test/c/memory-safety/global_alloc_fail_free.c b/test/c/memory-safety/global_alloc_fail_free.c index 7fe6e45d5..700a26895 100644 --- a/test/c/memory-safety/global_alloc_fail_free.c +++ b/test/c/memory-safety/global_alloc_fail_free.c @@ -1,4 +1,4 @@ -#include +#include "smack.h" #include #include diff --git a/test/c/memory-safety/global_and_heap_alloc.c b/test/c/memory-safety/global_and_heap_alloc.c index eab8100a7..ae6650e44 100644 --- a/test/c/memory-safety/global_and_heap_alloc.c +++ b/test/c/memory-safety/global_and_heap_alloc.c @@ -1,4 +1,4 @@ -#include +#include "smack.h" #include #include diff --git a/test/c/memory-safety/global_and_heap_alloc_fail_free.c b/test/c/memory-safety/global_and_heap_alloc_fail_free.c index 3bfcbf872..edceed306 100644 --- a/test/c/memory-safety/global_and_heap_alloc_fail_free.c +++ b/test/c/memory-safety/global_and_heap_alloc_fail_free.c @@ -1,4 +1,4 @@ -#include +#include "smack.h" #include #include diff --git a/test/c/memory-safety/global_and_heap_alloc_fail_no_free.c b/test/c/memory-safety/global_and_heap_alloc_fail_no_free.c index 6de2153d6..346028498 100644 --- a/test/c/memory-safety/global_and_heap_alloc_fail_no_free.c +++ b/test/c/memory-safety/global_and_heap_alloc_fail_no_free.c @@ -1,4 +1,4 @@ -#include +#include "smack.h" #include #include diff --git a/test/c/ntdrivers-simplified/cdaudio_simpl1_false.cil.c b/test/c/ntdrivers-simplified/cdaudio_simpl1_false.cil.c index 979cfcdb9..33fa52d63 100644 --- a/test/c/ntdrivers-simplified/cdaudio_simpl1_false.cil.c +++ b/test/c/ntdrivers-simplified/cdaudio_simpl1_false.cil.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/ntdrivers-simplified/cdaudio_simpl1_true.cil.c b/test/c/ntdrivers-simplified/cdaudio_simpl1_true.cil.c index 9f58e78d9..b6aec754f 100644 --- a/test/c/ntdrivers-simplified/cdaudio_simpl1_true.cil.c +++ b/test/c/ntdrivers-simplified/cdaudio_simpl1_true.cil.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/ntdrivers-simplified/diskperf_simpl1_true.cil.c b/test/c/ntdrivers-simplified/diskperf_simpl1_true.cil.c index ff59132f3..a90ffca06 100644 --- a/test/c/ntdrivers-simplified/diskperf_simpl1_true.cil.c +++ b/test/c/ntdrivers-simplified/diskperf_simpl1_true.cil.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/ntdrivers-simplified/floppy_simpl3_false.cil.c b/test/c/ntdrivers-simplified/floppy_simpl3_false.cil.c index fbbbfaf8d..6a756c469 100644 --- a/test/c/ntdrivers-simplified/floppy_simpl3_false.cil.c +++ b/test/c/ntdrivers-simplified/floppy_simpl3_false.cil.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/ntdrivers-simplified/floppy_simpl3_true.cil.c b/test/c/ntdrivers-simplified/floppy_simpl3_true.cil.c index 19ccf425d..131d858f8 100644 --- a/test/c/ntdrivers-simplified/floppy_simpl3_true.cil.c +++ b/test/c/ntdrivers-simplified/floppy_simpl3_true.cil.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/ntdrivers-simplified/floppy_simpl4_false.cil.c b/test/c/ntdrivers-simplified/floppy_simpl4_false.cil.c index 29be2307c..a276fb9fb 100644 --- a/test/c/ntdrivers-simplified/floppy_simpl4_false.cil.c +++ b/test/c/ntdrivers-simplified/floppy_simpl4_false.cil.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/ntdrivers-simplified/floppy_simpl4_true.cil.c b/test/c/ntdrivers-simplified/floppy_simpl4_true.cil.c index 2f806998a..719765178 100644 --- a/test/c/ntdrivers-simplified/floppy_simpl4_true.cil.c +++ b/test/c/ntdrivers-simplified/floppy_simpl4_true.cil.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/ntdrivers-simplified/kbfiltr_simpl1_true.cil.c b/test/c/ntdrivers-simplified/kbfiltr_simpl1_true.cil.c index 60a00e9b2..523b90043 100644 --- a/test/c/ntdrivers-simplified/kbfiltr_simpl1_true.cil.c +++ b/test/c/ntdrivers-simplified/kbfiltr_simpl1_true.cil.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/ntdrivers-simplified/kbfiltr_simpl2_false.cil.c b/test/c/ntdrivers-simplified/kbfiltr_simpl2_false.cil.c index f30024171..ee382a9b9 100644 --- a/test/c/ntdrivers-simplified/kbfiltr_simpl2_false.cil.c +++ b/test/c/ntdrivers-simplified/kbfiltr_simpl2_false.cil.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/ntdrivers-simplified/kbfiltr_simpl2_true.cil.c b/test/c/ntdrivers-simplified/kbfiltr_simpl2_true.cil.c index 0ad7b4a1f..16c9ce7c5 100644 --- a/test/c/ntdrivers-simplified/kbfiltr_simpl2_true.cil.c +++ b/test/c/ntdrivers-simplified/kbfiltr_simpl2_true.cil.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/ntdrivers/cdaudio_true.i.cil.c b/test/c/ntdrivers/cdaudio_true.i.cil.c index eaf4246e8..1ed989636 100644 --- a/test/c/ntdrivers/cdaudio_true.i.cil.c +++ b/test/c/ntdrivers/cdaudio_true.i.cil.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/ntdrivers/diskperf_false.i.cil.c b/test/c/ntdrivers/diskperf_false.i.cil.c index 96d7530bb..c90722d0f 100644 --- a/test/c/ntdrivers/diskperf_false.i.cil.c +++ b/test/c/ntdrivers/diskperf_false.i.cil.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/ntdrivers/diskperf_true.i.cil.c b/test/c/ntdrivers/diskperf_true.i.cil.c index f24b841e8..1a21ee401 100644 --- a/test/c/ntdrivers/diskperf_true.i.cil.c +++ b/test/c/ntdrivers/diskperf_true.i.cil.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/ntdrivers/floppy2_true.i.cil.c b/test/c/ntdrivers/floppy2_true.i.cil.c index 0c4227cf3..0f8820d48 100644 --- a/test/c/ntdrivers/floppy2_true.i.cil.c +++ b/test/c/ntdrivers/floppy2_true.i.cil.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/ntdrivers/kbfiltr_false.i.cil.c b/test/c/ntdrivers/kbfiltr_false.i.cil.c index 70f9ab73b..73095a791 100644 --- a/test/c/ntdrivers/kbfiltr_false.i.cil.c +++ b/test/c/ntdrivers/kbfiltr_false.i.cil.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/ntdrivers/parport_false.i.cil.c b/test/c/ntdrivers/parport_false.i.cil.c index 8f6290522..19526fb44 100644 --- a/test/c/ntdrivers/parport_false.i.cil.c +++ b/test/c/ntdrivers/parport_false.i.cil.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/ntdrivers/parport_true.i.cil.c b/test/c/ntdrivers/parport_true.i.cil.c index 36921913e..1fda3ce93 100644 --- a/test/c/ntdrivers/parport_true.i.cil.c +++ b/test/c/ntdrivers/parport_true.i.cil.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/pthread/account.c b/test/c/pthread/account.c index 6e0fa67dc..660dc89ad 100644 --- a/test/c/pthread/account.c +++ b/test/c/pthread/account.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/pthread/account_fail.c b/test/c/pthread/account_fail.c index 769916b3a..7bcefbbaf 100644 --- a/test/c/pthread/account_fail.c +++ b/test/c/pthread/account_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/pthread/cond.c b/test/c/pthread/cond.c index 6999b9080..a60c75399 100644 --- a/test/c/pthread/cond.c +++ b/test/c/pthread/cond.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // Generally tests pthread_cond_wait, pthread_cond_signal, // pthread_cond_init diff --git a/test/c/pthread/cond_fail.c b/test/c/pthread/cond_fail.c index 8fded9f16..db82aa07a 100644 --- a/test/c/pthread/cond_fail.c +++ b/test/c/pthread/cond_fail.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // Generally tests pthread_cond_wait, pthread_cond_signal, // pthread_cond_init diff --git a/test/c/pthread/equal.c b/test/c/pthread/equal.c index 67054d430..2808066c7 100644 --- a/test/c/pthread/equal.c +++ b/test/c/pthread/equal.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // Tests pthread_equal() // @expect verified diff --git a/test/c/pthread/equal2.c b/test/c/pthread/equal2.c index 810075654..e8d3f2e1d 100644 --- a/test/c/pthread/equal2.c +++ b/test/c/pthread/equal2.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // Tests pthread_equal() // @expect verified diff --git a/test/c/pthread/join.c b/test/c/pthread/join.c index a0ad6f507..f4f7ac32b 100644 --- a/test/c/pthread/join.c +++ b/test/c/pthread/join.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // Shows pthread_join effectively blocks until child thread done // @expect verified diff --git a/test/c/pthread/join_fail.c b/test/c/pthread/join_fail.c index 8fc7f4652..56fd4fcf0 100644 --- a/test/c/pthread/join_fail.c +++ b/test/c/pthread/join_fail.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // Shows join.c fails when parent doesn't wait for child before x++ call // @expect error diff --git a/test/c/pthread/join_null_retval.c b/test/c/pthread/join_null_retval.c index 2c6b01a75..43577a61c 100644 --- a/test/c/pthread/join_null_retval.c +++ b/test/c/pthread/join_null_retval.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/pthread/join_return.c b/test/c/pthread/join_return.c index ee71ea176..2e2c91022 100644 --- a/test/c/pthread/join_return.c +++ b/test/c/pthread/join_return.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include #include // Tests join & return in general - would fail if join doesn't block. diff --git a/test/c/pthread/join_return2.c b/test/c/pthread/join_return2.c index 6e9e980c8..1d77a5727 100644 --- a/test/c/pthread/join_return2.c +++ b/test/c/pthread/join_return2.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // Ensures return values from multiple threads can be // held simultaneously. diff --git a/test/c/pthread/join_return2_fail.c b/test/c/pthread/join_return2_fail.c index 8742c7998..cdb9fa22a 100644 --- a/test/c/pthread/join_return2_fail.c +++ b/test/c/pthread/join_return2_fail.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // Ensures return values from multiple threads can be // held simultaneously. diff --git a/test/c/pthread/join_return_fail.c b/test/c/pthread/join_return_fail.c index 959005bf8..b62be3810 100644 --- a/test/c/pthread/join_return_fail.c +++ b/test/c/pthread/join_return_fail.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include #include // Tests join & return in general - would fail if join doesn't block. diff --git a/test/c/pthread/join_self.c b/test/c/pthread/join_self.c index 187ad0cf1..25ffa6d0b 100644 --- a/test/c/pthread/join_self.c +++ b/test/c/pthread/join_self.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // Tests deadlock detection when join on self // @expect verified diff --git a/test/c/pthread/join_self_fail.c b/test/c/pthread/join_self_fail.c index 299f2643b..a7575fd06 100644 --- a/test/c/pthread/join_self_fail.c +++ b/test/c/pthread/join_self_fail.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // Tests deadlock detection when join on self // @expect error diff --git a/test/c/pthread/lock.c b/test/c/pthread/lock.c index d0bbff1b5..f08e2fadf 100644 --- a/test/c/pthread/lock.c +++ b/test/c/pthread/lock.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // Tests pthread_mutex_init() // @expect verified diff --git a/test/c/pthread/lock2.c b/test/c/pthread/lock2.c index b6b146f7a..6a1cfedfd 100644 --- a/test/c/pthread/lock2.c +++ b/test/c/pthread/lock2.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // Tests PTHREAD_MUTEX_INITIALIZER macro // @expect verified diff --git a/test/c/pthread/lock2_fail.c b/test/c/pthread/lock2_fail.c index c8fb51396..74719fca0 100644 --- a/test/c/pthread/lock2_fail.c +++ b/test/c/pthread/lock2_fail.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // Tests failure when trying to acquire an owned lock // @expect error diff --git a/test/c/pthread/lock3.c b/test/c/pthread/lock3.c index afa69f232..c0db24657 100644 --- a/test/c/pthread/lock3.c +++ b/test/c/pthread/lock3.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // Tests with multiple threads // @expect verified diff --git a/test/c/pthread/lock3_fail.c b/test/c/pthread/lock3_fail.c index dbdf2b67f..51a403aa7 100644 --- a/test/c/pthread/lock3_fail.c +++ b/test/c/pthread/lock3_fail.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // Tests with multiple threads // @expect error diff --git a/test/c/pthread/lock4.c b/test/c/pthread/lock4.c index d590b6cdd..9dd82a470 100644 --- a/test/c/pthread/lock4.c +++ b/test/c/pthread/lock4.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // Tests that using mutex fails after being destroyed // @expect verified diff --git a/test/c/pthread/lock4_fail.c b/test/c/pthread/lock4_fail.c index 2cfce82d4..02105f533 100644 --- a/test/c/pthread/lock4_fail.c +++ b/test/c/pthread/lock4_fail.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // Tests that using mutex fails after being destroyed // @expect error diff --git a/test/c/pthread/lock5.c b/test/c/pthread/lock5.c index 15e212492..b948a325b 100644 --- a/test/c/pthread/lock5.c +++ b/test/c/pthread/lock5.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // Tests that uninitialized mutex fails on use // @expect verified diff --git a/test/c/pthread/lock5_fail.c b/test/c/pthread/lock5_fail.c index 2936fc2f8..4c8cb4dec 100644 --- a/test/c/pthread/lock5_fail.c +++ b/test/c/pthread/lock5_fail.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // Tests that uninitialized mutex fails on use // @expect error diff --git a/test/c/pthread/lock_fail.c b/test/c/pthread/lock_fail.c index 2851ccabe..4d678b6a2 100644 --- a/test/c/pthread/lock_fail.c +++ b/test/c/pthread/lock_fail.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // Tests failure on use of uninitialized mutex // @expect error diff --git a/test/c/pthread/lockattr.c b/test/c/pthread/lockattr.c index 3d79dc382..407bb767b 100644 --- a/test/c/pthread/lockattr.c +++ b/test/c/pthread/lockattr.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // Uses error handling from error checking mutex // to avoid what would otherwise be deadlock or permitted error diff --git a/test/c/pthread/regression_525_malloc.c b/test/c/pthread/regression_525_malloc.c index 62fe5d484..b321eb6bc 100644 --- a/test/c/pthread/regression_525_malloc.c +++ b/test/c/pthread/regression_525_malloc.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/pthread/regression_525_malloc_fail.c b/test/c/pthread/regression_525_malloc_fail.c index 09d277211..bc09241e3 100644 --- a/test/c/pthread/regression_525_malloc_fail.c +++ b/test/c/pthread/regression_525_malloc_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/pthread/regression_525_stackalloc.c b/test/c/pthread/regression_525_stackalloc.c index 7f293b544..12d48fd39 100644 --- a/test/c/pthread/regression_525_stackalloc.c +++ b/test/c/pthread/regression_525_stackalloc.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include #include diff --git a/test/c/pthread/regression_525_stackalloc_fail.c b/test/c/pthread/regression_525_stackalloc_fail.c index ddad281d5..40fb3b4b9 100644 --- a/test/c/pthread/regression_525_stackalloc_fail.c +++ b/test/c/pthread/regression_525_stackalloc_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include #include diff --git a/test/c/pthread_extras/dekker_true-unreach-call.c b/test/c/pthread_extras/dekker_true-unreach-call.c index b26f12292..875cd539f 100644 --- a/test/c/pthread_extras/dekker_true-unreach-call.c +++ b/test/c/pthread_extras/dekker_true-unreach-call.c @@ -4,6 +4,7 @@ #include "pthread.h" #include "smack.h" +#include // @expect verified // @flag --unroll=4 diff --git a/test/c/pthread_extras/lamport_true-unreach-call.c b/test/c/pthread_extras/lamport_true-unreach-call.c index 42f359ea2..27a0fadc4 100644 --- a/test/c/pthread_extras/lamport_true-unreach-call.c +++ b/test/c/pthread_extras/lamport_true-unreach-call.c @@ -4,6 +4,7 @@ #include "pthread.h" #include "smack.h" +#include // @expect verified // @flag --unroll=4 diff --git a/test/c/pthread_extras/lazy01_false-unreach-call.c b/test/c/pthread_extras/lazy01_false-unreach-call.c index 8367ed2b6..579d536fe 100644 --- a/test/c/pthread_extras/lazy01_false-unreach-call.c +++ b/test/c/pthread_extras/lazy01_false-unreach-call.c @@ -1,5 +1,6 @@ #include "pthread.h" #include "smack.h" +#include // @expect error diff --git a/test/c/pthread_extras/peterson_true-unreach-call.c b/test/c/pthread_extras/peterson_true-unreach-call.c index cf15ebcd4..ed9eeeab8 100644 --- a/test/c/pthread_extras/peterson_true-unreach-call.c +++ b/test/c/pthread_extras/peterson_true-unreach-call.c @@ -4,6 +4,7 @@ #include "pthread.h" #include "smack.h" +#include // @expect verified // @flag --unroll=4 diff --git a/test/c/pthread_extras/queue_false-unreach-call.c b/test/c/pthread_extras/queue_false-unreach-call.c index f08add154..b3c145429 100644 --- a/test/c/pthread_extras/queue_false-unreach-call.c +++ b/test/c/pthread_extras/queue_false-unreach-call.c @@ -1,5 +1,6 @@ #include "pthread.h" #include "smack.h" +#include #include // @expect error diff --git a/test/c/pthread_extras/queue_ok_true-unreach-call.c b/test/c/pthread_extras/queue_ok_true-unreach-call.c index 50452b151..28e70e47e 100644 --- a/test/c/pthread_extras/queue_ok_true-unreach-call.c +++ b/test/c/pthread_extras/queue_ok_true-unreach-call.c @@ -1,5 +1,6 @@ #include "pthread.h" #include "smack.h" +#include #include // @expect verified diff --git a/test/c/pthread_extras/reorder_2_false-unreach-call.c b/test/c/pthread_extras/reorder_2_false-unreach-call.c index 2dd3902be..5a708517d 100644 --- a/test/c/pthread_extras/reorder_2_false-unreach-call.c +++ b/test/c/pthread_extras/reorder_2_false-unreach-call.c @@ -1,5 +1,6 @@ #include "pthread.h" #include "smack.h" +#include #include #include diff --git a/test/c/pthread_extras/reorder_5_false-unreach-call.c b/test/c/pthread_extras/reorder_5_false-unreach-call.c index 8f193a0f0..33695e7ff 100644 --- a/test/c/pthread_extras/reorder_5_false-unreach-call.c +++ b/test/c/pthread_extras/reorder_5_false-unreach-call.c @@ -1,5 +1,6 @@ #include "pthread.h" #include "smack.h" +#include #include #include diff --git a/test/c/pthread_extras/scull_true-unreach-call.c b/test/c/pthread_extras/scull_true-unreach-call.c index f1b42d822..3608392d1 100644 --- a/test/c/pthread_extras/scull_true-unreach-call.c +++ b/test/c/pthread_extras/scull_true-unreach-call.c @@ -4,6 +4,7 @@ #include "pthread.h" #include "smack.h" +#include // @expect verified diff --git a/test/c/pthread_extras/sigma_false-unreach-call.c b/test/c/pthread_extras/sigma_false-unreach-call.c index de1a09643..dfb05c35a 100644 --- a/test/c/pthread_extras/sigma_false-unreach-call.c +++ b/test/c/pthread_extras/sigma_false-unreach-call.c @@ -1,5 +1,6 @@ #include "pthread.h" #include "smack.h" +#include #include #include diff --git a/test/c/pthread_extras/sigma_false_GREAT-unreach-call.c b/test/c/pthread_extras/sigma_false_GREAT-unreach-call.c index e4e4bcb8d..3b11bf9ac 100644 --- a/test/c/pthread_extras/sigma_false_GREAT-unreach-call.c +++ b/test/c/pthread_extras/sigma_false_GREAT-unreach-call.c @@ -6,6 +6,7 @@ #include "pthread.h" #include "smack.h" +#include #include #include diff --git a/test/c/pthread_extras/singleton_false-unreach-call.c b/test/c/pthread_extras/singleton_false-unreach-call.c index 7cdb41241..180e83b46 100644 --- a/test/c/pthread_extras/singleton_false-unreach-call.c +++ b/test/c/pthread_extras/singleton_false-unreach-call.c @@ -1,5 +1,6 @@ #include "pthread.h" #include "smack.h" +#include #include #include diff --git a/test/c/pthread_extras/singleton_with-uninit-problems-true.c b/test/c/pthread_extras/singleton_with-uninit-problems-true.c index 92dacbff7..cc96d92f7 100644 --- a/test/c/pthread_extras/singleton_with-uninit-problems-true.c +++ b/test/c/pthread_extras/singleton_with-uninit-problems-true.c @@ -1,5 +1,6 @@ #include "pthread.h" #include "smack.h" +#include #include #include diff --git a/test/c/pthread_extras/sssc12_true-unreach-call.c b/test/c/pthread_extras/sssc12_true-unreach-call.c index 994a64fd3..da96f4837 100644 --- a/test/c/pthread_extras/sssc12_true-unreach-call.c +++ b/test/c/pthread_extras/sssc12_true-unreach-call.c @@ -4,6 +4,7 @@ #include "pthread.h" #include "smack.h" +#include // @expect verified diff --git a/test/c/pthread_extras/stack_false-unreach-call.c b/test/c/pthread_extras/stack_false-unreach-call.c index 76ad08187..d8c528ef8 100644 --- a/test/c/pthread_extras/stack_false-unreach-call.c +++ b/test/c/pthread_extras/stack_false-unreach-call.c @@ -1,5 +1,6 @@ #include "pthread.h" #include "smack.h" +#include #include // @expect error diff --git a/test/c/pthread_extras/stack_true-unreach-call.c b/test/c/pthread_extras/stack_true-unreach-call.c index feb6cfbaa..d50981d61 100644 --- a/test/c/pthread_extras/stack_true-unreach-call.c +++ b/test/c/pthread_extras/stack_true-unreach-call.c @@ -1,5 +1,6 @@ #include "pthread.h" #include "smack.h" +#include #include // @expect verified diff --git a/test/c/pthread_extras/stateful01_false-unreach-call.c b/test/c/pthread_extras/stateful01_false-unreach-call.c index c86a47141..752d41c9a 100644 --- a/test/c/pthread_extras/stateful01_false-unreach-call.c +++ b/test/c/pthread_extras/stateful01_false-unreach-call.c @@ -1,5 +1,6 @@ #include "pthread.h" #include "smack.h" +#include // @expect error diff --git a/test/c/pthread_extras/stateful01_true-unreach-call.c b/test/c/pthread_extras/stateful01_true-unreach-call.c index 028ea64f0..2252aff01 100644 --- a/test/c/pthread_extras/stateful01_true-unreach-call.c +++ b/test/c/pthread_extras/stateful01_true-unreach-call.c @@ -1,5 +1,6 @@ #include "pthread.h" #include "smack.h" +#include // @expect verified diff --git a/test/c/pthread_extras/sync01_true-unreach-call.c b/test/c/pthread_extras/sync01_true-unreach-call.c index 0fdbfa01d..709301af3 100644 --- a/test/c/pthread_extras/sync01_true-unreach-call.c +++ b/test/c/pthread_extras/sync01_true-unreach-call.c @@ -1,5 +1,6 @@ #include "pthread.h" #include "smack.h" +#include #include // @expect verified diff --git a/test/c/pthread_extras/szymanski_true-unreach-call.c b/test/c/pthread_extras/szymanski_true-unreach-call.c index 9fe576522..a09ef6c93 100644 --- a/test/c/pthread_extras/szymanski_true-unreach-call.c +++ b/test/c/pthread_extras/szymanski_true-unreach-call.c @@ -4,6 +4,7 @@ #include "pthread.h" #include "smack.h" +#include // @expect verified diff --git a/test/c/pthread_extras/time_var_mutex_true-unreach-call.c b/test/c/pthread_extras/time_var_mutex_true-unreach-call.c index 2e6237be5..b730e59d6 100644 --- a/test/c/pthread_extras/time_var_mutex_true-unreach-call.c +++ b/test/c/pthread_extras/time_var_mutex_true-unreach-call.c @@ -8,6 +8,7 @@ #include "pthread.h" #include "smack.h" +#include // @expect verified diff --git a/test/c/pthread_extras/twostage_3_false-unreach-call.c b/test/c/pthread_extras/twostage_3_false-unreach-call.c index 1257ced93..16f79dc8f 100644 --- a/test/c/pthread_extras/twostage_3_false-unreach-call.c +++ b/test/c/pthread_extras/twostage_3_false-unreach-call.c @@ -1,5 +1,6 @@ #include "pthread.h" #include "smack.h" +#include #include #include diff --git a/test/c/simd/add.c b/test/c/simd/add.c index b0684baf7..3add80e07 100644 --- a/test/c/simd/add.c +++ b/test/c/simd/add.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // @expect verified diff --git a/test/c/simd/add_fail.c b/test/c/simd/add_fail.c index 35767a321..b039cc7e3 100644 --- a/test/c/simd/add_fail.c +++ b/test/c/simd/add_fail.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // @expect error diff --git a/test/c/simd/cast.c b/test/c/simd/cast.c index 7b0e0df2d..15490100e 100644 --- a/test/c/simd/cast.c +++ b/test/c/simd/cast.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // @expect verified diff --git a/test/c/simd/cast_fail.c b/test/c/simd/cast_fail.c index 39444e3da..85650aa11 100644 --- a/test/c/simd/cast_fail.c +++ b/test/c/simd/cast_fail.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // @expect error diff --git a/test/c/simd/constant.c b/test/c/simd/constant.c index 2a45a19e1..3724308d7 100644 --- a/test/c/simd/constant.c +++ b/test/c/simd/constant.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // @expect verified diff --git a/test/c/simd/constant_fail.c b/test/c/simd/constant_fail.c index 1019f02bf..6675eda79 100644 --- a/test/c/simd/constant_fail.c +++ b/test/c/simd/constant_fail.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // @expect error diff --git a/test/c/simd/shuffle.c b/test/c/simd/shuffle.c index d93d45795..f9fda7184 100644 --- a/test/c/simd/shuffle.c +++ b/test/c/simd/shuffle.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // @expect verified // @flag --clang-options=-mavx2 diff --git a/test/c/simd/shuffle_fail.c b/test/c/simd/shuffle_fail.c index bbd5d4974..da2f4b7b7 100644 --- a/test/c/simd/shuffle_fail.c +++ b/test/c/simd/shuffle_fail.c @@ -1,5 +1,6 @@ +#include "smack.h" +#include #include -#include // @expect error // @flag --clang-options=-mavx2 diff --git a/test/c/special/assume.c b/test/c/special/assume.c index eee18cc4d..6a3770064 100644 --- a/test/c/special/assume.c +++ b/test/c/special/assume.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified // @flag --llvm-assumes=use diff --git a/test/c/special/assume2.c b/test/c/special/assume2.c index 03b70c663..ed0eb18f8 100644 --- a/test/c/special/assume2.c +++ b/test/c/special/assume2.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified // @flag --llvm-assumes=use diff --git a/test/c/special/assume_check.c b/test/c/special/assume_check.c index d1c2a37f8..64e2db939 100644 --- a/test/c/special/assume_check.c +++ b/test/c/special/assume_check.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified // @flag --llvm-assumes=check diff --git a/test/c/special/assume_check2.c b/test/c/special/assume_check2.c index 9a98a02c6..9a706a839 100644 --- a/test/c/special/assume_check2.c +++ b/test/c/special/assume_check2.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified // @flag --llvm-assumes=check diff --git a/test/c/special/assume_check_fail.c b/test/c/special/assume_check_fail.c index f84470d22..8056c55a1 100644 --- a/test/c/special/assume_check_fail.c +++ b/test/c/special/assume_check_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error // @flag --llvm-assumes=check diff --git a/test/c/special/assume_fail.c b/test/c/special/assume_fail.c index 8ab1c4e1b..c50a12ce1 100644 --- a/test/c/special/assume_fail.c +++ b/test/c/special/assume_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error // @flag --llvm-assumes=none diff --git a/test/c/strings/strcat.c b/test/c/strings/strcat.c index 5c7f3bded..a90f3fcc4 100644 --- a/test/c/strings/strcat.c +++ b/test/c/strings/strcat.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/strings/strcat_fail.c b/test/c/strings/strcat_fail.c index c37de53c9..615f6c82d 100644 --- a/test/c/strings/strcat_fail.c +++ b/test/c/strings/strcat_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/strings/strcat_overflow.c b/test/c/strings/strcat_overflow.c index 98431a560..42fa9b420 100644 --- a/test/c/strings/strcat_overflow.c +++ b/test/c/strings/strcat_overflow.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @flag --check=memory-safety diff --git a/test/c/strings/strchr.c b/test/c/strings/strchr.c index 3fedb3255..c1fa64f66 100644 --- a/test/c/strings/strchr.c +++ b/test/c/strings/strchr.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/strings/strchr_fail.c b/test/c/strings/strchr_fail.c index a09beb534..d463703a4 100644 --- a/test/c/strings/strchr_fail.c +++ b/test/c/strings/strchr_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/strings/strcmp.c b/test/c/strings/strcmp.c index 291329eb0..f4030c9cd 100644 --- a/test/c/strings/strcmp.c +++ b/test/c/strings/strcmp.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/strings/strcmp_fail.c b/test/c/strings/strcmp_fail.c index e1b467a66..410ed0899 100644 --- a/test/c/strings/strcmp_fail.c +++ b/test/c/strings/strcmp_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/strings/strcpy.c b/test/c/strings/strcpy.c index ee7abd0bf..49a2e1127 100644 --- a/test/c/strings/strcpy.c +++ b/test/c/strings/strcpy.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/strings/strcpy_fail.c b/test/c/strings/strcpy_fail.c index 1db27f451..7875ea208 100644 --- a/test/c/strings/strcpy_fail.c +++ b/test/c/strings/strcpy_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/strings/strcpy_overflow.c b/test/c/strings/strcpy_overflow.c index f89f1c5b8..66a7a5484 100644 --- a/test/c/strings/strcpy_overflow.c +++ b/test/c/strings/strcpy_overflow.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @flag --check=memory-safety diff --git a/test/c/strings/strcspn.c b/test/c/strings/strcspn.c index 0765f135b..d8498c9cd 100644 --- a/test/c/strings/strcspn.c +++ b/test/c/strings/strcspn.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/strings/strcspn_fail.c b/test/c/strings/strcspn_fail.c index 4db6da711..9ee4bc3fb 100644 --- a/test/c/strings/strcspn_fail.c +++ b/test/c/strings/strcspn_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/strings/strlen.c b/test/c/strings/strlen.c index 98933631f..28cf84a40 100644 --- a/test/c/strings/strlen.c +++ b/test/c/strings/strlen.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/strings/strlen_fail.c b/test/c/strings/strlen_fail.c index 56b3ad285..e30b354d1 100644 --- a/test/c/strings/strlen_fail.c +++ b/test/c/strings/strlen_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include #include diff --git a/test/c/strings/strncat.c b/test/c/strings/strncat.c index 80c52874d..a7b0e9dd8 100644 --- a/test/c/strings/strncat.c +++ b/test/c/strings/strncat.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/strings/strncat_fail.c b/test/c/strings/strncat_fail.c index 5c8238074..aadb6352b 100644 --- a/test/c/strings/strncat_fail.c +++ b/test/c/strings/strncat_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/strings/strncmp.c b/test/c/strings/strncmp.c index 03f229a86..91d1456bd 100644 --- a/test/c/strings/strncmp.c +++ b/test/c/strings/strncmp.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/strings/strncmp_fail.c b/test/c/strings/strncmp_fail.c index 88690b9c2..2eaeb406b 100644 --- a/test/c/strings/strncmp_fail.c +++ b/test/c/strings/strncmp_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/strings/strncmp_toolong.c b/test/c/strings/strncmp_toolong.c index 893e20542..aac717980 100644 --- a/test/c/strings/strncmp_toolong.c +++ b/test/c/strings/strncmp_toolong.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/strings/strpbrk.c b/test/c/strings/strpbrk.c index 5e77533ec..46eadfb57 100644 --- a/test/c/strings/strpbrk.c +++ b/test/c/strings/strpbrk.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/strings/strpbrk_fail.c b/test/c/strings/strpbrk_fail.c index 0f1473b66..ec8f2f26d 100644 --- a/test/c/strings/strpbrk_fail.c +++ b/test/c/strings/strpbrk_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/strings/strrchr.c b/test/c/strings/strrchr.c index 5cd6931a3..8551722e8 100644 --- a/test/c/strings/strrchr.c +++ b/test/c/strings/strrchr.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/strings/strrchr_fail.c b/test/c/strings/strrchr_fail.c index 5d677b63f..d4285df3d 100644 --- a/test/c/strings/strrchr_fail.c +++ b/test/c/strings/strrchr_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/strings/strspn.c b/test/c/strings/strspn.c index a03ce076c..b5e91eb8e 100644 --- a/test/c/strings/strspn.c +++ b/test/c/strings/strspn.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/strings/strspn_fail.c b/test/c/strings/strspn_fail.c index 3262c6975..d188491c3 100644 --- a/test/c/strings/strspn_fail.c +++ b/test/c/strings/strspn_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/strings/strstr.c b/test/c/strings/strstr.c index edf20a795..b35d76df4 100644 --- a/test/c/strings/strstr.c +++ b/test/c/strings/strstr.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/strings/strstr_fail.c b/test/c/strings/strstr_fail.c index 55124ab97..fbda65fd1 100644 --- a/test/c/strings/strstr_fail.c +++ b/test/c/strings/strstr_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/strings/strtok.c b/test/c/strings/strtok.c index 9184c2e59..12be82a76 100644 --- a/test/c/strings/strtok.c +++ b/test/c/strings/strtok.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/strings/strtok_fail.c b/test/c/strings/strtok_fail.c index bc3a6dbfd..15e4aed7a 100644 --- a/test/c/strings/strtok_fail.c +++ b/test/c/strings/strtok_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error From b195fca7934b53389410ba2d923b30c72db7d7a9 Mon Sep 17 00:00:00 2001 From: "Mark S. Baranowski" Date: Mon, 29 Mar 2021 18:35:48 -0600 Subject: [PATCH 02/25] Add an option to enable targeted checking of specific functions * This adds the option `--checked-functions' which is a list of functions on which to do checking * Not specifying this option enables all checks in every function --- .github/workflows/smack-ci.yaml | 2 ++ include/smack/SmackOptions.h | 2 ++ lib/smack/IntegerOverflowChecker.cpp | 6 +++-- lib/smack/MemorySafetyChecker.cpp | 3 ++- lib/smack/SmackInstGenerator.cpp | 12 ++++++++-- lib/smack/SmackOptions.cpp | 11 ++++++++++ share/smack/top.py | 9 ++++++++ test/c/targeted-checks/targeted_assertion.c | 9 ++++++++ .../targeted-checks/targeted_assertion_fail.c | 9 ++++++++ .../targeted_assume_checking.c | 11 ++++++++++ .../targeted_assume_checking_fail.c | 11 ++++++++++ .../targeted-checks/targeted_memory_safety.c | 22 +++++++++++++++++++ .../targeted_memory_safety_fail.c | 22 +++++++++++++++++++ .../targeted_overflow_arithmetic.c | 14 ++++++++++++ .../targeted_overflow_arithmetic_fail.c | 14 ++++++++++++ .../targeted-checks/targeted_overflow_shift.c | 14 ++++++++++++ .../targeted_overflow_shift_fail.c | 14 ++++++++++++ test/rust/targeted-checks/targeted_panic.rs | 16 ++++++++++++++ .../targeted-checks/targeted_panic_fail.rs | 16 ++++++++++++++ 19 files changed, 212 insertions(+), 5 deletions(-) create mode 100644 test/c/targeted-checks/targeted_assertion.c create mode 100644 test/c/targeted-checks/targeted_assertion_fail.c create mode 100644 test/c/targeted-checks/targeted_assume_checking.c create mode 100644 test/c/targeted-checks/targeted_assume_checking_fail.c create mode 100644 test/c/targeted-checks/targeted_memory_safety.c create mode 100644 test/c/targeted-checks/targeted_memory_safety_fail.c create mode 100644 test/c/targeted-checks/targeted_overflow_arithmetic.c create mode 100644 test/c/targeted-checks/targeted_overflow_arithmetic_fail.c create mode 100644 test/c/targeted-checks/targeted_overflow_shift.c create mode 100644 test/c/targeted-checks/targeted_overflow_shift_fail.c create mode 100644 test/rust/targeted-checks/targeted_panic.rs create mode 100644 test/rust/targeted-checks/targeted_panic_fail.rs diff --git a/.github/workflows/smack-ci.yaml b/.github/workflows/smack-ci.yaml index 9205d93f9..1ec7301d8 100644 --- a/.github/workflows/smack-ci.yaml +++ b/.github/workflows/smack-ci.yaml @@ -23,6 +23,7 @@ jobs: "--exhaustive --folder=c/pthread_extras", "--exhaustive --folder=c/strings", "--exhaustive --folder=c/special", + "--exhaustive --folder=c/targeted-checks", "--exhaustive --folder=rust/array --languages=rust", "--exhaustive --folder=rust/basic --languages=rust", "--exhaustive --folder=rust/box --languages=rust", @@ -32,6 +33,7 @@ jobs: "--exhaustive --folder=rust/panic --languages=rust", "--exhaustive --folder=rust/recursion --languages=rust", "--exhaustive --folder=rust/structures --languages=rust", + "--exhaustive --folder=rust/targeted-checks", "--exhaustive --folder=rust/vector --languages=rust", "--exhaustive --folder=rust/cargo/** --languages=cargo --threads=1", "--exhaustive --folder=llvm --languages=llvm-ir" diff --git a/include/smack/SmackOptions.h b/include/smack/SmackOptions.h index ce92d93e0..9ca18131c 100644 --- a/include/smack/SmackOptions.h +++ b/include/smack/SmackOptions.h @@ -15,6 +15,7 @@ enum class LLVMAssumeType { none, use, check }; class SmackOptions { public: static const llvm::cl::list EntryPoints; + static const llvm::cl::list CheckedFunctions; static const llvm::cl::opt WarningLevel; static const llvm::cl::opt ColoredWarnings; @@ -37,6 +38,7 @@ class SmackOptions { static const llvm::cl::opt WrappedIntegerEncoding; static bool isEntryPoint(llvm::StringRef); + static bool shouldCheckFunction(llvm::StringRef); }; } // namespace smack diff --git a/lib/smack/IntegerOverflowChecker.cpp b/lib/smack/IntegerOverflowChecker.cpp index fe2d9a648..31e38c53f 100644 --- a/lib/smack/IntegerOverflowChecker.cpp +++ b/lib/smack/IntegerOverflowChecker.cpp @@ -137,7 +137,8 @@ bool IntegerOverflowChecker::runOnModule(Module &m) { // Add check for UBSan left shift/signed division when needed ConstantInt *flag = ConstantInt::getTrue(ci->getFunction()->getContext()); - addCheck(co, flag, ci); + if (SmackOptions::shouldCheckFunction(F.getName())) + addCheck(co, flag, ci); addBlockingAssume(va, flag, ci); ci->replaceAllUsesWith(flag); instToErase.push_back(ci); @@ -176,7 +177,8 @@ bool IntegerOverflowChecker::runOnModule(Module &m) { INSTRUCTION_TABLE.at(op), eo1, eo2, "", ci); Value *r = createResult(ai, bits, &*I); BinaryOperator *flag = createFlag(ai, bits, isSigned, ci); - if (SmackOptions::IntegerOverflow) + if (SmackOptions::IntegerOverflow && + SmackOptions::shouldCheckFunction(F.getName())) addCheck(co, flag, ci); for (auto U : ci->users()) { if (ExtractValueInst *ei = dyn_cast(U)) { diff --git a/lib/smack/MemorySafetyChecker.cpp b/lib/smack/MemorySafetyChecker.cpp index fbb5fbabd..b57c304a2 100644 --- a/lib/smack/MemorySafetyChecker.cpp +++ b/lib/smack/MemorySafetyChecker.cpp @@ -55,7 +55,8 @@ void MemorySafetyChecker::insertMemoryAccessCheck(Value *addr, Value *size, } bool MemorySafetyChecker::runOnFunction(Function &F) { - if (Naming::isSmackName(F.getName())) + if (Naming::isSmackName(F.getName()) || + !SmackOptions::shouldCheckFunction(F.getName())) return false; this->visit(F); diff --git a/lib/smack/SmackInstGenerator.cpp b/lib/smack/SmackInstGenerator.cpp index 4ae9e1ce5..216caf3c3 100644 --- a/lib/smack/SmackInstGenerator.cpp +++ b/lib/smack/SmackInstGenerator.cpp @@ -647,10 +647,17 @@ void SmackInstGenerator::visitCallInst(llvm::CallInst &ci) { StringRef name = f->hasName() ? f->getName() : ""; - if (SmackOptions::RustPanics && Naming::isRustPanic(name)) { + if (SmackOptions::RustPanics && Naming::isRustPanic(name) && + SmackOptions::shouldCheckFunction( + ci.getParent()->getParent()->getName())) { // Convert Rust's panic functions into assertion violations emit(Stmt::assert_(Expr::lit(false), {Attr::attr(Naming::RUST_PANIC_ANNOTATION)})); + } else if (name == "__VERIFIER_assert" && + !SmackOptions::shouldCheckFunction( + ci.getParent()->getParent()->getName())) { + // Skip this assertion if we shouldn't check in the parent function + return; } else if (name.find(Naming::VALUE_PROC) != StringRef::npos) { emit(rep->valueAnnotation(ci)); @@ -914,7 +921,8 @@ void SmackInstGenerator::visitIntrinsicInst(llvm::IntrinsicInst &ii) { auto llvmTrue = SmackOptions::BitPrecise ? Expr::lit(1, 1) : Expr::lit(1LL); auto chkStmt = Expr::eq(arg, llvmTrue); - if (SmackOptions::LLVMAssumes == LLVMAssumeType::check) + if (SmackOptions::LLVMAssumes == LLVMAssumeType::check && + SmackOptions::shouldCheckFunction(ci->getFunction()->getName())) emit(Stmt::assert_(chkStmt)); else emit(Stmt::assume(chkStmt)); diff --git a/lib/smack/SmackOptions.cpp b/lib/smack/SmackOptions.cpp index a6455d87f..0bb40747e 100644 --- a/lib/smack/SmackOptions.cpp +++ b/lib/smack/SmackOptions.cpp @@ -12,6 +12,11 @@ const llvm::cl::list llvm::cl::desc("Entry point procedure names"), llvm::cl::value_desc("PROCS")); +const llvm::cl::list SmackOptions::CheckedFunctions( + "checked-functions", llvm::cl::ZeroOrMore, + llvm::cl::desc("Functions in which to check properties"), + llvm::cl::value_desc("PROCS")); + const llvm::cl::opt SmackOptions::WarningLevel( "warn-type", llvm::cl::desc("Enable certain type of warning messages."), llvm::cl::values(clEnumValN(SmackWarnings::WarningLevel::Silent, "silent", @@ -97,4 +102,10 @@ bool SmackOptions::isEntryPoint(llvm::StringRef name) { return true; return false; } + +bool SmackOptions::shouldCheckFunction(llvm::StringRef name) { + return CheckedFunctions.size() == 0 || // If empty, check everything + std::find(CheckedFunctions.begin(), CheckedFunctions.end(), name) != + CheckedFunctions.end(); +} } // namespace smack diff --git a/share/smack/top.py b/share/smack/top.py index 7fcf3f994..98bb64e3b 100755 --- a/share/smack/top.py +++ b/share/smack/top.py @@ -469,6 +469,13 @@ def arguments(): default=['main'], help='specify top-level procedures [default: %(default)s]') + translate_group.add_argument( + '--checked-functions', + metavar='PROC', + nargs='+', + default=[], + help='specify functions to do property checking [default: everything]') + translate_group.add_argument( '--check', metavar='PROPERTY', @@ -702,6 +709,8 @@ def llvm_to_bpl(args): cmd += ['-source-loc-syms'] for ep in args.entry_points: cmd += ['-entry-points', ep] + for cf in args.checked_functions: + cmd += ['-checked-functions', cf] if args.debug: cmd += ['-debug'] if args.debug_only: diff --git a/test/c/targeted-checks/targeted_assertion.c b/test/c/targeted-checks/targeted_assertion.c new file mode 100644 index 000000000..05746a8c0 --- /dev/null +++ b/test/c/targeted-checks/targeted_assertion.c @@ -0,0 +1,9 @@ +#include "smack.h" +#include + +// @flag --checked-functions main +// @expect verified + +void fun() { __VERIFIER_assert(__VERIFIER_nondet_int()); } + +int main() { fun(); } diff --git a/test/c/targeted-checks/targeted_assertion_fail.c b/test/c/targeted-checks/targeted_assertion_fail.c new file mode 100644 index 000000000..cf267d589 --- /dev/null +++ b/test/c/targeted-checks/targeted_assertion_fail.c @@ -0,0 +1,9 @@ +#include "smack.h" +#include + +// @flag --checked-functions main fun +// @expect error + +void fun() { __VERIFIER_assert(__VERIFIER_nondet_int()); } + +int main() { fun(); } diff --git a/test/c/targeted-checks/targeted_assume_checking.c b/test/c/targeted-checks/targeted_assume_checking.c new file mode 100644 index 000000000..1c5f8c25a --- /dev/null +++ b/test/c/targeted-checks/targeted_assume_checking.c @@ -0,0 +1,11 @@ +#include "smack.h" +#include + +// @flag --checked-functions main +// @flag --llvm-assumes check +// @flag --check none +// @expect verified + +void fun() { __builtin_assume(__VERIFIER_nondet_int() == 0); } + +int main() { fun(); } diff --git a/test/c/targeted-checks/targeted_assume_checking_fail.c b/test/c/targeted-checks/targeted_assume_checking_fail.c new file mode 100644 index 000000000..7f56ec1d1 --- /dev/null +++ b/test/c/targeted-checks/targeted_assume_checking_fail.c @@ -0,0 +1,11 @@ +#include "smack.h" +#include + +// @flag --checked-functions main fun +// @flag --llvm-assumes check +// @flag --check none +// @expect verified + +void fun() { __builtin_assume(__VERIFIER_nondet_int() == 0); } + +int main() { fun(); } diff --git a/test/c/targeted-checks/targeted_memory_safety.c b/test/c/targeted-checks/targeted_memory_safety.c new file mode 100644 index 000000000..3ea0c6bc1 --- /dev/null +++ b/test/c/targeted-checks/targeted_memory_safety.c @@ -0,0 +1,22 @@ +#include "smack.h" +#include + +// @flag --checked-functions main +// @flag --check memory-safety +// @expect verified + +struct BUF { + int *x; + size_t size; +}; + +int get_last(struct BUF b) { + // Access one past end of array + return b.x[b.size]; +} + +int main() { + int a[5] = {}; + struct BUF x = {a, 5}; + return get_last(x); +} diff --git a/test/c/targeted-checks/targeted_memory_safety_fail.c b/test/c/targeted-checks/targeted_memory_safety_fail.c new file mode 100644 index 000000000..46f50d01f --- /dev/null +++ b/test/c/targeted-checks/targeted_memory_safety_fail.c @@ -0,0 +1,22 @@ +#include "smack.h" +#include + +// @flag --checked-functions main get_last +// @flag --check memory-safety +// @expect error + +struct BUF { + int *x; + size_t size; +}; + +int get_last(struct BUF b) { + // Access one past end of array + return b.x[b.size]; +} + +int main() { + int a[5] = {}; + struct BUF x = {a, 5}; + return get_last(x); +} diff --git a/test/c/targeted-checks/targeted_overflow_arithmetic.c b/test/c/targeted-checks/targeted_overflow_arithmetic.c new file mode 100644 index 000000000..91bef4747 --- /dev/null +++ b/test/c/targeted-checks/targeted_overflow_arithmetic.c @@ -0,0 +1,14 @@ +#include "smack.h" +#include + +// @flag --checked-functions main +// @flag --check integer-overflow +// @expect verified + +int compute(int a, int b) { return a + b; } + +int main() { + int a = __VERIFIER_nondet_int(); + int b = __VERIFIER_nondet_int(); + return compute(a, b); +} diff --git a/test/c/targeted-checks/targeted_overflow_arithmetic_fail.c b/test/c/targeted-checks/targeted_overflow_arithmetic_fail.c new file mode 100644 index 000000000..597000144 --- /dev/null +++ b/test/c/targeted-checks/targeted_overflow_arithmetic_fail.c @@ -0,0 +1,14 @@ +#include "smack.h" +#include + +// @flag --checked-functions main compute +// @flag --check integer-overflow +// @expect error + +int compute(int a, int b) { return a + b; } + +int main() { + int a = __VERIFIER_nondet_int(); + int b = __VERIFIER_nondet_int(); + return compute(a, b); +} diff --git a/test/c/targeted-checks/targeted_overflow_shift.c b/test/c/targeted-checks/targeted_overflow_shift.c new file mode 100644 index 000000000..96246125a --- /dev/null +++ b/test/c/targeted-checks/targeted_overflow_shift.c @@ -0,0 +1,14 @@ +#include "smack.h" +#include + +// @flag --checked-functions main +// @flag --check integer-overflow +// @expect verified + +int compute(int a, int b) { return a << b; } + +int main() { + int a = __VERIFIER_nondet_int(); + int b = __VERIFIER_nondet_int(); + return compute(a, b); +} diff --git a/test/c/targeted-checks/targeted_overflow_shift_fail.c b/test/c/targeted-checks/targeted_overflow_shift_fail.c new file mode 100644 index 000000000..ace26d974 --- /dev/null +++ b/test/c/targeted-checks/targeted_overflow_shift_fail.c @@ -0,0 +1,14 @@ +#include "smack.h" +#include + +// @flag --checked-functions main compute +// @flag --check integer-overflow +// @expect error + +int compute(int a, int b) { return a << b; } + +int main() { + int a = __VERIFIER_nondet_int(); + int b = __VERIFIER_nondet_int(); + return compute(a, b); +} diff --git a/test/rust/targeted-checks/targeted_panic.rs b/test/rust/targeted-checks/targeted_panic.rs new file mode 100644 index 000000000..17aacc63d --- /dev/null +++ b/test/rust/targeted-checks/targeted_panic.rs @@ -0,0 +1,16 @@ +#[macro_use] +extern crate smack; +use smack::*; + +// @flag --checked-functions main +// @flag --check rust-panics +// @expect verified + +#[no_mangle] +fn dont_call_me() { + panic!(); +} + +fn main() { + dont_call_me(); +} diff --git a/test/rust/targeted-checks/targeted_panic_fail.rs b/test/rust/targeted-checks/targeted_panic_fail.rs new file mode 100644 index 000000000..d191cc3e1 --- /dev/null +++ b/test/rust/targeted-checks/targeted_panic_fail.rs @@ -0,0 +1,16 @@ +#[macro_use] +extern crate smack; +use smack::*; + +// @flag --checked-functions dont_call_me +// @flag --check rust-panics +// @expect error + +#[no_mangle] +fn dont_call_me() { + panic!(); +} + +fn main() { + dont_call_me(); +} From db9de31a0ac8b4d89b76f0b1a32c8414f77d89d7 Mon Sep 17 00:00:00 2001 From: "Mark S. Baranowski" Date: Thu, 8 Apr 2021 17:21:07 -0600 Subject: [PATCH 03/25] Enable regular expressions for targeted fuction checking --- lib/smack/SmackOptions.cpp | 14 +++++++++++--- share/smack/top.py | 5 ++++- test/c/targeted-checks/test-match.c | 13 +++++++++++++ test/c/targeted-checks/test-match_fail1.c | 13 +++++++++++++ test/c/targeted-checks/test-match_fail2.c | 13 +++++++++++++ test/c/targeted-checks/test-match_fail3.c | 13 +++++++++++++ test/rust/targeted-checks/targeted_panic2.rs | 15 +++++++++++++++ test/rust/targeted-checks/targeted_panic2_fail.rs | 15 +++++++++++++++ 8 files changed, 97 insertions(+), 4 deletions(-) create mode 100644 test/c/targeted-checks/test-match.c create mode 100644 test/c/targeted-checks/test-match_fail1.c create mode 100644 test/c/targeted-checks/test-match_fail2.c create mode 100644 test/c/targeted-checks/test-match_fail3.c create mode 100644 test/rust/targeted-checks/targeted_panic2.rs create mode 100644 test/rust/targeted-checks/targeted_panic2_fail.rs diff --git a/lib/smack/SmackOptions.cpp b/lib/smack/SmackOptions.cpp index 0bb40747e..fba7ba76d 100644 --- a/lib/smack/SmackOptions.cpp +++ b/lib/smack/SmackOptions.cpp @@ -4,6 +4,7 @@ #include "smack/SmackOptions.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Regex.h" namespace smack { @@ -104,8 +105,15 @@ bool SmackOptions::isEntryPoint(llvm::StringRef name) { } bool SmackOptions::shouldCheckFunction(llvm::StringRef name) { - return CheckedFunctions.size() == 0 || // If empty, check everything - std::find(CheckedFunctions.begin(), CheckedFunctions.end(), name) != - CheckedFunctions.end(); + if (CheckedFunctions.size() == 0) { + return false; + } + for (llvm::StringRef s : CheckedFunctions) { + llvm::SmallVector matches; + if (llvm::Regex(s).match(name, &matches) && matches[0] == name) { + return true; + } + } + return false; } } // namespace smack diff --git a/share/smack/top.py b/share/smack/top.py index 98bb64e3b..57ab4dd9d 100755 --- a/share/smack/top.py +++ b/share/smack/top.py @@ -474,7 +474,10 @@ def arguments(): metavar='PROC', nargs='+', default=[], - help='specify functions to do property checking [default: everything]') + help='''specify functions on which to do property checking. + These can be specified as extended regular expressions. + NOTE: a regular expression must match the entire + function name. [default: everything]''') translate_group.add_argument( '--check', diff --git a/test/c/targeted-checks/test-match.c b/test/c/targeted-checks/test-match.c new file mode 100644 index 000000000..7d07eb008 --- /dev/null +++ b/test/c/targeted-checks/test-match.c @@ -0,0 +1,13 @@ +#include "smack.h" + +// @flag --checked-functions should_match1 +// @expect verified + +int should_match1() { assert(1); } + +int should_match12() { assert(0); } + +int main() { + should_match1(); + should_match12(); +} diff --git a/test/c/targeted-checks/test-match_fail1.c b/test/c/targeted-checks/test-match_fail1.c new file mode 100644 index 000000000..d4f525cf4 --- /dev/null +++ b/test/c/targeted-checks/test-match_fail1.c @@ -0,0 +1,13 @@ +#include "smack.h" + +// @flag --checked-functions should_match12 +// @expect error + +int should_match1() { assert(1); } + +int should_match12() { assert(0); } + +int main() { + should_match1(); + should_match12(); +} diff --git a/test/c/targeted-checks/test-match_fail2.c b/test/c/targeted-checks/test-match_fail2.c new file mode 100644 index 000000000..a776e09fa --- /dev/null +++ b/test/c/targeted-checks/test-match_fail2.c @@ -0,0 +1,13 @@ +#include "smack.h" + +// @flag --checked-functions should_match1.* +// @expect error + +int should_match1() { assert(1); } + +int should_match12() { assert(0); } + +int main() { + should_match1(); + should_match12(); +} diff --git a/test/c/targeted-checks/test-match_fail3.c b/test/c/targeted-checks/test-match_fail3.c new file mode 100644 index 000000000..3bfbf9faa --- /dev/null +++ b/test/c/targeted-checks/test-match_fail3.c @@ -0,0 +1,13 @@ +#include "smack.h" + +// @flag --checked-functions should_match.* +// @expect error + +int should_match1() { assert(1); } + +int should_match12() { assert(0); } + +int main() { + should_match1(); + should_match12(); +} diff --git a/test/rust/targeted-checks/targeted_panic2.rs b/test/rust/targeted-checks/targeted_panic2.rs new file mode 100644 index 000000000..55bf21bda --- /dev/null +++ b/test/rust/targeted-checks/targeted_panic2.rs @@ -0,0 +1,15 @@ +#[macro_use] +extern crate smack; +use smack::*; + +// @flag --checked-functions _ZN20targeted_panic_fail212dont_call_me17h.{16} +// @flag --check rust-panics +// @expect verified + +fn dont_call_me() { + panic!(); +} + +fn main() { + dont_call_me(); +} diff --git a/test/rust/targeted-checks/targeted_panic2_fail.rs b/test/rust/targeted-checks/targeted_panic2_fail.rs new file mode 100644 index 000000000..4846013e6 --- /dev/null +++ b/test/rust/targeted-checks/targeted_panic2_fail.rs @@ -0,0 +1,15 @@ +#[macro_use] +extern crate smack; +use smack::*; + +// @flag --checked-functions _ZN20targeted_panic_fail212dont_call_me17h.{17} +// @flag --check rust-panics +// @expect error + +fn dont_call_me() { + panic!(); +} + +fn main() { + dont_call_me(); +} From ed4bfbb8defc0bee2f6f93280a086fdce28f9944 Mon Sep 17 00:00:00 2001 From: "Mark S. Baranowski" Date: Thu, 8 Apr 2021 17:33:16 -0600 Subject: [PATCH 04/25] Fixes --- lib/smack/SmackOptions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/smack/SmackOptions.cpp b/lib/smack/SmackOptions.cpp index fba7ba76d..b3978b09d 100644 --- a/lib/smack/SmackOptions.cpp +++ b/lib/smack/SmackOptions.cpp @@ -106,7 +106,7 @@ bool SmackOptions::isEntryPoint(llvm::StringRef name) { bool SmackOptions::shouldCheckFunction(llvm::StringRef name) { if (CheckedFunctions.size() == 0) { - return false; + return true; } for (llvm::StringRef s : CheckedFunctions) { llvm::SmallVector matches; From 340f158b4be4f0955ff7c3953412648f8901a10b Mon Sep 17 00:00:00 2001 From: Zvonimir Date: Tue, 20 Apr 2021 13:02:53 -0600 Subject: [PATCH 05/25] Updated Yices2 installation process We are now building Yices2 from source to avoid this issue: https://github.com/SRI-CSL/yices2/issues/355 --- bin/build.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/bin/build.sh b/bin/build.sh index be9dd51ab..a531655a4 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -375,14 +375,17 @@ fi if [ ${INSTALL_YICES2} -eq 1 ] ; then if [ ! -d "$YICES2_DIR" ] ; then puts "Installing Yices2" - mkdir -p ${YICES2_DIR} - ${WGET} https://yices.csl.sri.com/releases/${YICES2_VERSION}/yices-${YICES2_VERSION}-x86_64-pc-linux-gnu-static-gmp.tar.gz -O yices2-downloaded.tgz - tar xf yices2-downloaded.tgz - cd yices-${YICES2_VERSION} - ./install-yices ${YICES2_DIR} - cd .. - rm -rf yices2-downloaded.tgz yices-${YICES2_VERSION} + sudo apt-get install -y gperf libgmp-dev + cd ${DEPS_DIR} + git clone -b Yices-${YICES2_VERSION} https://github.com/SRI-CSL/yices2 yices2-src + cd yices2-src + autoconf + ./configure --prefix=${YICES2_DIR} + make -j + make install ln -s ${YICES2_DIR}/bin/yices-smt2 ${YICES2_DIR}/bin/yices2 + cd ${DEPS_DIR} + rm -rf yices2-src puts "Installed Yices2" else puts "Yices2 already installed" From 465280b2433d3b61d1ebfc86f4ffb39ad0c047f3 Mon Sep 17 00:00:00 2001 From: Zvonimir Rakamaric Date: Sat, 24 Apr 2021 17:18:02 -0600 Subject: [PATCH 06/25] Cleaned up handling of SMACK warnings Better naming convention and warning messages. Closes #722 --- include/smack/SmackWarnings.h | 30 ++++++++++----------- lib/smack/SmackInstGenerator.cpp | 31 ++++++++++----------- lib/smack/SmackOptions.cpp | 16 +++++------ lib/smack/SmackRep.cpp | 4 +-- lib/smack/SmackWarnings.cpp | 46 ++++++++++++++++++-------------- share/smack/top.py | 9 ++++--- 6 files changed, 72 insertions(+), 64 deletions(-) diff --git a/include/smack/SmackWarnings.h b/include/smack/SmackWarnings.h index b95aa2ed6..5c3e5d940 100644 --- a/include/smack/SmackWarnings.h +++ b/include/smack/SmackWarnings.h @@ -22,8 +22,8 @@ class SmackWarnings { public: enum class WarningLevel : unsigned { Silent = 0, - Imprecise = 10, // Unhandled intrinsics, asm, etc - Info = 20 // Memory length, etc. + Approximate = 10, // Unhandled intrinsics, asm, etc. + Info = 20 // Memory length, etc. }; enum class FlagRelation : unsigned { And = 0, Or = 1 }; @@ -31,26 +31,26 @@ class SmackWarnings { static UnsetFlagsT getUnsetFlags(RequiredFlagsT flags); static bool isSatisfied(RequiredFlagsT flags, FlagRelation rel); - static void warnUnModeled(std::string unmodeledOpName, Block *currBlock, - const llvm::Instruction *i); + static void warnApproximate(std::string name, Block *currBlock, + const llvm::Instruction *i); - static void warnIfIncomplete(std::string name, RequiredFlagsT requiredFlags, - Block *currBlock, const llvm::Instruction *i, - FlagRelation rel = FlagRelation::And); + static void warnOverApproximate(std::string name, UnsetFlagsT unsetFlags, + Block *currBlock, const llvm::Instruction *i, + FlagRelation rel); - static void warnIfIncomplete(std::string name, UnsetFlagsT unsetFlags, - Block *currBlock, const llvm::Instruction *i, - FlagRelation rel); - - static void warnImprecise(std::string name, std::string description, - UnsetFlagsT unsetFlags, Block *currBlock, - const llvm::Instruction *i, - FlagRelation rel = FlagRelation::And); + static void warnOverApproximate(std::string name, + RequiredFlagsT requiredFlags, + Block *currBlock, const llvm::Instruction *i, + FlagRelation rel = FlagRelation::And); // generate warnings about memcpy/memset length/DSA static void warnInfo(std::string info); private: + static void processApproximate(std::string description, + UnsetFlagsT unsetFlags, Block *currBlock, + const llvm::Instruction *i, + FlagRelation rel = FlagRelation::And); static bool isSufficientWarningLevel(WarningLevel level); static std::string getFlagStr(UnsetFlagsT flags); }; diff --git a/lib/smack/SmackInstGenerator.cpp b/lib/smack/SmackInstGenerator.cpp index 216caf3c3..28b7887ec 100644 --- a/lib/smack/SmackInstGenerator.cpp +++ b/lib/smack/SmackInstGenerator.cpp @@ -339,12 +339,12 @@ void SmackInstGenerator::visitUnreachableInst(llvm::UnreachableInst &ii) { void SmackInstGenerator::visitBinaryOperator(llvm::BinaryOperator &I) { processInstruction(I); if (rep->isBitwiseOp(&I) && I.getType()->getIntegerBitWidth() > 1) - SmackWarnings::warnIfIncomplete(std::string("bitwise operation ") + - I.getOpcodeName(), - {&SmackOptions::BitPrecise}, currBlock, &I); + SmackWarnings::warnOverApproximate( + std::string("bitwise operation ") + I.getOpcodeName(), + {&SmackOptions::BitPrecise}, currBlock, &I); if (rep->isFpArithOp(&I)) - SmackWarnings::warnIfIncomplete( - std::string("floating-point arithmetic ") + I.getOpcodeName(), + SmackWarnings::warnOverApproximate( + std::string("floating-point operation ") + I.getOpcodeName(), {&SmackOptions::FloatEnabled}, currBlock, &I); const Expr *E; @@ -367,9 +367,9 @@ void SmackInstGenerator::visitUnaryOperator(llvm::UnaryOperator &I) { assert(I.getOpcode() == Instruction::FNeg && !isa(I.getType()) && "Unsupported unary operation!"); processInstruction(I); - SmackWarnings::warnIfIncomplete(std::string("floating-point arithmetic ") + - I.getOpcodeName(), - {&SmackOptions::FloatEnabled}, currBlock, &I); + SmackWarnings::warnOverApproximate( + std::string("floating-point operation ") + I.getOpcodeName(), + {&SmackOptions::FloatEnabled}, currBlock, &I); emit(Stmt::assign(rep->expr(&I), rep->uop(&I))); } @@ -634,7 +634,8 @@ void SmackInstGenerator::visitCallInst(llvm::CallInst &ci) { processInstruction(ci); if (ci.isInlineAsm()) { - SmackWarnings::warnUnModeled("inline asm call " + i2s(ci), currBlock, &ci); + SmackWarnings::warnApproximate("inline asm call " + i2s(ci), currBlock, + &ci); emit(Stmt::skip()); return; } @@ -818,8 +819,8 @@ void SmackInstGenerator::visitCallInst(llvm::CallInst &ci) { void SmackInstGenerator::visitCallBrInst(llvm::CallBrInst &cbi) { processInstruction(cbi); - SmackWarnings::warnUnModeled("callbr instruction " + i2s(cbi), currBlock, - &cbi); + SmackWarnings::warnApproximate("callbr instruction " + i2s(cbi), currBlock, + &cbi); emit(Stmt::skip()); } @@ -869,7 +870,7 @@ void SmackInstGenerator::visitLandingPadInst(llvm::LandingPadInst &lpi) { emit(Stmt::assign(rep->expr(&lpi), Expr::id(Naming::EXN_VAL_VAR))); if (lpi.isCleanup()) emit(Stmt::assign(Expr::id(Naming::EXN_VAR), Expr::lit(false))); - SmackWarnings::warnUnModeled("landingpad clauses", currBlock, &lpi); + SmackWarnings::warnApproximate("landingpad clauses", currBlock, &lpi); } /******************************************************************************/ @@ -901,7 +902,7 @@ void SmackInstGenerator::visitIntrinsicInst(llvm::IntrinsicInst &ii) { if (satisfied) modelGenFunc(ci); else { - SmackWarnings::warnIfIncomplete( + SmackWarnings::warnOverApproximate( "call to " + ci->getCalledFunction()->getName().str(), unsetFlags, currBlock, ci, rel); emit(rep->call(ci->getCalledFunction(), *ci)); @@ -1218,8 +1219,8 @@ void SmackInstGenerator::visitIntrinsicInst(llvm::IntrinsicInst &ii) { if (it != stmtMap.end()) it->second(&ii); else { - SmackWarnings::warnUnModeled(ii.getCalledFunction()->getName().str(), - currBlock, &ii); + SmackWarnings::warnApproximate(ii.getCalledFunction()->getName().str(), + currBlock, &ii); emit(rep->call(ii.getCalledFunction(), ii)); } } diff --git a/lib/smack/SmackOptions.cpp b/lib/smack/SmackOptions.cpp index b3978b09d..8ee361e07 100644 --- a/lib/smack/SmackOptions.cpp +++ b/lib/smack/SmackOptions.cpp @@ -20,14 +20,14 @@ const llvm::cl::list SmackOptions::CheckedFunctions( const llvm::cl::opt SmackOptions::WarningLevel( "warn-type", llvm::cl::desc("Enable certain type of warning messages."), - llvm::cl::values(clEnumValN(SmackWarnings::WarningLevel::Silent, "silent", - "No warning messages"), - clEnumValN(SmackWarnings::WarningLevel::Imprecise, - "imprecise", - "Enable warnings about imprecise modeling"), - clEnumValN(SmackWarnings::WarningLevel::Info, "info", - "Enable warnings about imprecise modeling and " - "translation information"))); + llvm::cl::values( + clEnumValN(SmackWarnings::WarningLevel::Silent, "silent", + "No warning messages"), + clEnumValN(SmackWarnings::WarningLevel::Approximate, "approximate", + "Enable warnings about introduced approximations"), + clEnumValN(SmackWarnings::WarningLevel::Info, "info", + "Enable warnings about introduced approximations and " + "translation information"))); const llvm::cl::opt SmackOptions::ColoredWarnings( "colored-warnings", llvm::cl::desc("Enable colored warning messages.")); diff --git a/lib/smack/SmackRep.cpp b/lib/smack/SmackRep.cpp index 97cfbc754..12128c81c 100644 --- a/lib/smack/SmackRep.cpp +++ b/lib/smack/SmackRep.cpp @@ -857,8 +857,8 @@ const Expr *SmackRep::expr(const llvm::Value *v, bool isConstIntUnsigned, } } else if (isa(v)) { - SmackWarnings::warnUnModeled("inline asm passed as argument", nullptr, - nullptr); + SmackWarnings::warnApproximate("inline asm passed as argument", nullptr, + nullptr); return pointerLit(0ULL); } else { diff --git a/lib/smack/SmackWarnings.cpp b/lib/smack/SmackWarnings.cpp index 8c08181b8..835b30c7c 100644 --- a/lib/smack/SmackWarnings.cpp +++ b/lib/smack/SmackWarnings.cpp @@ -54,34 +54,40 @@ std::string SmackWarnings::getFlagStr(UnsetFlagsT flags) { return ret + "}"; } -void SmackWarnings::warnUnModeled(std::string unmodeledOpName, Block *currBlock, - const Instruction *i) { - warnImprecise("unmodeled operation " + unmodeledOpName, "", {}, currBlock, i); +void SmackWarnings::warnApproximate(std::string name, Block *currBlock, + const Instruction *i) { + processApproximate( + "approximating " + name + + " (can lead to both false alarms and missed detections)", + {}, currBlock, i); } -void SmackWarnings::warnIfIncomplete(std::string name, UnsetFlagsT unsetFlags, - Block *currBlock, const Instruction *i, - FlagRelation rel) { - warnImprecise(name, "over-approximating", unsetFlags, currBlock, i, rel); +void SmackWarnings::warnOverApproximate(std::string name, + UnsetFlagsT unsetFlags, + Block *currBlock, const Instruction *i, + FlagRelation rel) { + processApproximate("overapproximating " + name + + " (can lead to false alarms)", + unsetFlags, currBlock, i, rel); } -void SmackWarnings::warnIfIncomplete(std::string name, - RequiredFlagsT requiredFlags, - Block *currBlock, const Instruction *i, - FlagRelation rel) { +void SmackWarnings::warnOverApproximate(std::string name, + RequiredFlagsT requiredFlags, + Block *currBlock, const Instruction *i, + FlagRelation rel) { if (!isSatisfied(requiredFlags, rel)) - warnIfIncomplete(name, getUnsetFlags(requiredFlags), currBlock, i, rel); + warnOverApproximate(name, getUnsetFlags(requiredFlags), currBlock, i, rel); } -void SmackWarnings::warnImprecise(std::string name, std::string description, - UnsetFlagsT unsetFlags, Block *currBlock, - const Instruction *i, FlagRelation rel) { - if (!isSufficientWarningLevel(WarningLevel::Imprecise)) +void SmackWarnings::processApproximate(std::string description, + UnsetFlagsT unsetFlags, Block *currBlock, + const Instruction *i, FlagRelation rel) { + if (!isSufficientWarningLevel(WarningLevel::Approximate)) return; - std::string beginning = std::string("llvm2bpl: ") + buildDebugInfo(i); - std::string end = description + " " + name + ";"; + std::string beginning = buildDebugInfo(i); + std::string end = description + ";"; if (currBlock) - currBlock->addStmt(Stmt::comment(beginning + "warning: " + end)); + currBlock->addStmt(Stmt::comment(beginning + "SMACK warning: " + end)); std::string hint = ""; if (!unsetFlags.empty()) hint = (" try adding " + ((rel == FlagRelation::And ? "all the " : "any ") + @@ -89,7 +95,7 @@ void SmackWarnings::warnImprecise(std::string name, std::string description, errs() << beginning; (SmackOptions::ColoredWarnings ? errs().changeColor(raw_ostream::MAGENTA) : errs()) - << "warning: "; + << "SMACK warning: "; (SmackOptions::ColoredWarnings ? errs().resetColor() : errs()) << end << hint << "\n"; } diff --git a/share/smack/top.py b/share/smack/top.py index a64e07eee..95dd69b81 100755 --- a/share/smack/top.py +++ b/share/smack/top.py @@ -309,12 +309,13 @@ def arguments(): type=str, help='limit debugging output to given MODULES') - noise_group.add_argument('--warn', default="imprecise", - choices=['silent', 'imprecise', 'info'], + noise_group.add_argument('--warn', default="approximate", + choices=['silent', 'approximate', 'info'], help='''enable certain type of warning messages (silent: no warning messages; - unsound: warnings about imprecise modeling; - info: warnings about imprecise modeling/translation information) + approximate: warnings about introduced approximations; + info: warnings about introduced approximations and + translation information) [default: %(default)s]''') parser.add_argument( From ccbb45ea8945053e7a679184a46c3beae26c4b4f Mon Sep 17 00:00:00 2001 From: Shaobo He Date: Mon, 26 Apr 2021 20:19:58 -0700 Subject: [PATCH 07/25] Fixed a undefined behavior in ExtractContracts.cpp Fixes #724 --- lib/smack/ExtractContracts.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/smack/ExtractContracts.cpp b/lib/smack/ExtractContracts.cpp index 4d8b81b63..3554313f4 100644 --- a/lib/smack/ExtractContracts.cpp +++ b/lib/smack/ExtractContracts.cpp @@ -92,10 +92,12 @@ std::tuple splitContractBlocks(Function &F, LoopInfo &LI) { << "\n"); BasicBlock *B = CI->getParent(); auto NewBB = B->splitBasicBlock(++CI->getIterator()); - LI.getLoopFor(B)->addBasicBlockToLoop(NewBB, LI); + auto L = LI.getLoopFor(B); + if (L) + L->addBasicBlockToLoop(NewBB, LI); blocks.push_front(NewBB); - if (auto L = LI[B]) + if (L) invariantBlocks[L].push_back(B); else contractBlocks.push_back(B); From 249f805822ebacf8c695db7d9514e9f8b4c638e4 Mon Sep 17 00:00:00 2001 From: "Mark S. Baranowski" Date: Thu, 29 Apr 2021 20:11:48 -0600 Subject: [PATCH 08/25] Enable flags to be set through the environment Fix --- bin/build.sh | 50 +++++++++++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/bin/build.sh b/bin/build.sh index a531655a4..4c902315c 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -22,21 +22,22 @@ ################################################################################ # Set these flags to control various installation options -INSTALL_DEPENDENCIES=1 -INSTALL_MONO=0 # Mono is needed only for lockpwn and symbooglix -INSTALL_Z3=1 -INSTALL_CVC4=0 -INSTALL_YICES2=0 -INSTALL_BOOGIE=1 -INSTALL_CORRAL=1 -BUILD_SYMBOOGLIX=0 -BUILD_LOCKPWN=0 -BUILD_SMACK=1 -TEST_SMACK=1 -BUILD_LLVM=0 # LLVM is typically installed from packages (see below) +INSTALL_DEPENDENCIES=${INSTALL_DEPENDENCIES:-1} +INSTALL_MONO=${INSTALL_MONO:-0} # Mono is needed only for lockpwn and symbooglix +INSTALL_Z3=${INSTALL_Z3:-1} +INSTALL_CVC4=${INSTALL_CVC4:-0} +INSTALL_YICES2=${INSTALL_YICES2:-0} +INSTALL_BOOGIE=${INSTALL_BOOGIE:-1} +INSTALL_CORRAL=${INSTALL_CORRAL:-1} +BUILD_SYMBOOGLIX=${BUILD_SYMBOOGLIX:-0} +BUILD_LOCKPWN=${BUILD_LOCKPWN:-0} +BUILD_SMACK=${BUILD_SMACK:-1} +TEST_SMACK=${TEST_SMACK:-1} +INSTALL_LLVM=${INSTALL_LLVM:-1} +BUILD_LLVM=${BUILD_LLVM:-0} # LLVM is typically installed from packages (see below) # Support for more programming languages -INSTALL_OBJECTIVEC=0 +INSTALL_OBJECTIVEC=${INSTALL_OBJECTIVEC:-0} INSTALL_RUST=${INSTALL_RUST:-0} # Development dependencies @@ -190,23 +191,32 @@ puts "Detected distribution: $distro" case "$distro" in linux-opensuse*) Z3_DOWNLOAD_LINK="https://github.com/Z3Prover/z3/releases/download/z3-${Z3_VERSION}/z3-${Z3_VERSION}-x64-debian-8.10.zip" - DEPENDENCIES+=" llvm-clang llvm-devel gcc-c++ make" + if [ ${INSTALL_LLVM} -eq 1 ] ; then + DEPENDENCIES+=" llvm-clang llvm-devel" + fi + DEPENDENCIES+=" gcc-c++ make" DEPENDENCIES+=" ncurses-devel" ;; linux-@(ubuntu|neon)-16*) Z3_DOWNLOAD_LINK="https://github.com/Z3Prover/z3/releases/download/z3-${Z3_VERSION}/z3-${Z3_VERSION}-x64-ubuntu-18.04.zip" - DEPENDENCIES+=" clang-${LLVM_SHORT_VERSION} llvm-${LLVM_SHORT_VERSION}-dev" + if [ ${INSTALL_LLVM} -eq 1 ] ; then + DEPENDENCIES+=" clang-${LLVM_SHORT_VERSION} llvm-${LLVM_SHORT_VERSION}-dev" + fi ;; linux-@(ubuntu|neon)-18*) Z3_DOWNLOAD_LINK="https://github.com/Z3Prover/z3/releases/download/z3-${Z3_VERSION}/z3-${Z3_VERSION}-x64-ubuntu-18.04.zip" - DEPENDENCIES+=" clang-${LLVM_SHORT_VERSION} llvm-${LLVM_SHORT_VERSION}-dev" + if [ ${INSTALL_LLVM} -eq 1 ] ; then + DEPENDENCIES+=" clang-${LLVM_SHORT_VERSION} llvm-${LLVM_SHORT_VERSION}-dev" + fi ;; linux-@(ubuntu|neon)-20*) Z3_DOWNLOAD_LINK="https://github.com/Z3Prover/z3/releases/download/z3-${Z3_VERSION}/z3-${Z3_VERSION}-x64-ubuntu-18.04.zip" - DEPENDENCIES+=" clang-${LLVM_SHORT_VERSION} llvm-${LLVM_SHORT_VERSION}-dev" + if [ ${INSTALL_LLVM} -eq 1 ] ; then + DEPENDENCIES+=" clang-${LLVM_SHORT_VERSION} llvm-${LLVM_SHORT_VERSION}-dev" + fi ;; *) @@ -268,8 +278,10 @@ if [ ${INSTALL_DEPENDENCIES} -eq 1 ] ; then fi # Adding LLVM repository - ${WGET} -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo add-apt-repository "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-${LLVM_SHORT_VERSION} main" + if [ ${INSTALL_LLVM} -eq 1 ] ; then + ${WGET} -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + sudo add-apt-repository "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-${LLVM_SHORT_VERSION} main" + fi # Adding .NET repository ${WGET} -q https://packages.microsoft.com/config/ubuntu/${RELEASE_VERSION}/packages-microsoft-prod.deb -O packages-microsoft-prod.deb From 3aa7c34213b4063b158d341cd979da0adbbc4f5f Mon Sep 17 00:00:00 2001 From: Shaobo He Date: Fri, 30 Apr 2021 14:31:19 -0700 Subject: [PATCH 09/25] Added allocation size attribute for global variables --- include/smack/SmackRep.h | 3 +++ lib/smack/SmackRep.cpp | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/include/smack/SmackRep.h b/include/smack/SmackRep.h index 499930e6a..dc3584fde 100644 --- a/include/smack/SmackRep.h +++ b/include/smack/SmackRep.h @@ -22,6 +22,7 @@ class ProcDecl; class Stmt; class Expr; class Regions; +class Attr; using llvm::Regex; using llvm::SmallVector; @@ -113,6 +114,8 @@ class SmackRep { bool isUnsafeFloatAccess(const llvm::Type *elemTy, const llvm::Type *resultTy); + void addAllocSizeAttr(const llvm::GlobalVariable *, + std::list &); public: const Expr *pointerLit(unsigned v) { diff --git a/lib/smack/SmackRep.cpp b/lib/smack/SmackRep.cpp index 12128c81c..8b6bb9c5e 100644 --- a/lib/smack/SmackRep.cpp +++ b/lib/smack/SmackRep.cpp @@ -1249,6 +1249,14 @@ Decl *SmackRep::getInitFuncs() { return proc; } +void SmackRep::addAllocSizeAttr(const llvm::GlobalVariable *G, + std::list &ax) { + auto T = dyn_cast(G->getType()); + assert(T && "Global variables should have pointer types!"); + auto allocSize = targetData->getTypeAllocSize(T->getElementType()); + ax.push_back(Attr::attr("allocSize", allocSize)); +} + std::list SmackRep::globalDecl(const llvm::GlobalValue *v) { using namespace llvm; std::list decls; @@ -1262,6 +1270,7 @@ std::list SmackRep::globalDecl(const llvm::GlobalValue *v) { bool external = false; if (const GlobalVariable *g = dyn_cast(v)) { + addAllocSizeAttr(g, ax); if (g->hasInitializer()) { const Constant *init = g->getInitializer(); unsigned numElems = numElements(init); From 91aecd5d0d6eef9f4f77611c346642403bb1891a Mon Sep 17 00:00:00 2001 From: "Mark S. Baranowski" Date: Fri, 30 Apr 2021 16:57:26 -0600 Subject: [PATCH 10/25] Don't hard-code current PATH when doing a prefix install --- bin/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/build.sh b/bin/build.sh index 4c902315c..4bfce55bf 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -234,7 +234,7 @@ do INSTALL_PREFIX="${2%/}" CONFIGURE_INSTALL_PREFIX="--prefix=$2" CMAKE_INSTALL_PREFIX="-DCMAKE_INSTALL_PREFIX=$2" - echo export PATH=${INSTALL_PREFIX}/bin:$PATH >> ${SMACKENV} + echo export PATH=\"${INSTALL_PREFIX}/bin:\$PATH\" >> ${SMACKENV} shift shift ;; From 219d201b9f910fcebed55c118db3307de1c287ef Mon Sep 17 00:00:00 2001 From: Zvonimir Date: Sat, 1 May 2021 10:21:55 -0600 Subject: [PATCH 11/25] Updated links to vsmack --- docs/installation.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 778d48a6c..d60cec4e4 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -12,16 +12,17 @@ our prepackaged Vagrant box. ### Super-Quick Setup: Virtual Smack -Just download [vsmack](bin/vsmack) and put it in your executable path, ensure +Just download [vsmack](https://github.com/smackers/smack/blob/master/bin/vsmack) +and put it in your executable path, ensure [Vagrant][] and [VirtualBox][] are installed, and run `vsmack` directly on your source files. For example, ````Shell # fetch vsmack and set executable permission -wget -O ~/bin/vsmack https://raw.githubusercontent.com/smackers/smack/develop/bin/vsmack +wget -O ~/bin/vsmack https://raw.githubusercontent.com/smackers/smack/master/bin/vsmack chmod u+x ~/bin/vsmack # fetch a source file -wget https://raw.githubusercontent.com/smackers/smack/develop/test/basic/simple.c +wget https://raw.githubusercontent.com/smackers/smack/master/test/basic/simple.c # run vsmack vsmack simple.c From 3574136a1a875dd3c09c110acb878f591482499d Mon Sep 17 00:00:00 2001 From: Zvonimir Date: Tue, 4 May 2021 17:32:47 -0600 Subject: [PATCH 12/25] Remove virtual SMACK installation option It hasn't really been used actively and nobody has been maintaining it. Hence, we decided to remove it. Closes #729 --- bin/vsmack | 90 -------------------------------------------- docs/installation.md | 20 +--------- 2 files changed, 1 insertion(+), 109 deletions(-) delete mode 100755 bin/vsmack diff --git a/bin/vsmack b/bin/vsmack deleted file mode 100755 index 253c3ad73..000000000 --- a/bin/vsmack +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env python3 - -import argparse -import os.path -import subprocess -import sys - -WORKING_PATH = os.getcwd().replace('\\', r'\\') -MACHINE_PATH = os.path.join(os.path.expanduser("~"), ".vsmack") -VIRTUAL_PATH = '/home/vagrant/scratch' -VAGRANT_BOX = 'smackers/smack' - -DESCRIPTION = """ -Virtualized SMACK - -NOTE: this deployment has several inherent sources of overhead, -* downloading a pre-provisioned virtual machine (VM) image (once) -* creating the VM (once, until destroyed) -* starting the VM (once, until halted) -* running smack inside of the VM (always) -All of this overhead can be avoided by building Smack natively, - https://github.com/smackers/smack - -NOTE: this command leaves a VM running at the following path, - %(MACHINE_PATH)s -The following flags alter this default behavior, -* the `--halt` flag halts the VM after invoking smack -* the `--destroy` flag destroys the VM after invoking smack - -NOTE: this command gives the VM recursive access to the working directory only. -Files outside of the current working director will not be accessible. -""" % globals() - -VAGRANTFILE = """ -Vagrant.configure("2") do |config| - config.vm.box = "%(VAGRANT_BOX)s" - config.vm.synced_folder "%(WORKING_PATH)s", "%(VIRTUAL_PATH)s" -end -""" % globals() - -if __name__ == '__main__': - - parser = argparse.ArgumentParser( - description = DESCRIPTION, - formatter_class=argparse.RawTextHelpFormatter) - - parser.add_argument('--halt', - action = 'store_true', - help = 'halt the created vagrant box after running smack') - - parser.add_argument('--destroy', - action = 'store_true', - help = 'destroy the created vagrant box after running smack') - - args, smack_args = parser.parse_known_args() - - if subprocess.call(['which', 'vagrant'], stdout = subprocess.PIPE): - sys.exit('error: cannot find `vagrant`; it must be installed https://www.vagrantup.com') - - try: - if not os.path.exists(MACHINE_PATH): - os.makedirs(MACHINE_PATH) - - with open(os.path.join(MACHINE_PATH, 'Vagrantfile'), 'w') as f: - f.write(VAGRANTFILE) - - if subprocess.call(['vagrant', 'up'], cwd = MACHINE_PATH): - raise Exception('failed to bring up the box') - - subprocess.call(['vagrant', 'ssh', '-c', - '&&'.join([ - "source smack.environment", - "cd %(VIRTUAL_PATH)s" % globals(), - "smack {0}".format(' '.join(smack_args)) - ]) - ], cwd = MACHINE_PATH) - - if args.destroy: - if subprocess.call(['vagrant', 'destroy', '-f'], cwd = MACHINE_PATH): - raise Exception('failed to destroy the box') - - elif args.halt: - if subprocess.call(['vagrant', 'halt'], cwd = MACHINE_PATH): - raise Exception('failed to halt the box') - - except Exception as e: - print('error:', e) - - finally: - pass diff --git a/docs/installation.md b/docs/installation.md index d60cec4e4..a87eec076 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -10,24 +10,6 @@ installation, however, is to launch our reproducible and portable development environment using [Vagrant][]. An even quicker way to get started is to use our prepackaged Vagrant box. -### Super-Quick Setup: Virtual Smack - -Just download [vsmack](https://github.com/smackers/smack/blob/master/bin/vsmack) -and put it in your executable path, ensure -[Vagrant][] and [VirtualBox][] are installed, and run `vsmack` directly on -your source files. For example, -````Shell -# fetch vsmack and set executable permission -wget -O ~/bin/vsmack https://raw.githubusercontent.com/smackers/smack/master/bin/vsmack -chmod u+x ~/bin/vsmack - -# fetch a source file -wget https://raw.githubusercontent.com/smackers/smack/master/test/basic/simple.c - -# run vsmack -vsmack simple.c -```` - ### Quick Setup 1: Vagrant Development Environment SMACK can be run in a preconfigured virtual environment using [Vagrant][] and @@ -57,13 +39,13 @@ vagrant destroy ```` ### Quick Setup 2: Docker + SMACK can also be run in a [Docker][] container. We tested the Dockerfile on the following configurations: * Ubuntu 18.04, Docker version 19.03.6 * Windows WSL Ubuntu 20.04, Docker Desktop with Docker engine version 20.10.2 - #### Docker Hub SMACK's Docker container images can be pulled from Docker Hub directly: From 21fc78824418394784cffac4e57b76c156d4799b Mon Sep 17 00:00:00 2001 From: Zvonimir Date: Tue, 4 May 2021 17:52:06 -0600 Subject: [PATCH 13/25] Updated installation documentation --- docs/installation.md | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index a87eec076..a160e50d2 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -3,12 +3,12 @@ In principle SMACK can be run on any platform on which [LLVM][] and [Boogie][] can run. In practice we have run SMACK on standard Ubuntu and openSUSE Linux -distributions, OS X, and Windows via Cygwin. Below we outline system +distributions, OS X, and Windows. Below we outline system requirements and installation instructions for typical system configurations. A quick way to get started without worrying about system requirements and installation, however, is to launch our reproducible and portable development environment using [Vagrant][]. An even quicker way to get started is to use -our prepackaged Vagrant box. +our prepackaged Docker container. ### Quick Setup 1: Vagrant Development Environment @@ -79,7 +79,6 @@ SMACK depends on the following projects: * [Boost][] version 1.55 or greater * [Python][] version 3.6.8 or greater * [Ninja][] version 1.5.1 or greater -* [Mono][] version 5.0.0 or greater (except on Windows) * [Z3][] or compatible SMT-format theorem prover * [Boogie][] or [Corral][] or compatible Boogie-format verifier * [sea-dsa][] @@ -117,7 +116,7 @@ script. Alternatively, you can read how to accomplish this below. The general instructions for installation on OS X mainly follow those above for Linux, and are outlined in our automated [build.sh][] script in `bin/build.sh`. -Note however that `bin/build.sh` does not run on OS X . it can only be used as +Note however that `bin/build.sh` does not run on OS X . It can only be used as reference guidelines. In addition to the requirements above, installing SMACK and its dependencies @@ -127,20 +126,6 @@ the [Homebrew][] package manager. [Mono][] can be installed from binaries either from the [Mono][] download page, or via [Homebrew Cask][]. ### Installation on Windows -#### Cygwin (Deprecated) - -The general instructions for installation on Windows using [Cygwin][] mainly -follow those above for Linux, and are outlined in our automated [build.sh][] -script in `bin/build.sh`. Note however that an actual [.NET][] Framework and -SDK should be present in place of the [Mono][] emulator, and that prebuilt -[Z3][], [Boogie][], and [Corral][] may be installed via their Windows -installers rather than built from source. - -**NOTE** Although we have not pinpointed the problem exactly, building [LLVM][] -and [Clang][] is problematic on some [Cygwin][] configurations. Please consult -[LLVM][] documentation in case of any issues. - -#### Windows Subsystem for Linux (Recommended) SMACK can be installed on the Windows Subsystem for Linux (WSL) by following the same procedure as the Linux installation (i.e., via the build script [build.sh][]). From 523747fdd1290e63db8d291e1a9100af116c02e7 Mon Sep 17 00:00:00 2001 From: Zvonimir Date: Sun, 23 May 2021 12:20:05 -0600 Subject: [PATCH 14/25] Removing the SMACK mailing list We haven't really been using it, and I don't think we need it going forward. --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 8af7feac4..f3bb22ae8 100644 --- a/README.md +++ b/README.md @@ -39,10 +39,7 @@ See below for system requirements, installation, usage, and everything else. * As a last resort, send mail to [Michael](mailto:michael.emmi@gmail.com), [Zvonimir](mailto:zvonimir@cs.utah.edu), or both. -* To stay informed about updates, you can either watch SMACK's Github page, - or you can join [SMACK's Google Group](http://groups.google.com/group/smack-dev) - mailing list. Even without a Google account, you may join by sending mail to - [smack-dev+subscribe@googlegroups.com](mailto:smack-dev+subscribe@googlegroups.com). +* To stay informed about updates, you can watch SMACK's Github page. ### Acknowledgements From b2b9372e4aa7c94a29da483e1dab2e61ede95ac4 Mon Sep 17 00:00:00 2001 From: Zvonimir Date: Sat, 12 Jun 2021 14:32:42 -0600 Subject: [PATCH 15/25] Fixed issues with the assert header --- share/smack/include/assert.h | 5 ----- share/smack/include/smack.h | 8 +++++++- test/c/basic/extern_func.c | 1 - test/c/basic/init_funcs_example.c | 1 - test/c/basic/init_funcs_example_fail.c | 1 - test/c/basic/printfs.c | 1 - test/c/bits/left_shift_negative_fail.c | 1 - test/c/bits/left_shift_overflow.c | 1 - test/c/bits/left_shift_overflow_fail.c | 1 - test/c/bits/left_shift_unsigned.c | 1 - test/c/bits/left_shift_unsigned_fail.c | 1 - test/c/data/free_as_func_ptr.c | 1 - test/c/failing/bitwise_and.c | 1 + test/c/failing/bitwise_and_fail.c | 1 + test/c/special/bitwise_constant_shifts.c | 1 + test/c/special/bitwise_constant_shifts_fail.c | 1 + test/c/special/countpop8.c | 1 + test/c/special/countpop8_fail.c | 1 + test/c/strings/strcpy_overflow.c | 1 - test/c/strings/test_memcmp.c | 1 + test/c/strings/test_memcmp_fail.c | 1 + test/c/targeted-checks/targeted_assertion.c | 3 ++- test/c/targeted-checks/targeted_assertion_fail.c | 3 ++- test/c/targeted-checks/test-match.c | 1 + test/c/targeted-checks/test-match_fail1.c | 1 + test/c/targeted-checks/test-match_fail2.c | 1 + test/c/targeted-checks/test-match_fail3.c | 1 + 27 files changed, 23 insertions(+), 19 deletions(-) diff --git a/share/smack/include/assert.h b/share/smack/include/assert.h index 8499b4997..f6d7956c9 100644 --- a/share/smack/include/assert.h +++ b/share/smack/include/assert.h @@ -10,10 +10,5 @@ if (!(EX)) \ __VERIFIER_assert(0); \ } while (0) -#define assume(EX) \ - do { \ - if (!(EX)) \ - __VERIFIER_assume(0); \ - } while (0) #endif diff --git a/share/smack/include/smack.h b/share/smack/include/smack.h index a6e3048a9..0b7c4e835 100644 --- a/share/smack/include/smack.h +++ b/share/smack/include/smack.h @@ -54,8 +54,14 @@ void __SMACK_check_memory_leak(void); // with an integer argument (DSA gets confused otherwise) __attribute__((always_inline)) void __SMACK_dummy(int v); -void __VERIFIER_assume(int); void __VERIFIER_assert(int); +void __VERIFIER_assume(int); + +#define assume(EX) \ + do { \ + if (!(EX)) \ + __VERIFIER_assume(0); \ + } while (0) #define S4(a, b, c, d) a b c d #define S3(a, b, c) a b c diff --git a/test/c/basic/extern_func.c b/test/c/basic/extern_func.c index e93f13ccd..c10edf64c 100644 --- a/test/c/basic/extern_func.c +++ b/test/c/basic/extern_func.c @@ -1,5 +1,4 @@ #include "smack.h" -#include // @expect verified diff --git a/test/c/basic/init_funcs_example.c b/test/c/basic/init_funcs_example.c index 7da18c924..5f33bf559 100644 --- a/test/c/basic/init_funcs_example.c +++ b/test/c/basic/init_funcs_example.c @@ -1,5 +1,4 @@ #include "smack.h" -#include // @expect verified diff --git a/test/c/basic/init_funcs_example_fail.c b/test/c/basic/init_funcs_example_fail.c index f2621cd98..1c7aaaad8 100644 --- a/test/c/basic/init_funcs_example_fail.c +++ b/test/c/basic/init_funcs_example_fail.c @@ -1,5 +1,4 @@ #include "smack.h" -#include // @expect error diff --git a/test/c/basic/printfs.c b/test/c/basic/printfs.c index 3022a6fa6..e1683ea44 100644 --- a/test/c/basic/printfs.c +++ b/test/c/basic/printfs.c @@ -1,5 +1,4 @@ #include "smack.h" -#include #include // @expect verified diff --git a/test/c/bits/left_shift_negative_fail.c b/test/c/bits/left_shift_negative_fail.c index 47c59164b..9095bcefb 100644 --- a/test/c/bits/left_shift_negative_fail.c +++ b/test/c/bits/left_shift_negative_fail.c @@ -1,5 +1,4 @@ #include "smack.h" -#include // @expect error // @flag --check=integer-overflow diff --git a/test/c/bits/left_shift_overflow.c b/test/c/bits/left_shift_overflow.c index 3bf80388b..b8b9bbd77 100644 --- a/test/c/bits/left_shift_overflow.c +++ b/test/c/bits/left_shift_overflow.c @@ -1,5 +1,4 @@ #include "smack.h" -#include // @expect verified // @flag --check=integer-overflow diff --git a/test/c/bits/left_shift_overflow_fail.c b/test/c/bits/left_shift_overflow_fail.c index bca39ab38..ee43fb381 100644 --- a/test/c/bits/left_shift_overflow_fail.c +++ b/test/c/bits/left_shift_overflow_fail.c @@ -1,5 +1,4 @@ #include "smack.h" -#include // @expect error // @flag --check=integer-overflow diff --git a/test/c/bits/left_shift_unsigned.c b/test/c/bits/left_shift_unsigned.c index 8175aece6..a7ead0a89 100644 --- a/test/c/bits/left_shift_unsigned.c +++ b/test/c/bits/left_shift_unsigned.c @@ -1,5 +1,4 @@ #include "smack.h" -#include // @expect verified // @flag --check=integer-overflow diff --git a/test/c/bits/left_shift_unsigned_fail.c b/test/c/bits/left_shift_unsigned_fail.c index e4f036aae..54f6d78e1 100644 --- a/test/c/bits/left_shift_unsigned_fail.c +++ b/test/c/bits/left_shift_unsigned_fail.c @@ -1,5 +1,4 @@ #include "smack.h" -#include // @expect error // @flag --check=integer-overflow diff --git a/test/c/data/free_as_func_ptr.c b/test/c/data/free_as_func_ptr.c index cc9a26a41..5c630d557 100644 --- a/test/c/data/free_as_func_ptr.c +++ b/test/c/data/free_as_func_ptr.c @@ -1,5 +1,4 @@ #include "smack.h" -#include #include // @expect verified diff --git a/test/c/failing/bitwise_and.c b/test/c/failing/bitwise_and.c index b7591ae79..7b40eb51b 100644 --- a/test/c/failing/bitwise_and.c +++ b/test/c/failing/bitwise_and.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified diff --git a/test/c/failing/bitwise_and_fail.c b/test/c/failing/bitwise_and_fail.c index e42e4e31f..25ead9e06 100644 --- a/test/c/failing/bitwise_and_fail.c +++ b/test/c/failing/bitwise_and_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error diff --git a/test/c/special/bitwise_constant_shifts.c b/test/c/special/bitwise_constant_shifts.c index 8b1e9433a..e13b5cdb1 100644 --- a/test/c/special/bitwise_constant_shifts.c +++ b/test/c/special/bitwise_constant_shifts.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect verified // @flag --rewrite-bitwise-ops diff --git a/test/c/special/bitwise_constant_shifts_fail.c b/test/c/special/bitwise_constant_shifts_fail.c index ed11f16de..7dd8b07e6 100644 --- a/test/c/special/bitwise_constant_shifts_fail.c +++ b/test/c/special/bitwise_constant_shifts_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @expect error // @flag --rewrite-bitwise-ops diff --git a/test/c/special/countpop8.c b/test/c/special/countpop8.c index 5ba59a24a..8646b9d66 100644 --- a/test/c/special/countpop8.c +++ b/test/c/special/countpop8.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @flag --rewrite-bitwise-ops diff --git a/test/c/special/countpop8_fail.c b/test/c/special/countpop8_fail.c index 1868415d3..36e3018a9 100644 --- a/test/c/special/countpop8_fail.c +++ b/test/c/special/countpop8_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @flag --rewrite-bitwise-ops diff --git a/test/c/strings/strcpy_overflow.c b/test/c/strings/strcpy_overflow.c index 66a7a5484..f89f1c5b8 100644 --- a/test/c/strings/strcpy_overflow.c +++ b/test/c/strings/strcpy_overflow.c @@ -1,5 +1,4 @@ #include "smack.h" -#include #include // @flag --check=memory-safety diff --git a/test/c/strings/test_memcmp.c b/test/c/strings/test_memcmp.c index f548437f7..a5ccda5f4 100644 --- a/test/c/strings/test_memcmp.c +++ b/test/c/strings/test_memcmp.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect verified diff --git a/test/c/strings/test_memcmp_fail.c b/test/c/strings/test_memcmp_fail.c index ed65f13ef..bfbed94d2 100644 --- a/test/c/strings/test_memcmp_fail.c +++ b/test/c/strings/test_memcmp_fail.c @@ -1,4 +1,5 @@ #include "smack.h" +#include #include // @expect error diff --git a/test/c/targeted-checks/targeted_assertion.c b/test/c/targeted-checks/targeted_assertion.c index 05746a8c0..5e255bb05 100644 --- a/test/c/targeted-checks/targeted_assertion.c +++ b/test/c/targeted-checks/targeted_assertion.c @@ -1,9 +1,10 @@ #include "smack.h" +#include #include // @flag --checked-functions main // @expect verified -void fun() { __VERIFIER_assert(__VERIFIER_nondet_int()); } +void fun() { assert(__VERIFIER_nondet_int()); } int main() { fun(); } diff --git a/test/c/targeted-checks/targeted_assertion_fail.c b/test/c/targeted-checks/targeted_assertion_fail.c index cf267d589..2fcffb618 100644 --- a/test/c/targeted-checks/targeted_assertion_fail.c +++ b/test/c/targeted-checks/targeted_assertion_fail.c @@ -1,9 +1,10 @@ #include "smack.h" +#include #include // @flag --checked-functions main fun // @expect error -void fun() { __VERIFIER_assert(__VERIFIER_nondet_int()); } +void fun() { assert(__VERIFIER_nondet_int()); } int main() { fun(); } diff --git a/test/c/targeted-checks/test-match.c b/test/c/targeted-checks/test-match.c index 7d07eb008..653839664 100644 --- a/test/c/targeted-checks/test-match.c +++ b/test/c/targeted-checks/test-match.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @flag --checked-functions should_match1 // @expect verified diff --git a/test/c/targeted-checks/test-match_fail1.c b/test/c/targeted-checks/test-match_fail1.c index d4f525cf4..64e77d771 100644 --- a/test/c/targeted-checks/test-match_fail1.c +++ b/test/c/targeted-checks/test-match_fail1.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @flag --checked-functions should_match12 // @expect error diff --git a/test/c/targeted-checks/test-match_fail2.c b/test/c/targeted-checks/test-match_fail2.c index a776e09fa..e47f60421 100644 --- a/test/c/targeted-checks/test-match_fail2.c +++ b/test/c/targeted-checks/test-match_fail2.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @flag --checked-functions should_match1.* // @expect error diff --git a/test/c/targeted-checks/test-match_fail3.c b/test/c/targeted-checks/test-match_fail3.c index 3bfbf9faa..dbb538810 100644 --- a/test/c/targeted-checks/test-match_fail3.c +++ b/test/c/targeted-checks/test-match_fail3.c @@ -1,4 +1,5 @@ #include "smack.h" +#include // @flag --checked-functions should_match.* // @expect error From 1b7b4c1034469c422452147e9bba378c8ca06438 Mon Sep 17 00:00:00 2001 From: Zvonimir Date: Sat, 12 Jun 2021 15:31:50 -0600 Subject: [PATCH 16/25] Added cassert C++ header Fixes #727 --- CMakeLists.txt | 1 + share/smack/include/cassert | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 share/smack/include/cassert diff --git a/CMakeLists.txt b/CMakeLists.txt index ab522a15a..00b5e44b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -200,6 +200,7 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/share/smack USE_SOURCE_PERMISSIONS FILES_MATCHING PATTERN "*.py" PATTERN "*.h" PATTERN "*.c" PATTERN "Makefile" PATTERN "*.rs" PATTERN "*.f90" PATTERN "*.di" PATTERN "*.toml" + PATTERN "*.cpp" PATTERN "cassert" ) install(FILES diff --git a/share/smack/include/cassert b/share/smack/include/cassert new file mode 100644 index 000000000..b249e1129 --- /dev/null +++ b/share/smack/include/cassert @@ -0,0 +1,4 @@ +// +// This file is distributed under the MIT License. See LICENSE for details. +// +#include From d89387179863e1d8cf183cf6b42ab2080fef163d Mon Sep 17 00:00:00 2001 From: Shaobo He Date: Mon, 14 Jun 2021 23:56:10 -0700 Subject: [PATCH 17/25] Generate precise error type when Boogie is used Previously, SMACK doesn't report the error type such as ``invalid pointer dereference'' when Boogie is used. This commit fixes it. Furthermore, the original error type generation for Corral is also improved. --- share/smack/top.py | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/share/smack/top.py b/share/smack/top.py index 95dd69b81..8ff6da67f 100755 --- a/share/smack/top.py +++ b/share/smack/top.py @@ -853,18 +853,36 @@ def verification_result(verifier_output): return VResult.VERIFIED elif re.search((r'\d* verified, [1-9]\d* errors?|can fail|' r'ERRORS_NO_TIMEOUT'), verifier_output): - for p in (VProperty.mem_safe_subprops() + [VProperty.INTEGER_OVERFLOW] - + [VProperty.RUST_PANICS]): - if re.search(r'ASSERTION FAILS assert {:%s}' % p.boogie_attr(), - verifier_output): - return p.result() - - listCall = re.findall(r'\(CALL .+\)', verifier_output) - if len(listCall) > 0 and re.search( - r'free_', listCall[len(listCall) - 1]): - return VResult.INVALID_FREE - else: - return VResult.ASSERTION_FAILURE + attr = None + attr_pat = r'assert {:(.+)}' + + corral_af_msg = re.search(r'ASSERTION FAILS %s' % attr_pat, + verifier_output) + if corral_af_msg: + attr = corral_af_msg.group(1) + + boogie_af_msg = re.search( + r'([\w#$~%.\/-]+)\((\d+),\d+\): Error: This assertion might not', + verifier_output) + + if boogie_af_msg: + if re.match('.*[.]bpl$', boogie_af_msg.group(1)): + line_no = int(boogie_af_msg.group(2)) + with open(boogie_af_msg.group(1), 'r') as f: + assert_line = re.search( + attr_pat, + f.read().splitlines(True)[line_no - 1]) + if assert_line: + attr = assert_line.group(1) + + if attr is not None: + for p in (VProperty.mem_safe_subprops() + + [VProperty.INTEGER_OVERFLOW] + + [VProperty.RUST_PANICS]): + if p.boogie_attr() == attr: + return p.result() + + return VResult.ASSERTION_FAILURE else: return VResult.UNKNOWN From 65cc8309c5aa06473a984e114203f435051a1d47 Mon Sep 17 00:00:00 2001 From: Shaobo He Date: Wed, 16 Jun 2021 16:34:12 -0700 Subject: [PATCH 18/25] Changes after PR comments --- share/smack/svcomp/utils.py | 2 +- share/smack/top.py | 39 ++++++++++++++++++++----------------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/share/smack/svcomp/utils.py b/share/smack/svcomp/utils.py index df867e85b..02dfef512 100644 --- a/share/smack/svcomp/utils.py +++ b/share/smack/svcomp/utils.py @@ -104,7 +104,7 @@ def verify_bpl_svcomp(args): corral_command += ["/trackAllVars"] verifier_output = smack.top.try_command(corral_command, timeout=time_limit) - result = smack.top.verification_result(verifier_output) + result = smack.top.verification_result(verifier_output, 'corral') if result in VResult.ERROR: #normal inlining heurTrace += "Found a bug during normal inlining.\n" diff --git a/share/smack/top.py b/share/smack/top.py index 8ff6da67f..07138a05f 100755 --- a/share/smack/top.py +++ b/share/smack/top.py @@ -843,7 +843,7 @@ def transform_out(args, old): return out -def verification_result(verifier_output): +def verification_result(verifier_output, verifier): if re.search( r'[1-9]\d* time out|Z3 ran out of resources|timed out|ERRORS_TIMEOUT', verifier_output): @@ -856,24 +856,27 @@ def verification_result(verifier_output): attr = None attr_pat = r'assert {:(.+)}' - corral_af_msg = re.search(r'ASSERTION FAILS %s' % attr_pat, - verifier_output) - if corral_af_msg: - attr = corral_af_msg.group(1) - - boogie_af_msg = re.search( - r'([\w#$~%.\/-]+)\((\d+),\d+\): Error: This assertion might not', - verifier_output) - - if boogie_af_msg: - if re.match('.*[.]bpl$', boogie_af_msg.group(1)): - line_no = int(boogie_af_msg.group(2)) - with open(boogie_af_msg.group(1), 'r') as f: - assert_line = re.search( + if args.verifier == 'corral': + corral_af_msg = re.search(r'ASSERTION FAILS %s' % attr_pat, + verifier_output) + if corral_af_msg: + attr = corral_af_msg.group(1) + + elif args.verifier == 'boogie': + boogie_af_msg = re.search( + r'([\w#$~%.\/-]+)\((\d+),\d+\): ' + r'Error: This assertion might not hold', verifier_output) + if boogie_af_msg: + if re.match('.*[.]bpl$', boogie_af_msg.group(1)): + line_no = int(boogie_af_msg.group(2)) + with open(boogie_af_msg.group(1), 'r') as f: + assert_line = re.search( attr_pat, f.read().splitlines(True)[line_no - 1]) - if assert_line: - attr = assert_line.group(1) + if assert_line: + attr = assert_line.group(1) + else: + print('Warning: Unable to decide error type.') if attr is not None: for p in (VProperty.mem_safe_subprops() @@ -941,7 +944,7 @@ def verify_bpl(args): verifier_output = try_command(command, timeout=args.time_limit) verifier_output = transform_out(args, verifier_output) - result = verification_result(verifier_output) + result = verification_result(verifier_output, args.verifier) if args.smackd: print(smackdOutput(result, verifier_output)) From f4faa658ad7a8a4b32de3e4eff5d1deaa65a9b0d Mon Sep 17 00:00:00 2001 From: Shaobo He Date: Thu, 17 Jun 2021 12:20:51 -0700 Subject: [PATCH 19/25] Minor fix --- share/smack/top.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/smack/top.py b/share/smack/top.py index 07138a05f..6eed62f4e 100755 --- a/share/smack/top.py +++ b/share/smack/top.py @@ -856,13 +856,13 @@ def verification_result(verifier_output, verifier): attr = None attr_pat = r'assert {:(.+)}' - if args.verifier == 'corral': + if verifier == 'corral': corral_af_msg = re.search(r'ASSERTION FAILS %s' % attr_pat, verifier_output) if corral_af_msg: attr = corral_af_msg.group(1) - elif args.verifier == 'boogie': + elif verifier == 'boogie': boogie_af_msg = re.search( r'([\w#$~%.\/-]+)\((\d+),\d+\): ' r'Error: This assertion might not hold', verifier_output) From c668b09e13e066428078069c767ab0b23a65edc8 Mon Sep 17 00:00:00 2001 From: "Mark S. Baranowski" Date: Wed, 23 Jun 2021 18:03:08 -0600 Subject: [PATCH 20/25] Make llvm-dis use LLVM short version --- share/smack/frontend.py | 8 ++------ share/smack/top.py | 5 +++-- share/smack/utils.py | 5 +++++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/share/smack/frontend.py b/share/smack/frontend.py index 555703955..057c3c6a7 100644 --- a/share/smack/frontend.py +++ b/share/smack/frontend.py @@ -2,9 +2,9 @@ import sys import re import json -from .utils import temporary_file, try_command, temporary_directory +from .utils import temporary_file, try_command, temporary_directory,\ + llvm_exact_bin from .versions import RUST_VERSION -from .versions import LLVM_SHORT_VERSION # Needed for cargo operations try: @@ -86,10 +86,6 @@ def smack_lib(): return os.path.join(smack_root(), 'share', 'smack', 'lib') -def llvm_exact_bin(name): - return name + '-' + LLVM_SHORT_VERSION - - def default_clang_compile_command(args, lib=False): cmd = [ llvm_exact_bin('clang'), diff --git a/share/smack/top.py b/share/smack/top.py index 6eed62f4e..b23d5fe6f 100755 --- a/share/smack/top.py +++ b/share/smack/top.py @@ -8,7 +8,8 @@ import functools from enum import Flag, auto from .svcomp.utils import verify_bpl_svcomp -from .utils import temporary_file, try_command, remove_temp_files +from .utils import temporary_file, try_command, remove_temp_files,\ + llvm_exact_bin from .replay import replay_error_trace from .frontend import link_bc_files, frontends, languages, extra_libs from .errtrace import error_trace, smackdOutput @@ -652,7 +653,7 @@ def target_selection(args): os.path.basename(src))[0], '.ll', args) - try_command(['llvm-dis', '-o', ll, src]) + try_command([llvm_exact_bin('llvm-dis'), '-o', ll, src]) src = ll if os.path.splitext(src)[1] == '.ll': with open(src, 'r') as f: diff --git a/share/smack/utils.py b/share/smack/utils.py index 2467c5e72..8d28c6ab0 100644 --- a/share/smack/utils.py +++ b/share/smack/utils.py @@ -6,6 +6,7 @@ import signal from threading import Timer from . import top +from .versions import LLVM_SHORT_VERSION temporary_files = [] @@ -104,3 +105,7 @@ def try_command(cmd, cwd=None, console=False, timeout=None, env=None): if filelog: with open(temporary_file(cmd[0], '.log', args), 'w') as f: f.write(output) + + +def llvm_exact_bin(name): + return name + '-' + LLVM_SHORT_VERSION From 136e63fdf9f377194ec989b4ccba5d2f411549d1 Mon Sep 17 00:00:00 2001 From: Zvonimir Date: Thu, 8 Jul 2021 20:58:57 -0600 Subject: [PATCH 21/25] Updated Boogie and Corral verifiers Also moved to dotnet 5.0. --- bin/build.sh | 2 +- bin/versions | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/build.sh b/bin/build.sh index 4bfce55bf..a48d6b37c 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -67,7 +67,7 @@ CONFIGURE_INSTALL_PREFIX= CMAKE_INSTALL_PREFIX= # Partial list of dependencies; the rest are added depending on the platform -DEPENDENCIES="git cmake python3-yaml python3-psutil python3-toml unzip wget ninja-build apt-transport-https dotnet-sdk-3.1 libboost-all-dev" +DEPENDENCIES="git cmake python3-yaml python3-psutil python3-toml unzip wget ninja-build apt-transport-https dotnet-sdk-5.0 libboost-all-dev" shopt -s extglob diff --git a/bin/versions b/bin/versions index 6bc11485a..940c6ab4d 100644 --- a/bin/versions +++ b/bin/versions @@ -1,8 +1,8 @@ Z3_VERSION="4.8.10" CVC4_VERSION="1.8" YICES2_VERSION="2.6.2" -BOOGIE_VERSION="2.8.26" -CORRAL_VERSION="1.0.17" +BOOGIE_VERSION="2.9.1" +CORRAL_VERSION="1.1.8" SYMBOOGLIX_COMMIT="ccb2e7f2b3" LOCKPWN_COMMIT="12ba58f1ec" LLVM_SHORT_VERSION="11" From d5999768ffcb65f7253ce549551d00138159dfc6 Mon Sep 17 00:00:00 2001 From: Zvonimir Date: Sun, 11 Jul 2021 12:10:33 -0600 Subject: [PATCH 22/25] Add alloc size attribute to globals only when size is known Otherwise, we were getting crashes since we were asking for size of globals that do not have size defined. --- lib/smack/SmackRep.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/smack/SmackRep.cpp b/lib/smack/SmackRep.cpp index 8b6bb9c5e..4ab04a129 100644 --- a/lib/smack/SmackRep.cpp +++ b/lib/smack/SmackRep.cpp @@ -1253,8 +1253,10 @@ void SmackRep::addAllocSizeAttr(const llvm::GlobalVariable *G, std::list &ax) { auto T = dyn_cast(G->getType()); assert(T && "Global variables should have pointer types!"); - auto allocSize = targetData->getTypeAllocSize(T->getElementType()); - ax.push_back(Attr::attr("allocSize", allocSize)); + if (T->getElementType()->isSized()) { + auto allocSize = targetData->getTypeAllocSize(T->getElementType()); + ax.push_back(Attr::attr("allocSize", allocSize)); + } } std::list SmackRep::globalDecl(const llvm::GlobalValue *v) { From 3a057e8bb18a383813e4ffcac097083e25b30cd2 Mon Sep 17 00:00:00 2001 From: Zvonimir Date: Tue, 13 Jul 2021 18:43:42 -0600 Subject: [PATCH 23/25] Disable __VERIFIER_assert for SVCOMP Some SVCOMP benchmarks actually declare and define their own custom __VERIFIER_assert, which then causes name clashes with the SMACK version of it. --- share/smack/include/smack.h | 2 ++ share/smack/lib/smack.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/share/smack/include/smack.h b/share/smack/include/smack.h index 0b7c4e835..e8136d17d 100644 --- a/share/smack/include/smack.h +++ b/share/smack/include/smack.h @@ -54,7 +54,9 @@ void __SMACK_check_memory_leak(void); // with an integer argument (DSA gets confused otherwise) __attribute__((always_inline)) void __SMACK_dummy(int v); +#ifndef SVCOMP void __VERIFIER_assert(int); +#endif void __VERIFIER_assume(int); #define assume(EX) \ diff --git a/share/smack/lib/smack.c b/share/smack/lib/smack.c index b88376ad5..5666122c9 100644 --- a/share/smack/lib/smack.c +++ b/share/smack/lib/smack.c @@ -45,12 +45,14 @@ void __VERIFIER_assume(int x) { __SMACK_code("assume @ != $0;", x); } +#ifndef SVCOMP void __VERIFIER_assert(int x) { #if !DISABLE_SMACK_ASSERTIONS __SMACK_dummy(x); __SMACK_code("assert @ != $0;", x); #endif } +#endif int __SMACK_and32(int a, int b) { int c = 0; From a603560d3d02ccd44501915188784b8d14cd9877 Mon Sep 17 00:00:00 2001 From: "Mark S. Baranowski" Date: Wed, 4 Aug 2021 17:41:47 -0600 Subject: [PATCH 24/25] Adds support for externalizing entry points. * This adds a utility `extern-statics` that transforms input LLVM files to have functions which are entry-points to always have external linkage. * SMACK's front-end is changed to process input bit-codes before running llvm-link on them in order to keep these functions from being erased during linking. --- CMakeLists.txt | 17 ++++++ share/smack/frontend.py | 18 +++++++ test/llvm/intern.ll | 14 +++++ test/llvm/intern_fail.ll | 14 +++++ tools/externalizer/ExternalizePass.cpp | 74 ++++++++++++++++++++++++++ tools/externalizer/ExternalizePass.h | 19 +++++++ tools/externalizer/extern-statics.cpp | 68 +++++++++++++++++++++++ 7 files changed, 224 insertions(+) create mode 100644 test/llvm/intern.ll create mode 100644 test/llvm/intern_fail.ll create mode 100644 tools/externalizer/ExternalizePass.cpp create mode 100644 tools/externalizer/ExternalizePass.h create mode 100644 tools/externalizer/extern-statics.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 00b5e44b3..ade90912b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -155,6 +155,15 @@ add_executable(llvm2bpl tools/llvm2bpl/llvm2bpl.cpp ) +add_library(externalizePass STATIC + tools/externalizer/ExternalizePass.h + tools/externalizer/ExternalizePass.cpp +) + +add_executable(extern-statics + tools/externalizer/extern-statics.cpp +) + # We need to include Boost header files at least for macOS find_package(Boost 1.55) if(Boost_FOUND) @@ -182,10 +191,18 @@ target_link_libraries(smackTranslator ${LLVM_LIBS} ${LLVM_SYSTEM_LIBS} ${LLVM_LDFLAGS}) target_link_libraries(llvm2bpl smackTranslator utils SeaDsaAnalysis) +target_link_libraries(externalizePass ${LLVM_LIBS} ${LLVM_SYSTEM_LIBS} + ${LLVM_LDFLAGS}) +target_link_libraries(extern-statics externalizePass) + install(TARGETS llvm2bpl RUNTIME DESTINATION bin ) +install(TARGETS extern-statics + RUNTIME DESTINATION bin +) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/bin/smack ${CMAKE_CURRENT_SOURCE_DIR}/bin/smack-doctor diff --git a/share/smack/frontend.py b/share/smack/frontend.py index 057c3c6a7..19ca8ccb1 100644 --- a/share/smack/frontend.py +++ b/share/smack/frontend.py @@ -86,6 +86,23 @@ def smack_lib(): return os.path.join(smack_root(), 'share', 'smack', 'lib') +def extern_entry_points(args, bcs): + new_bcs = [] + for bc in bcs: + new_bc = temporary_file( + os.path.splitext( + os.path.basename(bc))[0], + '.bc', + args) + cmd = ['-in', bc, '-out', new_bc] + for ep in args.entry_points: + cmd += ['-entry-points', ep] + + try_command(['extern-statics'] + cmd, console=True) + new_bcs.append(new_bc) + return new_bcs + + def default_clang_compile_command(args, lib=False): cmd = [ llvm_exact_bin('clang'), @@ -469,6 +486,7 @@ def link_bc_files(bitcodes, libs, args): for build_lib in libs: smack_libs += build_lib(args) + bitcodes = extern_entry_points(args, bitcodes) try_command([llvm_exact_bin('llvm-link'), '-o', args.bc_file] + bitcodes) try_command([llvm_exact_bin('llvm-link'), '-o', args.linked_bc_file, args.bc_file] + smack_libs) diff --git a/test/llvm/intern.ll b/test/llvm/intern.ll new file mode 100644 index 000000000..30305e89b --- /dev/null +++ b/test/llvm/intern.ll @@ -0,0 +1,14 @@ +; @expect verified +; @flag --entry-points=foo + +source_filename = "llvm-link" +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +; Function Attrs: nounwind uwtable +define internal i32 @foo() { + call void @__VERIFIER_assert(i32 1) + ret i32 0 +} + +declare void @__VERIFIER_assert(i32) \ No newline at end of file diff --git a/test/llvm/intern_fail.ll b/test/llvm/intern_fail.ll new file mode 100644 index 000000000..d5a306d50 --- /dev/null +++ b/test/llvm/intern_fail.ll @@ -0,0 +1,14 @@ +; @expect error +; @flag --entry-points=foo + +source_filename = "llvm-link" +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +; Function Attrs: nounwind uwtable +define internal i32 @foo() { + call void @__VERIFIER_assert(i32 0) + ret i32 0 +} + +declare void @__VERIFIER_assert(i32) \ No newline at end of file diff --git a/tools/externalizer/ExternalizePass.cpp b/tools/externalizer/ExternalizePass.cpp new file mode 100644 index 000000000..ac4b16fc6 --- /dev/null +++ b/tools/externalizer/ExternalizePass.cpp @@ -0,0 +1,74 @@ +#include "ExternalizePass.h" +#include "llvm/IR/GlobalValue.h" +#include "llvm/IR/Instructions.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Transforms/Utils/Cloning.h" +#include "llvm/Transforms/Utils/ValueMapper.h" + +static llvm::cl::list + entryPoints("entry-points", llvm::cl::ZeroOrMore, + llvm::cl::desc("Verification entry points"), + llvm::cl::value_desc("PROCS")); + +using namespace llvm; + +namespace externalize { +// Based on internalizeFunctions +// from https://llvm.org/doxygen/Attributor_8cpp_source.html#l01948 +Function *externalizeFunction(Function *Fn) { + // Generate the externalized version of Fn + Module &M = *Fn->getParent(); + FunctionType *FnTy = Fn->getFunctionType(); + + // Create a copy of the current function + Function *Copied = + Function::Create(FnTy, GlobalValue::LinkageTypes::ExternalLinkage, + Fn->getAddressSpace(), Fn->getName() + ".externalized"); + ValueToValueMapTy VMap; + auto *NewFArgIt = Copied->arg_begin(); + for (auto &Arg : Fn->args()) { + auto ArgName = Arg.getName(); + NewFArgIt->setName(ArgName); + VMap[&Arg] = &(*NewFArgIt++); + } + SmallVector Returns; + + // Copy the body of the original function to the new one + CloneFunctionInto(Copied, Fn, VMap, false, Returns); + + // Copy metadata + SmallVector, 1> MDs; + Fn->getAllMetadata(MDs); + for (auto MDIt : MDs) + if (!Copied->hasMetadata()) + Copied->addMetadata(MDIt.first, *MDIt.second); + + M.getFunctionList().insert(Fn->getIterator(), Copied); + Copied->setDSOLocal(true); + + // Replace all uses of the old function with the new externalized function + Fn->replaceAllUsesWith(Copied); + + return Copied; +} +bool ExternalizePass::runOnModule(Module &M) { + bool changed = false; + for (const std::string &e : entryPoints) { + if (Function *f = M.getFunction(e)) { + if (!f->hasExternalLinkage()) { + changed = true; + Function *external = externalizeFunction(f); + f->removeFromParent(); + external->setName(e); + } + } + } + return changed; +} + +char ExternalizePass::ID = 0; + +StringRef ExternalizePass::getPassName() const { + return "Externalize static entry point functions"; +} +} // namespace externalize diff --git a/tools/externalizer/ExternalizePass.h b/tools/externalizer/ExternalizePass.h new file mode 100644 index 000000000..e25a4b3f1 --- /dev/null +++ b/tools/externalizer/ExternalizePass.h @@ -0,0 +1,19 @@ +// +// This file is distributed under the MIT License. See LICENSE for details. +// +#ifndef EXTERNALIZEPASS_H +#define EXTERNALIZEPASS_H + +#include "llvm/IR/Module.h" +#include "llvm/Pass.h" +#include "llvm/Support/raw_ostream.h" + +namespace externalize { +struct ExternalizePass : public llvm::ModulePass { + static char ID; + ExternalizePass() : llvm::ModulePass(ID) {} + virtual llvm::StringRef getPassName() const; + virtual bool runOnModule(llvm::Module &M); +}; +} // namespace externalize +#endif // EXTERNALIZEPASS_H diff --git a/tools/externalizer/extern-statics.cpp b/tools/externalizer/extern-statics.cpp new file mode 100644 index 000000000..324858178 --- /dev/null +++ b/tools/externalizer/extern-statics.cpp @@ -0,0 +1,68 @@ +#include "ExternalizePass.h" + +#include "llvm/Bitcode/BitcodeWriter.h" +#include "llvm/IR/IRPrintingPasses.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/LegacyPassManager.h" +#include "llvm/IRReader/IRReader.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/Debug.h" +#include "llvm/Support/PrettyStackTrace.h" +#include "llvm/Support/Signals.h" +#include "llvm/Support/ToolOutputFile.h" + +static llvm::cl::opt + InputFilename("in", llvm::cl::desc("Input bitcode filename"), + llvm::cl::Required, llvm::cl::value_desc("input filename")); + +static llvm::cl::opt + OutputFilename("out", llvm::cl::desc("Output bitcode filename"), + llvm::cl::Required, llvm::cl::value_desc("output filename")); + +int main(int argc, char **argv) { + + llvm::llvm_shutdown_obj shutdown; // calls llvm_shutdown() on exit + llvm::cl::ParseCommandLineOptions( + argc, argv, "extern-statics - Externalize static functions\n"); + + llvm::sys::PrintStackTraceOnErrorSignal(argv[0]); + llvm::PrettyStackTraceProgram PSTP(argc, argv); + llvm::EnableDebugBuffering = true; + + llvm::SMDiagnostic err; + llvm::LLVMContext Context; + + std::unique_ptr module = + llvm::parseIRFile(InputFilename, err, Context); + if (!err.getMessage().empty()) { + llvm::errs() << "Problem reading input bitcode/IR: " + + err.getMessage().str() + << "\n"; + return 1; + } + + /////////////////////////////// + // initialise and run passes // + /////////////////////////////// + + llvm::legacy::PassManager pass_manager; + pass_manager.add(new externalize::ExternalizePass()); + + pass_manager.run(*module.get()); + + std::error_code EC; + auto out = new llvm::ToolOutputFile(OutputFilename.c_str(), EC, + llvm::sys::fs::F_None); + + if (EC) { + llvm::errs() << "Could not create output file: " << EC.message() << "\n"; + return 1; + } + out->keep(); + + WriteBitcodeToFile(*module, out->os()); + + delete out; + + return 0; +} From 820acd9b4af909ef1ec6acfd5a528f0fe19886ed Mon Sep 17 00:00:00 2001 From: Zvonimir Date: Wed, 8 Sep 2021 13:44:00 -0600 Subject: [PATCH 25/25] Bumped version number to 2.7.1 --- Doxyfile | 2 +- share/smack/reach.py | 2 +- share/smack/top.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Doxyfile b/Doxyfile index 8b235a352..f9b99dad3 100644 --- a/Doxyfile +++ b/Doxyfile @@ -5,7 +5,7 @@ #--------------------------------------------------------------------------- DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = smack -PROJECT_NUMBER = 2.7.0 +PROJECT_NUMBER = 2.7.1 PROJECT_BRIEF = "A bounded software verifier." PROJECT_LOGO = OUTPUT_DIRECTORY = docs diff --git a/share/smack/reach.py b/share/smack/reach.py index c5e72341e..e1cfd0344 100755 --- a/share/smack/reach.py +++ b/share/smack/reach.py @@ -11,7 +11,7 @@ from smackgen import * from smackverify import * -VERSION = '2.7.0' +VERSION = '2.7.1' def reachParser(): diff --git a/share/smack/top.py b/share/smack/top.py index b23d5fe6f..fe64058db 100755 --- a/share/smack/top.py +++ b/share/smack/top.py @@ -14,7 +14,7 @@ from .frontend import link_bc_files, frontends, languages, extra_libs from .errtrace import error_trace, smackdOutput -VERSION = '2.7.0' +VERSION = '2.7.1' class VResult(Flag):