[llvm] r264431 - [InstCombine] use FileCheck for better checking

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 25 13:32:16 PDT 2016


Do we have any documentation for this script? It would be nice to have some
examples for how to use it.

On Fri, Mar 25, 2016 at 11:01 AM, Sanjay Patel via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: spatel
> Date: Fri Mar 25 13:01:23 2016
> New Revision: 264431
>
> URL: http://llvm.org/viewvc/llvm-project?rev=264431&view=rev
> Log:
> [InstCombine] use FileCheck for better checking
>
> (testing script for autogeneration of check lines)
>
>
> Modified:
>     llvm/trunk/test/Transforms/InstCombine/zero-point-zero-add.ll
>
> Modified: llvm/trunk/test/Transforms/InstCombine/zero-point-zero-add.ll
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/zero-point-zero-add.ll?rev=264431&r1=264430&r2=264431&view=diff
>
> ==============================================================================
> --- llvm/trunk/test/Transforms/InstCombine/zero-point-zero-add.ll
> (original)
> +++ llvm/trunk/test/Transforms/InstCombine/zero-point-zero-add.ll Fri Mar
> 25 13:01:23 2016
> @@ -1,14 +1,23 @@
> -; RUN: opt < %s -instcombine -S | grep 0.0 | count 1
> +; NOTE: Assertions have been autogenerated by update_test_checks.py
> +; RUN: opt < %s -instcombine -S | FileCheck %s
>
>  declare double @abs(double)
>
>  define double @test(double %X) {
> +; CHECK-LABEL: @test(
> +; CHECK:         [[Y:%.*]] = fadd double %X, 0.000000e+00
> +; CHECK-NEXT:    ret double [[Y]]
> +;
>    %Y = fadd double %X, 0.0          ;; Should be a single add x, 0.0
>    %Z = fadd double %Y, 0.0
>    ret double %Z
>  }
>
>  define double @test1(double %X) {
> +; CHECK-LABEL: @test1(
> +; CHECK:         [[Y:%.*]] = call double @abs(double %X)
> +; CHECK-NEXT:    ret double [[Y]]
> +;
>    %Y = call double @abs(double %X)
>    %Z = fadd double %Y, 0.0
>    ret double %Z
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160325/aaf05c1b/attachment.html>


More information about the llvm-commits mailing list