aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/testsuite/gcc.target/mips/bswap-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.8/gcc/testsuite/gcc.target/mips/bswap-3.c')
-rw-r--r--gcc-4.8/gcc/testsuite/gcc.target/mips/bswap-3.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc-4.8/gcc/testsuite/gcc.target/mips/bswap-3.c b/gcc-4.8/gcc/testsuite/gcc.target/mips/bswap-3.c
new file mode 100644
index 000000000..5d2086fd3
--- /dev/null
+++ b/gcc-4.8/gcc/testsuite/gcc.target/mips/bswap-3.c
@@ -0,0 +1,14 @@
+/* { dg-options "isa_rev>=2" } */
+/* { dg-skip-if "bswap recognition needs expensive optimizations" { *-*-* } { "-O0" "-O1" } { "" } } */
+
+NOMIPS16 unsigned int
+foo (unsigned int x)
+{
+ return (((x << 24) & 0xff000000)
+ | ((x << 8) & 0xff0000)
+ | ((x >> 8) & 0xff00)
+ | ((x >> 24) & 0xff));
+}
+
+/* { dg-final { scan-assembler "\twsbh\t" } } */
+/* { dg-final { scan-assembler "\tror\t" } } */