[llvm] [utils] Add script to generate elaborated assembly tests (PR #89026)

Paul T Robinson via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 19 05:49:30 PDT 2024


pogo59 wrote:

> similarly for LLVM IR debug info tests.

Good point. Although IR doesn't have an equivalent of `.ifdef` so it would need a different tactic. Probably would have to rely on `split-file` and use it even in the RUN lines. Off the top of my head could follow this general idea:
```
# RUN: split-file
# RUN: opt input.ll --whatever | FileCheck %s
# CHECK: whatever
# UTC-GEN: split-file
# UTC-GEN: clang -c -S -emit-llvm input.c
# --- input.c
void foo () {}
# --- input.ll
output from UTC-GEN
```
Although, getting it to play nicely with the other update-test scripts that the optimizer folks love so much might be a trick, as those tend to intersperse the CHECKs with the source.

https://github.com/llvm/llvm-project/pull/89026


More information about the llvm-commits mailing list