xref: /third_party/skia/resources/sksl/runtime_errors/IllegalRecursionComplex.rts
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/skia/resources/sksl/runtime_errors/
1cb93a386Sopenharmony_ci// Expect 1 errors (with f_one(int), f_two, f_three in cycle)
2cb93a386Sopenharmony_ci
3cb93a386Sopenharmony_ci// Complex recursion spanning several functions with overloads, etc.
4cb93a386Sopenharmony_ci
5cb93a386Sopenharmony_civoid f_one(bool b);
6cb93a386Sopenharmony_civoid f_one(int n);
7cb93a386Sopenharmony_civoid f_two(int n);
8cb93a386Sopenharmony_civoid f_three(int n);
9cb93a386Sopenharmony_civoid f_four(int n);
10cb93a386Sopenharmony_ci
11cb93a386Sopenharmony_civoid f_one(bool b) {
12cb93a386Sopenharmony_ci    int n = b ? 1 : 0;
13cb93a386Sopenharmony_ci    f_one(n);
14cb93a386Sopenharmony_ci}
15cb93a386Sopenharmony_ci
16cb93a386Sopenharmony_civoid f_one(int n) {
17cb93a386Sopenharmony_ci    if (n > 0) {
18cb93a386Sopenharmony_ci        f_four(n);
19cb93a386Sopenharmony_ci    } else {
20cb93a386Sopenharmony_ci        f_two(n);
21cb93a386Sopenharmony_ci    }
22cb93a386Sopenharmony_ci}
23cb93a386Sopenharmony_ci
24cb93a386Sopenharmony_civoid f_two(int n) {
25cb93a386Sopenharmony_ci    for (int i = 0; i < 4; ++i) {
26cb93a386Sopenharmony_ci        f_three(n);
27cb93a386Sopenharmony_ci    }
28cb93a386Sopenharmony_ci}
29cb93a386Sopenharmony_ci
30cb93a386Sopenharmony_civoid f_three(int n) {
31cb93a386Sopenharmony_ci    f_one(n);
32cb93a386Sopenharmony_ci}
33cb93a386Sopenharmony_ci
34cb93a386Sopenharmony_civoid f_four(int n) {}
35

Indexes created Thu Nov 07 10:32:03 CST 2024