Skip to content

Commit 553c29f

Browse files
committed
[test] [llvm-objcopy] Fix broken test case
Summary: The test case added in D62718 did not work unless the user was root because write bits were not set for the output file. This change uses only permissions with user write (0200) to ensure tests pass regardless of the users permissions. Reviewers: jhenderson, rupprecht, MaskRay, espindola, alexshap Reviewed By: MaskRay Subscribers: emaste, arichardson, jakehehrlich, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64302 llvm-svn: 366527
1 parent ca9f68e commit 553c29f

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

llvm/test/tools/llvm-objcopy/ELF/respect-umask.test

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,25 @@
99
# RUN: touch %t
1010
# RUN: chmod 0755 %t
1111
# RUN: ls -l %t | cut -f 1 -d ' ' > %t.0755
12-
# RUN: chmod 0500 %t
13-
# RUN: ls -l %t | cut -f 1 -d ' ' > %t.0500
14-
# RUN: chmod 0555 %t
15-
# RUN: ls -l %t | cut -f 1 -d ' ' > %t.0555
12+
# RUN: chmod 0600 %t
13+
# RUN: ls -l %t | cut -f 1 -d ' ' > %t.0600
14+
# RUN: chmod 0655 %t
15+
# RUN: ls -l %t | cut -f 1 -d ' ' > %t.0655
1616

17-
# RUN: rm -f %t; yaml2obj %s -o %t
17+
# RUN: yaml2obj %s -o %t
1818

1919
# RUN: umask 0022
2020
# RUN: chmod 0777 %t
21-
# RUN: rm -f %t1; llvm-objcopy %t %t1
22-
# RUN: ls -l %t1 | cut -f 1 -d ' ' > %t1.perms
23-
# RUN: cmp %t1.perms %t.0755
21+
# RUN: llvm-objcopy %t %t1
22+
# RUN: ls -l %t1 | cut -f 1 -d ' ' | cmp - %t.0755
23+
24+
# RUN: umask 0177
25+
# RUN: llvm-objcopy %t %t2
26+
# RUN: ls -l %t2 | cut -f 1 -d ' ' | cmp - %t.0600
27+
28+
# RUN: umask 0122
29+
# RUN: llvm-objcopy %t %t3
30+
# RUN: ls -l %t3 | cut -f 1 -d ' ' | cmp - %t.0655
2431

2532
--- !ELF
2633
FileHeader:

0 commit comments

Comments
 (0)