[PATCH] D68472: [test] Depend on C.UTF-8 dependency for mri-utf8.test

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 5 07:58:07 PDT 2019


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/test/tools/llvm-ar/mri-utf8.test:26
+# and linux vs windows. The C.UTF-8 locale is chosen
+RUN: env LANG=C.UTF-8 %python -c "assert open(u'\xA3.txt', 'rb').read() == b'contents\n'"
----------------
MaskRay wrote:
> Just delete the comments and avoid python.
> 
> ```
> RUN: FileCheck --input-file £.txt --match-full-lines
> CHECK: contents
> ```
As it is, the file contains nothing aside from this last RUN line and its associated comment block that indicates that U+00A3 is the intended interpretation of the bytes `\xC2\xA3`. Note: There is no BOM in the file.

In addition to making the intent clear, I believe that the current approach has more of an ability to detect cases where the instances of `\xC2\xA3` in the file are misinterpreted.

That said, if the file redirection to create the file works, then `FileCheck` can be invoked with use of file redirection:
```
RUN: FileCheck <£.txt --match-full-lines %s
```



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68472/new/

https://reviews.llvm.org/D68472





More information about the llvm-commits mailing list