From 0564cdb94a7a1facbb0dbf888ceb90638aa70ecd Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 18 Dec 2017 20:12:08 +0000 Subject: Vendor import of libc++ trunk r321017: https://llvm.org/svn/llvm-project/libcxx/trunk@321017 --- test/libcxx/fuzzing/regex_ECMAScript.cpp | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 test/libcxx/fuzzing/regex_ECMAScript.cpp (limited to 'test/libcxx/fuzzing/regex_ECMAScript.cpp') diff --git a/test/libcxx/fuzzing/regex_ECMAScript.cpp b/test/libcxx/fuzzing/regex_ECMAScript.cpp new file mode 100644 index 000000000000..2e57126022f3 --- /dev/null +++ b/test/libcxx/fuzzing/regex_ECMAScript.cpp @@ -0,0 +1,37 @@ +// -*- C++ -*- +//===--------------------- regex_ECMAScript.cpp ---------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// XFAIL + +#include "fuzzing.h" +#include +#include // for strlen + +const char * test_cases[] = { + "", + "s", + "b*c", + "ba?sf" + "lka*ea", + "adsf*kas;lnc441[0-9]1r34525234" + }; + +const size_t k_num_tests = sizeof(test_cases)/sizeof(test_cases[0]); + +int main () +{ + for (size_t i = 0; i < k_num_tests; ++i) + { + const size_t size = std::strlen(test_cases[i]); + const uint8_t *data = (const uint8_t *) test_cases[i]; + assert(0 == fuzzing::regex_ECMAScript(data, size)); + } + return 0; +} -- cgit v1.2.3