On Mon, Apr 30, 2012 at 6:42 PM, Douglas Gregor <[email protected]> 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
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to