Files
android_external_libcxx/test/numerics/rand/rand.device/ctor.pass.cpp
Dan Albert 90dc8dd841 Update to upstream r216384.
This rebase skips the following patches in upstream:

+ 37025e1b32
Make the helper routines in string really be constexpr. This required a
bit of refacoring in algorithm as well. Give them better names while
we're at it. All of these are internal rotines; no visible functionality
change.

+ 164b297099
Implement string_view from the library fundamentals TS (n4023). Also
works in C++11 and 03, with reduced functionality (mostly in the area of
constexpr)

+ e4694b4129
Formatting improvements in the <string_view> synopsis suggested by
RSmith. No functionality change.

+ 3a61b30f3a
Minor cleanup for string_view; mostly from suggestions by Richard Smith.
Also, make the tests pass under c++03

+ 484728789e
string_view enhancements.  Move to the correct namespace. Better
constexpr support (thanks to Richard for the suggestions). Update the
tests to match this. Add <experimental/__config for experimental
macros/etc to live.

+ b1a40264dc
[libcxx] Add <experimental/utility> header for LFTS.

+ 3ee7233c80
[libcxx] expose experimental::erased_type for all standard versions.

+ 67740670f9
NFC. Remove trailing whitespace and tabs.

+ b9536101dc
NFC. Move definition of _LIBCPP_ASSERT into __debug header and remove
external include guards.

+ 98c4e404ca.
Revert "Turn off extern templates for most uses."

Bug: 17255369
Change-Id: I629ff16275d50e4cc8767b253a2c0542468348d8
2014-09-03 17:27:48 -07:00

50 lines
1.0 KiB
C++

//===----------------------------------------------------------------------===//
//
// 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;
// explicit random_device(const string& token = "/dev/urandom");
#include <random>
#include <cassert>
#include <unistd.h>
int main()
{
try
{
std::random_device r("wrong file");
assert(false);
}
catch (const std::system_error& e)
{
}
{
std::random_device r;
}
{
int ec;
ec = close(STDIN_FILENO);
assert(!ec);
ec = close(STDOUT_FILENO);
assert(!ec);
ec = close(STDERR_FILENO);
assert(!ec);
std::random_device r;
}
{
std::random_device r("/dev/urandom");;
}
{
std::random_device r("/dev/random");;
}
}