[llvm-dev] [RFC] Compiled regression tests.

David Greene via llvm-dev llvm-dev at lists.llvm.org
Wed Jul 15 12:11:11 PDT 2020


"Robinson, Paul via llvm-dev" <llvm-dev at lists.llvm.org> writes:

>> My use-case is for metadata, where I wanted to do this:
>> 
>> CHECK: %r1 = add %r2, %r3
>> CHECK-SAME: !some-metadata
>> CHECK-SAME: !some-other-metadata
>> 
>> where some-metadata and some-other-metadata might be reordered within
>> the line (because some unrelated metadata got added to the instruction).
>> In other words, all of these should match:
>> 
>> %r1 = add %r2, %r3, !some-metadata !1, !some-other-metadata !2
>> %r1 = add %r2, %r3, !some-other-metadata !1, !some-metadata !2
>> %r1 = add %r2, %r3, !some-other-metadata !1, !some-unrelated-metadata !3,
>> !some-metadata !2

>
> I'd expect the following to do what you want:
>
> CHECK: %r1 = add %r2, %r3
> CHECK-DAG: !some-metadata
> CHECK-DAG: !some-other-metadata
> CHECK: {{$}}
>
> Interestingly, it does not; I filed PR46634 to figure this out.

According to that PR this isn't supposed to work.  So I don't think we
have a solution to do what I want.

And CHECK-DAG starts from the end of the previous match, and so can
match things on the same line?  I didn't expect that given the
documentation.

                     -David


More information about the llvm-dev mailing list