2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gcc.target / arc / mulsi3_highpart-2.c
blob6ec4bc5d8755e8f45370a4b4aea73038018c0441
1 /* { dg-do run } */
2 /* { dg-skip-if "ARC700 always has mpy option on" { arc700 } } */
3 /* { dg-skip-if "ARC600 doesn't have mpy instruction" { arc6xx } } */
4 /* { dg-options "-O2 --save-temps -mmpy-option=0" } */
6 #include <stdlib.h>
8 /* Hide value propagation from the optimizers. */
9 static int
10 id (int i)
12 asm ("": "+r" (i));
13 return i;
16 static int
17 mulhigh (unsigned a, unsigned b)
19 return (unsigned long long) a * b >> 32;
22 int
23 main (void)
25 if (mulhigh (id (0x12345678), id (0x90abcdef)) != 0xa49a83e)
26 abort ();
27 return 0;
30 /* { dg-final { scan-assembler-not "mpyhu\[ \t\]" } } */
31 /* { dg-final { scan-assembler-not "@__muldi3" } } */
32 /* { dg-final { scan-assembler "@__umulsi3_highpart" } } */