#include <functional>
#include <testsuite_random.h>
+// { dg-additional-options "-DSIMULATOR_TEST" { target simulator } }
+
+#ifdef SIMULATOR_TEST
+# define ARGS 100, 1000
+#else
+# define ARGS
+#endif
+
void test01()
{
using namespace __gnu_test;
std::bernoulli_distribution bd1(0.25);
auto bbd1 = std::bind(bd1, eng);
- testDiscreteDist(bbd1, [](int n) { return bernoulli_pdf(n, 0.25); } );
+ testDiscreteDist<ARGS>(bbd1, [](int n) { return bernoulli_pdf(n, 0.25); } );
std::bernoulli_distribution bd2(0.5);
auto bbd2 = std::bind(bd2, eng);
- testDiscreteDist(bbd2, [](int n) { return bernoulli_pdf(n, 0.5); } );
+ testDiscreteDist<ARGS>(bbd2, [](int n) { return bernoulli_pdf(n, 0.5); } );
std::bernoulli_distribution bd3(0.75);
auto bbd3 = std::bind(bd3, eng);
- testDiscreteDist(bbd3, [](int n) { return bernoulli_pdf(n, 0.75); } );
+ testDiscreteDist<ARGS>(bbd3, [](int n) { return bernoulli_pdf(n, 0.75); } );
}
int main()
#include <functional>
#include <testsuite_random.h>
+// { dg-additional-options "-DSIMULATOR_TEST" { target simulator } }
+
+#ifdef SIMULATOR_TEST
+# define ARGS 100, 1000
+#else
+# define ARGS
+#endif
+
void test01()
{
using namespace __gnu_test;
std::binomial_distribution<> bd1(5, 0.3);
auto bbd1 = std::bind(bd1, eng);
- testDiscreteDist(bbd1, [](int n) { return binomial_pdf(n, 5, 0.3); } );
+ testDiscreteDist<ARGS>(bbd1, [](int n) { return binomial_pdf(n, 5, 0.3); } );
- // These tests take a relatively long time on soft-float simulated
+ // These tests take a relatively long time on soft-float simulated targets.
// targets, so please don't add new tests here, instead add a new file.
}
#include <functional>
#include <testsuite_random.h>
+// { dg-additional-options "-DSIMULATOR_TEST" { target simulator } }
+
+#ifdef SIMULATOR_TEST
+# define ARGS 100, 1000
+#else
+# define ARGS
+#endif
+
void test01()
{
using namespace __gnu_test;
#include <functional>
#include <testsuite_random.h>
+// { dg-additional-options "-DSIMULATOR_TEST" { target simulator } }
+
+#ifdef SIMULATOR_TEST
+# define ARGS 100, 1000
+#else
+# define ARGS
+#endif
+
void test01()
{
using namespace __gnu_test;
std::geometric_distribution<> gd1(0.5);
auto bgd1 = std::bind(gd1, eng);
- testDiscreteDist(bgd1, [](int n) { return geometric_pdf(n, 0.5); } );
+ testDiscreteDist<ARGS>(bgd1, [](int n) { return geometric_pdf(n, 0.5); } );
std::geometric_distribution<> gd2(0.75);
auto bgd2 = std::bind(gd2, eng);
- testDiscreteDist(bgd2, [](int n) { return geometric_pdf(n, 0.75); } );
+ testDiscreteDist<ARGS>(bgd2, [](int n) { return geometric_pdf(n, 0.75); } );
// libstdc++/48114
std::geometric_distribution<> gd3(0.25);
auto bgd3 = std::bind(gd3, eng);
- testDiscreteDist(bgd3, [](int n) { return geometric_pdf(n, 0.25); } );
+ testDiscreteDist<ARGS>(bgd3, [](int n) { return geometric_pdf(n, 0.25); } );
}
int main()
#include <functional>
#include <testsuite_random.h>
+// { dg-additional-options "-DSIMULATOR_TEST" { target simulator } }
+
+#ifdef SIMULATOR_TEST
+# define ARGS 100, 1000
+#else
+# define ARGS
+#endif
+
void test01()
{
using namespace __gnu_test;
std::negative_binomial_distribution<> nbd1(5, 0.3);
auto bnbd1 = std::bind(nbd1, eng);
- testDiscreteDist(bnbd1, [](int n)
- { return negative_binomial_pdf(n, 5, 0.3); } );
+ testDiscreteDist<ARGS>(bnbd1, [](int n)
+ { return negative_binomial_pdf(n, 5, 0.3); } );
std::negative_binomial_distribution<> nbd2(55, 0.3);
auto bnbd2 = std::bind(nbd2, eng);
- testDiscreteDist(bnbd2, [](int n)
- { return negative_binomial_pdf(n, 55, 0.3); } );
+ testDiscreteDist<ARGS>(bnbd2, [](int n)
+ { return negative_binomial_pdf(n, 55, 0.3); } );
std::negative_binomial_distribution<> nbd3(10, 0.75);
auto bnbd3 = std::bind(nbd3, eng);
- testDiscreteDist(bnbd3, [](int n)
- { return negative_binomial_pdf(n, 10, 0.75); } );
+ testDiscreteDist<ARGS>(bnbd3, [](int n)
+ { return negative_binomial_pdf(n, 10, 0.75); } );
}
int main()
-// { dg-options "-DSIMULATOR_TEST" { target simulator } }
// { dg-do run { target c++11 } }
// { dg-require-cstdint "" }
// { dg-require-cmath "" }
#include <functional>
#include <testsuite_random.h>
+// { dg-additional-options "-DSIMULATOR_TEST" { target simulator } }
+
+#ifdef SIMULATOR_TEST
+# define ARGS 100, 1000
+#else
+# define ARGS
+#endif
+
void test01()
{
using namespace __gnu_test;
std::poisson_distribution<> pd1(3.0);
auto bpd1 = std::bind(pd1, eng);
- testDiscreteDist(bpd1, [](int n) { return poisson_pdf(n, 3.0); } );
+ testDiscreteDist<ARGS>(bpd1, [](int n) { return poisson_pdf(n, 3.0); } );
std::poisson_distribution<> pd2(15.0);
auto bpd2 = std::bind(pd2, eng);
- testDiscreteDist(bpd2, [](int n) { return poisson_pdf(n, 15.0); } );
+ testDiscreteDist<ARGS>(bpd2, [](int n) { return poisson_pdf(n, 15.0); } );
std::poisson_distribution<> pd3(30.0);
auto bpd3 = std::bind(pd3, eng);
- testDiscreteDist(bpd3, [](int n) { return poisson_pdf(n, 30.0); } );
+ testDiscreteDist<ARGS>(bpd3, [](int n) { return poisson_pdf(n, 30.0); } );
// This can take extremely long on simulators, timing out the test.
#ifndef SIMULATOR_TEST
#include <functional>
#include <testsuite_random.h>
+// { dg-additional-options "-DSIMULATOR_TEST" { target simulator } }
+
+#ifdef SIMULATOR_TEST
+# define ARGS 100, 1000
+#else
+# define ARGS
+#endif
+
void test01()
{
using namespace __gnu_test;
std::uniform_int_distribution<> uid1(0, 2);
auto buid1 = std::bind(uid1, eng);
- testDiscreteDist(buid1, [](int n) { return uniform_int_pdf(n, 0, 2); } );
+ testDiscreteDist<ARGS>(buid1, [](int n) { return uniform_int_pdf(n, 0, 2); } );
std::uniform_int_distribution<> uid2(3, 7);
auto buid2 = std::bind(uid2, eng);
- testDiscreteDist(buid2, [](int n) { return uniform_int_pdf(n, 3, 7); } );
+ testDiscreteDist<ARGS>(buid2, [](int n) { return uniform_int_pdf(n, 3, 7); } );
std::uniform_int_distribution<> uid3(1, 20);
auto buid3 = std::bind(uid3, eng);
- testDiscreteDist(buid3, [](int n) { return uniform_int_pdf(n, 1, 20); } );
+ testDiscreteDist<ARGS>(buid3, [](int n) { return uniform_int_pdf(n, 1, 20); } );
}
int main()