llvm-project/bolt/test/unreadable-profile.test
Aiden Grossman 2bf3ef1847
[BOLT] Require non root user for unreadable-profile.test (#119816)
This patch adds a requirement for a non root user in
unreadable-profile.test. This test fails if run as a root user (like in
a container without explicitly changing the user), which can lead to
some CI test failures.
2024-12-12 22:14:41 -08:00

14 lines
486 B
Plaintext

REQUIRES: system-linux, non-root-user
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