@@ -574,14 +574,20 @@ withMethodSpec pathSat lm nm setup action =
574574 -- execute commands of the method spec
575575 io $ W4. setCurrentProgramLoc sym setupLoc
576576
577-
578577 setupState <-
579578 (execStateT
580579 (runReaderT (runLLVMCrucibleSetupM setup)
581580 (Setup. makeCrucibleSetupRO))
582581 st0)
583582 let methodSpec = setupState ^. Setup. csMethodSpec
584583 cc1 = setupState ^. Setup. csCrucibleContext
584+
585+ -- check for missing llvm_execute_func
586+ unless (setupState ^. Setup. csPrePost == PostState ) $
587+ io $ throwMethodSpec methodSpec $ Text. unpack $
588+ " Missing llvm_execute_func specification when verifying " <>
589+ methodSpec^. csName
590+
585591 io $ checkSpecArgumentTypes cc1 methodSpec
586592 io $ checkSpecReturnType cc1 methodSpec
587593
@@ -909,7 +915,12 @@ checkSpecReturnType cc mspec =
909915 , " Expected: " <> Text. pack (show retTy)
910916 , " but given value of type: " <> Text. pack (show retTy')
911917 ]
912- (Nothing , _) -> return ()
918+ (Nothing , Just retTy) ->
919+ throwMethodSpec mspec $ Text. unpack $ Text. unlines
920+ [ " Missing return value specification for function with non-void return type"
921+ , " Expected: " <> Text. pack (show retTy)
922+ ]
923+ (Nothing , Nothing ) -> pure ()
913924
914925-- | Evaluate the precondition part of a Crucible method spec:
915926--
0 commit comments