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 10 // XFAIL: libcpp-no-exceptions 11 // <random> 12 13 // class random_device; 14 15 // result_type operator()(); 16 17 #include <random> 18 #include <cassert> 19 20 #include "test_macros.h" 21 22 int main() 23 { 24 { 25 std::random_device r; 26 std::random_device::result_type e = r(); 27 } 28 29 try 30 { 31 std::random_device r("/dev/null"); 32 r(); 33 LIBCPP_ASSERT(false); 34 } 35 catch (const std::system_error&) 36 { 37 } 38 } 39