eval.pass.cpp 749 B

123456789101112131415161718192021222324252627282930313233343536
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is dual licensed under the MIT and the University of Illinois Open
  6. // Source Licenses. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. // XFAIL: libcpp-no-exceptions
  10. // <random>
  11. // class random_device;
  12. // result_type operator()();
  13. #include <random>
  14. #include <cassert>
  15. int main()
  16. {
  17. {
  18. std::random_device r;
  19. std::random_device::result_type e = r();
  20. }
  21. try
  22. {
  23. std::random_device r("/dev/null");
  24. r();
  25. assert(false);
  26. }
  27. catch (const std::system_error&)
  28. {
  29. }
  30. }