can llvm-lit pass output of one RUN command as an argument to another RUN command

Is there a way to do this with llvm-lit, i.e., use the equivalent of backticks?

foo takes a single argument, but doesn’t read from stdin.

// RUN foo some_arg > %t; FileCheck %s < %t
// RUN foo cat %t | FileCheck --check-prefix=INVERSE

// CHECK: {{[1]+$}}
// INVERSE: some_arg


  1. 0-9 ↩︎

Btw, this works on *nix type systems, but I’m not sure about Windows.

lit run lines are written in posix shell. However as you suspect the situation on windows is special, lit comes with its own shell parser/interpreter which doesn’t support the full range of posix shell features. Glancing at the code in llvm/utils/lit/lit/ I don’t see anything supporting command substitution.

  • Matthias

Thanks. I grep’d all the tests and found a few cases using xargs, i.e., “cat %t | xargs”. They don’t set windows as unsupported, so I’m going to try that.

thanks again…