Merged with mainline at revision 128810.
[official-gcc.git] / gcc / testsuite / gcc.target / mips / dse-1.c
bloba2b844509683edb7e44c1eedfa7c1e2c3834f774
1 /* { dg-mips-options "-mgp64 -O" } */
3 #define TEST(ID, TYPE1, TYPE2) \
4 union { \
5 TYPE1 m1[sizeof (TYPE2) / sizeof (TYPE1)]; \
6 TYPE2 m2; \
7 } u##ID; \
9 /* The MIPS16 versions of the shifts we need are too \
10 expensive. */ \
11 TYPE1 __attribute__((nomips16)) \
12 f##ID (TYPE2 x) \
13 { \
14 u##ID.m2 = x; \
15 return (u##ID.m1[0] \
16 + u##ID.m1[sizeof (TYPE2) / sizeof (TYPE1) - 1]); \
19 TEST (1, unsigned int, unsigned long long);
20 TEST (2, int, long long);
21 TEST (3, unsigned short, unsigned long long);
22 TEST (4, short, long long);
23 TEST (5, unsigned char, unsigned long long);
24 TEST (6, signed char, long long);
26 TEST (7, unsigned short, unsigned int);
27 TEST (8, short, int);
28 TEST (9, unsigned char, unsigned int);
29 TEST (10, signed char, int);
31 /* DSE isn't yet read to consider stores of subregs, so the corresponding
32 (char, short) tests won't pass. */
34 /* { dg-final { scan-assembler-not "\tlh\t" } } */
35 /* { dg-final { scan-assembler-not "\tlw\t" } } */
36 /* { dg-final { scan-assembler-not "\tlb\t" } } */