• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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, nor would
5## it work because there is no umask(1) in a Windows environment
6# UNSUPPORTED: system-windows
7# REQUIRES: shell
8
9# RUN: rm -f %t
10# RUN: touch %t
11# RUN: chmod 0755 %t
12# RUN: ls -l %t | cut -f 1 -d ' ' > %t.0755
13# RUN: chmod 0600 %t
14# RUN: ls -l %t | cut -f 1 -d ' ' > %t.0600
15# RUN: chmod 0655 %t
16# RUN: ls -l %t | cut -f 1 -d ' ' > %t.0655
17
18# RUN: yaml2obj %s -o %t
19
20# RUN: umask 0022
21# RUN: chmod 0777 %t
22# RUN: llvm-objcopy %t %t1
23# RUN: ls -l %t1 | cut -f 1 -d ' ' | cmp - %t.0755
24
25# RUN: umask 0177
26# RUN: llvm-objcopy %t %t2
27# RUN: ls -l %t2 | cut -f 1 -d ' ' | cmp - %t.0600
28
29# RUN: umask 0122
30# RUN: llvm-objcopy %t %t3
31# RUN: ls -l %t3 | cut -f 1 -d ' ' | cmp - %t.0655
32
33--- !ELF
34FileHeader:
35  Class:   ELFCLASS64
36  Data:    ELFDATA2LSB
37  Type:    ET_EXEC
38  Machine: EM_X86_64
39