Merge tag 'pull-loongarch-20241016' of https://gitlab.com/gaosong/qemu into staging
[qemu/armbru.git] / tests / tcg / openrisc / test_sub.c
blob474ec6055b2f98b926ad8dab2fd02b5dbe4ca806
1 #include <stdio.h>
3 int main(void)
5 int a, b;
6 int result;
8 a = 0x100;
9 b = 0x100;
10 result = 0x0;
11 __asm
12 ("l.sub %0, %0, %1\n\t"
13 : "+r"(a)
14 : "r"(b)
16 if (a != result) {
17 printf("sub error\n");
18 return -1;
21 a = 0xffff;
22 b = 0x1;
23 result = 0xfffe;
24 __asm
25 ("l.sub %0, %0, %1\n\t"
26 : "+r"(a)
27 : "r"(b)
29 if (a != result) {
30 printf("sub error\n");
31 return -1;
34 return 0;