PR target/84226
[official-gcc.git] / gcc / testsuite / gcc.target / avr / pr71676-2.c
bloba3a7a08032d5b6226af92adc4af76f37bf5add53
1 /* { dg-do compile } */
2 /* { dg-options "-dp -w -Os -fno-tree-switch-conversion" } */
4 #define MK_FUN(NAME, TYP, V) \
5 unsigned char __attribute__((noinline,noclone)) \
6 select_## NAME (TYP x, unsigned char y) \
7 { \
8 switch (x) \
9 { \
10 case V + 0: return 0 + y; \
11 case V + 1: return 1; \
12 case V + 2: return 2 + y; \
13 case V + 3: return 3; \
14 case V + 4: return 4 + y; \
15 case V + 5: return 5; \
16 case V + 6: return 6 + y; \
17 case V + 7: return 7; \
18 case V + 8: return 8 + y; \
19 case V + 9: return 9; \
20 case V + 10: return 10 + y; \
21 case V + 11: return 11; \
22 case V + 12: return 12 + y; \
23 case V + 13: return 13; \
24 case V + 14: return 14 + y; \
25 case V + 15: return 15; \
26 } \
27 return x; \
30 MK_FUN (0_s8, signed char, 0)
31 MK_FUN (0_u8, unsigned char, 0)
32 MK_FUN (0_s16, signed int, 0)
33 MK_FUN (0_u16, unsigned int, 0)
35 MK_FUN (m4_s8, signed char, -4)
36 MK_FUN (m4_u8, unsigned char, -4)
37 MK_FUN (m4_s16, signed int, -4)
38 MK_FUN (m4_u16, unsigned int, -4)
40 MK_FUN (4_s8, signed char, 4)
41 MK_FUN (4_u8, unsigned char, 4)
42 MK_FUN (4_s16, signed int, 4)
43 MK_FUN (4_u16, unsigned int, 4)
45 /* { dg-final { scan-assembler-not "extendqisi" } } */
46 /* { dg-final { scan-assembler-not "extendhisi" } } */