comparison gcc/testsuite/gfortran.dg/chmod_2.f90 @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 ! { dg-do run { target { ! { *-*-mingw* *-*-cygwin* spu-*-* } } } }
2 ! { dg-options "-std=gnu" }
3 ! See PR38956. Test fails on cygwin when user has Administrator rights
4 implicit none
5 character(len=*), parameter :: n = "foobar_file_chmod_2"
6 integer :: i
7
8 open (10,file=n)
9 close (10,status="delete")
10
11 open (10,file=n)
12 close (10,status="keep")
13
14 if (access(n,"") /= 0 .or. access(n," ") /= 0 .or. access(n,"r") /= 0 .or. &
15 access(n,"R") /= 0 .or. access(n,"w") /= 0 .or. access(n,"W") /= 0) &
16 call abort
17
18 i = chmod (n, "a+x")
19 if (i == 0) then
20 if (access(n,"x") /= 0 .or. access(n,"X") /= 0) call abort
21 end if
22
23 i = chmod (n, "a-w")
24 if (i == 0 .and. getuid() /= 0) then
25 if (access(n,"w") == 0 .or. access(n,"W") == 0) call abort
26 end if
27
28 open (10,file=n)
29 close (10,status="delete")
30
31 if (access(n,"") == 0 .or. access(n," ") == 0 .or. access(n,"r") == 0 .or. &
32 access(n,"R") == 0 .or. access(n,"w") == 0 .or. access(n,"W") == 0) &
33 call abort
34
35 end