[PATCH] D18553: [profile] Make a test work if run by the super-user

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 29 07:43:08 PDT 2016


vsk created this revision.
vsk added reviewers: davidxl, kubabrecka.
vsk added a subscriber: llvm-commits.

This test checks if we get the appropriate error message when writing to an unwritable file. However, it fails on bots which run check-all using sudo (in general this is something we'd like to support). Fix up the test so it works even if run as sudo.

Note: I'm not sure if this patch breaks Windows compatibility. If someone can tell, please comment :).

http://reviews.llvm.org/D18553

Files:
  test/profile/instrprof-error.c

Index: test/profile/instrprof-error.c
===================================================================
--- test/profile/instrprof-error.c
+++ test/profile/instrprof-error.c
@@ -1,8 +1,5 @@
 // RUN: %clang_profgen -o %t -O3 %s
-// RUN: touch %t.profraw
-// RUN: chmod -w %t.profraw
-// RUN: env LLVM_PROFILE_FILE=%t.profraw LLVM_PROFILE_VERBOSE_ERRORS=1 %run %t 1 2>&1 | FileCheck %s
-// RUN: chmod +w %t.profraw
+// RUN: env LLVM_PROFILE_FILE="/" LLVM_PROFILE_VERBOSE_ERRORS=1 %run %t 1 2>&1 | FileCheck %s
 
 int main(int argc, const char *argv[]) {
   if (argc < 2)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18553.51909.patch
Type: text/x-patch
Size: 571 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160329/574a0d85/attachment.bin>


More information about the llvm-commits mailing list