John Kessenich | 2ecdd14 | 2013-10-01 21:58:43 +0000 | [diff] [blame] | 1 | #version 330 core
|
| 2 |
|
| 3 | // cross-unit recursion
|
| 4 |
|
| 5 | void main() {}
|
| 6 |
|
| 7 | // two-level recursion
|
| 8 |
|
| 9 | float cbar(int);
|
| 10 |
|
| 11 | void cfoo(float)
|
| 12 | {
|
| 13 | cbar(2);
|
| 14 | }
|
| 15 |
|
| 16 | // four-level, out of order
|
| 17 |
|
| 18 | void CB();
|
| 19 | void CD();
|
| 20 | void CA() { CB(); }
|
| 21 | void CC() { CD(); }
|
| 22 |
|
| 23 | // high degree
|
| 24 |
|
| 25 | void CBT();
|
| 26 | void CDT();
|
| 27 | void CAT() { CBT(); CBT(); CBT(); }
|
| 28 | void CCT() { CDT(); CDT(); CBT(); }
|
John Kessenich | 8cbd18e | 2013-10-30 01:22:04 +0000 | [diff] [blame] | 29 |
|
| 30 | // not recursive
|
| 31 |
|
| 32 | void norA() {}
|
| 33 | void norB() { norA(); }
|
| 34 | void norC() { norA(); }
|
| 35 | void norD() { norA(); }
|
| 36 | void norE() { norB(); }
|
| 37 | void norF() { norB(); }
|
| 38 | void norG() { norE(); }
|
| 39 | void norH() { norE(); }
|
| 40 | void norI() { norE(); }
|
| 41 |
|
| 42 | // not recursive, but with a call leading into a cycle if ignoring direction
|
| 43 |
|
| 44 | void norcA() { }
|
| 45 | void norcB() { norcA(); }
|
| 46 | void norcC() { norcB(); }
|
| 47 | void norcD() { norcC(); norcB(); } // head of cycle
|
| 48 | void norcE() { norcD(); } // lead into cycle
|