summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Preud'homme <thomasp@graphcore.ai>2019-10-10 13:39:12 +0000
committerThomas Preud'homme <thomasp@graphcore.ai>2019-10-10 13:39:12 +0000
commit48edae336bc701054e28e4723ff70d45af9fbfc2 (patch)
tree44f0ce7056af88f5ee4585c8a9eeee5e5a9e06f9
parent765055658cd7ec4e1eec8e0e90f0fc9fcc90ce31 (diff)
downloadbcm5719-llvm-48edae336bc701054e28e4723ff70d45af9fbfc2.tar.gz
bcm5719-llvm-48edae336bc701054e28e4723ff70d45af9fbfc2.zip
Revert "[test] Use system locale for mri-utf8.test"
This reverts commit r374318 / b6f1d1fa0e3ee0e25f22414bf97c05276b934507. llvm-svn: 374349
-rw-r--r--llvm/test/tools/llvm-ar/mri-nonascii.test22
-rw-r--r--llvm/test/tools/llvm-ar/mri-utf8.test23
2 files changed, 23 insertions, 22 deletions
diff --git a/llvm/test/tools/llvm-ar/mri-nonascii.test b/llvm/test/tools/llvm-ar/mri-nonascii.test
deleted file mode 100644
index 7e92957e121..00000000000
--- a/llvm/test/tools/llvm-ar/mri-nonascii.test
+++ /dev/null
@@ -1,22 +0,0 @@
-# Test non-ascii archive members
-# XFAIL: system-darwin
-
-RUN: rm -rf %t && mkdir -p %t/extracted
-
-# Note: lit's Python will read this UTF-8 encoded mri-nonascii.txt file,
-# decode it to unicode. The filename in the redirection below will then
-# be encoded in the system's filename encoding (e.g. UTF-16 for
-# Microsoft Windows).
-RUN: echo "contents" > %t/£.txt
-
-RUN: echo "CREATE %t/mri.ar" > %t/script.mri
-RUN: echo "ADDMOD %t/£.txt" >> %t/script.mri
-RUN: echo "SAVE" >> %t/script.mri
-
-RUN: llvm-ar -M < %t/script.mri
-RUN: cd %t/extracted && llvm-ar x %t/mri.ar
-
-# Same as above.
-RUN: FileCheck --strict-whitespace %s <£.txt
-CHECK:{{^}}
-CHECK-SAME:{{^}}contents{{$}}
diff --git a/llvm/test/tools/llvm-ar/mri-utf8.test b/llvm/test/tools/llvm-ar/mri-utf8.test
new file mode 100644
index 00000000000..e297dce8d8a
--- /dev/null
+++ b/llvm/test/tools/llvm-ar/mri-utf8.test
@@ -0,0 +1,23 @@
+# Test non-ascii archive members
+# XFAIL: system-darwin
+
+RUN: rm -rf %t && mkdir -p %t/extracted
+
+RUN: echo "contents" > %t/£.txt
+
+RUN: echo "CREATE %t/mri.ar" > %t/script.mri
+RUN: echo "ADDMOD %t/£.txt" >> %t/script.mri
+RUN: echo "SAVE" >> %t/script.mri
+
+RUN: llvm-ar -M < %t/script.mri
+RUN: cd %t/extracted && llvm-ar x %t/mri.ar
+
+# This works around problems launching processess that
+# include arguments with non-ascii characters.
+# Python on Linux defaults to ASCII encoding unless the
+# environment specifies otherwise, so it is explicitly set.
+# The reliance the test has on this locale is not ideal,
+# however alternate solutions have been difficult due to
+# behaviour differences with python 2 vs python 3,
+# and linux vs windows.
+RUN: env LANG=en_US.UTF-8 %python -c "assert open(u'\U000000A3.txt', 'rb').read() == b'contents\n'"
OpenPOWER on IntegriCloud