xref: /openbmc/qemu/tests/tcg/alpha/test-ovf.c (revision 7f709ce7)
1 static long test_subqv (long a, long b)
2 {
3   long res;
4 
5   asm ("subq/v %1,%2,%0"
6        : "=r" (res) : "r" (a), "r" (b));
7   return res;
8 }
9 static struct {
10   long (*func)(long, long);
11   long a;
12   long b;
13   long r;
14 } vectors[] =
15   {
16     {test_subqv, 0, 0x7d54000, 0xfffffffff82ac000L}
17   };
18 
19 int main (void)
20 {
21   int i;
22 
23   for (i = 0; i < sizeof (vectors)/sizeof(vectors[0]); i++)
24     if ((*vectors[i].func)(vectors[i].a, vectors[i].b) != vectors[i].r) {
25       write(1, "Failed\n", 7);
26     }
27   write(1, "OK\n", 3);
28   return 0;
29 }
30