1 /* -mlong32 added because of PR target/38595.  */
2 /* { dg-options "(-mips16) isa_rev>=1 -mlong32" } */
3 /* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
4 
5 extern int validate ();
6 
cksum16(unsigned long n)7 MIPS16 short cksum16 (unsigned long n)
8 {
9   unsigned long l;
10   l = validate (n, (n >> 16) + (n & 0xffff));
11   return l;
12 }
13 
cksum8(unsigned long n)14 MIPS16 signed char cksum8 (unsigned long n)
15 {
16   unsigned long l;
17   l = validate (n, (n >> 8) + (n & 0xff));
18   return l;
19 }
20 
21 /* { dg-final { scan-assembler "\tzeh\t" } } */
22 /* { dg-final { scan-assembler "\tseh\t" } } */
23 /* { dg-final { scan-assembler "\tzeb\t" } } */
24 /* { dg-final { scan-assembler "\tseb\t" } } */
25