Debian Codegraph @

llvm/test/tools/llvm-objcopy/ELF/mirror-permissions-win.test

raw
1 ## Test that permissions for ouput files are mirrored
2 ## from their input files.
3
4 ## The Unix version of this test is separated because it needs
5 ## to use umask(1). Windows has no umask, so it can be considered
6 ## to be always 0, the required behavior.
7 # REQUIRES: system-windows
8
9 # RUN: touch %t
10 # RUN: chmod 0777 %t
11 # RUN: ls -l %t | cut -f 1 -d ' ' > %t.0777
12 # RUN: chmod 0666 %t
13 # RUN: ls -l %t | cut -f 1 -d ' ' > %t.0666
14 # RUN: chmod 0640 %t
15 # RUN: ls -l %t | cut -f 1 -d ' ' > %t.0640
16
17 # RUN: yaml2obj %s -o %t
18
19 # RUN: chmod 0777 %t
20 # RUN: llvm-objcopy %t %t1
21 # RUN: ls -l %t1 | cut -f 1 -d ' ' > %t1.perms
22 # RUN: cmp %t1.perms %t.0777
23
24 # RUN: chmod 0666 %t
25 # RUN: llvm-objcopy %t %t1
26 # RUN: ls -l %t1 | cut -f 1 -d ' ' > %t1.perms
27 # RUN: cmp %t1.perms %t.0666
28
29 # RUN: chmod 0640 %t
30 # RUN: llvm-objcopy %t %t1
31 # RUN: ls -l %t1 | cut -f 1 -d ' ' > %t1.perms
32 # RUN: cmp %t1.perms %t.0640
33
34 --- !ELF
35 FileHeader:
36 Class: ELFCLASS64
37 Data: ELFDATA2LSB
38 Type: ET_EXEC
39 Machine: EM_X86_64