diff mbox

[13/17] x86emul: re-order checks in test harness

Message ID 594A7D64020000780016539F@prv-mh.provo.novell.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Beulich June 21, 2017, 12:06 p.m. UTC
On older systems printing the "n/a" messages (resulting from the
compiler not being new enough to deal with some of the test code) isn't
very useful: If both CPU and compiler are too old for a certain test,
we can as well omit those messages, as those tests wouldn't be run even
if the compiler did produce code. (This has become obvious with the
3DNow! tests, which I had to run on an older system still supporting
those insns, and that system naturally also had an older compiler.)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
x86emul: re-order checks in test harness

On older systems printing the "n/a" messages (resulting from the
compiler not being new enough to deal with some of the test code) isn't
very useful: If both CPU and compiler are too old for a certain test,
we can as well omit those messages, as those tests wouldn't be run even
if the compiler did produce code. (This has become obvious with the
3DNow! tests, which I had to run on an older system still supporting
those insns, and that system naturally also had an older compiler.)

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -3267,15 +3267,15 @@ int main(int argc, char **argv)
 
     for ( j = 0; j < ARRAY_SIZE(blobs); j++ )
     {
+        if ( blobs[j].check_cpu && !blobs[j].check_cpu() )
+            continue;
+
         if ( !blobs[j].size )
         {
             printf("%-39s n/a\n", blobs[j].name);
             continue;
         }
 
-        if ( blobs[j].check_cpu && !blobs[j].check_cpu() )
-            continue;
-
         memcpy(res, blobs[j].code, blobs[j].size);
         ctxt.lma = blobs[j].bitness == 64;
         ctxt.addr_size = ctxt.sp_size = blobs[j].bitness;
diff mbox

Patch

--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -3267,15 +3267,15 @@  int main(int argc, char **argv)
 
     for ( j = 0; j < ARRAY_SIZE(blobs); j++ )
     {
+        if ( blobs[j].check_cpu && !blobs[j].check_cpu() )
+            continue;
+
         if ( !blobs[j].size )
         {
             printf("%-39s n/a\n", blobs[j].name);
             continue;
         }
 
-        if ( blobs[j].check_cpu && !blobs[j].check_cpu() )
-            continue;
-
         memcpy(res, blobs[j].code, blobs[j].size);
         ctxt.lma = blobs[j].bitness == 64;
         ctxt.addr_size = ctxt.sp_size = blobs[j].bitness;