]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/g++.dg/pr69667.C
Get rid of dg-skip-if etc. default args
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / pr69667.C
CommitLineData
76255d0d 1/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
4f4b0ab8 2/* { dg-skip-if "" { powerpc*-*-darwin* } } */
76255d0d
MM
3/* { dg-require-effective-target powerpc_p8vector_ok } */
4/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
5/* { dg-options "-mcpu=power8 -w -std=c++14 -mlra" } */
6
7/* target/69667, compiler got
8 internal compiler error: Max. number of generated reload insns per insn is achieved (90) */
9
10struct A {
11 typedef int evaluation_error_type;
12};
13template <class T, class> T get_epsilon();
14template <class E> __attribute__((__noreturn__)) void throw_exception(E);
15template <class Formatter, class Group> char do_format(Formatter, Group &);
16int raise_error_e, non_central_beta_p_k;
17template <class, class T> void raise_error(T &p1) {
18 char msg = do_format(msg, p1);
19 throw_exception(raise_error_e);
20}
21char raise_evaluation_error_function;
22template <class T1, class T2, class Policy>
23T1 gamma_p_derivative(T1, T2, Policy);
24template <class T, class Policy> T ibeta_imp(Policy, bool, T *);
25template <class> struct B {};
26template <class Dist, class RealType> B<Dist> complement(Dist, RealType);
27template <class, class> class C;
28template <class T, class Policy> struct D {
29 D(C<T, Policy> p1, T, bool) : dist(p1) {}
30 void operator()(T p1) { comp ? cdf(complement(dist, p1)) : T(); }
31 C<T, Policy> dist;
32 bool comp;
33};
34template <class, class = A> class C {
35public:
36 C(int, int, int);
37};
38template <class RealType, class Policy> void quantile(Policy p1, RealType) {
39 nc_beta_quantile(p1, false);
40}
41double quantile_sanity_check___trans_tmp_1, quantile_sanity_check___trans_tmp_3,
42 quantile_sanity_check___trans_tmp_5, quantile_sanity_check___trans_tmp_7;
43void Trans_NS_detail_raise_evaluation_error(char *, char *, long double &p3,
44 int) {
45 raise_error<int>(p3);
46}
47template <class T, class Policy>
48void raise_evaluation_error(char *, T &p2, Policy) {
49 Trans_NS_detail_raise_evaluation_error(
50 &raise_evaluation_error_function, "", p2,
51 typename Policy::evaluation_error_type());
52}
53template <class T, class Policy>
54T non_central_beta_p(T p1, T p2, T p3, Policy p4, T p5 = 0) {
55 T y, errtol = get_epsilon<T, Policy>(), l2,
56 pois = gamma_p_derivative(T(), l2, p4), xterm, last_term = 0;
57 if (pois)
58 return p5;
59 T beta = y ? ibeta_imp(p4, false, &xterm) : ibeta_imp(p4, true, &xterm);
60 xterm = y - 1;
61 T sum = p5;
62 if (beta && xterm)
63 return p5;
64 for (; non_central_beta_p_k;) {
65 sum += beta;
66 if (errtol && last_term || beta)
67 break;
68 xterm *=
69 p1 + non_central_beta_p_k - 1 / p3 * p1 + p2 + non_central_beta_p_k - 2;
70 last_term = beta;
71 }
72 raise_evaluation_error("", sum, p4);
73}
74template <class RealType, class Policy>
75RealType non_central_beta_cdf(RealType, bool, Policy) {
76 RealType b, a, x;
77 non_central_beta_p(a, b, x, A());
78}
79template <class F, class T, class Tol, class Policy>
80int bracket_and_solve_root_01(F p1, T, bool, Tol, unsigned, Policy) {
81 T guess;
82 p1(guess);
83}
84template <class RealType, class Policy>
85void nc_beta_quantile(C<RealType, Policy>, bool p2) {
86 RealType p;
87 typedef RealType value_type;
88 D<value_type, Policy> f(C<value_type, Policy>(0, 0, 0), p, p2);
89 void tol();
90 long max_iter =
91 bracket_and_solve_root_01(f, value_type(), true, tol, max_iter, Policy());
92}
93template <class RealType, class Policy> RealType cdf(B<C<RealType, Policy>>) {
94 RealType l = non_central_beta_cdf(l, true, Policy());
95}
96template <typename T> void quantile_sanity_check(T) {
97 quantile(C<long double>(quantile_sanity_check___trans_tmp_1,
98 quantile_sanity_check___trans_tmp_3,
99 quantile_sanity_check___trans_tmp_5),
100 quantile_sanity_check___trans_tmp_7);
101}
102void test_accuracy() {
103 int ncbeta;
104 quantile_sanity_check(ncbeta);
105}