[PATCH] Fix dependency-generation-crash test to actually execute clang and to clean up after itself

Justin Bogner mail at justinbogner.com
Tue Feb 10 20:55:42 PST 2015


Greg Bedwell <greg_bedwell at sn.scee.net> writes:
> I've been having an issue on my Windows box where often my build
> directory would not be able to be deleted from a script due to a
> permission denied error from a temp file created during one of the
> Clang tests.  Looking at the test, it appears to be badly formed,
> creating a temp file and then removing all permissions via chmod
> without actually involving clang at all.  I've attempted to fix the
> test to carry out what I think is its original intent and made sure it
> cleans up after itself on success now so fixes my original issue of
> not being able to delete the build folder.

Looks good with one little nit, below. Do you need me to commit this
for you?

> Greg Bedwell
> SN Systems - Sony Computer Entertainment Inc.
>
> http://reviews.llvm.org/D7534
>
> Files:
>   clang/test/Frontend/dependency-generation-crash.c
>
> Index: clang/test/Frontend/dependency-generation-crash.c
> ===================================================================
> --- clang/test/Frontend/dependency-generation-crash.c
> +++ clang/test/Frontend/dependency-generation-crash.c
> @@ -1,4 +1,9 @@
>  // RUN: touch %t
>  // RUN: chmod 0 %t
> -// %clang -E -dependency-file bla -MT %t -MP -o %t -x c /dev/null
> +// RUN: not %clang_cc1 -E -dependency-file bla -MT %t -MP -o %t -x c /dev/null 2>&1 | FileCheck %s

This could use -verify instead of FileCheck. We have to change /dev/null
to %s so that clang knows where to look for the verify strings, then...

> +// RUN: rm -f %t
> +
> +// CHECK: error: unable to open output file

...we can spell this // expected-error {{unable to open output file}}

> +
>  // rdar://9286457
> +
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list