Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
Howard Hinnant | 5b08a8a | 2010-05-11 21:36:01 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 4 | // |
Howard Hinnant | 412dbeb | 2010-11-16 22:09:02 +0000 | [diff] [blame] | 5 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | // Source Licenses. See LICENSE.TXT for details. |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
Asiri Rathnayake | f520c14 | 2015-11-10 11:41:22 +0000 | [diff] [blame] | 10 | // XFAIL: libcpp-no-exceptions |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 11 | // <random> |
| 12 | |
| 13 | // class random_device; |
| 14 | |
| 15 | // result_type operator()(); |
| 16 | |
| 17 | #include <random> |
| 18 | #include <cassert> |
| 19 | |
| 20 | int main() |
| 21 | { |
David Majnemer | 2dfdfdf | 2014-06-03 02:40:39 +0000 | [diff] [blame] | 22 | { |
| 23 | std::random_device r; |
| 24 | std::random_device::result_type e = r(); |
| 25 | } |
| 26 | |
| 27 | try |
| 28 | { |
| 29 | std::random_device r("/dev/null"); |
| 30 | r(); |
| 31 | assert(false); |
| 32 | } |
Eric Fiselier | fb42f4c | 2016-05-02 19:15:48 +0000 | [diff] [blame^] | 33 | catch (const std::system_error&) |
David Majnemer | 2dfdfdf | 2014-06-03 02:40:39 +0000 | [diff] [blame] | 34 | { |
| 35 | } |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 36 | } |