re PR d/90064 (InSituRegion lacks SPARC64 support)
authorIain Buclaw <ibuclaw@gcc.gnu.org>
Sun, 21 Apr 2019 10:21:07 +0000 (10:21 +0000)
committerIain Buclaw <ibuclaw@gcc.gnu.org>
Sun, 21 Apr 2019 10:21:07 +0000 (10:21 +0000)
PR d/90064
libphobos: Merge upstream phobos 428460ddd

Defines growDownwards on SPARC64, initial patch by Rainer Orth.

Backports another fix to std.process, allowing permissions tests to be
skipped when running as root.

Reviewed-on: https://github.com/dlang/phobos/pull/6962

From-SVN: r270483

libphobos/src/MERGE
libphobos/src/std/experimental/allocator/building_blocks/region.d
libphobos/src/std/process.d

index b4d44b55624a2a70b4760680c19e4493da66182a..3935c059403399a9f5b8f1390ceb82785cc5a202 100644 (file)
@@ -1,4 +1,4 @@
-cf95639ffd9ed6f3b9d10d98461b2fbd31615757
+428460ddd8087fa28815e613ff04facb51108a7b
 
 The first line of this file holds the git revision number of the last
 merge done from the dlang/phobos repository.
index 3d8431c23ca84aac12bfff3dbac2cbaacb1972d4..43dfdb788e5e5e33efd79fc4247a24e0053da497 100644 (file)
@@ -395,6 +395,7 @@ struct InSituRegion(size_t size, size_t minAlign = platformAlignment)
     else version (RISCV32) enum growDownwards = Yes.growDownwards;
     else version (RISCV64) enum growDownwards = Yes.growDownwards;
     else version (SPARC) enum growDownwards = Yes.growDownwards;
+    else version (SPARC64) enum growDownwards = Yes.growDownwards;
     else version (SystemZ) enum growDownwards = Yes.growDownwards;
     else static assert(0, "Dunno how the stack grows on this architecture.");
 
index a1cac2c9fdf4b102cb3c5bcbcfa58e8f7d4eec82..b0310a870d926c3918783d38f4e3759699bc84ec 100644 (file)
@@ -1188,13 +1188,16 @@ version (Posix) @system unittest
     // can't run in directory if user does not have search permission on this directory
     version (Posix)
     {
-        import core.sys.posix.sys.stat : S_IRUSR;
-        auto directoryNoSearch = uniqueTempPath();
-        mkdir(directoryNoSearch);
-        scope(exit) rmdirRecurse(directoryNoSearch);
-        setAttributes(directoryNoSearch, S_IRUSR);
-        assertThrown!ProcessException(spawnProcess(prog.path, null, Config.none, directoryNoSearch));
-        assertThrown!ProcessException(spawnProcess(prog.path, null, Config.detached, directoryNoSearch));
+        if (core.sys.posix.unistd.getuid() != 0)
+        {
+            import core.sys.posix.sys.stat : S_IRUSR;
+            auto directoryNoSearch = uniqueTempPath();
+            mkdir(directoryNoSearch);
+            scope(exit) rmdirRecurse(directoryNoSearch);
+            setAttributes(directoryNoSearch, S_IRUSR);
+            assertThrown!ProcessException(spawnProcess(prog.path, null, Config.none, directoryNoSearch));
+            assertThrown!ProcessException(spawnProcess(prog.path, null, Config.detached, directoryNoSearch));
+        }
     }
 }