summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/avremu/test-suite/fibonacci-rec.c
blob: a3f2f6edf336dfe9d02ca6cb6437230413d50731 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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:
*/