aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/arc/mulsi3_highpart-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target/arc/mulsi3_highpart-2.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/arc/mulsi3_highpart-2.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arc/mulsi3_highpart-2.c b/gcc-4.9/gcc/testsuite/gcc.target/arc/mulsi3_highpart-2.c
new file mode 100644
index 000000000..ccc74e7b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/arc/mulsi3_highpart-2.c
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -mARC700 --save-temps -mno-mpy" } */
+
+#include <stdlib.h>
+
+/* Hide value propagation from the optimizers. */
+static int
+id (int i)
+{
+ asm ("": "+Xr" (i));
+ return i;
+}
+
+static int
+mulhigh (unsigned a, unsigned b)
+{
+ return (unsigned long long) a * b >> 32;
+}
+
+int
+main (void)
+{
+ if (mulhigh (id (0x12345678), id (0x90abcdef)) != 0xa49a83e)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-assembler-not "mpyhu\[ \t\]" } } */
+/* { dg-final { scan-assembler-not "@__muldi3" } } */
+/* { dg-final { scan-assembler "@__umulsi3_highpart" } } */