[PATCH] Add test for LinkModules warning on triple, modified by r203009. Datalayout is already tested.

JF Bastien jfb at chromium.org
Mon Mar 10 18:27:16 PDT 2014


>
> I meant  the following (what I suggested earlier) will not work because
> t.a.err is empty.
> > ; RUN: cat %t.a.err | FileCheck --check-prefix=WARN-A %s
> > WARN-A-NOT:  WARNING: Linking two modules of different target triples:
>
> Your checkin is fine, but I think it is possible to simplify it with
> ; RUN: llvm-link %s %S/Inputs/targettriple-a.ll -S 2>&1 | FileCheck %s
> --check-prefix=WARN-A
> ; RUN: llvm-link %s %S/Inputs/targettriple-b.ll -S 2>&1 | FileCheck %s
> --check-prefix=WARN-B
>
> target triple = "e"
>
> ; WARN-A-NOT: WARNING: Linking two modules of different target triples:
> ; WARN-A: target triple = "e"
>
> ; WARN-B: WARNING: Linking two modules of different target triples:
> ; WARN-B: target triple = "e"
>

That could work too, but I think the original intent was to make sure that
nothing gets emitted. I could change the test to:

; WARN-A-NOT: WARNING:

To check that no warning got emitted, but at that point the existing check
is strictly more general since it checks that nothing (including warnings)
got emitted.

TL;DR: adding WARN-A-NOT is defensive since it's included in the other
check, but removing the other check means we're testing for strictly less.
I'm not sure that's a good idea.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140310/c76b8321/attachment.html>


More information about the llvm-commits mailing list