diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/arc/mulsi3_highpart-1.c')
-rw-r--r-- | gcc/testsuite/gcc.target/arc/mulsi3_highpart-1.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/arc/mulsi3_highpart-1.c b/gcc/testsuite/gcc.target/arc/mulsi3_highpart-1.c new file mode 100644 index 00000000000..398ecfe948e --- /dev/null +++ b/gcc/testsuite/gcc.target/arc/mulsi3_highpart-1.c @@ -0,0 +1,28 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -mARC700 --save-temps" } */ + +#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 "mpyhu\[ \t\]" } } */ |