Tested on x86_64, i686 darwin, pushed to trunk,
thanks
Iain

--- 8< ---

Two of the tests make excplict use of O_CLOEXEC which is not provided
on earlier Darwin versions.  In those case, for these tests it is
sufficient to provide a dummy (set to the value used on later Darwin).

With this, the tests work back to darwin9.

gcc/testsuite/ChangeLog:

        * gcc.dg/analyzer/mkostemp-1.c: Provide a dummy version of
        O_CLOEXEC where the OS headers omit it.
        * gcc.dg/analyzer/mkostemps-1.c: Likewise.

Signed-off-by: Iain Sandoe <[email protected]>
---
 gcc/testsuite/gcc.dg/analyzer/mkostemp-1.c  | 4 ++++
 gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/analyzer/mkostemp-1.c 
b/gcc/testsuite/gcc.dg/analyzer/mkostemp-1.c
index 539377c1ee0..a7e0edb3441 100644
--- a/gcc/testsuite/gcc.dg/analyzer/mkostemp-1.c
+++ b/gcc/testsuite/gcc.dg/analyzer/mkostemp-1.c
@@ -9,6 +9,10 @@
 extern int mkostemp (char *, int);
 extern void populate (char *buf);
 
+#if defined(__APPLE__) && !defined(O_CLOEXEC)
+# define O_CLOEXEC 0x1000000
+#endif
+
 void test_passthrough (char *s, int flags)
 {
   mkostemp (s, flags);
diff --git a/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c 
b/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c
index 7961c8b6f63..727da62a4ed 100644
--- a/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c
+++ b/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c
@@ -9,6 +9,10 @@
 extern int mkostemps (char *, int, int);
 extern void populate (char *buf);
 
+#if defined(__APPLE__) && !defined(O_CLOEXEC)
+# define O_CLOEXEC 0x1000000
+#endif
+
 void test_passthrough (char *s, int suffixlen, int flags)
 {
   mkostemps (s, suffixlen, flags);
-- 
2.50.1 (Apple Git-155)

Reply via email to