[PATCH] D49084: FileCheck: Add support for variable expressions

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 13 02:06:40 PDT 2018


arichardson added a comment.

In https://reviews.llvm.org/D49084#1161262, @jhenderson wrote:

> In https://reviews.llvm.org/D49084#1160851, @arichardson wrote:
>
> > I case people are interested I have also implemented something similar in our fork of llvm. I chose `[[@EXPR var + 0x42]]` as the syntax. I also added some functions such as `[[@EXPR hex(VAR)]]`.
> >  Variables can either by referenced by name or if they conflict with one of the builtin functions using `${x}` syntax: `[[@EXPR toupper(hex(${hex}))]]`
>
>
> Simple functions are also on my wish-list! The main ones we care about are converting to and from hex numbers, and being able to do additions and subtractions. But I think just the basic integer and hex reading and additions would be a good start.


I added hex, oct, bin, dec + toupper/tolower (https://github.com/CTSRD-CHERI/llvm/blob/master/utils/FileCheck/FileCheck.cpp#L697) but I think I only ever ended up using dec/hex/toupper in the tests that I've written since.


Repository:
  rL LLVM

https://reviews.llvm.org/D49084





More information about the llvm-commits mailing list