summaryrefslogtreecommitdiff
path: root/src/test/java/com/seaofnodes/simple/spill/Chapter23Test-testCondSideEffOr.smp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/com/seaofnodes/simple/spill/Chapter23Test-testCondSideEffOr.smp')
-rw-r--r--src/test/java/com/seaofnodes/simple/spill/Chapter23Test-testCondSideEffOr.smp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/java/com/seaofnodes/simple/spill/Chapter23Test-testCondSideEffOr.smp b/src/test/java/com/seaofnodes/simple/spill/Chapter23Test-testCondSideEffOr.smp
new file mode 100644
index 00000000..f2bb16c5
--- /dev/null
+++ b/src/test/java/com/seaofnodes/simple/spill/Chapter23Test-testCondSideEffOr.smp
@@ -0,0 +1,24 @@
+{i32 i64 u32 -> u32} write="C";
+val _p={u8[~] str -> i64 ptr=str; return write(1,ptr,str#);};
+int a = 1;
+int b = 1;
+
+int x = -1;
+int y=1;
+int z= -1;
+
+int g = x++ || y++ || z++;
+
+int switch = 0;
+if(x == 4 || y == 4 || z == 4) {
+ switch = -1;
+} else {
+ switch = 1;
+}
+int cd = 1;
+if((x == 0 && y == 1 && z==-1) && switch && g) {
+ _p("Effected");
+} else {
+ _p("Not effected");
+}
+return 0;