1
0
mirror of synced 2024-11-25 06:24:23 +01:00
avremu/source/test-suite/fibonacci-rec.c
Christian Dietrich 8d320f3744 Use TDS Layout
2014-10-09 15:20:20 +02:00

21 lines
290 B
C

#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:
*/