summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/mips/ext-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/mips/ext-3.c')
-rw-r--r--gcc/testsuite/gcc.target/mips/ext-3.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/mips/ext-3.c b/gcc/testsuite/gcc.target/mips/ext-3.c
new file mode 100644
index 000000000..acdbbc9a4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/ext-3.c
@@ -0,0 +1,14 @@
+/* For MIPS64r2 use DEXT rather than DSLL/DSRL to zero-extend. */
+/* { dg-do compile } */
+/* { dg-options "-O isa_rev>=2 -mgp64" } */
+/* { dg-final { scan-assembler "\tdext\t" } } */
+/* { dg-final { scan-assembler-not "sll" } } */
+
+NOMIPS16 unsigned long long
+f (unsigned *i)
+{
+ unsigned j = *i;
+ j >>= 1; /* enforce this is all done in SI mode */
+ j++; /* don't merge the shift and the extension */
+ return j;
+}