1 ## Test that permissions for ouput files are mirrored
2 ## from their input files.
4 ## The Unix version of this test must use umask(1) because
5 ## llvm-objcopy respects the umask in setting output permissions.
6 ## Setting the umask to 0 ensures deterministic permissions across
8 # UNSUPPORTED: system-windows
13 # RUN: ls -l %t | cut -f 1 -d ' ' > %t.0777
15 # RUN: ls -l %t | cut -f 1 -d ' ' > %t.0666
17 # RUN: ls -l %t | cut -f 1 -d ' ' > %t.0640
19 ## Set umask to be permissive of all permissions,
20 ## only test mirroring of permissions.
23 # RUN: yaml2obj %s -o %t
26 # RUN: llvm-objcopy %t %t1
27 # RUN: ls -l %t1 | cut -f 1 -d ' ' > %t1.perms
28 # RUN: cmp %t1.perms %t.0777
31 # RUN: llvm-objcopy %t %t1
32 # RUN: ls -l %t1 | cut -f 1 -d ' ' > %t1.perms
33 # RUN: cmp %t1.perms %t.0666
36 # RUN: llvm-objcopy %t %t1
37 # RUN: ls -l %t1 | cut -f 1 -d ' ' > %t1.perms
38 # RUN: cmp %t1.perms %t.0640
40 ## Don't set the permission of a character special file, otherwise there will
41 ## be an EPERM error (or worse: root may change the permission).
42 # RUN: ls -l /dev/null | cut -f 1 -d ' ' > %tnull.perms
43 # RUN: llvm-objcopy %t /dev/null
44 # RUN: ls -l /dev/null | cut -f 1 -d ' ' | diff - %tnull.perms