diff options
author | Karl Berry <karl@freefriends.org> | 2014-10-14 22:25:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-10-14 22:25:31 +0000 |
commit | 0db489324b44568fc4fdd9d194ce6d17203fae88 (patch) | |
tree | d14c24184a6da8bdbbb2886ac268350ce77fe1e5 /Master/texmf-dist/source/latex/avremu/test-suite/printf.c | |
parent | 0f77752d377a5492ac8d36d73cb08ef7098dee64 (diff) |
avremu (14oct14)
git-svn-id: svn://tug.org/texlive/trunk@35373 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/avremu/test-suite/printf.c')
-rw-r--r-- | Master/texmf-dist/source/latex/avremu/test-suite/printf.c | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/avremu/test-suite/printf.c b/Master/texmf-dist/source/latex/avremu/test-suite/printf.c new file mode 100644 index 00000000000..e8d14fb0782 --- /dev/null +++ b/Master/texmf-dist/source/latex/avremu/test-suite/printf.c @@ -0,0 +1,69 @@ +#include <avr/io.h> +#include <stdio.h> + +char buffer[30]; + +volatile char buf[3]; + +static int uart_putchar(char c, FILE *stream); +static FILE mystdout = FDEV_SETUP_STREAM(uart_putchar, NULL, + _FDEV_SETUP_WRITE); +static int +uart_putchar(char c, FILE *stream) +{ + UDR = c; + return 0; +} + + +int +main(void) +{ + stdout = &mystdout; + + buf[0] = 'x'; + buf[1] = 'y'; + buf[2] = '\0'; + + puts(buf); + + + asm volatile("break;"); + + printf(":%c", buf[0]); + + asm volatile("break;"); + + printf(":%d:", buf[1]); + + asm volatile("break;"); + + volatile float x=0.23; + printf(":%.2f:", x); + + asm volatile("break;"); + + return 0; +} + + +/** + check-name: Print to Stdout + compiler-opts: -Wl,-u,vfprintf -lm -lprintf_flt + check-start: + + \avr@instr@stepn{100000} + \avr@test@UDR{xy^10} % ^10 == \n + \def\avr@UDR{} + + \avr@instr@stepn{100000} + \avr@test@UDR{:x} + + \avr@instr@stepn{100000} + \avr@test@UDR{:121:} + + \avr@instr@stepn{100000} + \avr@test@UDR{:0.23:} + + check-end: +**/ |