[test-suite] r181258 - Fix office-ispell big-endian reference output

Hal Finkel hfinkel at anl.gov
Mon May 6 15:15:13 PDT 2013


Author: hfinkel
Date: Mon May  6 17:15:13 2013
New Revision: 181258

URL: http://llvm.org/viewvc/llvm-project?rev=181258&view=rev
Log:
Fix office-ispell big-endian reference output

As Daniel has mentioned, this test is completely broken (on both big and little
endian systems, it just errors out). On top of that, there seems to be some
endian sensitivity in the code that checks the file magic. As a result, on big
endian systems, the error message contains the full path of the input file
(which makes it impossible to create a reference output).

Here I've slightly modified the test so that it only prints the base path name
on big endian systems (so that I can create a reference output), and I've added
that reference output. This change can be reverted once the test is actually
fixed to do something useful.

Added:
    test-suite/trunk/MultiSource/Benchmarks/MiBench/office-ispell/office-ispell.reference_output.big-endian
Modified:
    test-suite/trunk/MultiSource/Benchmarks/MiBench/office-ispell/lookup.c

Modified: test-suite/trunk/MultiSource/Benchmarks/MiBench/office-ispell/lookup.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/MiBench/office-ispell/lookup.c?rev=181258&r1=181257&r2=181258&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/MiBench/office-ispell/lookup.c (original)
+++ test-suite/trunk/MultiSource/Benchmarks/MiBench/office-ispell/lookup.c Mon May  6 17:15:13 2013
@@ -84,6 +84,7 @@ int linit ()
     int			nextchar;
     int			viazero;
     register ichar_t *	cp;
+    char *errhashname;
 
     if (inited)
 	return 0;
@@ -94,30 +95,36 @@ int linit ()
 	return (-1);
 	}
 
+    errhashname = strrchr(hashname, '/');
+    if (errhashname == NULL)
+      errhashname = hashname;
+    else
+      ++errhashname;
+
     hashsize = read (hashfd, (char *) &hashheader, sizeof hashheader);
     if (hashsize < sizeof hashheader)
 	{
 	if (hashsize < 0)
-	    (void) fprintf (stderr, LOOKUP_C_CANT_READ, hashname);
+	    (void) fprintf (stderr, LOOKUP_C_CANT_READ, errhashname);
 	else if (hashsize == 0)
-	    (void) fprintf (stderr, LOOKUP_C_NULL_HASH, hashname);
+	    (void) fprintf (stderr, LOOKUP_C_NULL_HASH, errhashname);
 	else
 	    (void) fprintf (stderr,
-	      LOOKUP_C_SHORT_HASH (hashname, hashsize,
+	      LOOKUP_C_SHORT_HASH (errhashname, hashsize,
 	        (int) sizeof hashheader));
 	return (-1);
 	}
     else if (hashheader.magic != MAGIC)
 	{
 	(void) fprintf (stderr,
-	  LOOKUP_C_BAD_MAGIC (hashname, (unsigned int) MAGIC,
+	  LOOKUP_C_BAD_MAGIC (errhashname, (unsigned int) MAGIC,
 	    (unsigned int) hashheader.magic));
 	return (-1);
 	}
     else if (hashheader.magic2 != MAGIC)
 	{
 	(void) fprintf (stderr,
-	  LOOKUP_C_BAD_MAGIC2 (hashname, (unsigned int) MAGIC,
+	  LOOKUP_C_BAD_MAGIC2 (errhashname, (unsigned int) MAGIC,
 	    (unsigned int) hashheader.magic2));
 	return (-1);
 	}

Added: test-suite/trunk/MultiSource/Benchmarks/MiBench/office-ispell/office-ispell.reference_output.big-endian
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/MiBench/office-ispell/office-ispell.reference_output.big-endian?rev=181258&view=auto
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/MiBench/office-ispell/office-ispell.reference_output.big-endian (added)
+++ test-suite/trunk/MultiSource/Benchmarks/MiBench/office-ispell/office-ispell.reference_output.big-endian Mon May  6 17:15:13 2013
@@ -0,0 +1,2 @@
+Illegal format hash table americanmed+.hash - expected magic 0x9602, got 0x296
+exit 1





More information about the llvm-commits mailing list