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

[WIP] Revamp LLVM error messages using annotations #441

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Fix test suites
  • Loading branch information
robdockins committed Feb 13, 2020
commit 01be86054e33482fb7cfa8e1580210ce67567e95
11 changes: 10 additions & 1 deletion crucible-llvm/test/Tests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import Data.Foldable
import Data.Sequence (Seq)
import Control.Monad
import Control.Monad.Except
import Data.IORef
import qualified Data.Map.Strict as Map
import qualified Data.Sequence as Seq
import qualified Data.Set as Set
Expand Down Expand Up @@ -361,12 +362,20 @@ userSymbol' s = case What4.userSymbol s of

withMem ::
EndianForm ->
(forall sym scope solver fs wptr . (sym ~ Crucible.OnlineBackend scope solver fs, Crucible.IsSymInterface sym, What4.OnlineSolver scope solver, HasPtrWidth wptr) => sym -> MemImpl sym -> IO a) ->
(forall sym scope solver fs wptr .
( sym ~ Crucible.OnlineBackend scope solver fs
, Crucible.IsSymInterface sym
, HasLLVMAnn sym
, What4.OnlineSolver scope solver
, HasPtrWidth wptr ) =>
sym -> MemImpl sym -> IO a) ->
IO a
withMem endianess action = withIONonceGenerator $ \nonce_gen ->
Crucible.withZ3OnlineBackend What4.FloatIEEERepr nonce_gen Crucible.NoUnsatFeatures $ \sym -> do
let ?ptrWidth = knownNat @64
mem <- emptyMem endianess
bbMapRef <- newIORef mempty
let ?badBehaviorMap = bbMapRef
action sym mem

assume :: Crucible.IsSymInterface sym => sym -> What4.Pred sym -> IO ()
Expand Down
6 changes: 3 additions & 3 deletions crux-llvm/test-data/golden/vector-cmp.good
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ let -- internal
-- internal
v3 = floatFromBinary 0x42280000:[32]
-- internal
v10 = ite (floatLe v3 v2) 0x0:[1] 0x1:[1]
v18 = ite (floatLe v3 v2) 0x0:[1] 0x1:[1]
-- internal
v12 = bvZext 32 (bvAnd (ite (floatLe v2 v3) 0x1:[1] 0x0:[1]) v10)
in bvOr 0x1:[32] (bvShl v12 0x1:[32])
v20 = bvZext 32 (bvAnd (ite (floatLe v2 v3) 0x1:[1] 0x0:[1]) v18)
in bvOr 0x1:[32] (bvShl v20 0x1:[32])
[Crux] Overall status: Valid.