1
0
mirror of synced 2024-11-10 07:08:52 +01:00
avremu/source/test-suite/fibonacci-rec.c

21 lines
290 B
C
Raw Normal View History

2014-09-28 16:49:03 +02:00
#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:
*/