Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crux-llvm: Add some missing __VERIFIER_nondet_* overrides #858

Merged
merged 2 commits into from
Sep 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crux-llvm/crux-llvm.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ library
build-depends:
aeson,
bv-sized,
config-schema,
config-schema >= 1.2.2.0,
data-binary-ieee754,
logict,
llvm-pretty,
Expand Down
33 changes: 33 additions & 0 deletions crux-llvm/src/Crux/LLVM/Overrides.hs
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,34 @@ svCompOverrides ::
[OverrideTemplate (personality sym) sym arch rtp l a]
svCompOverrides =
[ basic_llvm_override $
[llvmOvr| i64 @__VERIFIER_nondet_longlong() |]
(sv_comp_fresh_bits (knownNat @64))

-- loff_t is pretty Linux-specific, so we can't point to the C or POSIX
-- standards for justification about what size it should be. The man page
-- for lseek64 (https://linux.die.net/man/3/lseek64) is as close to a
-- definitive reference for this as I can find, which says
-- "The type loff_t is a 64-bit signed type".
, basic_llvm_override $
[llvmOvr| i64 @__VERIFIER_nondet_loff_t() |]
(sv_comp_fresh_bits (knownNat @64))

, basic_llvm_override $
[llvmOvr| size_t @__VERIFIER_nondet_ulong() |]
(sv_comp_fresh_bits ?ptrWidth)

, basic_llvm_override $
[llvmOvr| size_t @__VERIFIER_nondet_long() |]
(sv_comp_fresh_bits ?ptrWidth)

, basic_llvm_override $
[llvmOvr| i32 @__VERIFIER_nondet_unsigned() |]
(sv_comp_fresh_bits (knownNat @32))

, basic_llvm_override $
[llvmOvr| i32 @__VERIFIER_nondet_u32() |]
(sv_comp_fresh_bits (knownNat @32))

, basic_llvm_override $
[llvmOvr| i32 @__VERIFIER_nondet_uint() |]
(sv_comp_fresh_bits (knownNat @32))
Expand All @@ -266,6 +287,10 @@ svCompOverrides =
[llvmOvr| i32 @__VERIFIER_nondet_int() |]
(sv_comp_fresh_bits (knownNat @32))

, basic_llvm_override $
[llvmOvr| i16 @__VERIFIER_nondet_u16() |]
(sv_comp_fresh_bits (knownNat @16))

, basic_llvm_override $
[llvmOvr| i16 @__VERIFIER_nondet_ushort() |]
(sv_comp_fresh_bits (knownNat @16))
Expand All @@ -274,6 +299,10 @@ svCompOverrides =
[llvmOvr| i16 @__VERIFIER_nondet_short() |]
(sv_comp_fresh_bits (knownNat @16))

, basic_llvm_override $
[llvmOvr| i8 @__VERIFIER_nondet_u8() |]
(sv_comp_fresh_bits (knownNat @8))

, basic_llvm_override $
[llvmOvr| i8 @__VERIFIER_nondet_uchar() |]
(sv_comp_fresh_bits (knownNat @8))
Expand All @@ -286,6 +315,10 @@ svCompOverrides =
[llvmOvr| i1 @__VERIFIER_nondet_bool() |]
(sv_comp_fresh_bits (knownNat @1))

, basic_llvm_override $
[llvmOvr| size_t @__VERIFIER_nondet_size_t() |]
(sv_comp_fresh_bits ?ptrWidth)

, basic_llvm_override $
[llvmOvr| float @__VERIFIER_nondet_float() |]
(sv_comp_fresh_float SingleFloatRepr)
Expand Down
2 changes: 1 addition & 1 deletion crux/crux.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ library
raw-strings-qq,
simple-get-opt,
config-value,
config-schema,
config-schema >= 1.2.2.0,
semigroupoids,
unordered-containers,
xml,
Expand Down