Mercurial > hg > CbC > CbC_gcc
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/testsuite/gfortran.dg/chmod_2.f90 Fri Oct 27 22:46:09 2017 +0900 @@ -0,0 +1,35 @@ +! { dg-do run { target { ! { *-*-mingw* *-*-cygwin* spu-*-* } } } } +! { dg-options "-std=gnu" } +! See PR38956. Test fails on cygwin when user has Administrator rights + implicit none + character(len=*), parameter :: n = "foobar_file_chmod_2" + integer :: i + + open (10,file=n) + close (10,status="delete") + + open (10,file=n) + close (10,status="keep") + + if (access(n,"") /= 0 .or. access(n," ") /= 0 .or. access(n,"r") /= 0 .or. & + access(n,"R") /= 0 .or. access(n,"w") /= 0 .or. access(n,"W") /= 0) & + call abort + + i = chmod (n, "a+x") + if (i == 0) then + if (access(n,"x") /= 0 .or. access(n,"X") /= 0) call abort + end if + + i = chmod (n, "a-w") + if (i == 0 .and. getuid() /= 0) then + if (access(n,"w") == 0 .or. access(n,"W") == 0) call abort + end if + + open (10,file=n) + close (10,status="delete") + + if (access(n,"") == 0 .or. access(n," ") == 0 .or. access(n,"r") == 0 .or. & + access(n,"R") == 0 .or. access(n,"w") == 0 .or. access(n,"W") == 0) & + call abort + + end