From: Ivo Raisr Date: Wed, 17 May 2017 11:06:53 +0000 (+0000) Subject: Fix test fb_test_amd64. X-Git-Tag: svn/VALGRIND_3_13_0~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4bf4fc7f138ec41d3379f65eb63213799a5ac6cf;p=thirdparty%2Fvalgrind.git Fix test fb_test_amd64. Follow up to r16372. The test is now built if the compiler understands AVX instructions. The test is executed if the host speaks AVX is well. Finally bogus printf format flags were fixed as they caused the output to be inconsistent on Linux and Solaris. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16393 --- diff --git a/none/tests/amd64/Makefile.am b/none/tests/amd64/Makefile.am index a4139dd83f..cca385e43e 100644 --- a/none/tests/amd64/Makefile.am +++ b/none/tests/amd64/Makefile.am @@ -98,7 +98,6 @@ check_PROGRAMS = \ bug127521-64 bug132813-amd64 bug132918 bug137714-amd64 \ clc \ cmpxchg \ - fb_test_amd64 \ getseg \ $(INSN_TESTS) \ nan80and64 \ @@ -113,6 +112,7 @@ if BUILD_ADDR32_TESTS check_PROGRAMS += asorep endif if BUILD_AVX_TESTS + check_PROGRAMS += fb_test_amd64 if BUILD_VPCLMULQDQ_TESTS check_PROGRAMS += avx-1 endif diff --git a/none/tests/amd64/fb_test_amd64.c b/none/tests/amd64/fb_test_amd64.c index 5f77d6be3c..f4b06e68d4 100644 --- a/none/tests/amd64/fb_test_amd64.c +++ b/none/tests/amd64/fb_test_amd64.c @@ -362,6 +362,7 @@ void xxprintf_done(void) printf("\n"); } +__attribute__((format(__printf__, 1, 2))) void xxprintf (const char *format, ...) { char buf[128]; @@ -947,9 +948,9 @@ void test_fcvt(double a) la = a; xxprintf("(float)%f = %f\n", a, fa); xxprintf("(long double)%f = %Lf\n", a, la); - xxprintf("a=%016Lx\n", *(long long *)&a); - xxprintf("la=%016Lx %04x\n", *(long long *)&la, - *(unsigned short *)((char *)(&la) + 8)); + xxprintf("a=%016llx\n", *(unsigned long long int *) &a); + xxprintf("la=%016llx %04x\n", *(unsigned long long int *) &la, + *(unsigned short *) ((char *)(&la) + 8)); /* test all roundings */ asm volatile ("fstcw %0" : "=m" (fpuc)); @@ -963,7 +964,7 @@ void test_fcvt(double a) asm volatile ("fldcw %0" : : "m" (fpuc)); xxprintf("(short)a = %d\n", wa); xxprintf("(int)a = %d\n", ia); - xxprintf("(int64_t)a = %Ld\n", lla); + xxprintf("(int64_t)a = %lld\n", lla); xxprintf("rint(a) = %f\n", ra); } } diff --git a/none/tests/amd64/fb_test_amd64.vgtest b/none/tests/amd64/fb_test_amd64.vgtest index 009190678f..43286d615f 100644 --- a/none/tests/amd64/fb_test_amd64.vgtest +++ b/none/tests/amd64/fb_test_amd64.vgtest @@ -1 +1,2 @@ prog: fb_test_amd64 +prereq: test -x fb_test_amd64 && ../../../tests/x86_amd64_features amd64-avx