-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add example testing Copilot-Language/copilot#386
- Loading branch information
1 parent
ce4aa73
commit c6eef4a
Showing
3 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
copilot-verifier/examples/Copilot/Verifier/Examples/ShouldPass/ArrayGen.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
module Copilot.Verifier.Examples.ShouldPass.ArrayGen where | ||
|
||
import Copilot.Compile.C99 | ||
import Copilot.Verifier ( Verbosity, VerifierOptions(..) | ||
, defaultVerifierOptions, verifyWithOptions ) | ||
import Language.Copilot | ||
import qualified Prelude hiding ((++), (>)) | ||
|
||
spec :: Spec | ||
spec = trigger "f" (stream .!! 0 > 0) [arg stream] | ||
where | ||
stream :: Stream (Array 2 Int16) | ||
stream = [array [3,4]] ++ rest | ||
|
||
rest :: Stream (Array 2 Int16) | ||
rest = constant $ array [5,6] | ||
|
||
verifySpec :: Verbosity -> IO () | ||
verifySpec verb = reify spec >>= verifyWithOptions defaultVerifierOptions{verbosity = verb} | ||
mkDefaultCSettings [] "arrayGen" |