diff options
author | Xavier Leroy <xavier.leroy@college-de-france.fr> | 2020-07-25 17:13:05 +0200 |
---|---|---|
committer | Xavier Leroy <xavierleroy@users.noreply.github.com> | 2020-07-27 16:30:28 +0200 |
commit | 70f105e623dddeb27be258fedb56bd0e9a59d190 (patch) | |
tree | 4c6130620108ec3b2d42f476986fe2896f0dae4a /test/regression/builtins-aarch64.c | |
parent | bc20d7c0d16d07790fb6eb608bf608237b0abbc3 (diff) | |
download | compcert-70f105e623dddeb27be258fedb56bd0e9a59d190.tar.gz compcert-70f105e623dddeb27be258fedb56bd0e9a59d190.zip |
Refactor regression testing of built-in functions
Share the testing code for built-in functions that are available on
all target platforms.
Improve testing of __builtin_clz* and __builtin_ctz*
Diffstat (limited to 'test/regression/builtins-aarch64.c')
-rw-r--r-- | test/regression/builtins-aarch64.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/test/regression/builtins-aarch64.c b/test/regression/builtins-aarch64.c index 2cfa2d09..671f65e3 100644 --- a/test/regression/builtins-aarch64.c +++ b/test/regression/builtins-aarch64.c @@ -1,43 +1,25 @@ -/* Fun with builtin functions */ +/* AArch64-specific builtin functions */ #include <stdio.h> int main(int argc, char ** argv) { - unsigned int x = 0x12345678; - unsigned int y = 0xDEADBEEF; - unsigned long long xx = 0x1234567812345678ULL; - unsigned long long yy = 0x1234567800000000ULL; - unsigned long long zz = 0x123456789ABCDEF0ULL; - unsigned z; double a = 3.14159; double b = 2.718; double c = 1.414; - unsigned short s = 0x1234; signed int u = 1234567; signed int v = -9999; - printf("bswap(%x) = %x\n", x, __builtin_bswap(x)); - printf("bswap16(%x) = %x\n", s, __builtin_bswap16(s)); - printf("bswap64(%llx) = %llx\n", zz, __builtin_bswap64(zz)); - printf("clz(%x) = %d\n", x, __builtin_clz(x)); - printf("clzll(%llx) = %d\n", (unsigned long long) x, __builtin_clzll(x)); - printf("clzll(%llx) = %d\n", xx, __builtin_clzll(xx)); printf("cls(%d) = %d\n", u, __builtin_cls(u)); printf("cls(%d) = %d\n", v, __builtin_cls(v)); printf("clsll(%lld) = %d\n", (signed long long) u, __builtin_clsll(u)); printf("clsll(%lld) = %d\n", (signed long long) v, __builtin_clsll(v)); - printf("fsqrt(%f) = %f\n", a, __builtin_fsqrt(a)); printf("fmadd(%f, %f, %f) = %f\n", a, b, c, __builtin_fmadd(a, b, c)); printf("fmsub(%f, %f, %f) = %f\n", a, b, c, __builtin_fmsub(a, b, c)); printf("fnmadd(%f, %f, %f) = %f\n", a, b, c, __builtin_fnmadd(a, b, c)); printf("fnmsub(%f, %f, %f) = %f\n", a, b, c, __builtin_fnmsub(a, b, c)); - /* Make sure that ignoring the result of a builtin - doesn't cause an internal error */ - (void) __builtin_bswap(x); - (void) __builtin_fsqrt(a); return 0; } |