diff options
Diffstat (limited to 'libcxx/test/std/numerics/rand/rand.device/eval.pass.cpp')
-rw-r--r-- | libcxx/test/std/numerics/rand/rand.device/eval.pass.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libcxx/test/std/numerics/rand/rand.device/eval.pass.cpp b/libcxx/test/std/numerics/rand/rand.device/eval.pass.cpp new file mode 100644 index 00000000000..72aff076a5d --- /dev/null +++ b/libcxx/test/std/numerics/rand/rand.device/eval.pass.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <random> + +// class random_device; + +// result_type operator()(); + +#include <random> +#include <cassert> + +int main() +{ + { + std::random_device r; + std::random_device::result_type e = r(); + } + + try + { + std::random_device r("/dev/null"); + r(); + assert(false); + } + catch (const std::system_error& e) + { + } +} |