regex_ECMAScript.cpp 874 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // -*- C++ -*-
  2. //===--------------------- regex_ECMAScript.cpp ---------------------------===//
  3. //
  4. // The LLVM Compiler Infrastructure
  5. //
  6. // This file is dual licensed under the MIT and the University of Illinois Open
  7. // Source Licenses. See LICENSE.TXT for details.
  8. //
  9. //===----------------------------------------------------------------------===//
  10. // XFAIL
  11. #include "fuzzing.h"
  12. #include <cassert>
  13. #include <cstring> // for strlen
  14. const char * test_cases[] = {
  15. "",
  16. "s",
  17. "b*c",
  18. "ba?sf"
  19. "lka*ea",
  20. "adsf*kas;lnc441[0-9]1r34525234"
  21. };
  22. const size_t k_num_tests = sizeof(test_cases)/sizeof(test_cases[0]);
  23. int main ()
  24. {
  25. for (size_t i = 0; i < k_num_tests; ++i)
  26. {
  27. const size_t size = std::strlen(test_cases[i]);
  28. const uint8_t *data = (const uint8_t *) test_cases[i];
  29. assert(0 == fuzzing::regex_ECMAScript(data, size));
  30. }
  31. return 0;
  32. }