From: Reid Kleckner Date: Fri, 4 Aug 2017 21:52:00 +0000 (+0000) Subject: [Support] Use FILE_SHARE_DELETE to fix RemoveFileOnSignal on Windows X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4ae50e81b9a7c35f26a10bb103b8d46bfb6cf290;p=clang [Support] Use FILE_SHARE_DELETE to fix RemoveFileOnSignal on Windows Summary: Tools like clang that use RemoveFileOnSignal on their output files weren't actually able to clean up their outputs before this change. Now the call to llvm::sys::fs::remove succeeds and the temporary file is deleted. This is a stop-gap to fix clang before implementing the solution outlined in PR34070. Reviewers: davide Subscribers: llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D36337 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310137 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Frontend/remove-file-on-signal.c b/test/Frontend/remove-file-on-signal.c new file mode 100644 index 0000000000..95d9b105f0 --- /dev/null +++ b/test/Frontend/remove-file-on-signal.c @@ -0,0 +1,7 @@ +// RUN: rm -rf %t && mkdir -p %t && cd %t +// RUN: not --crash %clang_cc1 %s -emit-llvm -o foo.ll +// RUN: ls . | FileCheck %s --allow-empty +// CHECK-NOT: foo.ll + +#pragma clang __debug crash +FOO