@nagisa CHECK-LABEL does not allow binding variables
so I need a CHECK AFAICT
// CHECK-LABEL @foo // CHECK-SAME [[FOO_ATTRIBUTE:#[0-9]+]]
but then because I have two functions I get two attributes at the end of the module, and FileCheck always tries to match the #0 instead of expanding the label
I tried that too, and that does capture the attribute number
but then somewhere I need a CHECK #[[FOO_ATTRIBUTE]] = ...
and the attributes at the end of the module can be in any order
sure, that can go at the end of the file for all attributes you care about. you can use
CHECK-DAG to verify attributes come in whatever order.
alternative is to check for
Function Attrs comment on top of your labels.
(which is, admittedly easier and most likely cleaner)
I remember dealing with this problem before for optimize attribute myself, and ended up just checking the comment.
when i put it at the end of the file, it does not match the correct line
ill check the tests for the optimize attribute
The test is https://github.com/rust-lang/rust/blob/master/src/test/codegen/optimize-attr-1.rs and turns out it is actually checking the attributes :slight_smile:
@nagisa should be fixed, I had to use
FileCheck is quite nice
okay, I cannot really r+ this because that is more of a language decision, but the implementation looks fine
I’ll write a comment to that effect.