aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2018-12-26 14:37:41 +0000
committerSimon Atanasyan <simon@atanasyan.com>2018-12-26 14:37:41 +0000
commitf7cd127dcba75d524bd480929b22d5489f40649d (patch)
tree609d19fbdd244209a445836373cda18deaeb47e1
parentdad9a2bba599e529ce4cf50de2e17641ed95adf1 (diff)
[test-suite][mips] Disable setlocale calls in consumer-typeset test
When running the test-suite through qemu an error can occur when the host and target architecture differ in endianness. This happens when the test calls setlocale. The glibc implementation of this call reads /usr/lib/locale/locale-archive as raw bites. Since the endianness doesn't match, the numbers read from the archive don't make sense and cause the check to fail. This patch disables the setlocale call so the test passes regardless of endianness. Patch by Miloš Stojanović Differential Revision: http://reviews.llvm.org/D55708 git-svn-id: https://llvm.org/svn/llvm-project/test-suite/trunk@350066 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--MultiSource/Benchmarks/MiBench/consumer-typeset/CMakeLists.txt5
-rw-r--r--MultiSource/Benchmarks/MiBench/consumer-typeset/Makefile5
2 files changed, 10 insertions, 0 deletions
diff --git a/MultiSource/Benchmarks/MiBench/consumer-typeset/CMakeLists.txt b/MultiSource/Benchmarks/MiBench/consumer-typeset/CMakeLists.txt
index 5f670b48..6925e01d 100644
--- a/MultiSource/Benchmarks/MiBench/consumer-typeset/CMakeLists.txt
+++ b/MultiSource/Benchmarks/MiBench/consumer-typeset/CMakeLists.txt
@@ -1,4 +1,9 @@
list(APPEND CPPFLAGS -DOS_UNIX=1 -DOS_DOS=0 -DOS_MAC=0 -DDB_FIX=0 -DUSE_STAT=1 -DSAFE_DFT=0 -DCOLLATE=1 -DLIB_DIR="lout.lib" -DFONT_DIR="font" -DMAPS_DIR="maps" -DINCL_DIR="include" -DDATA_DIR="data" -DHYPH_DIR="hyph" -DLOCALE_DIR="locale" -DCHAR_IN=1 -DCHAR_OUT=0 -DLOCALE_ON=1 -DASSERT_ON=1 -DDEBUG_ON=0 -DPDF_COMPRESSION=0 -D_FORTIFY_SOURCE=0)
+
+if(ARCH STREQUAL "Mips")
+ list(APPEND CPPFLAGS -DCOLLATE=0 -DLOCALE_ON=0)
+endif()
+
list(APPEND LDFLAGS -lm)
set(RUN_OPTIONS -x -I data/include -D data/data -F data/font -C data/maps -H data/hyph large.lout)
diff --git a/MultiSource/Benchmarks/MiBench/consumer-typeset/Makefile b/MultiSource/Benchmarks/MiBench/consumer-typeset/Makefile
index 4403a8e0..98a3be02 100644
--- a/MultiSource/Benchmarks/MiBench/consumer-typeset/Makefile
+++ b/MultiSource/Benchmarks/MiBench/consumer-typeset/Makefile
@@ -4,6 +4,11 @@ PROG = consumer-typeset
# FORTIFY_SOURCE is turned off for this benchmark because the type lies at some
# point in this program and FORIFY implementations rely on the correct type.
CPPFLAGS = -DOS_UNIX=1 -DOS_DOS=0 -DOS_MAC=0 -DDB_FIX=0 -DUSE_STAT=1 -DSAFE_DFT=0 -DCOLLATE=1 -DLIB_DIR=\"lout.lib\" -DFONT_DIR=\"font\" -DMAPS_DIR=\"maps\" -DINCL_DIR=\"include\" -DDATA_DIR=\"data\" -DHYPH_DIR=\"hyph\" -DLOCALE_DIR=\"locale\" -DCHAR_IN=1 -DCHAR_OUT=0 -DLOCALE_ON=1 -DASSERT_ON=1 -DDEBUG_ON=0 -DPDF_COMPRESSION=0 -D_FORTIFY_SOURCE=0
+
+ifeq ($(ARCH),Mips)
+CPPFLAGS += -DCOLLATE=0 -DLOCALE_ON=0
+endif
+
LDFLAGS = -lm
RUN_OPTIONS = -x -I $(PROJ_SRC_DIR)/data/include -D $(PROJ_SRC_DIR)/data/data -F $(PROJ_SRC_DIR)/data/font -C $(PROJ_SRC_DIR)/data/maps -H $(PROJ_SRC_DIR)/data/hyph $(PROJ_SRC_DIR)/large.lout