aboutsummaryrefslogtreecommitdiffstats
path: root/test/fix-fmtspcl.awk
diff options
context:
space:
mode:
Diffstat (limited to 'test/fix-fmtspcl.awk')
-rw-r--r--test/fix-fmtspcl.awk23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/fix-fmtspcl.awk b/test/fix-fmtspcl.awk
new file mode 100644
index 00000000..018f519d
--- /dev/null
+++ b/test/fix-fmtspcl.awk
@@ -0,0 +1,23 @@
+BEGIN {
+ pnan = sprintf("%g",sqrt(-1))
+ nnan = sprintf("%g",-sqrt(-1))
+ pinf = sprintf("%g",-log(0))
+ ninf = sprintf("%g",log(0))
+
+ pnanu = toupper(pnan)
+ nnanu = toupper(nnan)
+ pinfu = toupper(pinf)
+ ninfu = toupper(ninf)
+}
+{
+ sub(/positive_nan/, pnan)
+ sub(/negative_nan/, nnan)
+ sub(/positive_infinity/, pinf)
+ sub(/negative_infinity/, ninf)
+ sub(/POSITIVE_NAN/, pnanu)
+ sub(/NEGATIVE_NAN/, nnanu)
+ sub(/POSITIVE_INFINITY/, pinfu)
+ sub(/NEGATIVE_INFINITY/, ninfu)
+ sub(/fmtspcl/,(sd "/fmtspcl"))
+ print
+}