[PATCH] D83834: Add test utility 'extract'

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 24 08:38:20 PDT 2020


MaskRay added a comment.

In D83834#2172384 <https://reviews.llvm.org/D83834#2172384>, @lattner wrote:

> Instead of adding an explicit command 'extract', did you consider building this into llvm-mc and similar tools?  This is will lead to more efficient tests and scales better to things that have diagnostic verification and other sorts of checks.  This is also more consistent with the precedent MLIR has set here.


I considered the choice. mlir-opt/mlir-translate's -split-input-file/clang -verify is suitable when the input is homogeneous and the test is performed the tool itself.
For heterogeneous needs (`llvm-objcopy --strip-symbols %t-list.txt %t %t5` (symbol list), `ld.lld -T %t.lds %t.o` (linker script)), or when the tool output is inspected by another tool, a standalone utility is likely more useful.

So far I like @dblaikie's semantics. I'd like syntax like `extract %s -o %t.dir`. For example the following will create `%t.dir/{a.txt,b.ll,c.c}`

  #--- a.txt
  0
  ;--- b.ll
  1
  //--- c.c
  2

I am not settled on completely deleting the previous `extract part %s` syntax, or renaming 'extract' to something else.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83834





More information about the llvm-commits mailing list