summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/mips/truncate-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/mips/truncate-2.c')
-rw-r--r--gcc/testsuite/gcc.target/mips/truncate-2.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/mips/truncate-2.c b/gcc/testsuite/gcc.target/mips/truncate-2.c
new file mode 100644
index 000000000..423dc26f4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/truncate-2.c
@@ -0,0 +1,20 @@
+/* { dg-options "-O -mgp64" } */
+
+#define TEST(ID, TYPE, SHIFT) \
+ int NOMIPS16 \
+ f##ID (long long y) \
+ { \
+ return (TYPE) ((TYPE) (y >> SHIFT) + 1); \
+ }
+
+TEST (1, int, 32)
+TEST (2, short, 32)
+TEST (3, char, 32)
+TEST (4, int, 33)
+TEST (5, short, 33)
+TEST (6, char, 33)
+TEST (7, int, 61)
+TEST (8, short, 61)
+TEST (9, char, 61)
+
+/* { dg-final { scan-assembler-not "\tsll\t\[^\n\]*,0" } } */