qapi/error: Check format string argument in error_*prepend()
[qemu/armbru.git] / tests / tcg / openrisc / test_lf_lts.c
blobfa56721dfab1be1bee38c32cd9bef4980c215a52
1 #include <stdio.h>
3 int main(void)
5 int a;
6 float b, c, d;
7 int result;
9 a = 0;
10 b = 124.5;
11 c = 1.4;
12 result = 1;
13 __asm
14 ("lfltd:\n\t"
15 "l.addi %0, %0, 0x1\n\t"
16 "lf.sflt.s %1, %2\n\t"
17 "l.bf lfltd\n\t"
18 "l.nop\n\t"
19 : "+r"(a)
20 : "r"(b), "r"(c)
22 if (a != result) {
23 printf("lf.sflt.s error\n");
24 return -1;
27 a = 0;
28 b = 11.1;
29 c = 13.1;
30 d = 1.0;
31 result = 2;
32 __asm
33 ("1:\n\t"
34 "lf.add.s %1, %1, %3\n\t"
35 "l.addi %0, %0, 1\n\t"
36 "lf.sflt.s %1, %2\n\t"
37 "l.bf 1b\n\t"
38 "l.nop\n\t"
39 : "+r"(a)
40 : "r"(b), "r"(c), "r"(d)
42 if (a != result) {
43 printf("lf.sflt.s error\n");
44 return -1;
47 /* int a;
48 double b, c;
49 int result;
51 a = 0;
52 b = 1432.1;
53 c = 2.4;
54 result = 0x1;
55 __asm
56 ("lfltd:\n\t"
57 "l.addi %0, %0, 0x1\n\t"
58 "lf.sflt.d %1, %2\n\t"
59 "l.bf lfltd\n\t"
60 "l.nop\n\t"
61 : "+r"(a)
62 : "r"(b), "r"(c)
64 if (a != result) {
65 printf("lf.sflt.d error\n");
66 return -1;
69 a = 0;
70 b = 1.1;
71 c = 19.7;
72 result = 2;
73 __asm
74 ("lf.sflt.d %1, %2\n\t"
75 "l.bf 1f\n\t"
76 "l.nop\n\t"
77 "l.addi %0, %0, 1\n\t"
78 "l.addi %0, %0, 1\n\t"
79 "l.addi %0, %0, 1\n\t"
80 "1:\n\t"
81 "l.addi %0, %0, 1\n\t"
82 "l.addi %0, %0, 1\n\t"
83 : "+r"(a), "+r"(b)
84 : "r"(c)
86 if (a != result) {
87 printf("lf.sflt.d error\n");
88 return -1;
89 }*/
91 return 0;