[PATCH, GCC/ARM, 6/10] Clear GPRs inline when calling nscall function
[official-gcc.git] / gcc / testsuite / gcc.target / arm / rev16.c
blob1c869b3067a6992cfb58f2b1a20e4649d2ded184
1 /* { dg-options "-O2" } */
2 /* { dg-do run } */
4 extern void abort (void);
6 typedef unsigned int __u32;
8 __u32
9 __rev16_32_alt (__u32 x)
11 return (((__u32)(x) & (__u32)0xff00ff00UL) >> 8)
12 | (((__u32)(x) & (__u32)0x00ff00ffUL) << 8);
15 __u32
16 __rev16_32 (__u32 x)
18 return (((__u32)(x) & (__u32)0x00ff00ffUL) << 8)
19 | (((__u32)(x) & (__u32)0xff00ff00UL) >> 8);
22 int
23 main (void)
25 volatile __u32 in32 = 0x12345678;
26 volatile __u32 expected32 = 0x34127856;
28 if (__rev16_32 (in32) != expected32)
29 abort ();
31 if (__rev16_32_alt (in32) != expected32)
32 abort ();
34 return 0;