aboutsummaryrefslogtreecommitdiffstats
path: root/test/noeffect.awk
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2021-04-14 17:35:27 +0300
committerArnold D. Robbins <arnold@skeeve.com>2021-04-14 17:35:27 +0300
commit7d775b9560e8ad2eb1f55a843e27f3b929e35223 (patch)
treed9126af1feffec13e0195271892d77fa15b44c7a /test/noeffect.awk
parentd8f4cea75943f89b77063655e41ef68ee48e62dc (diff)
parenta8f16ebdef4e43fcda9a4956e8ef528c33728047 (diff)
downloadegawk-7d775b9560e8ad2eb1f55a843e27f3b929e35223.tar.gz
egawk-7d775b9560e8ad2eb1f55a843e27f3b929e35223.tar.bz2
egawk-7d775b9560e8ad2eb1f55a843e27f3b929e35223.zip
Merge branch 'gawk-5.1-stable'
Diffstat (limited to 'test/noeffect.awk')
-rw-r--r--test/noeffect.awk18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/noeffect.awk b/test/noeffect.awk
index 4be76b1e..107ccbe5 100644
--- a/test/noeffect.awk
+++ b/test/noeffect.awk
@@ -7,4 +7,22 @@ BEGIN {
42
q = 42
q
+
+ a = b = 42
+
+ a * b
+ a != b
+ # the following should not produce warnings
+ a++ == a--
+ f_without_side_effect(a);
+ f_with_side_effect(b) == 2
+ 1 == 2 && a++
+ 1 == 1 || b--
+ a = a
+ a *= 1
+ a += 0
+ a*a < 0 && b = 1001
}
+
+function f_without_side_effect(x) { }
+function f_with_side_effect(x) { }