Add include-strict-utf8 build flag

When this flag is enabled benchmarks that require strictly valid utf8
input are enabled.
This commit is contained in:
Harendra Kumar 2021-11-30 03:00:15 +05:30
parent 1c6c2d0346
commit 6db157f120
2 changed files with 9 additions and 1 deletions

View File

@ -276,7 +276,7 @@ o_1_space_decode_encode_read env =
copyStreamLatin1' inh outh
, mkBench "encodeLatin1 . decodeLatin1" env $ \inh outh ->
copyStreamLatin1 inh outh
#ifdef DEVBUILD
#ifdef INCLUDE_STRICT_UTF8
-- Requires valid unicode input
, mkBench "encodeUtf8' . decodeUtf8'" env $ \inh outh ->
_copyStreamUtf8' inh outh

View File

@ -39,6 +39,11 @@ flag dev
manual: True
default: False
flag include-strict-utf8
description: Include strict utf8 input benchmarks
manual: True
default: False
flag has-llvm
description: Use llvm backend for better performance
manual: True
@ -64,6 +69,9 @@ common compile-options
if flag(dev)
cpp-options: -DDEVBUILD
if flag(include-strict-utf8)
cpp-options: -DINCLUDE_STRICT_UTF8
if flag(inspection)
cpp-options: -DINSPECTION