di_int x = __muldi3(a, b);
if (x != expected)
printf("error in __muldi3: %lld * %lld = %lld, expected %lld\n",
- a, b, __muldi3(a, b), expected);
+ a, b, x, expected);
return x != expected;
}
-// REQUIRES: riscv32-target-arch
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_mulsi3
#include "int_lib.h"
#include <stdio.h>
#include <limits.h>
-#if !defined(__riscv_mul) && __riscv_xlen == 32
-// Based on mulsi3_test.c
-
COMPILER_RT_ABI si_int __mulsi3(si_int a, si_int b);
int test__mulsi3(si_int a, si_int b, si_int expected)
si_int x = __mulsi3(a, b);
if (x != expected)
printf("error in __mulsi3: %d * %d = %d, expected %d\n",
- a, b, __mulsi3(a, b), expected);
+ a, b, x, expected);
return x != expected;
}
-#endif
int main()
{
-#if !defined(__riscv_mul) && __riscv_xlen == 32
if (test__mulsi3(0, 0, 0))
return 1;
if (test__mulsi3(0, 1, 0))
return 1;
if (test__mulsi3(-8192, -4194303, 34359730176))
return 1;
-#else
- printf("skipped\n");
-#endif
return 0;
}