[cfe-commits] r155874 - /cfe/trunk/test/Driver/clang-g-opts.c

Chandler Carruth chandlerc at google.com
Mon Apr 30 19:01:34 PDT 2012


On Mon, Apr 30, 2012 at 6:42 PM, Douglas Gregor <dgregor at apple.com> wrote:

> Author: dgregor
> Date: Mon Apr 30 20:42:40 2012
> New Revision: 155874
>
> URL: http://llvm.org/viewvc/llvm-project?rev=155874&view=rev
> Log:
> Move a non portable test to FileCheck, from Jonathan Gray!
>

This patch changes the test dramatically, I don't think it's correct..


>
> Modified:
>    cfe/trunk/test/Driver/clang-g-opts.c
>
> Modified: cfe/trunk/test/Driver/clang-g-opts.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/clang-g-opts.c?rev=155874&r1=155873&r2=155874&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/Driver/clang-g-opts.c (original)
> +++ cfe/trunk/test/Driver/clang-g-opts.c Mon Apr 30 20:42:40 2012
> @@ -1,5 +1,14 @@
> -// RUN: %clang -S -v -o %t %s        2>&1 | not grep -w -- -g
> -// RUN: %clang -S -v -o %t %s -g     2>&1 | grep -w -- -g
> -// RUN: %clang -S -v -o %t %s -g0    2>&1 | not grep -w -- -g
> -// RUN: %clang -S -v -o %t %s -g -g0 2>&1 | not grep -w -- -g
> -// RUN: %clang -S -v -o %t %s -g0 -g 2>&1 | grep -w -- -g
> +// RUN: %clang -S -v -o %t %s        2>&1 | FileCheck %s
> +// CHECK-NOT: -g
> +
> +// RUN: %clang -S -v -o %t %s -g     2>&1 | FileCheck %s
> +// CHECK: -g
>

How can this work? Every invocation of FlieCheck in this test uses *all* of
the CHECK assertions, and applies them to a single clang invocation. I
think we need to use the --check-prefix option to separate out the
different assertions being made.



> +
> +// RUN: %clang -S -v -o %t %s -g0    2>&1 | FileCheck %s
> +// CHECK-NOT: -g
> +
> +// RUN: %clang -S -v -o %t %s -g -g0 2>&1 | FileCheck %s
> +// CHECK-NOT: -g
> +
> +// RUN: %clang -S -v -o %t %s -g0 -g 2>&1 | FileCheck %s
> +// CHECK: -g
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120430/52b07df2/attachment.html>


More information about the cfe-commits mailing list