diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/avremu/test-suite/fibonacci-rec.c')
-rw-r--r-- | Master/texmf-dist/source/latex/avremu/test-suite/fibonacci-rec.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/avremu/test-suite/fibonacci-rec.c b/Master/texmf-dist/source/latex/avremu/test-suite/fibonacci-rec.c new file mode 100644 index 00000000000..a3f2f6edf33 --- /dev/null +++ b/Master/texmf-dist/source/latex/avremu/test-suite/fibonacci-rec.c @@ -0,0 +1,20 @@ +#include <avr/io.h> + +char fib(char n) { + if (n <= 1) { + return 1; + } + return fib(n-1) + fib(n-2); +} + +int main() { + UDR = fib(5); + asm volatile ("break"); +} +/* + check-name: Fibonacci (Recursive) + check-start: + \avr@instr@stepn{1000} + \avr@test@REG{r24}{00001000} + check-end: +*/ |