changeset 31990:167761ba14ca

maint: Merge stable to default.
author Markus Mützel <markus.muetzel@gmx.de>
date Sat, 08 Apr 2023 16:31:03 +0200
parents 50b3024162cd (current diff) 9b36d30d27e3 (diff)
children 36cf9546a3f7
files libinterp/corefcn/strfns.cc scripts/general/logspace.m test/io.tst
diffstat 6 files changed, 45 insertions(+), 54 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/dlmread.cc	Sat Apr 08 14:11:49 2023 +0200
+++ b/libinterp/corefcn/dlmread.cc	Sat Apr 08 16:31:03 2023 +0200
@@ -601,7 +601,7 @@
 %!   unlink (file);
 %! end_unwind_protect
 
-%!testif ; ! ismac ()
+%!testif ; ! __have_feature__ ("LLVM_LIBCXX")
 %! file = tempname ();
 %! unwind_protect
 %!   fid = fopen (file, "wt");
@@ -622,9 +622,8 @@
 %!   unlink (file);
 %! end_unwind_protect
 
-%!test <47413>
-%! ## Same test code as above, but intended only for test statistics on Mac.
-%! if (! ismac ()), return; endif
+%!testif HAVE_LLVM_LIBCXX  <47413>
+%! ## Same test code as above, intended only for test statistics with libc++.
 %! file = tempname ();
 %! unwind_protect
 %!   fid = fopen (file, "wt");
@@ -661,7 +660,7 @@
 %!   unlink (file);
 %! end_unwind_protect
 
-%!testif ; ! ismac ()   <*50589>
+%!testif ; ! __have_feature__ ("LLVM_LIBCXX")  <*50589>
 %! file = tempname ();
 %! unwind_protect
 %!   fid = fopen (file, "wt");
@@ -679,9 +678,8 @@
 %!   unlink (file);
 %! end_unwind_protect
 
-%!test <47413>
-%! ## Same test code as above, but intended only for test statistics on Mac.
-%! if (! ismac ()), return; endif
+%!testif HAVE_LLVM_LIBCXX  <47413>
+%! ## Same test code as above, intended only for test statistics with libc++.
 %! file = tempname ();
 %! unwind_protect
 %!   fid = fopen (file, "wt");
--- a/libinterp/corefcn/mappers.cc	Sat Apr 08 14:11:49 2023 +0200
+++ b/libinterp/corefcn/mappers.cc	Sat Apr 08 16:31:03 2023 +0200
@@ -130,14 +130,14 @@
 
 ## Test large magnitude arguments (bug #45507)
 ## Test fails with older versions of libm, solution is to upgrade.
-%!testif ; ! ismac () && ! ispc ()   <*45507>
+%!testif ; ! __have_feature__ ("LLVM_LIBCXX") && ! ispc ()  <*45507>
 %! x = [1, -1, i, -i] .* 1e150;
 %! v = [0, pi, pi/2, pi/2];
 %! assert (real (acos (x)), v);
 
-%!testif ; ismac () || ispc ()   <52627>
-%! ## Same test code as above, but intended only for test statistics on Mac and
-%! ## Windows.  Their trig/hyperbolic functions have huge tolerances.
+%!testif ; __have_feature__ ("LLVM_LIBCXX") || ispc ()  <52627>
+%! ## Same test code as above, but intended for test statistics with libc++ or
+%! ## on Windows.  Their trig/hyperbolic functions have huge tolerances.
 %! x = [1, -1, i, -i] .* 1e150;
 %! v = [0, pi, pi/2, pi/2];
 %! assert (real (acos (x)), v);
@@ -202,14 +202,14 @@
 
 ## Test large magnitude arguments (bug #45507)
 ## Test fails with older versions of libm, solution is to upgrade.
-%!testif ; ! ismac () && ! ispc ()   <*45507>
+%!testif ; ! __have_feature__ ("LLVM_LIBCXX") && ! ispc ()  <*45507>
 %! x = [1, -1, i, -i] .* 1e150;
 %! v = [0, pi, pi/2, -pi/2];
 %! assert (imag (acosh (x)), v);
 
-%!testif ; ismac () || ispc ()   <52627>
-%! ## Same test code as above, but intended only for test statistics on Mac and
-%! ## Windows.  Their trig/hyperbolic functions have huge tolerances.
+%!testif ; __have_feature__ ("LLVM_LIBCXX") || ispc ()  <52627>
+%! ## Same test code as above, but intended for test statistics with libc++ or
+%! ## on Windows.  Their trig/hyperbolic functions have huge tolerances.
 %! x = [1, -1, i, -i] .* 1e150;
 %! v = [0, pi, pi/2, -pi/2];
 %! assert (imag (acosh (x)), v);
@@ -336,14 +336,14 @@
 
 ## Test large magnitude arguments (bug #45507)
 ## Test fails with older versions of libm, solution is to upgrade.
-%!testif ; ! ismac () && ! ispc ()   <*45507>
+%!testif ; ! __have_feature__ ("LLVM_LIBCXX") && ! ispc ()  <*45507>
 %! x = [1, -1, i, -i] .* 1e150;
 %! v = [pi/2, -pi/2, 0, -0];
 %! assert (real (asin (x)), v);
 
-%!testif ; ismac () || ispc ()   <52627>
-%! ## Same test code as above, but intended only for test statistics on Mac and
-%! ## Windows. Their trig/hyperbolic functions have huge tolerances.
+%!testif ; __have_feature__ ("LLVM_LIBCXX") || ispc ()  <52627>
+%! ## Same test code as above, but intended for test statistics with libc++ or
+%! ## on Windows.  Their trig/hyperbolic functions have huge tolerances.
 %! x = [1, -1, i, -i] .* 1e150;
 %! v = [pi/2, -pi/2, 0, -0];
 %! assert (real (asin (x)), v);
@@ -378,14 +378,14 @@
 
 ## Test large magnitude arguments (bug #45507)
 ## Test fails with older versions of libm, solution is to upgrade.
-%!testif ; ! ismac () && ! ispc ()   <*45507>
+%!testif ; ! __have_feature__ ("LLVM_LIBCXX") && ! ispc ()  <*45507>
 %! x = [1, -1, i, -i] .* 1e150;
 %! v = [0, 0, pi/2, -pi/2];
 %! assert (imag (asinh (x)), v);
 
-%!testif ; ismac () || ispc ()   <52627>
-%! ## Same test code as above, but intended only for test statistics on Mac and
-%! ## Windows.  Their trig/hyperbolic functions have huge tolerances.
+%!testif ; __have_feature__ ("LLVM_LIBCXX") || ispc ()  <52627>
+%! ## Same test code as above, but intended for test statistics with libc++ or
+%! ## on Windows.  Their trig/hyperbolic functions have huge tolerances.
 %! x = [1, -1, i, -i] .* 1e150;
 %! v = [0, 0, pi/2, -pi/2];
 %! assert (imag (asinh (x)), v);
--- a/libinterp/corefcn/strfns.cc	Sat Apr 08 14:11:49 2023 +0200
+++ b/libinterp/corefcn/strfns.cc	Sat Apr 08 16:31:03 2023 +0200
@@ -832,11 +832,10 @@
 /*
 %!assert (str2double ("1"), 1)
 %!assert (str2double ("-.1e-5"), -1e-6)
-%!testif ; ! ismac ()
+%!testif ; ! __have_feature__ ("LLVM_LIBCXX")
 %! assert (str2double (char ("1", "2 3", "4i")), [1; NaN; 4i]);
-%!test <47413>
-%! ## Same test code as above, but intended only for test statistics on Mac.
-%! if (! ismac ()), return; endif
+%!testif HAVE_LLVM_LIBCXX  <47413>
+%! ## Same test code as above, intended only for test statistics with libc++.
 %! assert (str2double (char ("1", "2 3", "4i")), [1; NaN; 4i]);
 %!assert (str2double ("1,222.5"), 1222.5)
 %!assert (str2double ("i"), i)
@@ -860,15 +859,13 @@
 %!assert (str2double ("NaN + Inf*i"), complex (NaN, Inf))
 %!assert (str2double ("Inf - Inf*i"), complex (Inf, -Inf))
 %!assert (str2double ("-i*NaN - Inf"), complex (-Inf, -NaN))
-%!testif ; ! ismac ()
+%!testif ; ! __have_feature__ ("LLVM_LIBCXX")
 %! assert (str2double ({"abc", "4i"}), [NaN + 0i, 4i]);
-%!test <47413>
-%! if (! ismac ()), return; endif
+%!testif HAVE_LLVM_LIBCXX  <47413>
 %! assert (str2double ({"abc", "4i"}), [NaN + 0i, 4i]);
-%!testif ; ! ismac ()
+%!testif ; ! __have_feature__ ("LLVM_LIBCXX")
 %! assert (str2double ({2, "4i"}), [NaN + 0i, 4i])
-%!test <47413>
-%! if (! ismac ()), return; endif
+%!testif HAVE_LLVM_LIBCXX  <47413>
 %! assert (str2double ({2, "4i"}), [NaN + 0i, 4i])
 %!assert (str2double (zeros (3,1,2)), NaN)
 %!assert (str2double (''), NaN)
--- a/scripts/general/logspace.m	Sat Apr 08 14:11:49 2023 +0200
+++ b/scripts/general/logspace.m	Sat Apr 08 16:31:03 2023 +0200
@@ -118,16 +118,16 @@
 ## Edge cases
 %!assert (logspace (Inf, Inf, 3), [Inf, Inf, Inf])
 %!assert (logspace (-Inf, Inf, 3), [0, 1, Inf])
-%!testif ; ! ismac ()
+%!testif ; ! __have_feature__ ("LLVM_LIBCXX")
 %! assert (logspace (Inf + 1i, Inf + 1i, 3),
 %!         repmat (complex (-Inf,Inf), [1, 3]))
-%!testif ; ismac () <55538>
+%!testif HAVE_LLVM_LIBCXX  <55538>
 %! assert (logspace (Inf + 1i, Inf + 1i, 3),
 %!         repmat (complex (-Inf,Inf), [1, 3]))
-%!testif ; ! ismac ()
+%!testif ; ! __have_feature__ ("LLVM_LIBCXX")
 %! assert (logspace (-Inf + 1i, Inf + 1i, 3),
 %!         [0, NaN + NaN * 1i, complex(-Inf, Inf)])
-%!testif ; ismac () <55538>
+%!testif HAVE_LLVM_LIBCXX  <55538>
 %! assert (logspace (-Inf + 1i, Inf + 1i, 3),
 %!         [0, NaN + NaN * 1i, complex(-Inf, Inf)])
 ## Octave prefers to return NaN which indicates failure of algorithm.
--- a/scripts/io/importdata.m	Sat Apr 08 14:11:49 2023 +0200
+++ b/scripts/io/importdata.m	Sat Apr 08 16:31:03 2023 +0200
@@ -522,7 +522,7 @@
 %! assert (d, "\t");
 %! assert (h, 0);
 
-%!testif ; ! ismac ()
+%!testif ; ! __have_feature__ ("LLVM_LIBCXX")
 %! ## Complex numbers
 %! A = [3.1 -7.2 0-3.4i; 0.012 -6.5+7.2i 128];
 %! fn  = tempname ();
@@ -535,9 +535,8 @@
 %! assert (d, "\t");
 %! assert (h, 0);
 
-%!test <47413>
-%! ## Same test code as above, but intended only for test statistics on Mac.
-%! if (! ismac ()), return; endif
+%!testif HAVE_LLVM_LIBCXX  <47413>
+%! ## Same test code as above, intended only for test statistics with libc++.
 %! ## Complex numbers
 %! A = [3.1 -7.2 0-3.4i; 0.012 -6.5+7.2i 128];
 %! fn  = tempname ();
--- a/test/io.tst	Sat Apr 08 14:11:49 2023 +0200
+++ b/test/io.tst	Sat Apr 08 16:31:03 2023 +0200
@@ -451,48 +451,45 @@
 %!assert (sscanf ('7777777777777777', '%lo', 'C'), 281474976710655)
 %!assert (sscanf ('ffffffffffff', '%lx', 'C'), 281474976710655)
 
-%!testif ; ! ismac ()
+%!testif ; ! __have_feature__ ("LLVM_LIBCXX")
 %! [val, count, msg, pos] = sscanf ("3I2", "%f");
 %! assert (val, 3);
 %! assert (count, 1);
 %! assert (msg, "sscanf: format failed to match");
 %! assert (pos, 2);
 
-%!test <47413>
-%! ## Same test code as above, but intended only for test statistics on Mac.
-%! if (! ismac ()), return; endif
+%!testif HAVE_LLVM_LIBCXX  <47413>
+%! ## Same test code as above, intended only for test statistics with libc++.
 %! [val, count, msg, pos] = sscanf ("3I2", "%f");
 %! assert (val, 3);
 %! assert (count, 1);
 %! assert (msg, "sscanf: format failed to match");
 %! assert (pos, 2);
 
-%!testif ; ! ismac ()
+%!testif ; ! __have_feature__ ("LLVM_LIBCXX")
 %! [val, count, msg, pos] = sscanf ("3In2", "%f");
 %! assert (val, 3);
 %! assert (count, 1);
 %! assert (msg, "sscanf: format failed to match");
 %! assert (pos, 2);
 
-%!test <47413>
-%! ## Same test code as above, but intended only for test statistics on Mac.
-%! if (! ismac ()), return; endif
+%!testif HAVE_LLVM_LIBCXX  <47413>
+%! ## Same test code as above, intended only for test statistics with libc++.
 %! [val, count, msg, pos] = sscanf ("3In2", "%f");
 %! assert (val, 3);
 %! assert (count, 1);
 %! assert (msg, "");
 %! assert (pos, 2);
 
-%!testif ; ! ismac ()
+%!testif ; ! __have_feature__ ("LLVM_LIBCXX")
 %! [val, count, msg, pos] = sscanf ("3Inf2", "%f");
 %! assert (val, [3; Inf; 2]);
 %! assert (count, 3);
 %! assert (msg, "");
 %! assert (pos, 6);
 
-%!test <47413>
-%! ## Same test code as above, but intended only for test statistics on Mac.
-%! if (! ismac ()), return; endif
+%!testif HAVE_LLVM_LIBCXX  <47413>
+%! ## Same test code as above, intended only for test statistics with libc++.
 %! [val, count, msg, pos] = sscanf ("3Inf2", "%f");
 %! assert (val, [3; Inf; 2]);
 %! assert (count, 3);