c++: normalizing ttp constraints [PR115656]
[official-gcc.git] / gcc / testsuite / gcc.target / avr / uint8-single-reg.c
blob291b56cd6eb203fd32c982afcd6dfcbb06d1c89c
1 /* { dg-do compile } */
2 /* { dg-options "-Os" } */
4 /* This testcase verifies that a uint8_t variable assigned from a wider variable
5 with the same range is held in a single register. VRP must not fold away the
6 conversion and use two regs to hold the uint16_t - widenings are ok only upto
7 word mode (1 byte for AVR).
8 */
10 unsigned int foo(const unsigned int wvalue)
12 const unsigned char type = (wvalue >> 8);
13 unsigned int size = 0;
15 if (type == 1)
17 size = 20;
19 return size;
22 /* { dg-final { scan-assembler "cpi r25,lo8\\(1\\)" } } */
23 /* { dg-final { scan-assembler-not "cpc r\\d+,__zero_reg__" } } */