brintos

brintos / llvm-project-archived public Read only

0
0
Text · 736 B · 39fbfe8 Raw
31 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// UNSUPPORTED: no-random-device10 11// <random>12 13// class random_device;14 15// double entropy() const;16 17#include <random>18#include <cassert>19#include <climits>20 21#include "test_macros.h"22 23int main(int, char**) {24  std::random_device r;25  double e = r.entropy();26  assert(e >= 0);27  assert(e <= sizeof(typename std::random_device::result_type) * CHAR_BIT);28 29  return 0;30}31