// 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

int main(int argc, const char *argv[]) {
  if (argc < 2)
    return 1;
  return 0;
}
// CHECK: LLVM Profile: Failed to write file 

// RUN: %clang_profgen -o %t -O3 %s
// 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)
    return 1;
  return 0;
}
// CHECK: LLVM Profile: Failed to write file 

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

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@264773 91177308-0d34-0410-b5e6-96231b3b80d8
