1/* Make sure that the H8 backend does not generate a div 2 instruction in a delay slot. */ 3/* { dg-options "-Os" } */ 4/* { dg-skip-if "" { "h8300*-*-*" } "*" "-msx*" } */ 5/* { dg-final { scan-assembler-not "\tbra/s\t.*\n\tdiv*" } } */ 6 7extern volatile unsigned long timer_ticks; 8#define timer_ms_elapsed(ticks) (((unsigned long)(timer_ticks-ticks))/10) 9unsigned long ticks; 10 11unsigned tst_read( unsigned char idx ) 12{ 13 switch( idx ) 14 { 15 case 0x62: return timer_ms_elapsed(ticks); 16 case 0x61: return timer_ticks; 17 default: return 0; 18 } 19} 20