llvm-project/bolt/test/unreadable-profile.test
Maksim Panchenko 0f915826cc [BOLT] Handle access errors while reading profile
When the user does not have permissions to access the profile, consume
the error contained in Expected<> to avoid dumping stack to the user.

Differential Revision: https://reviews.llvm.org/D139480
2022-12-07 17:11:30 -08:00

14 lines
471 B
Plaintext

REQUIRES: system-linux
RUN: touch %t.profile && chmod 000 %t.profile
RUN: %clang %S/Inputs/hello.c -o %t
RUN: not llvm-bolt %t -o %t.bolt --data %t.profile 2>&1 \
RUN: | FileCheck %s --check-prefix CHECK-NOPERM
RUN: not llvm-bolt %t -o %t.bolt --data %t.fake.profile 2>&1 \
RUN: | FileCheck %s --check-prefix CHECK-FAKE
## Check that llvm-bolt gracefully handles errors accessing profile data.
CHECK-NOPERM: Permission denied
CHECK-FAKE: No such file or directory