Debian Codegraph @

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

raw
1 ## This tests that the umask is respected when
2 ## assigning permissions of output files.
3
4 ## Windows has no umask so this test makes no sense.
5 # UNSUPPORTED: system-windows
6
7 # RUN: rm -f %t
8 # RUN: touch %t
9 # RUN: chmod 0755 %t
10 # RUN: ls -l %t | cut -f 1 -d ' ' > %t.0755
11 # RUN: chmod 0600 %t
12 # RUN: ls -l %t | cut -f 1 -d ' ' > %t.0600
13 # RUN: chmod 0655 %t
14 # RUN: ls -l %t | cut -f 1 -d ' ' > %t.0655
15
16 # RUN: yaml2obj %s -o %t
17
18 # RUN: umask 0022
19 # RUN: chmod 0777 %t
20 # RUN: llvm-objcopy %t %t1
21 # RUN: ls -l %t1 | cut -f 1 -d ' ' | cmp - %t.0755
22
23 # RUN: umask 0177
24 # RUN: llvm-objcopy %t %t2
25 # RUN: ls -l %t2 | cut -f 1 -d ' ' | cmp - %t.0600
26
27 # RUN: umask 0122
28 # RUN: llvm-objcopy %t %t3
29 # RUN: ls -l %t3 | cut -f 1 -d ' ' | cmp - %t.0655
30
31 --- !ELF
32 FileHeader:
33 Class: ELFCLASS64
34 Data: ELFDATA2LSB
35 Type: ET_EXEC
36 Machine: EM_X86_64