vmnet: stop recieving events when VM is stopped
[qemu/armbru.git] / tests / tcg / s390x / div.c
blob6ad9900e082279ee7e24321c522924672b178cdf
1 #include <assert.h>
2 #include <stdint.h>
4 static void test_dr(void)
6 register int32_t r0 asm("r0") = -1;
7 register int32_t r1 asm("r1") = -4241;
8 int32_t b = 101, q, r;
10 asm("dr %[r0],%[b]"
11 : [r0] "+r" (r0), [r1] "+r" (r1)
12 : [b] "r" (b)
13 : "cc");
14 q = r1;
15 r = r0;
16 assert(q == -41);
17 assert(r == -100);
20 static void test_dlr(void)
22 register uint32_t r0 asm("r0") = 0;
23 register uint32_t r1 asm("r1") = 4243;
24 uint32_t b = 101, q, r;
26 asm("dlr %[r0],%[b]"
27 : [r0] "+r" (r0), [r1] "+r" (r1)
28 : [b] "r" (b)
29 : "cc");
30 q = r1;
31 r = r0;
32 assert(q == 42);
33 assert(r == 1);
36 static void test_dsgr(void)
38 register int64_t r0 asm("r0") = -1;
39 register int64_t r1 asm("r1") = -4241;
40 int64_t b = 101, q, r;
42 asm("dsgr %[r0],%[b]"
43 : [r0] "+r" (r0), [r1] "+r" (r1)
44 : [b] "r" (b)
45 : "cc");
46 q = r1;
47 r = r0;
48 assert(q == -41);
49 assert(r == -100);
52 static void test_dlgr(void)
54 register uint64_t r0 asm("r0") = 0;
55 register uint64_t r1 asm("r1") = 4243;
56 uint64_t b = 101, q, r;
58 asm("dlgr %[r0],%[b]"
59 : [r0] "+r" (r0), [r1] "+r" (r1)
60 : [b] "r" (b)
61 : "cc");
62 q = r1;
63 r = r0;
64 assert(q == 42);
65 assert(r == 1);
68 int main(void)
70 test_dr();
71 test_dlr();
72 test_dsgr();
73 test_dlgr();
74 return 0;