gcc/testsuite/gcc.target/avr/mmcu/pr58545.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-Os -mmcu=atmega8" } */ |
| 3 | |
| 4 | typedef unsigned char uint8_t; |
| 5 | typedef unsigned int uint16_t; |
| 6 | |
| 7 | extern uint8_t f1 (const uint8_t*); |
| 8 | extern void f2 (uint8_t*, uint8_t); |
| 9 | |
| 10 | void func (uint16_t parameter, uint8_t *addr, uint8_t data) |
| 11 | { |
| 12 | uint8_t status; |
| 13 | |
| 14 | status = f1 (addr + 8); |
| 15 | |
| 16 | addr++; |
| 17 | |
| 18 | if (*addr == parameter + 8) |
| 19 | *addr = parameter; |
| 20 | |
| 21 | f2 (addr, data); |
| 22 | f2 (addr + 8, status + 1); |
| 23 | } |